diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2022-08-31 09:43:45 +0200 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2022-11-10 00:19:03 +0000 |
commit | f158c9c96156475c524742ada013453887d86af9 (patch) | |
tree | 4217200c1bb7538e9df361f804ce56f9c5983ab2 | |
parent | a23aa1ca904be76a163f959c9e366fcce030798b (diff) |
cpu/x86/lapic.h: Fix CONFIG_X2APIC_RUNTIME
The deadlock prevention is also needed with CONFIG_X2APIC_RUNTIME when
the cpu is in x2apic mode.
TESTED: Fixes SMI generation on xeon_sp hardware with
CONFIG_X2APIC_RUNTIME.
Change-Id: I6a71204fcff35e11613fc8363ce061b348e73496
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67239
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r-- | src/include/cpu/x86/lapic.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h index 5fa5608db9..cfb9c9098b 100644 --- a/src/include/cpu/x86/lapic.h +++ b/src/include/cpu/x86/lapic.h @@ -155,7 +155,9 @@ static __always_inline void lapic_send_ipi_self(uint32_t icrlow) /* In case of X2APIC force a short delay, to prevent deadlock in a case * the immediately following code acquires some lock, like with printk(). */ - while (CONFIG(X2APIC_ONLY) && i--) + const bool x2apic = is_x2apic_mode(); + + while (x2apic && i--) cpu_relax(); } |