summaryrefslogtreecommitdiff
path: root/arch/x86/mm/pat.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2014-11-03 14:01:54 +0100
committerThomas Gleixner <tglx@linutronix.de>2014-11-16 11:04:25 +0100
commit49a3b3cbdf1621678a39bd95a3e67c0f858539c7 (patch)
treefb59b9624d615faf4a3e32dec9bde28d53863a4c /arch/x86/mm/pat.c
parentd85f33342a0f57acfbe078cdd0c4f590d5608bb7 (diff)
x86: Use new cache mode type in mm/iomap_32.c
Instead of directly using the cache mode bits in the pte switch to using the cache mode type. This requires to change io_reserve_memtype() as well. Based-on-patch-by: Stefan Bader <stefan.bader@canonical.com> Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Cc: stefan.bader@canonical.com Cc: xen-devel@lists.xensource.com Cc: konrad.wilk@oracle.com Cc: ville.syrjala@linux.intel.com Cc: david.vrabel@citrix.com Cc: jbeulich@suse.com Cc: toshi.kani@hp.com Cc: plagnioj@jcrosoft.com Cc: tomi.valkeinen@ti.com Cc: bhelgaas@google.com Link: http://lkml.kernel.org/r/1415019724-4317-9-git-send-email-jgross@suse.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/pat.c')
-rw-r--r--arch/x86/mm/pat.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index 47282c273647..6d5a8e3ef63d 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -442,25 +442,27 @@ static unsigned long lookup_memtype(u64 paddr)
* On failure, returns non-zero
*/
int io_reserve_memtype(resource_size_t start, resource_size_t end,
- unsigned long *type)
+ enum page_cache_mode *type)
{
resource_size_t size = end - start;
- unsigned long req_type = *type;
- unsigned long new_type;
+ enum page_cache_mode req_type = *type;
+ enum page_cache_mode new_type;
+ unsigned long new_prot;
int ret;
WARN_ON_ONCE(iomem_map_sanity_check(start, size));
- ret = reserve_memtype(start, end, req_type, &new_type);
+ ret = reserve_memtype(start, end, cachemode2protval(req_type),
+ &new_prot);
if (ret)
goto out_err;
- if (!is_new_memtype_allowed(start, size,
- pgprot2cachemode(__pgprot(req_type)),
- pgprot2cachemode(__pgprot(new_type))))
+ new_type = pgprot2cachemode(__pgprot(new_prot));
+
+ if (!is_new_memtype_allowed(start, size, req_type, new_type))
goto out_free;
- if (kernel_map_sync_memtype(start, size, new_type) < 0)
+ if (kernel_map_sync_memtype(start, size, new_prot) < 0)
goto out_free;
*type = new_type;