Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34747 )
Change subject: cpu/x86/smm: Drop SMI handler address from struct ......................................................................
cpu/x86/smm: Drop SMI handler address from struct
Change-Id: Ib925b11ba269e0f3a9a0a7550705bf2a6794c5b1 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/cpu/intel/haswell/smmrelocate.c M src/cpu/intel/smm/gen1/smmrelocate.c M src/soc/intel/broadwell/include/soc/smm.h M src/soc/intel/broadwell/smmrelocate.c M src/soc/intel/cannonlake/include/soc/smm.h M src/soc/intel/cannonlake/smmrelocate.c M src/soc/intel/fsp_broadwell_de/include/soc/smm.h M src/soc/intel/fsp_broadwell_de/smmrelocate.c M src/soc/intel/icelake/include/soc/smm.h M src/soc/intel/icelake/smmrelocate.c M src/soc/intel/skylake/include/soc/smm.h M src/soc/intel/skylake/smmrelocate.c 12 files changed, 14 insertions(+), 35 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/34747/1
diff --git a/src/cpu/intel/haswell/smmrelocate.c b/src/cpu/intel/haswell/smmrelocate.c index a9954ec..9464227 100644 --- a/src/cpu/intel/haswell/smmrelocate.c +++ b/src/cpu/intel/haswell/smmrelocate.c @@ -46,8 +46,6 @@ #define EMRR_SUPPORTED (1 << 12)
struct smm_relocation_params { - uintptr_t smram_base; - size_t smram_size; uintptr_t ied_base; size_t ied_size; msr_t smrr_base; @@ -237,7 +235,6 @@ params->smrr_mask.lo = (~(tseg_size - 1) & rmask) | MTRR_PHYS_MASK_VALID; params->smrr_mask.hi = 0;
- smm_subregion(SMM_SUBREGION_HANDLER, ¶ms->smram_base, ¶ms->smram_size); smm_subregion(SMM_SUBREGION_IED, ¶ms->ied_base, ¶ms->ied_size);
/* The EMRR and UNCORE_EMRR are at IEDBASE + 2MiB */ @@ -293,10 +290,10 @@
fill_in_relocation_params(&smm_reloc_params);
+ smm_subregion(SMM_SUBREGION_HANDLER, perm_smbase, perm_smsize); + setup_ied_area(&smm_reloc_params);
- *perm_smbase = smm_reloc_params.smram_base; - *perm_smsize = smm_reloc_params.smram_size; *smm_save_state_size = sizeof(em64t101_smm_state_save_area_t); }
diff --git a/src/cpu/intel/smm/gen1/smmrelocate.c b/src/cpu/intel/smm/gen1/smmrelocate.c index 20a1e36..18cd45f 100644 --- a/src/cpu/intel/smm/gen1/smmrelocate.c +++ b/src/cpu/intel/smm/gen1/smmrelocate.c @@ -47,8 +47,6 @@
struct smm_relocation_params { - uintptr_t smram_base; - size_t smram_size; uintptr_t ied_base; size_t ied_size; msr_t smrr_base; @@ -120,7 +118,6 @@ if (cpu_has_alternative_smrr()) params->smrr_base.lo &= ~rmask;
- smm_subregion(SMM_SUBREGION_HANDLER, ¶ms->smram_base, ¶ms->smram_size); smm_subregion(SMM_SUBREGION_IED, ¶ms->ied_base, ¶ms->ied_size); }
@@ -161,11 +158,11 @@
fill_in_relocation_params(&smm_reloc_params);
+ smm_subregion(SMM_SUBREGION_HANDLER, perm_smbase, perm_smsize); + if (smm_reloc_params.ied_size) setup_ied_area(&smm_reloc_params);
- *perm_smbase = smm_reloc_params.smram_base; - *perm_smsize = smm_reloc_params.smram_size; *smm_save_state_size = sizeof(em64t101_smm_state_save_area_t); }
diff --git a/src/soc/intel/broadwell/include/soc/smm.h b/src/soc/intel/broadwell/include/soc/smm.h index 0c6f587..fad5b20 100644 --- a/src/soc/intel/broadwell/include/soc/smm.h +++ b/src/soc/intel/broadwell/include/soc/smm.h @@ -26,8 +26,6 @@ } __packed;
struct smm_relocation_params { - uintptr_t smram_base; - size_t smram_size; uintptr_t ied_base; size_t ied_size; msr_t smrr_base; diff --git a/src/soc/intel/broadwell/smmrelocate.c b/src/soc/intel/broadwell/smmrelocate.c index 981b42b..2fd26d5 100644 --- a/src/soc/intel/broadwell/smmrelocate.c +++ b/src/soc/intel/broadwell/smmrelocate.c @@ -205,7 +205,6 @@ params->smrr_mask.lo = (~(tseg_size - 1) & rmask) | MTRR_PHYS_MASK_VALID; params->smrr_mask.hi = 0;
- smm_subregion(SMM_SUBREGION_HANDLER, ¶ms->smram_base, ¶ms->smram_size); smm_subregion(SMM_SUBREGION_IED, ¶ms->ied_base, ¶ms->ied_size);
/* The EMRR and UNCORE_EMRR are at IEDBASE + 2MiB */ @@ -254,10 +253,10 @@
fill_in_relocation_params(&smm_reloc_params);
+ smm_subregion(SMM_SUBREGION_HANDLER, perm_smbase, perm_smsize); + setup_ied_area(&smm_reloc_params);
- *perm_smbase = smm_reloc_params.smram_base; - *perm_smsize = smm_reloc_params.smram_size; *smm_save_state_size = sizeof(em64t101_smm_state_save_area_t); }
diff --git a/src/soc/intel/cannonlake/include/soc/smm.h b/src/soc/intel/cannonlake/include/soc/smm.h index 5f51fa2..e2367a7 100644 --- a/src/soc/intel/cannonlake/include/soc/smm.h +++ b/src/soc/intel/cannonlake/include/soc/smm.h @@ -29,8 +29,6 @@ } __packed;
struct smm_relocation_params { - uintptr_t smram_base; - size_t smram_size; uintptr_t ied_base; size_t ied_size; msr_t smrr_base; diff --git a/src/soc/intel/cannonlake/smmrelocate.c b/src/soc/intel/cannonlake/smmrelocate.c index 26951bd..6912765 100644 --- a/src/soc/intel/cannonlake/smmrelocate.c +++ b/src/soc/intel/cannonlake/smmrelocate.c @@ -188,7 +188,6 @@ phys_bits = cpu_phys_address_size();
smm_region(&tseg_base, &tseg_size); - smm_subregion(SMM_SUBREGION_HANDLER, ¶ms->smram_base, ¶ms->smram_size); smm_subregion(SMM_SUBREGION_IED, ¶ms->ied_base, ¶ms->ied_size);
/* SMRR has 32-bits of valid address aligned to 4KiB. */ @@ -248,11 +247,11 @@
fill_in_relocation_params(&smm_reloc_params);
+ smm_subregion(SMM_SUBREGION_HANDLER, perm_smbase, perm_smsize); + if (smm_reloc_params.ied_size) setup_ied_area(&smm_reloc_params);
- *perm_smbase = smm_reloc_params.smram_base; - *perm_smsize = smm_reloc_params.smram_size; *smm_save_state_size = sizeof(em64t101_smm_state_save_area_t); }
diff --git a/src/soc/intel/fsp_broadwell_de/include/soc/smm.h b/src/soc/intel/fsp_broadwell_de/include/soc/smm.h index 42cadb3..e08ffb1 100644 --- a/src/soc/intel/fsp_broadwell_de/include/soc/smm.h +++ b/src/soc/intel/fsp_broadwell_de/include/soc/smm.h @@ -27,8 +27,6 @@ } __packed;
struct smm_relocation_params { - uintptr_t smram_base; - size_t smram_size; uintptr_t ied_base; size_t ied_size; msr_t smrr_base; diff --git a/src/soc/intel/fsp_broadwell_de/smmrelocate.c b/src/soc/intel/fsp_broadwell_de/smmrelocate.c index a7b06dc..583039b 100644 --- a/src/soc/intel/fsp_broadwell_de/smmrelocate.c +++ b/src/soc/intel/fsp_broadwell_de/smmrelocate.c @@ -222,7 +222,6 @@ params->smrr_mask.lo = (~(tseg_size - 1) & rmask) | MTRR_PHYS_MASK_VALID; params->smrr_mask.hi = 0;
- smm_subregion(SMM_SUBREGION_HANDLER, ¶ms->smram_base, ¶ms->smram_size); smm_subregion(SMM_SUBREGION_IED, ¶ms->ied_base, ¶ms->ied_size);
/* The PRMRR is at IEDBASE + 2MiB */ @@ -264,10 +263,10 @@
fill_in_relocation_params(&smm_reloc_params);
+ smm_subregion(SMM_SUBREGION_HANDLER, perm_smbase, perm_smsize); + setup_ied_area(&smm_reloc_params);
- *perm_smbase = smm_reloc_params.smram_base; - *perm_smsize = smm_reloc_params.smram_size; *smm_save_state_size = sizeof(em64t101_smm_state_save_area_t); }
diff --git a/src/soc/intel/icelake/include/soc/smm.h b/src/soc/intel/icelake/include/soc/smm.h index 498a221..2d4adf7 100644 --- a/src/soc/intel/icelake/include/soc/smm.h +++ b/src/soc/intel/icelake/include/soc/smm.h @@ -28,8 +28,6 @@ } __packed;
struct smm_relocation_params { - uintptr_t smram_base; - size_t smram_size; uintptr_t ied_base; size_t ied_size; msr_t smrr_base; diff --git a/src/soc/intel/icelake/smmrelocate.c b/src/soc/intel/icelake/smmrelocate.c index 62a8a0d..58f76ed 100644 --- a/src/soc/intel/icelake/smmrelocate.c +++ b/src/soc/intel/icelake/smmrelocate.c @@ -187,7 +187,6 @@ phys_bits = cpu_phys_address_size();
smm_region(&tseg_base, &tseg_size); - smm_subregion(SMM_SUBREGION_HANDLER, ¶ms->smram_base, ¶ms->smram_size); smm_subregion(SMM_SUBREGION_IED, ¶ms->ied_base, ¶ms->ied_size);
/* SMRR has 32-bits of valid address aligned to 4KiB. */ @@ -247,11 +246,11 @@
fill_in_relocation_params(&smm_reloc_params);
+ smm_subregion(SMM_SUBREGION_HANDLER, perm_smbase, perm_smsize); + if (smm_reloc_params.ied_size) setup_ied_area(&smm_reloc_params);
- *perm_smbase = smm_reloc_params.smram_base; - *perm_smsize = smm_reloc_params.smram_size; *smm_save_state_size = sizeof(em64t101_smm_state_save_area_t); }
diff --git a/src/soc/intel/skylake/include/soc/smm.h b/src/soc/intel/skylake/include/soc/smm.h index b2debe8..9c15db2 100644 --- a/src/soc/intel/skylake/include/soc/smm.h +++ b/src/soc/intel/skylake/include/soc/smm.h @@ -30,8 +30,6 @@ } __packed;
struct smm_relocation_params { - uintptr_t smram_base; - size_t smram_size; uintptr_t ied_base; size_t ied_size; msr_t smrr_base; diff --git a/src/soc/intel/skylake/smmrelocate.c b/src/soc/intel/skylake/smmrelocate.c index 3595c15..ce51a3c 100644 --- a/src/soc/intel/skylake/smmrelocate.c +++ b/src/soc/intel/skylake/smmrelocate.c @@ -197,7 +197,6 @@ phys_bits = cpuid_eax(0x80000008) & 0xff;
smm_region(&tseg_base, &tseg_size); - smm_subregion(SMM_SUBREGION_HANDLER, ¶ms->smram_base, ¶ms->smram_size); smm_subregion(SMM_SUBREGION_IED, ¶ms->ied_base, ¶ms->ied_size);
/* SMRR has 32-bits of valid address aligned to 4KiB. */ @@ -257,11 +256,11 @@
fill_in_relocation_params(&smm_reloc_params);
+ smm_subregion(SMM_SUBREGION_HANDLER, perm_smbase, perm_smsize); + if (smm_reloc_params.ied_size) setup_ied_area(&smm_reloc_params);
- *perm_smbase = smm_reloc_params.smram_base; - *perm_smsize = smm_reloc_params.smram_size; *smm_save_state_size = sizeof(em64t101_smm_state_save_area_t); }