Skip to content

Commit dd55235

Browse files
yhluH. Peter Anvin
authored andcommitted
x86: mtrr_cleanup: treat WRPROT as UNCACHEABLE
For the purpose of MTRR canonicalization, treat WRPROT as UNCACHEABLE. Signed-off-by: Yinghai Lu <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]>
1 parent 99e1aa1 commit dd55235

File tree

1 file changed

+4
-1
lines changed
  • arch/x86/kernel/cpu/mtrr

1 file changed

+4
-1
lines changed

arch/x86/kernel/cpu/mtrr/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,8 @@ x86_get_mtrr_mem_range(struct res_range *range, int nr_range,
759759
/* take out UC ranges */
760760
for (i = 0; i < num_var_ranges; i++) {
761761
type = range_state[i].type;
762-
if (type != MTRR_TYPE_UNCACHABLE)
762+
if (type != MTRR_TYPE_UNCACHABLE &&
763+
type != MTRR_TYPE_WRPROT)
763764
continue;
764765
size = range_state[i].size_pfn;
765766
if (!size)
@@ -1248,6 +1249,8 @@ static int __init mtrr_cleanup(unsigned address_bits)
12481249
continue;
12491250
if (!size)
12501251
type = MTRR_NUM_TYPES;
1252+
if (type == MTRR_TYPE_WRPROT)
1253+
type = MTRR_TYPE_UNCACHABLE;
12511254
num[type]++;
12521255
}
12531256

0 commit comments

Comments
 (0)