Attention is currently required from: Nico Huber, Jonathan Zhang, Paul Menzel, Christian Walter, Rocky Phagura, Angel Pons, Arthur Heymans, Kyösti Mälkki, Deomid "rojer" Ryabkov. Johnny Lin has uploaded a new patch set (#11) to the change originally created by Deomid "rojer" Ryabkov. ( https://review.coreboot.org/c/coreboot/+/56386 )
Change subject: Add console deinit API, use in SMM handler ......................................................................
Add console deinit API, use in SMM handler
SMM handler should return shared hardware to the state it was at the time of the SMI call. When CONFIG_DEBUG_SMI is enabled SMM handler performs console hardware initialization that may interfere with OS.
Specifically, this has been observed with SMM handler output to UART on an OCP Delta Lake server: uart8250_init disables interrupts because it uses polling but the Linux kernel (5.6) uses interrupts. As a result, SMI call leaves interrupts disabled and causes OS console I/O issues.
For 8250, we save all the registers we touch in init and restore them in deinit. Other deinit functions are provided as stubs only due to lack of hardware for testing but should probably be looked into as well.
Signed-off-by: Deomid "rojer" Ryabkov rojer9@fb.com Change-Id: Ia5e51f385f83cb998c244ca1d1ffc10339d3a714 --- M src/console/console.c M src/console/init.c M src/cpu/x86/smm/smm_module_handler.c M src/drivers/uart/pl011.c M src/drivers/uart/sifive.c M src/drivers/uart/uart8250io.c M src/drivers/uart/uart8250mem.c M src/include/console/cbmem_console.h M src/include/console/console.h M src/include/console/flash.h M src/include/console/ne2k.h M src/include/console/qemu_debugcon.h M src/include/console/spi.h M src/include/console/spkmodem.h M src/include/console/streams.h M src/include/console/system76_ec.h M src/include/console/uart.h M src/include/console/usb.h 18 files changed, 126 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/56386/11