summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2021-07-31 11:45:24 +0300
committerBin Meng <bmeng.cn@gmail.com>2021-08-02 10:11:40 +0300
commit596bd0589ad8ee1df78133af740f1d29b235fb66 (patch)
tree40d2941f1b7e1d4a3aa3eaecae547b9156f937e8 /arch/x86
parentc79cbb5952068d9f05e4bcc7bdbbc8957fe35c68 (diff)
downloadu-boot-596bd0589ad8ee1df78133af740f1d29b235fb66.tar.xz
x86: mtrr: Do not clear the unused ones in mtrr_commit()
Current mtrr_commit() logic assumes that MTRR MSRs are programmed consecutively from index 0 to its maximum number, and whenever it detects an unused one, it clears all other MTRRs starting from that one. However this may not always be the case. In fact, the clear is not much helpful because these MTRRs come out of reset as disabled already. Drop the clear codes. 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>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/cpu/mtrr.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/x86/cpu/mtrr.c b/arch/x86/cpu/mtrr.c
index 166aff380c..73cf7bb2be 100644
--- a/arch/x86/cpu/mtrr.c
+++ b/arch/x86/cpu/mtrr.c
@@ -157,10 +157,6 @@ int mtrr_commit(bool do_caches)
for (i = 0; i < gd->arch.mtrr_req_count; i++, req++)
set_var_mtrr(i, req->type, req->start, req->size);
- /* Clear the ones that are unused */
- debug("clear\n");
- for (; i < mtrr_get_var_count(); i++)
- wrmsrl(MTRR_PHYS_MASK_MSR(i), 0);
debug("close\n");
mtrr_close(&state, do_caches);
debug("mtrr done\n");