Attention is currently required from: Julius Werner, Rob Barnes, Kyösti Mälkki, Karthik Ramasubramanian. Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59320 )
Change subject: lib: Add a mutex ......................................................................
Patch Set 2:
(1 comment)
File src/lib/mutex.c:
https://review.coreboot.org/c/coreboot/+/59320/comment/7bbd1e40_767985bb PS2, Line 24: #if ENV_X86
I'm honestly not sure if combining this stuff like this is a good idea, because as you can see here […]
I haven't specifically looked at the ARM assembly generated by this. ENV_STAGE_SUPPORTS_SMP always evaluates to false for ARM platforms so we will never use this code path. But from my reading (https://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync) is meant to handle all the correct barriers as long as you specify the correct memory order.
As for the WFE and SEV. I say we cross the bridge when we get there. We can make arch specific `sleep/pasue` and `wake/resume` methods if we need them. I wanted to keep it simple since this is only targeting RISCV and x86 right now.