diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/mm/pat.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index b629f75f73de..a6cace0694a2 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -783,11 +783,29 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, | |||
783 | is_ram = pat_pagerange_is_ram(paddr, paddr + size); | 783 | is_ram = pat_pagerange_is_ram(paddr, paddr + size); |
784 | 784 | ||
785 | /* | 785 | /* |
786 | * reserve_pfn_range() doesn't support RAM pages. Maintain the current | 786 | * reserve_pfn_range() for RAM pages. We do not refcount to keep |
787 | * behavior with RAM pages by returning success. | 787 | * track of number of mappings of RAM pages. We can assert that |
788 | * the type requested matches the type of first page in the range. | ||
788 | */ | 789 | */ |
789 | if (is_ram != 0) | 790 | if (is_ram) { |
791 | if (!pat_enabled) | ||
792 | return 0; | ||
793 | |||
794 | flags = lookup_memtype(paddr); | ||
795 | if (want_flags != flags) { | ||
796 | printk(KERN_WARNING | ||
797 | "%s:%d map pfn RAM range req %s for %Lx-%Lx, got %s\n", | ||
798 | current->comm, current->pid, | ||
799 | cattr_name(want_flags), | ||
800 | (unsigned long long)paddr, | ||
801 | (unsigned long long)(paddr + size), | ||
802 | cattr_name(flags)); | ||
803 | *vma_prot = __pgprot((pgprot_val(*vma_prot) & | ||
804 | (~_PAGE_CACHE_MASK)) | | ||
805 | flags); | ||
806 | } | ||
790 | return 0; | 807 | return 0; |
808 | } | ||
791 | 809 | ||
792 | ret = reserve_memtype(paddr, paddr + size, want_flags, &flags); | 810 | ret = reserve_memtype(paddr, paddr + size, want_flags, &flags); |
793 | if (ret) | 811 | if (ret) |