Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63480 )
Change subject: cpu/x86/smm_module_loader: Drop superfluous check ......................................................................
cpu/x86/smm_module_loader: Drop superfluous check
Checking if the stack encroaches on the entry points is done in other parts of the code.
Change-Id: I275d5dda9c69cc89608450ae27dd5dbd581e3595 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/x86/smm/smm_module_loader.c 1 file changed, 3 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/63480/1
diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c index 0e8df34..6f8529e 100644 --- a/src/cpu/x86/smm/smm_module_loader.c +++ b/src/cpu/x86/smm/smm_module_loader.c @@ -177,28 +177,11 @@ */
static int smm_place_entry_code(uintptr_t smbase, unsigned int num_cpus, - uintptr_t stack_top, const struct smm_loader_params *params) + const struct smm_loader_params *params) { unsigned int i; unsigned int size;
- /* - * Ensure there was enough space and the last CPUs smbase - * did not encroach upon the stack. Stack top is smram start - * + size of stack. - */ - if (cpus[num_cpus].active) { - if (cpus[num_cpus - 1].smbase + SMM_ENTRY_OFFSET < stack_top) { - printk(BIOS_ERR, "%s: stack encroachment\n", __func__); - printk(BIOS_ERR, "%s: smbase %lx, stack_top %lx\n", - __func__, cpus[num_cpus].smbase, stack_top); - return 0; - } - } - - printk(BIOS_INFO, "%s: smbase %lx, stack_top %lx\n", - __func__, cpus[num_cpus-1].smbase, stack_top); - /* start at 1, the first CPU stub code is already there */ size = cpus[0].code_end - cpus[0].code_start; for (i = 1; i < num_cpus; i++) { @@ -249,9 +232,8 @@ * sets up the stack, and then jumps to common SMI handler */ if (params->num_concurrent_save_states > 1 || stub_entry_offset != 0) { - rc = smm_place_entry_code((uintptr_t)base, - params->num_concurrent_save_states, - stack_top, params); + rc = smm_place_entry_code((uintptr_t)base, params->num_concurrent_save_states, + params); } return rc; }