summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2021-07-31 11:45:25 +0300
committerBin Meng <bmeng.cn@gmail.com>2021-08-02 10:11:40 +0300
commit3bcd6cf89efee5c8088dce2f770bdd5592186efb (patch)
tree39745f1012ba41a5a594d2995a6f826d77803882
parent596bd0589ad8ee1df78133af740f1d29b235fb66 (diff)
downloadu-boot-3bcd6cf89efee5c8088dce2f770bdd5592186efb.tar.xz
x86: mtrr: Skip MSRs that were already programmed in mtrr_commit()
At present mtrr_commit() programs the MTRR MSRs starting from index 0, which may overwrite MSRs that were already programmed by previous boot stage or FSP. Switch to call mtrr_set_next_var() instead. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax Tested-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/x86/cpu/mtrr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/cpu/mtrr.c b/arch/x86/cpu/mtrr.c
index 73cf7bb2be..14c644eb56 100644
--- a/arch/x86/cpu/mtrr.c
+++ b/arch/x86/cpu/mtrr.c
@@ -155,7 +155,7 @@ int mtrr_commit(bool do_caches)
debug("open done\n");
qsort(req, gd->arch.mtrr_req_count, sizeof(*req), h_comp_mtrr);
for (i = 0; i < gd->arch.mtrr_req_count; i++, req++)
- set_var_mtrr(i, req->type, req->start, req->size);
+ mtrr_set_next_var(req->type, req->start, req->size);
debug("close\n");
mtrr_close(&state, do_caches);