Patrick Georgi submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved Angel Pons: Looks good to me, but someone else must approve Christian Walter: Looks good to me, approved
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>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47714
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M src/cpu/x86/sipi_vector.S
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/cpu/x86/sipi_vector.S b/src/cpu/x86/sipi_vector.S
index 61d9e34..02ad0d3 100644
--- a/src/cpu/x86/sipi_vector.S
+++ b/src/cpu/x86/sipi_vector.S
@@ -84,10 +84,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

To view, visit change 47714. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie4b9957d8aa1f272ff1db5caf2c69d1e1f086a03
Gerrit-Change-Number: 47714
Gerrit-PatchSet: 3
Gerrit-Owner: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Christian Walter <christian.walter@9elements.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged