Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41951 )
Change subject: cpu/intel/smm/srvstr: Clean up parallel SMM relocation ......................................................................
cpu/intel/smm/srvstr: Clean up parallel SMM relocation
Change-Id: I65c078181970c5f391636b395483c7c7171e8897 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/cpu/intel/smm/cpu_svrstr.c 1 file changed, 9 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/41951/1
diff --git a/src/cpu/intel/smm/cpu_svrstr.c b/src/cpu/intel/smm/cpu_svrstr.c index 76c8a0f..f69aba3 100644 --- a/src/cpu/intel/smm/cpu_svrstr.c +++ b/src/cpu/intel/smm/cpu_svrstr.c @@ -20,7 +20,7 @@ * the saving state to each CPU's MSRs. At least one save state size * is required for the initial SMM entry for the BSP to determine if * parallel SMM relocation is even feasible. */ -static void per_cpu_smm_trigger(void) +static void per_cpu_smm_trigger_parallel(void) { /* * If smm_save_state_in_msrs is non-zero then parallel SMM relocation @@ -102,17 +102,21 @@ write_smm_msrs(cpu, relo_params); }
-void select_mp_ops_em64t101_cpu_svrstr(struct mp_ops *mp_ops) +static int detect_cpu_svrstr(void) { msr_t smm_mca_cap; + smm_mca_cap = rdmsr(SMM_MCA_CAP_MSR); + return (smm_mca_cap.hi & SMM_CPU_SVRSTR_MASK); +}
+void select_mp_ops_em64t101_cpu_svrstr(struct mp_ops *mp_ops) +{ select_mp_ops_em64t101(mp_ops);
- smm_mca_cap = rdmsr(SMM_MCA_CAP_MSR); - if (!(smm_mca_cap.hi & SMM_CPU_SVRSTR_MASK)) + if (!detect_cpu_svrstr()) return;
printk(BIOS_DEBUG, "Doing parallel SMM relocation.\n"); - mp_ops->per_cpu_smm_trigger = per_cpu_smm_trigger; + mp_ops->per_cpu_smm_trigger = per_cpu_smm_trigger_parallel; mp_ops->relocation_handler = relocation_handler; }