diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2022-11-11 19:46:05 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2022-11-16 15:34:44 +0000 |
commit | bbba201165caa3a666dad98b9b28051b03333f62 (patch) | |
tree | bdc573f01acfb74b3107e0aa65482fbe488166ca /src/cpu | |
parent | 2d4c2b9850435267053edd2dfadc1faea4fa873c (diff) |
cpu/x86/smm: Use common SMM_ASEG region
Change-Id: Idca56583c1c8dc41ad11d915ec3e8be781fb4e48
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69665
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/x86/smm/Makefile.inc | 4 | ||||
-rw-r--r-- | src/cpu/x86/smm/smm_module_loader.c | 5 | ||||
-rw-r--r-- | src/cpu/x86/smm/tseg_region.c | 7 |
3 files changed, 6 insertions, 10 deletions
diff --git a/src/cpu/x86/smm/Makefile.inc b/src/cpu/x86/smm/Makefile.inc index da93827274..327b6c6720 100644 --- a/src/cpu/x86/smm/Makefile.inc +++ b/src/cpu/x86/smm/Makefile.inc @@ -29,14 +29,10 @@ endif smm-y += save_state.c -ifeq ($(CONFIG_SMM_TSEG),y) - ramstage-y += tseg_region.c romstage-y += tseg_region.c postcar-y += tseg_region.c -endif - ifeq ($(CONFIG_PARALLEL_MP),y) smmstub-y += smm_stub.S diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c index 6f334a2e81..6924f08e78 100644 --- a/src/cpu/x86/smm/smm_module_loader.c +++ b/src/cpu/x86/smm/smm_module_loader.c @@ -409,11 +409,6 @@ static int append_and_check_region(const struct region smram, int smm_load_module(const uintptr_t smram_base, const size_t smram_size, struct smm_loader_params *params) { - if (CONFIG(SMM_ASEG) && (smram_base != SMM_BASE || smram_size != SMM_CODE_SEGMENT_SIZE)) { - printk(BIOS_ERR, "SMM base & size are 0x%lx, 0x%zx, but must be 0x%x, 0x%x\n", - smram_base, smram_size, SMM_BASE, SMM_CODE_SEGMENT_SIZE); - return -1; - } /* * Place in .bss to reduce stack usage. * TODO: once CPU_INFO_V2 is used everywhere, use smaller stack for APs and move diff --git a/src/cpu/x86/smm/tseg_region.c b/src/cpu/x86/smm/tseg_region.c index f6aecd0557..413d5fcb8b 100644 --- a/src/cpu/x86/smm/tseg_region.c +++ b/src/cpu/x86/smm/tseg_region.c @@ -26,7 +26,12 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size) const size_t ied_size = CONFIG_IED_REGION_SIZE; const size_t cache_size = CONFIG_SMM_RESERVED_SIZE; - smm_region(&sub_base, &sub_size); + if (CONFIG(SMM_TSEG)) + smm_region(&sub_base, &sub_size); + else if (CONFIG(SMM_ASEG)) + aseg_region(&sub_base, &sub_size); + else + return -1; ASSERT(IS_ALIGNED(sub_base, sub_size)); ASSERT(sub_size > (cache_size + ied_size)); |