cpu/x86/smm_loaderv2: Use the permanent stack top during relocation

Use the same stack location during relocation as for the permanent
handler.

When the number of CPUs is too large the stacks during relocation
don't fit inside the default SMRAM segment at 0x30000. Currently the
code would just let the CPU stack base grow downwards outside of the
default SMM segment which would corrupt lower memory if S3 is
implemented.

Also update the comment on smm_module_setup_stub().

Change-Id: I6a0a890e8b1c2408301564c22772032cfee4d296
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51186
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Arthur Heymans
2021-02-16 13:19:18 +01:00
committed by Patrick Georgi
parent 110c47699a
commit e6c3523b1b
4 changed files with 19 additions and 26 deletions

View File

@@ -148,7 +148,7 @@ struct smm_loader_params {
};
/* Both of these return 0 on success, < 0 on failure. */
int smm_setup_relocation_handler(struct smm_loader_params *params);
int smm_setup_relocation_handler(void * const perm_smram, struct smm_loader_params *params);
int smm_load_module(void *smram, size_t size, struct smm_loader_params *params);
u32 smm_get_cpu_smbase(unsigned int cpu_num);