diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2017-08-18 22:19:03 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2017-08-19 15:32:18 +0000 |
commit | a9450081cf76bf0041b55f87b64824bdc5b26eda (patch) | |
tree | 9d769de60dd849a4fa89fe85a0929f16b9ebdd4e /src/cpu | |
parent | 2e50142f62c20c437100ac3a1a1a50720a31a9d6 (diff) | |
download | coreboot-a9450081cf76bf0041b55f87b64824bdc5b26eda.tar.xz |
intel/smm/gen1: Backup default SMM area
Fix low memory corruption on S3 resume path.
Affected platforms were sandy/ivybridge.
Change-Id: I7379e7396b61ee4dc2438276d530feffaa1bc8f2
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/21100
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/intel/smm/gen1/smmrelocate.c | 8 |
1 files changed, 8 insertions, 0 deletions
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. |