diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cpu/x86/mp_init.c | 5 | ||||
-rw-r--r-- | src/cpu/x86/smm/smm_module_handler.c | 4 | ||||
-rw-r--r-- | src/include/cpu/x86/smm.h | 9 |
3 files changed, 13 insertions, 5 deletions
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 642667b41b..d3af6ecc8f 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -1087,10 +1087,7 @@ static void fill_mp_state_smm(struct mp_state *state, const struct mp_ops *ops) /* * Make sure there is enough room for the SMM descriptor */ - if (CONFIG(STM)) { - state->smm_save_state_size += - ALIGN_UP(sizeof(TXT_PROCESSOR_SMM_DESCRIPTOR), 0x100); - } + state->smm_save_state_size += STM_PSD_SIZE; /* * Default to smm_initiate_relocation() if trigger callback isn't diff --git a/src/cpu/x86/smm/smm_module_handler.c b/src/cpu/x86/smm/smm_module_handler.c index 3415b02842..0daae00ebb 100644 --- a/src/cpu/x86/smm/smm_module_handler.c +++ b/src/cpu/x86/smm/smm_module_handler.c @@ -9,6 +9,7 @@ #include <cpu/x86/smm.h> #include <rmodule.h> #include <types.h> +#include <security/intel/stm/SmmStm.h> #if CONFIG(SPI_FLASH_SMM) #include <spi-generic.h> @@ -103,7 +104,8 @@ void *smm_get_save_state(int cpu) if (cpu > smm_runtime.num_cpus) return NULL; - return (void *)(smm_runtime.save_state_top[cpu] - smm_runtime.save_state_size); + return (void *)(smm_runtime.save_state_top[cpu] - + (smm_runtime.save_state_size - STM_PSD_SIZE)); } uint32_t smm_revision(void) diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index 68c7c3bba7..a240ac2f51 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -33,6 +33,15 @@ #define SMM_PCI_RESOURCE_STORE_NUM_RESOURCES 6 +/* + * SMI Transfer Monitor (STM) descriptor reserved in SMM save state. + */ +#if CONFIG(STM) +#define STM_PSD_SIZE ALIGN_UP(sizeof(TXT_PROCESSOR_SMM_DESCRIPTOR), 0x100) +#else +#define STM_PSD_SIZE 0 +#endif + /* Send cmd to APM_CNT with HAVE_SMI_HANDLER checking. */ int apm_control(u8 cmd); u8 apm_get_apmc(void); |