Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/51377 )
Change subject: [WIP]cpu/x86/smm: Add a Kconfig option to disable smihandler ......................................................................
[WIP]cpu/x86/smm: Add a Kconfig option to disable smihandler
Change-Id: Ia3834897d909c0edcf52ebace19586ee5038748d Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/x86/Kconfig M src/cpu/x86/smm/smm_module_handler.c 2 files changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/51377/1
diff --git a/src/cpu/x86/Kconfig b/src/cpu/x86/Kconfig index b3a16bc..4a6b221 100644 --- a/src/cpu/x86/Kconfig +++ b/src/cpu/x86/Kconfig @@ -96,6 +96,13 @@ default y depends on !(NO_SMM || SMM_ASEG)
+config X86_DISABLE_SMIHANDLER + bool "Disable smihandler" + default n + help + This sets up an smihandler that never sets EOS, which effectively + disables SMM. + if SMM_TSEG
config SMM_MODULE_HEAP_SIZE diff --git a/src/cpu/x86/smm/smm_module_handler.c b/src/cpu/x86/smm/smm_module_handler.c index 8532d59..e61a28d 100644 --- a/src/cpu/x86/smm/smm_module_handler.c +++ b/src/cpu/x86/smm/smm_module_handler.c @@ -132,6 +132,10 @@ cpu = p->cpu; expected_canary = (uintptr_t)p->canary;
+ /* As we don't set EOS, no further SMI# will be generated */ + if (CONFIG(X86_DISABLE_SMIHANDLER)) + return; + /* Make sure to set the global runtime. It's OK to race as the value * will be the same across CPUs as well as multiple SMIs. */ if (smm_runtime == NULL) {