Attention is currently required from: Julius Werner, Kyösti Mälkki, Rob Barnes, Karthik Ramasubramanian. Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59021 )
Change subject: arch/x86/smp/spinlock: Fix threading when !STAGE_HAS_SPINLOCKS ......................................................................
Patch Set 2:
(2 comments)
File src/arch/x86/include/arch/smp/spinlock.h:
https://review.coreboot.org/c/coreboot/+/59021/comment/97024a61_d124ca3a PS2, Line 21: static spinlock_t x = SPIN_LOCK_UNLOCKED;
STAGE_HAS_DATA_SECTION could be used as guard, .data is needed. […]
The lock variable is never accessed, so the compiler just removes it. Thus we don't need a .data section.
https://review.coreboot.org/c/coreboot/+/59021/comment/28d9d0eb_6e21d4ee PS2, Line 50: thread_coop_disable();
For a sequence like below, thread_coop_disable() is not desired? I think our spin_lock() does more t […]
In your first example, there is nothing wrong with disabling threading. There is no yield so it's really a noop. The only cost we pay is incrementing and decrementing a counter. I don't think we gain anything by adding additional API calls.