diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2022-05-30 13:49:20 +0300 |
---|---|---|
committer | Arthur Heymans <arthur@aheymans.xyz> | 2022-05-31 10:12:25 +0000 |
commit | 2a13a5487f31bd690cc5cba01657b47f169e8364 (patch) | |
tree | a84a63cbc4dff6ea87bc42730159a44c1e92b948 /src/cpu/x86 | |
parent | 74129e51411c26ffcb61607f676059799198bb34 (diff) |
cpu/x86/smm_module_load: Fix SMM stub params
There is NULL dereference in adjust_apic_id_map() and updating
apic_id_to_cpu[] array within SMM stub fails.
Initial apic_id_to_cpu[] array may have worked for platforms
where APIC IDs are consecutive.
Change-Id: Ie59a731bfc883f8a47048b2ceacc66f44aa5b68c
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64798
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Uwe Poeche <uwe.poeche@siemens.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/cpu/x86')
-rw-r--r-- | src/cpu/x86/smm/smm_module_loader.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c index 6502a6d5b1..1c32ecd5be 100644 --- a/src/cpu/x86/smm/smm_module_loader.c +++ b/src/cpu/x86/smm/smm_module_loader.c @@ -318,6 +318,8 @@ static int smm_module_setup_stub(const uintptr_t smbase, const size_t smm_size, for (int i = 0; i < params->num_cpus; i++) stub_params->apic_id_to_cpu[i] = i; + /* Allow the initiator to manipulate SMM stub parameters. */ + params->stub_params = stub_params; printk(BIOS_DEBUG, "%s: stack_top = 0x%x\n", __func__, stub_params->stack_top); printk(BIOS_DEBUG, "%s: per cpu stack_size = 0x%x\n", __func__, |