Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30855 )
Change subject: arch/x86: Align _start16bit with C_ENVIRONMENT_BOOBLOCK ......................................................................
Patch Set 3:
Patch Set 2:
Patch Set 2:
So we could isolate top 4 KiB? Use it for entry16, entry32, walkcbfs, update_microcode?
I'll try to learn how to do that, there's no rush submitting this one.
Yes, we could do that. There's some gotchas there in how we add FIT entries and bizarre platform specifics such as apollolake. That said, I believe putting in a static assert for our current implementation of C_ENV_BOOTBLOCK_SIZE <= 64KiB would be sufficient. If we need to make it larger then we could look at fixing the location of those pieces of code. After working through the math, current implementation, and adding a static assert inherently documents and protects the current implementation. I'm fine with submitting this and following up.
This could be put in a better place, but we just need something to fail during compilation:
LINK cbfs/fallback/bootblock.debug ... xgcc/bin/i386-elf-ld.bfd: _start16bit too low. Please report. src/arch/x86/Makefile.inc:120: recipe for target 'build/cbfs/fallback/bootblock.debug' failed make: *** [build/cbfs/fallback/bootblock.debug] Error 1
$ git grep "_start16bit too low" src/cpu/x86/16bit/reset16.ld: _bogus = ASSERT(_start16bit >= 0xffff0000, "_start16bit too low. Please report.");
IMHO it already fails compile-time with a reasonable error message.