From 3e4e4abb61cab420eaad1f59b1e24d2b30b77125 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Fri, 8 Apr 2022 13:25:49 +0530 Subject: [PATCH] cpu/x86/mtrr: Use `need_restore_mtrr` to set put_back_original_solution This patch calls into need_restore_mtrr() from the mtrr_use_temp_range function to set `put_back_original_solution` to discard any temporary MTRR range prior to boot to payload. BUG=b:225766934 TEST=Able to build and boot google/brya to verify that `remove_temp_solution()` is able to discard any temporary MTRR range before booting to payload. Signed-off-by: Subrata Banik Change-Id: I2e00ec593847e1eb173d5ac77b15b50342860f89 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63491 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh --- src/cpu/x86/mtrr/mtrr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/x86/mtrr/mtrr.c b/src/cpu/x86/mtrr/mtrr.c index e1bdf4546a..288f06dd0e 100644 --- a/src/cpu/x86/mtrr/mtrr.c +++ b/src/cpu/x86/mtrr/mtrr.c @@ -908,7 +908,7 @@ void mtrr_use_temp_range(uintptr_t begin, size_t size, int type) (long long)begin, (long long)begin + size, (long long)size, type); else - put_back_original_solution = true; + need_restore_mtrr(); memranges_teardown(&addr_space); }