From e769bcee9a73ac712748fb55c38d072b39bbcd88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 16 Jun 2020 21:37:05 +0300 Subject: ACPI: Add and fill gnvs_ptr for smm_runtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I823d04a4851437b4267a60886e5ab205bb2e1b10 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/42464 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Aaron Durbin Reviewed-by: Furquan Shaikh --- src/cpu/x86/smm/smm_module_loader.c | 2 ++ src/cpu/x86/smm/smm_stub.S | 2 ++ src/include/cpu/x86/smm.h | 1 + 3 files changed, 5 insertions(+) diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c index 6e9781a2f303..fc1e1b306229 100644 --- a/src/cpu/x86/smm/smm_module_loader.c +++ b/src/cpu/x86/smm/smm_module_loader.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -261,6 +262,7 @@ static int smm_module_setup_stub(void *smbase, size_t smm_size, stub_params->runtime.smm_size = smm_size; stub_params->runtime.save_state_size = params->per_cpu_save_state_size; stub_params->runtime.num_cpus = params->num_concurrent_stacks; + stub_params->runtime.gnvs_ptr = (uintptr_t)acpi_get_gnvs(); /* Initialize the APIC id to CPU number table to be 1:1 */ for (i = 0; i < params->num_concurrent_stacks; i++) diff --git a/src/cpu/x86/smm/smm_stub.S b/src/cpu/x86/smm/smm_stub.S index 8086b756d465..425724d559a9 100644 --- a/src/cpu/x86/smm/smm_stub.S +++ b/src/cpu/x86/smm/smm_stub.S @@ -36,6 +36,8 @@ save_state_size: .long 0 num_cpus: .long 0 +gnvs_ptr: +.long 0 /* allows the STM to bring up SMM in 32-bit mode */ start32_offset: .long smm_trampoline32 - _start diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index 6671a513fc3e..a3101e515572 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -61,6 +61,7 @@ struct smm_runtime { u32 smm_size; u32 save_state_size; u32 num_cpus; + u32 gnvs_ptr; /* STM's 32bit entry into SMI handler */ u32 start32_offset; /* The apic_id_to_cpu provides a mapping from APIC id to CPU number. -- cgit v1.2.3