From ed4be45d58ea482c1c8172bc4b2fa1c6af75c75f Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Mon, 15 Feb 2021 13:20:35 +0100 Subject: cpu/x86/smm: Move apic_id_to_cpu map to smm_stub params This is only consumed by the stub and not by the relocation handler or the permanent handler, so move it out of the runtime struct. Change-Id: I01ed0a412c23c8a82d88408be058a27e55d0dc4d Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/50762 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/cpu/x86/smm/smm_module_loader.c | 3 ++- src/cpu/x86/smm/smm_module_loaderv2.c | 3 ++- src/cpu/x86/smm/smm_stub.S | 11 ++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src/cpu/x86/smm') diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c index d799ae2805..16feeb6c6e 100644 --- a/src/cpu/x86/smm/smm_module_loader.c +++ b/src/cpu/x86/smm/smm_module_loader.c @@ -259,9 +259,10 @@ static int smm_module_setup_stub(void *smbase, size_t smm_size, /* Initialize the APIC id to CPU number table to be 1:1 */ for (i = 0; i < params->num_concurrent_stacks; i++) - stub_params->runtime.apic_id_to_cpu[i] = i; + stub_params->apic_id_to_cpu[i] = i; /* Allow the initiator to manipulate SMM stub parameters. */ + params->stub_params = stub_params; params->runtime = &stub_params->runtime; printk(BIOS_DEBUG, "SMM Module: stub loaded at %p. Will call %p\n", diff --git a/src/cpu/x86/smm/smm_module_loaderv2.c b/src/cpu/x86/smm/smm_module_loaderv2.c index be0e23d50c..81d85c6f92 100644 --- a/src/cpu/x86/smm/smm_module_loaderv2.c +++ b/src/cpu/x86/smm/smm_module_loaderv2.c @@ -464,9 +464,10 @@ static int smm_module_setup_stub(void *smbase, size_t smm_size, /* Initialize the APIC id to CPU number table to be 1:1 */ for (i = 0; i < params->num_concurrent_stacks; i++) - stub_params->runtime.apic_id_to_cpu[i] = i; + stub_params->apic_id_to_cpu[i] = i; /* Allow the initiator to manipulate SMM stub parameters. */ + params->stub_params = stub_params; params->runtime = &stub_params->runtime; printk(BIOS_DEBUG, "SMM Module: stub loaded at %p. Will call %p\n", diff --git a/src/cpu/x86/smm/smm_stub.S b/src/cpu/x86/smm/smm_stub.S index b9b0670ef6..24cb684e10 100644 --- a/src/cpu/x86/smm/smm_stub.S +++ b/src/cpu/x86/smm/smm_stub.S @@ -25,6 +25,12 @@ fxsave_area: .long 0 fxsave_area_size: .long 0 +/* apic_to_cpu_num is a table mapping the default APIC id to CPU num. If the + * APIC id is found at the given index, the contiguous CPU number is index + * into the table. */ +apic_to_cpu_num: +.fill CONFIG_MAX_CPUS,1,0xff + /* struct smm_runtime begins here. */ smm_runtime: smbase: @@ -40,11 +46,6 @@ gnvs_ptr: /* allows the STM to bring up SMM in 32-bit mode */ start32_offset: .long smm_trampoline32 - _start -/* apic_to_cpu_num is a table mapping the default APIC id to CPU num. If the - * APIC id is found at the given index, the contiguous CPU number is index - * into the table. */ -apic_to_cpu_num: -.fill CONFIG_MAX_CPUS,1,0xff /* end struct smm_runtime */ .data -- cgit v1.2.3