Attention is currently required from: Jason Glenesk, Raul Rangel, Marshall Dawson, Fred Reitberger, Felix Held. Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/64871 )
Change subject: cpu/amd: Move locking SMM as part of SMM init ......................................................................
cpu/amd: Move locking SMM as part of SMM init
Change-Id: Ibcdfc0f9ae211644cf0911790b0b0c5d1b0b7dc9 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/amd/smm/smm_helper.c M src/soc/amd/common/block/cpu/smm/finalize.c 2 files changed, 3 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/64871/1
diff --git a/src/cpu/amd/smm/smm_helper.c b/src/cpu/amd/smm/smm_helper.c index 82fd423..585fe0d 100644 --- a/src/cpu/amd/smm/smm_helper.c +++ b/src/cpu/amd/smm/smm_helper.c @@ -115,6 +115,9 @@ amd64_smm_state_save_area_t *smm_state; smm_state = (void *)(SMM_AMD64_SAVE_STATE_OFFSET + curr_smbase); smm_state->smbase = staggered_smbase; + + tseg_valid(); + lock_smm(); }
const struct mp_ops amd_mp_ops_with_smm = { diff --git a/src/soc/amd/common/block/cpu/smm/finalize.c b/src/soc/amd/common/block/cpu/smm/finalize.c index 08d93ea..9d29005 100644 --- a/src/soc/amd/common/block/cpu/smm/finalize.c +++ b/src/soc/amd/common/block/cpu/smm/finalize.c @@ -10,33 +10,8 @@ #include <cpu/x86/msr.h> #include <types.h>
-static void per_core_finalize(void *unused) -{ - msr_t hwcr; - - /* Finalize SMM settings */ - hwcr = rdmsr(HWCR_MSR); - if (hwcr.lo & SMM_LOCK) /* Skip if already locked, avoid GPF */ - return; - - if (CONFIG(HAVE_SMI_HANDLER)) - tseg_valid(); - - lock_smm(); -} - -static void finalize_cores(void) -{ - printk(BIOS_SPEW, "Lock SMM configuration\n"); - - if (mp_run_on_all_cpus(per_core_finalize, NULL) != CB_SUCCESS) - printk(BIOS_WARNING, "Failed to finalize all cores\n"); -} - static void soc_finalize(void *unused) { - finalize_cores(); - if (!acpi_is_wakeup_s3()) { acpi_clear_pm_gpe_status();