Hi coreboot folks, I'd like to propose adding optional compile-time console log tokenization to coreboot, libpayload, and cbmem.
Verbose debug logging gets expensive on constrained targets. Format strings make up over half of .rodata in some stages, a BIOS_SPEW boot overflows the 128 KiB cbmem console and overwrites the early boot log, and at 115200 baud coreboot spends close to 18 seconds just printing to serial. The proposal adds a CONFIG_CONSOLE_TOKENIZED option. When it's enabled, eligible printk() format strings are replaced at compile time with a 32-bit hash, and the strings move into a non-loaded ELF section that stays in the .debug and .elf files. The console prints a short printable token instead, so vendor blob output and the existing cbmem log format keep working, and cbmem -d turns the tokens back into text from the build's ELF files. It's off by default and costs nothing when disabled. On google/skyrim the BIOS_SPEW cbmem console drops from about 183 KiB to 117 KiB, so the whole boot fits in the buffer again. Serial debug boot time drops by about 7.5 seconds (38.4 s to 30.8 s), and each RW slot gets about 25 KiB smaller in flash. Design doc: Compile-Time Console Log Tokenization <https://docs.google.com/document/d/1tN19v0Cj9Vq7ixURlXUGDC1sudFuQpi1IYLzOMkQ4yU/preview?usp=sharing> Patches: coreboot, libpayload, and cbmem series (97306-97312) <https://review.coreboot.org/q/topic:%22ap-fw-log-tokenization%22> The design doc covers the details and the alternatives considered, and the patches are up for review on Gerrit. Thanks, Jon
_______________________________________________ coreboot mailing list -- [email protected] To unsubscribe send an email to [email protected]

