summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2018-06-25 14:22:27 -0600
committerMartin Roth <martinroth@google.com>2018-06-27 22:11:11 +0000
commitdd549e117588472d11b10e0b1287a0e19377b844 (patch)
tree9eba7c4af647c19091eeb80a0a53773e0d7dbe07
parentc57a273d4ccc409e0ae52d8bd09e42d7c87e0aff (diff)
smm: Clear SMRAM when debugging
This makes it easier to spot unused RAM. BUG=b:80539294 TEST=built and tested on grunt. Verified unused memory was set to 0xcdcdcdcd Change-Id: I335eaf642bd8526f31819eaac95ce80c2df3c300 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://review.coreboot.org/27227 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
-rw-r--r--src/cpu/x86/smm/smm_module_loader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c
index 3d7952ff42..e92fa05e13 100644
--- a/src/cpu/x86/smm/smm_module_loader.c
+++ b/src/cpu/x86/smm/smm_module_loader.c
@@ -346,6 +346,10 @@ int smm_load_module(void *smram, size_t size, struct smm_loader_params *params)
if (rmodule_parse(&_binary_smm_start, &smm_mod))
return -1;
+ /* Clear SMM region */
+ if (IS_ENABLED(CONFIG_DEBUG_SMI))
+ memset(smram, 0xcd, size);
+
total_stack_size = params->per_cpu_stack_size *
params->num_concurrent_stacks;