cpu/x86/smm: Add support for exception handling
Add an exception handler to SMM to debug crashes when a serial console is enabled and DEBUG_SMI is set. This allows for narrowing down issues faster than letting the machine triple fault. Change-Id: I2ccaf8d23d508d773ce56912983884ad6832ede6 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/87208 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Shuo Liu <shuo.liu@intel.com> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
This commit is contained in:
parent
2e27ceed67
commit
245cba6795
2 changed files with 6 additions and 0 deletions
|
|
@ -665,6 +665,8 @@ asmlinkage void exception_init(void)
|
|||
|
||||
load_idt(idt, sizeof(idt));
|
||||
|
||||
#if !ENV_SMM
|
||||
null_breakpoint_init();
|
||||
stack_canary_breakpoint_init();
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 @@ asmlinkage void smm_handler_start(void *arg)
|
|||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue