Attention is currently required from: Raul Rangel, Julius Werner, Rob Barnes, Karthik Ramasubramanian. Kyösti Mälkki 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/6ac8980e_73b853c3 PS2, Line 21: static spinlock_t x = SPIN_LOCK_UNLOCKED; STAGE_HAS_DATA_SECTION could be used as guard, .data is needed.
AFAICs CAR does not work for spinlock variables always. At least old AMD fam14 would fail such spinlock even if it did get .data for romstage. CB:30830
CB:37074 -- do not put CMOS access on parallel execution paths CB:34929 -- console printk locks removed from ENV_ROMSTAGE_OR_BEFORE
https://review.coreboot.org/c/coreboot/+/59021/comment/80215659_b5b1b214 PS2, Line 50: thread_coop_disable(); For a sequence like below, thread_coop_disable() is not desired? I think our spin_lock() does more than it traditionally means.
spin_lock() outb(0x70, index) outb(0x71, data) spin_unlock()
Should we have these separately:
spin_lock_disable_coop() spin_unlock_enable_coop()