Commit f72d3d6b authored by Bin Meng's avatar Bin Meng
Browse files

x86: Avoid using hardcoded number of variable range MTRRs in mtrr_commit()

Since commit 29d2d64e ("x86: Add support for more than 8 MTRRs"),
the maximum number of variable range MTRRs was increased from 8 to 10.
On the BayTrail platform there are only 8 variable range MTRRs. In
mtrr_commit() it still uses MTRR_MAX_COUNT which caused a #GP during
VESA video driver probe. It should have been updated to use dynamically
probed number.

This fixes the boot failure seen on Intel Minnow Max board.

Fixes: 29d2d64e

 ("x86: Add support for more than 8 MTRRs")
Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 1ae955e3
...@@ -158,7 +158,7 @@ int mtrr_commit(bool do_caches) ...@@ -158,7 +158,7 @@ int mtrr_commit(bool do_caches)
/* Clear the ones that are unused */ /* Clear the ones that are unused */
debug("clear\n"); debug("clear\n");
for (; i < MTRR_MAX_COUNT; i++) for (; i < mtrr_get_var_count(); i++)
wrmsrl(MTRR_PHYS_MASK_MSR(i), 0); wrmsrl(MTRR_PHYS_MASK_MSR(i), 0);
debug("close\n"); debug("close\n");
mtrr_close(&state, do_caches); mtrr_close(&state, do_caches);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment