aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pat.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/pat.c')
-rw-r--r--arch/x86/mm/pat.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index e78cd0ec2bcf..a81b7e73275d 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -20,6 +20,7 @@
20#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
21#include <asm/processor.h> 21#include <asm/processor.h>
22#include <asm/tlbflush.h> 22#include <asm/tlbflush.h>
23#include <asm/x86_init.h>
23#include <asm/pgtable.h> 24#include <asm/pgtable.h>
24#include <asm/fcntl.h> 25#include <asm/fcntl.h>
25#include <asm/e820.h> 26#include <asm/e820.h>
@@ -388,7 +389,7 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
388 } 389 }
389 390
390 /* Low ISA region is always mapped WB in page table. No need to track */ 391 /* Low ISA region is always mapped WB in page table. No need to track */
391 if (is_ISA_range(start, end - 1)) { 392 if (x86_platform.is_untracked_pat_range(start, end)) {
392 if (new_type) 393 if (new_type)
393 *new_type = _PAGE_CACHE_WB; 394 *new_type = _PAGE_CACHE_WB;
394 return 0; 395 return 0;
@@ -499,7 +500,7 @@ int free_memtype(u64 start, u64 end)
499 return 0; 500 return 0;
500 501
501 /* Low ISA region is always mapped WB. No need to track */ 502 /* Low ISA region is always mapped WB. No need to track */
502 if (is_ISA_range(start, end - 1)) 503 if (x86_platform.is_untracked_pat_range(start, end))
503 return 0; 504 return 0;
504 505
505 is_range_ram = pat_pagerange_is_ram(start, end); 506 is_range_ram = pat_pagerange_is_ram(start, end);
@@ -582,7 +583,7 @@ static unsigned long lookup_memtype(u64 paddr)
582 int rettype = _PAGE_CACHE_WB; 583 int rettype = _PAGE_CACHE_WB;
583 struct memtype *entry; 584 struct memtype *entry;
584 585
585 if (is_ISA_range(paddr, paddr + PAGE_SIZE - 1)) 586 if (x86_platform.is_untracked_pat_range(paddr, paddr + PAGE_SIZE))
586 return rettype; 587 return rettype;
587 588
588 if (pat_pagerange_is_ram(paddr, paddr + PAGE_SIZE)) { 589 if (pat_pagerange_is_ram(paddr, paddr + PAGE_SIZE)) {
@@ -1018,8 +1019,10 @@ static const struct file_operations memtype_fops = {
1018 1019
1019static int __init pat_memtype_list_init(void) 1020static int __init pat_memtype_list_init(void)
1020{ 1021{
1021 debugfs_create_file("pat_memtype_list", S_IRUSR, arch_debugfs_dir, 1022 if (pat_enabled) {
1022 NULL, &memtype_fops); 1023 debugfs_create_file("pat_memtype_list", S_IRUSR,
1024 arch_debugfs_dir, NULL, &memtype_fops);
1025 }
1023 return 0; 1026 return 0;
1024} 1027}
1025 1028