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:
parent
2e50142f62
commit
a9450081cf
|
@ -55,6 +55,7 @@ struct smm_relocation_params {
|
||||||
|
|
||||||
/* This gets filled in and used during relocation. */
|
/* This gets filled in and used during relocation. */
|
||||||
static struct smm_relocation_params smm_reloc_params;
|
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)
|
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,
|
.handler_arg = (void *)relo_params,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
default_smm_area = backup_default_smm_area();
|
||||||
|
|
||||||
if (smm_setup_relocation_handler(&smm_params))
|
if (smm_setup_relocation_handler(&smm_params))
|
||||||
return -1;
|
return -1;
|
||||||
int i;
|
int i;
|
||||||
|
@ -270,6 +273,11 @@ void smm_init(void)
|
||||||
smm_lock();
|
smm_lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void smm_init_completion(void)
|
||||||
|
{
|
||||||
|
restore_default_smm_area(default_smm_area);
|
||||||
|
}
|
||||||
|
|
||||||
void smm_lock(void)
|
void smm_lock(void)
|
||||||
{
|
{
|
||||||
/* LOCK the SMM memory window and enable normal SMM.
|
/* LOCK the SMM memory window and enable normal SMM.
|
||||||
|
|
Loading…
Reference in New Issue