diff options
author | Eugene Myers <cedarhouse@comcast.net> | 2022-02-07 16:27:26 -0500 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-02-24 00:27:08 +0000 |
commit | a514192ffee49266568ce1f2bb3cbbebf05c36b8 (patch) | |
tree | 4ab6593ac563178561c2759a33de9be1f84dbe54 /src | |
parent | b582ce08140e693831adc8521950eb571d0588c2 (diff) |
security/intel/stm: Use correct SMBASE for SMM descriptor setup
Commit ea3376c (SMM module loader version 2) changedhow the
SMBASE is calculated.
This patch modifies setup_smm_descriptor to properly acquire the
SMBASE.
This patch has been tested on a Purism L1UM-1X8C and a Purism 15v4.
Signed-off-by: Eugene Myers <cedarhouse@comcast.net>
Change-Id: I1d62a36cdcbc20a19c42266164e612fb96f91953
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61688
Reviewed-by: Eugene Myers <cedarhouse1@comcast.net>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/security/intel/stm/SmmStm.h | 2 | ||||
-rw-r--r-- | src/security/intel/stm/StmPlatformSmm.c | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/security/intel/stm/SmmStm.h b/src/security/intel/stm/SmmStm.h index b395493a06..8db770dc23 100644 --- a/src/security/intel/stm/SmmStm.h +++ b/src/security/intel/stm/SmmStm.h @@ -75,7 +75,7 @@ void notify_stm_resource_change(void *stm_resource); */ void *get_stm_resource(void); -void setup_smm_descriptor(void *smbase, void *base_smbase, int32_t apic_id, +void setup_smm_descriptor(void *smbase, int32_t apic_id, int32_t entry32_off); /* diff --git a/src/security/intel/stm/StmPlatformSmm.c b/src/security/intel/stm/StmPlatformSmm.c index cbb111adf0..ef02ae3971 100644 --- a/src/security/intel/stm/StmPlatformSmm.c +++ b/src/security/intel/stm/StmPlatformSmm.c @@ -77,8 +77,7 @@ static void read_gdtr(struct descriptor *gdtr) __asm__ __volatile__("sgdt %0" : "=m"(*gdtr)); } -void setup_smm_descriptor(void *smbase, void *base_smbase, int32_t apic_id, - int32_t entry32_off) +void setup_smm_descriptor(void *smbase, int32_t apic_id, int32_t entry32_off) { struct descriptor gdtr; void *smbase_processor; @@ -103,7 +102,7 @@ void setup_smm_descriptor(void *smbase, void *base_smbase, int32_t apic_id, psd->smm_descriptor_ver_minor = TXT_PROCESSOR_SMM_DESCRIPTOR_VERSION_MINOR; psd->smm_smi_handler_rip = - (uint64_t)((uintptr_t)base_smbase + SMM_ENTRY_OFFSET + + (uint64_t)((uintptr_t)smbase + SMM_ENTRY_OFFSET + entry32_off); psd->local_apic_id = apic_id; psd->size = sizeof(TXT_PROCESSOR_SMM_DESCRIPTOR); @@ -123,7 +122,7 @@ void setup_smm_descriptor(void *smbase, void *base_smbase, int32_t apic_id, read_gdtr(&gdtr); gdtr.base -= (uintptr_t) smbase_processor; - gdtr.base += (uintptr_t) base_smbase; + gdtr.base += (uintptr_t) smbase; psd->smm_gdt_ptr = gdtr.base; psd->smm_gdt_size = gdtr.limit + 1; // the stm will subtract, so add @@ -183,8 +182,8 @@ void stm_setup(uintptr_t mseg, int cpu, uintptr_t smbase, cpu, MsegChk.hi, MsegChk.lo); // setup the descriptor for this cpu - setup_smm_descriptor((void *)smbase, (void *) base_smbase, - cpu, offset32); + setup_smm_descriptor((void *)smbase, cpu, offset32); + } else { printk(BIOS_DEBUG, "STM: Error in STM load, STM not enabled: %d\n", |