diff options
Diffstat (limited to 'arch/x86/mm/pat.c')
-rw-r--r-- | arch/x86/mm/pat.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 2f3744fdc741..8f68a83491ba 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -462,7 +462,7 @@ int io_reserve_memtype(resource_size_t start, resource_size_t end, | |||
462 | if (!is_new_memtype_allowed(start, size, req_type, new_type)) | 462 | if (!is_new_memtype_allowed(start, size, req_type, new_type)) |
463 | goto out_free; | 463 | goto out_free; |
464 | 464 | ||
465 | if (kernel_map_sync_memtype(start, size, new_prot) < 0) | 465 | if (kernel_map_sync_memtype(start, size, new_type) < 0) |
466 | goto out_free; | 466 | goto out_free; |
467 | 467 | ||
468 | *type = new_type; | 468 | *type = new_type; |
@@ -560,7 +560,8 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | |||
560 | * Change the memory type for the physial address range in kernel identity | 560 | * Change the memory type for the physial address range in kernel identity |
561 | * mapping space if that range is a part of identity map. | 561 | * mapping space if that range is a part of identity map. |
562 | */ | 562 | */ |
563 | int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags) | 563 | int kernel_map_sync_memtype(u64 base, unsigned long size, |
564 | enum page_cache_mode pcm) | ||
564 | { | 565 | { |
565 | unsigned long id_sz; | 566 | unsigned long id_sz; |
566 | 567 | ||
@@ -578,11 +579,11 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags) | |||
578 | __pa(high_memory) - base : | 579 | __pa(high_memory) - base : |
579 | size; | 580 | size; |
580 | 581 | ||
581 | if (ioremap_change_attr((unsigned long)__va(base), id_sz, flags) < 0) { | 582 | if (ioremap_change_attr((unsigned long)__va(base), id_sz, pcm) < 0) { |
582 | printk(KERN_INFO "%s:%d ioremap_change_attr failed %s " | 583 | printk(KERN_INFO "%s:%d ioremap_change_attr failed %s " |
583 | "for [mem %#010Lx-%#010Lx]\n", | 584 | "for [mem %#010Lx-%#010Lx]\n", |
584 | current->comm, current->pid, | 585 | current->comm, current->pid, |
585 | cattr_name(flags), | 586 | cattr_name(cachemode2protval(pcm)), |
586 | base, (unsigned long long)(base + size-1)); | 587 | base, (unsigned long long)(base + size-1)); |
587 | return -EINVAL; | 588 | return -EINVAL; |
588 | } | 589 | } |
@@ -656,7 +657,8 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot, | |||
656 | flags); | 657 | flags); |
657 | } | 658 | } |
658 | 659 | ||
659 | if (kernel_map_sync_memtype(paddr, size, flags) < 0) { | 660 | if (kernel_map_sync_memtype(paddr, size, |
661 | pgprot2cachemode(__pgprot(flags))) < 0) { | ||
660 | free_memtype(paddr, paddr + size); | 662 | free_memtype(paddr, paddr + size); |
661 | return -EINVAL; | 663 | return -EINVAL; |
662 | } | 664 | } |