git: ba47974c843e - stable/13 - Increase MAX_APIC_ID safeguard to 0x800

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Thu, 03 Nov 2022 00:51:29 UTC
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=ba47974c843ef562c14d48160e3d88c7cff42998

commit ba47974c843ef562c14d48160e3d88c7cff42998
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-10-20 13:04:37 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2022-11-03 00:50:53 +0000

    Increase MAX_APIC_ID safeguard to 0x800
    
    MAX_APIC_ID must be at least twice MAXCPU.  Increase it to 0x800 so that
    it is possible to set MAXCPU to 512 or 1024 in a custom kernel config
    file.
    
    Note that increasing this limit does not itself cause any allocations
    to be larger; it just allows madt_parse_cpu() to process higher APIC
    IDs.
    
    APIC IDs may be sparse and so we can waste memory.  This is independent
    of this change, but becomes more of an issue as the maximum APIC ID
    grows.  This should be addressed with future work.
    
    Reviewed by:    royger
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D37067
    
    (cherry picked from commit c8113dad7ed4024376901a834fc239d754292049)
---
 sys/x86/include/apicvar.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h
index 373e7d576426..fbc2d58cae04 100644
--- a/sys/x86/include/apicvar.h
+++ b/sys/x86/include/apicvar.h
@@ -77,7 +77,7 @@
 
 #define	xAPIC_MAX_APIC_ID	0xfe
 #define	xAPIC_ID_ALL		0xff
-#define	MAX_APIC_ID		0x200
+#define	MAX_APIC_ID		0x800
 #define	APIC_ID_ALL		0xffffffff
 
 #define	IOAPIC_MAX_ID		xAPIC_MAX_APIC_ID