Skip to content

Commit 9232c49

Browse files
matjonIngo Molnar
authored andcommitted
x86/Kconfig: Enable X86_X2APIC by default and improve help text
As many current platforms (most modern Intel CPUs and QEMU) have x2APIC present, enable CONFIG_X86_X2APIC by default as it gives performance and functionality benefits. Additionally, if the BIOS has already switched APIC to x2APIC mode, but CONFIG_X86_X2APIC is disabled, the kernel will panic in arch/x86/kernel/apic/apic.c . Also improve the help text, which was confusing and really did not describe what the feature is about. Help text references and discussion: Both Intel [1] and AMD [3] spell the name as "x2APIC", not "x2apic". "It allows faster access to the local APIC" [2], chapter 2.1, page 15: "More efficient MSR interface to access APIC registers." "x2APIC was introduced in Intel CPUs around 2008": I was unable to find specific information which Intel CPUs support x2APIC. Wikipedia claims it was "introduced with the Nehalem microarchitecture in November 2008", but I was not able to confirm this independently. At least some Nehalem CPUs do not support x2APIC [1]. The documentation [2] is dated June 2008. Linux kernel also introduced x2APIC support in 2008, so the year seems to be right. "and in AMD EPYC CPUs in 2019": [3], page 15: "AMD introduced an x2APIC in our EPYC 7002 Series processors for the first time." "It is also frequently emulated in virtual machines, even when the host CPU does not support it." [1] "If this configuration option is disabled, the kernel will not boot on some platforms that have x2APIC enabled." According to some BIOS documentation [4], the x2APIC may be "disabled", "enabled", or "force enabled" on this system. I think that "enabled" means "made available to the operating system, but not already turned on" and "force enabled" means "already switched to x2APIC mode when the OS boots". Only in the latter mode a kernel without CONFIG_X86_X2APIC will panic in validate_x2apic() in arch/x86/kernel/apic/apic.c . QEMU 4.2.1 and my Intel HP laptop (bought in 2019) use the "enabled" mode and the kernel does not panic. [1] "Re: [Qemu-devel] [Question] why x2apic's set by default without host sup" https://lists.gnu.org/archive/html/qemu-devel/2013-07/msg03527.html [2] Intel® 64 Architecture x2APIC Specification, ( https://www.naic.edu/~phil/software/intel/318148.pdf ) [3] Workload Tuning Guide for AMD EPYC ™ 7002 Series Processor Based Servers Application Note, https://developer.amd.com/wp-content/resources/56745_0.80.pdf [4] UEFI System Utilities and Shell Command Mobile Help for HPE ProLiant Gen10, ProLiant Gen10 Plus Servers and HPE Synergy: Enabling or disabling Processor x2APIC Support https://techlibrary.hpe.com/docs/iss/proliant-gen10-uefi/s_enable_disable_x2APIC_support.html Signed-off-by: Mateusz Jończyk <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Linus Torvalds <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1400c87 commit 9232c49

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

arch/x86/Kconfig

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -458,20 +458,27 @@ config SMP
458458
If you don't know what to do here, say N.
459459

460460
config X86_X2APIC
461-
bool "Support x2apic"
461+
bool "x2APIC interrupt controller architecture support"
462462
depends on X86_LOCAL_APIC && X86_64 && (IRQ_REMAP || HYPERVISOR_GUEST)
463+
default y
463464
help
464-
This enables x2apic support on CPUs that have this feature.
465+
x2APIC is an interrupt controller architecture, a component of which
466+
(the local APIC) is present in the CPU. It allows faster access to
467+
the local APIC and supports a larger number of CPUs in the system
468+
than the predecessors.
465469

466-
This allows 32-bit apic IDs (so it can support very large systems),
467-
and accesses the local apic via MSRs not via mmio.
470+
x2APIC was introduced in Intel CPUs around 2008 and in AMD EPYC CPUs
471+
in 2019, but it can be disabled by the BIOS. It is also frequently
472+
emulated in virtual machines, even when the host CPU does not support
473+
it. Support in the CPU can be checked by executing
474+
cat /proc/cpuinfo | grep x2apic
468475

469-
Some Intel systems circa 2022 and later are locked into x2APIC mode
470-
and can not fall back to the legacy APIC modes if SGX or TDX are
471-
enabled in the BIOS. They will boot with very reduced functionality
472-
without enabling this option.
476+
If this configuration option is disabled, the kernel will not boot on
477+
some platforms that have x2APIC enabled.
473478

474-
If you don't know what to do here, say N.
479+
Say N if you know that your platform does not have x2APIC.
480+
481+
Otherwise, say Y.
475482

476483
config X86_POSTED_MSI
477484
bool "Enable MSI and MSI-x delivery by posted interrupts"

0 commit comments

Comments
 (0)