From a9450081cf76bf0041b55f87b64824bdc5b26eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 18 Aug 2017 22:19:03 +0300 Subject: intel/smm/gen1: Backup default SMM area MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix low memory corruption on S3 resume path. Affected platforms were sandy/ivybridge. Change-Id: I7379e7396b61ee4dc2438276d530feffaa1bc8f2 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/21100 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph --- src/cpu/intel/smm/gen1/smmrelocate.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/cpu/intel/smm') diff --git a/src/cpu/intel/smm/gen1/smmrelocate.c b/src/cpu/intel/smm/gen1/smmrelocate.c index a349594fa6..da43de09fd 100644 --- a/src/cpu/intel/smm/gen1/smmrelocate.c +++ b/src/cpu/intel/smm/gen1/smmrelocate.c @@ -55,6 +55,7 @@ struct smm_relocation_params { /* This gets filled in and used during relocation. */ static struct smm_relocation_params smm_reloc_params; +static void *default_smm_area = NULL; static inline void write_smrr(struct smm_relocation_params *relo_params) { @@ -156,6 +157,8 @@ static int install_relocation_handler(int *apic_id_map, int num_cpus, .handler_arg = (void *)relo_params, }; + default_smm_area = backup_default_smm_area(); + if (smm_setup_relocation_handler(&smm_params)) return -1; int i; @@ -270,6 +273,11 @@ void smm_init(void) smm_lock(); } +void smm_init_completion(void) +{ + restore_default_smm_area(default_smm_area); +} + void smm_lock(void) { /* LOCK the SMM memory window and enable normal SMM. -- cgit v1.2.3