Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/87208?usp=email )
Change subject: cpu/x86/smm: Add support for exception handling ......................................................................
cpu/x86/smm: Add support for exception handling
Add an expception handler to SMM to debug crashes when a serial console it enabled and DEBUG_SMI is set. Allows to narrow down issues faster than letting the machine tripple faulting.
Change-Id: I2ccaf8d23d508d773ce56912983884ad6832ede6 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/arch/x86/exception.c M src/cpu/x86/smm/smm_module_handler.c 2 files changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/87208/1
diff --git a/src/arch/x86/exception.c b/src/arch/x86/exception.c index 224f0e1..e21cfa6 100644 --- a/src/arch/x86/exception.c +++ b/src/arch/x86/exception.c @@ -665,6 +665,8 @@
load_idt(idt, sizeof(idt));
+#if !ENV_SMM null_breakpoint_init(); stack_canary_breakpoint_init(); +#endif } diff --git a/src/cpu/x86/smm/smm_module_handler.c b/src/cpu/x86/smm/smm_module_handler.c index d25b5f4..d9f6420 100644 --- a/src/cpu/x86/smm/smm_module_handler.c +++ b/src/cpu/x86/smm/smm_module_handler.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <arch/io.h> +#include <arch/exception.h> #include <commonlib/region.h> #include <console/cbmem_console.h> #include <console/console.h> @@ -169,6 +170,9 @@
printk(BIOS_SPEW, "\nSMI# #%d\n", cpu);
+ if (CONFIG(DEBUG_SMI) && CONFIG(CONSOLE_SERIAL)) + exception_init(); + /* Allow drivers to initialize variables in SMM context. */ if (do_driver_init) { #if CONFIG(SPI_FLASH_SMM)