]> Git Repo - J-u-boot.git/commitdiff
x86: mtrr: Do not clear the unused ones in mtrr_commit()
authorBin Meng <[email protected]>
Sat, 31 Jul 2021 08:45:24 +0000 (16:45 +0800)
committerBin Meng <[email protected]>
Mon, 2 Aug 2021 07:11:40 +0000 (15:11 +0800)
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax
Tested-by: Simon Glass <[email protected]>
arch/x86/cpu/mtrr.c

index 166aff380c64c8c247d36a938508f284c98cfaa0..73cf7bb2bea9b256cd69e7400ae431ddf8c6df67 100644 (file)
@@ -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");
This page took 0.045652 seconds and 4 git commands to generate.