Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63498 )
Change subject: cpu/x86/mtrr: Running `remove_temp_solution` for all logical processors ......................................................................
cpu/x86/mtrr: Running `remove_temp_solution` for all logical processors
Signed-off-by: Subrata Banik subratabanik@google.com Change-Id: I4dc9183a06ef60b60907d26ea3e6e382f0c29d8c --- M src/cpu/x86/mtrr/mtrr.c 1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/98/63498/1
diff --git a/src/cpu/x86/mtrr/mtrr.c b/src/cpu/x86/mtrr/mtrr.c index 288f06d..a437fb9 100644 --- a/src/cpu/x86/mtrr/mtrr.c +++ b/src/cpu/x86/mtrr/mtrr.c @@ -16,6 +16,7 @@ #include <device/device.h> #include <device/pci_ids.h> #include <cpu/cpu.h> +#include <cpu/x86/mp.h> #include <cpu/x86/msr.h> #include <cpu/x86/mtrr.h> #include <cpu/x86/cache.h> @@ -913,11 +914,17 @@ memranges_teardown(&addr_space); }
-static void remove_temp_solution(void *unused) +static void restore_original_mtrr_solution(void *unused) { if (put_back_original_solution) commit_var_mtrrs(&mtrr_global_solution); }
+static void remove_temp_solution(void *unused) +{ + if (mp_run_on_all_cpus(&restore_original_mtrr_solution, NULL) != CB_SUCCESS) + printk(BIOS_ERR, "MTRR restoring to original solution failure\n"); +} + BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, remove_temp_solution, NULL); BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, remove_temp_solution, NULL);