diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-05-29 20:33:22 +0300 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-06-09 05:19:58 +0000 |
commit | 176c8877ce8820ecc4f74748c83ab993b938eac6 (patch) | |
tree | 46a82e28b03ec2563ea9ac76f919da970700cb3e /src/include/cpu | |
parent | 4cf65e9cc37f6f1e0467d57a680fcbdeb1a8614d (diff) |
cpu/x86/lapic: Add Kconfig choice LAPIC_ACCESS_MODE
Allows compile-time optimisation on platforms that do not wish
to enable runtime checking of X2APIC.
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.
Since the code actually lacks enablement of X2APIC (apparently
assuming the blob has done it) and the other small flaws pointed
out in earlier reviews, X2APIC_RUNTIME is not selected per
default on any platform yet.
Change-Id: I8269f9639ee3e89a2c2b4178d266ba2dac46db3f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55073
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
Diffstat (limited to 'src/include/cpu')
-rw-r--r-- | src/include/cpu/x86/lapic.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h index ab2843f69a..2de5dd57df 100644 --- a/src/include/cpu/x86/lapic.h +++ b/src/include/cpu/x86/lapic.h @@ -10,6 +10,12 @@ static inline bool is_x2apic_mode(void) { + if (CONFIG(XAPIC_ONLY)) + return false; + + if (CONFIG(X2APIC_ONLY)) + return true; + msr_t msr; msr = rdmsr(LAPIC_BASE_MSR); return ((msr.lo & LAPIC_BASE_X2APIC_ENABLED) == LAPIC_BASE_X2APIC_ENABLED); |