Carl-Daniel Hailfinger wrote:
do_printk is defined in src/arch/i386/lib/printk_init.c as almost identical function, but without console_tx_flush and without locking. If only one CPU uses the lockless variant, we lose.
This is the version that was intended to be used when CONFIG_USE_INIT is set.
Does the _flush actually do much? I had the impression that we flush after each character anyways, but I'm no terminal expert.
Other than that, we could unify those versions by just defining an empty (for now) version of the spinlock functions in raminit stage. Then think about where we can place our locking for those platforms that need it this early...?
A quick test abuild with #error inserted in the lockless function shows we indeed use it for every freaking x86 target. That explains the supermicro/h8dme intertwined printk messages Ward is seeing.
They're from ram init stage afaict ...
Besides that, do we know where static spinlock_t console_lock is placed?
In RAM
grep console_lock *.map coreboot_ram.map:00122058 d console_lock smm.map:000a13fc t console_lock
(raminit stage symbols are in coreboot.map)
Stefan