summaryrefslogtreecommitdiff
path: root/src/cpu/x86/smm/smm_module_loader.c
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2021-02-15 16:02:10 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-03-19 11:29:10 +0000
commit823b1a827046ccfc00835bfbce95824dd644e9f9 (patch)
treea2667ac1dd3132751ebd562406a6515c964c82d2 /src/cpu/x86/smm/smm_module_loader.c
parentc9aecb4440d753168e84039c27906472d6174e3e (diff)
cpu/x86/smm_module_handler: Add relocatable module params
Instead of passing on parameters from the stub to the permanent handler, add them directly to the permanent handler. The parameters in the stub will be removed in a later patch. Change-Id: Ib3bde78dd9e0c02dd1d86e03665fa9c65e3d07eb Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/50764 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/cpu/x86/smm/smm_module_loader.c')
-rw-r--r--src/cpu/x86/smm/smm_module_loader.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c
index 16feeb6c6e..087cf1a760 100644
--- a/src/cpu/x86/smm/smm_module_loader.c
+++ b/src/cpu/x86/smm/smm_module_loader.c
@@ -324,6 +324,7 @@ int smm_setup_relocation_handler(struct smm_loader_params *params)
int smm_load_module(void *smram, size_t size, struct smm_loader_params *params)
{
struct rmodule smm_mod;
+ struct smm_runtime *handler_mod_params;
size_t total_stack_size;
size_t handler_size;
size_t module_alignment;
@@ -390,6 +391,12 @@ int smm_load_module(void *smram, size_t size, struct smm_loader_params *params)
return -1;
params->handler = rmodule_entry(&smm_mod);
+ handler_mod_params = rmodule_parameters(&smm_mod);
+ handler_mod_params->smbase = (uintptr_t)smram;
+ handler_mod_params->smm_size = size;
+ handler_mod_params->save_state_size = params->per_cpu_save_state_size;
+ handler_mod_params->num_cpus = params->num_concurrent_stacks;
+ handler_mod_params->gnvs_ptr = (uintptr_t)acpi_get_gnvs();
return smm_module_setup_stub(smram, size, params, fxsave_area);
}