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>
This commit is contained in:
Kyösti Mälkki 2017-08-18 22:19:03 +03:00
parent 2e50142f62
commit a9450081cf
1 changed files with 8 additions and 0 deletions

View File

@ -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.