Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/55199 )
Change subject: [RFC,WIP] cpu/x86/lapic: Drop xapic_write_atomic() ......................................................................
[RFC,WIP] cpu/x86/lapic: Drop xapic_write_atomic()
The memory clobber impacts code generator.
In linux kernel, the errata or quick X86_BUG_11AP is documented to be specific quirk for Intel model 0x520.
Change-Id: Iec10335f603674bcef2e7494831cf11200795d38 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/cpu/x86/lapic/lapic_cpu_init.c M src/include/cpu/x86/lapic.h 2 files changed, 4 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/55199/1
diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c index 22647bc..fe1c824 100644 --- a/src/cpu/x86/lapic/lapic_cpu_init.c +++ b/src/cpu/x86/lapic/lapic_cpu_init.c @@ -128,7 +128,7 @@ printk(BIOS_ERR, "ESR is 0x%x\n", lapic_read(LAPIC_ESR)); if (lapic_read(LAPIC_ESR)) { printk(BIOS_ERR, "Try to reset ESR\n"); - xapic_write_atomic(LAPIC_ESR, 0); + lapic_write(LAPIC_ESR, 0); printk(BIOS_ERR, "ESR is 0x%x\n", lapic_read(LAPIC_ESR)); } diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h index 3c860ab..30c12e8 100644 --- a/src/include/cpu/x86/lapic.h +++ b/src/include/cpu/x86/lapic.h @@ -21,21 +21,10 @@ write32((volatile void *)(uintptr_t)(LAPIC_DEFAULT_BASE + reg), v); }
-static inline void xapic_write_atomic(unsigned long reg, uint32_t v) -{ - volatile uint32_t *ptr; - - ptr = (volatile uint32_t *)(LAPIC_DEFAULT_BASE + reg); - - asm volatile ("xchgl %0, %1\n" - : "+r" (v), "+m" (*(ptr)) - : : "memory", "cc"); -} - static __always_inline void xapic_send_ipi(uint32_t icrlow, uint32_t apicid) { - xapic_write_atomic(LAPIC_ICR2, SET_LAPIC_DEST_FIELD(apicid)); - xapic_write_atomic(LAPIC_ICR, icrlow); + xapic_write(LAPIC_ICR2, SET_LAPIC_DEST_FIELD(apicid)); + xapic_write(LAPIC_ICR, icrlow); }
static __always_inline int xapic_busy(void) @@ -115,7 +104,7 @@ value = xapic_read(reg); value &= mask; value |= or; - xapic_write_atomic(reg, value); + xapic_write(reg, value); } }