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>
This commit is contained in:
Kyösti Mälkki
2022-11-11 19:46:05 +02:00
parent 2d4c2b9850
commit bbba201165
5 changed files with 15 additions and 16 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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));