Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47714 )
Change subject: cpu/x86/sipi_vector: Simplify loop getting unique CPU number ......................................................................
cpu/x86/sipi_vector: Simplify loop getting unique CPU number
Get rid of using eax and reload counter on race condition.
Change-Id: Ie4b9957d8aa1f272ff1db5caf2c69d1e1f086a03 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/cpu/x86/sipi_vector.S 1 file changed, 2 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/47714/1
diff --git a/src/cpu/x86/sipi_vector.S b/src/cpu/x86/sipi_vector.S index 394c03a..199a12b 100644 --- a/src/cpu/x86/sipi_vector.S +++ b/src/cpu/x86/sipi_vector.S @@ -89,10 +89,9 @@ mov idt_ptr, %ebx lidt (%ebx)
- /* Obtain CPU number. */ - movl ap_count, %eax 1: - movl %eax, %ecx + /* Obtain CPU number. */ + movl ap_count, %ecx inc %ecx lock cmpxchg %ecx, ap_count jnz 1b