diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-08-08 11:16:06 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-08-15 05:46:59 +0000 |
commit | 7cdb047ce714378a644b7aa2c1f40a2e1a8d5750 (patch) | |
tree | ed3f8a336d9d8ac6caa48d3713dc4fa7d0d898c9 /src/cpu | |
parent | 544878b56349a74e8cb7a0e9af899b5f7fc246fc (diff) | |
download | coreboot-7cdb047ce714378a644b7aa2c1f40a2e1a8d5750.tar.xz |
cpu/x86/smm: Promote smm_memory_map()
Change-Id: I909e9b5fead317928d3513a677cfab25e3c42f64
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34792
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/intel/car/romstage.c | 4 | ||||
-rw-r--r-- | src/cpu/x86/smm/tseg_region.c | 20 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/cpu/intel/car/romstage.c b/src/cpu/intel/car/romstage.c index 624f3ff9b7..43fbe8af38 100644 --- a/src/cpu/intel/car/romstage.c +++ b/src/cpu/intel/car/romstage.c @@ -15,6 +15,7 @@ #include <console/console.h> #include <cpu/intel/romstage.h> #include <cpu/x86/mtrr.h> +#include <cpu/x86/smm.h> #include <arch/symbols.h> #include <commonlib/helpers.h> #include <program_loading.h> @@ -69,6 +70,9 @@ static void romstage_main(unsigned long bist) printk(BIOS_DEBUG, "Smashed stack detected in romstage!\n"); } + if (CONFIG(SMM_TSEG)) + smm_list_regions(); + prepare_and_run_postcar(&early_mtrrs); /* We do not return here. */ } diff --git a/src/cpu/x86/smm/tseg_region.c b/src/cpu/x86/smm/tseg_region.c index df9dea5c0f..07789f4ac1 100644 --- a/src/cpu/x86/smm/tseg_region.c +++ b/src/cpu/x86/smm/tseg_region.c @@ -84,3 +84,23 @@ void __weak stage_cache_external_region(void **base, size_t *size) *size = 0; } } + +void smm_list_regions(void) +{ + uintptr_t base; + size_t size; + int i; + + smm_region(&base, &size); + if (!size) + return; + + printk(BIOS_DEBUG, "SMM Memory Map\n"); + printk(BIOS_DEBUG, "SMRAM : 0x%zx 0x%zx\n", base, size); + + for (i = 0; i < SMM_SUBREGION_NUM; i++) { + if (smm_subregion(i, &base, &size)) + continue; + printk(BIOS_DEBUG, " Subregion %d: 0x%zx 0x%zx\n", i, base, size); + } +} |