From 72c6071770da42334e2f0f41a1db35f53eb463d2 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 18 Nov 2020 13:26:10 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/47714 Reviewed-by: Arthur Heymans Reviewed-by: Christian Walter Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/cpu/x86/sipi_vector.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cpu/x86/sipi_vector.S b/src/cpu/x86/sipi_vector.S index 61d9e34466..02ad0d367a 100644 --- a/src/cpu/x86/sipi_vector.S +++ b/src/cpu/x86/sipi_vector.S @@ -84,10 +84,9 @@ _start: 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