Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/55073 )
Change subject: [WIP] cpu/x86: Add Kconfig X2APIC_SUPPORT ......................................................................
[WIP] cpu/x86: Add Kconfig X2APIC_SUPPORT
Allows compile-time optimisation on platforms that do not wish to enable runtime checking of X2APIC_ENABLED.
Legacy lapic_cpu_init() is incompatible so there is dependency on PARALLEL_MP. Also stop_this_cpu() is incompatible, so there is dependency on !AP_IN_SIPI_WAIT.
Change-Id: I8269f9639ee3e89a2c2b4178d266ba2dac46db3f Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/cpu/x86/Kconfig M src/include/cpu/x86/lapic.h 2 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/55073/1
diff --git a/src/cpu/x86/Kconfig b/src/cpu/x86/Kconfig index bcaf0bf..ad53229 100644 --- a/src/cpu/x86/Kconfig +++ b/src/cpu/x86/Kconfig @@ -17,6 +17,13 @@ Allow APs to do other work after initialization instead of going to sleep.
+config X2APIC_SUPPORT + bool + depends on PARALLEL_MP + depends on !AP_IN_SIPI_WAIT + help + Add support for X2_APIC mode. + config UDELAY_LAPIC bool default n diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h index 717fc9a..1d43b5f 100644 --- a/src/include/cpu/x86/lapic.h +++ b/src/include/cpu/x86/lapic.h @@ -10,6 +10,9 @@
static inline bool is_x2apic_mode(void) { + if (!CONFIG(X2APIC_SUPPORT)) + return false; + msr_t msr; msr = rdmsr(LAPIC_BASE_MSR); return ((msr.lo & LAPIC_BASE_X2APIC_ENABLED) == LAPIC_BASE_X2APIC_ENABLED);