These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / arch / x86 / mm / iomap_32.c
index b2ffa5c..dd25dd1 100644 (file)
@@ -84,13 +84,13 @@ void __iomem *
 iomap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot)
 {
        /*
-        * For non-PAT systems, promote PAGE_KERNEL_WC to PAGE_KERNEL_UC_MINUS.
-        * PAGE_KERNEL_WC maps to PWT, which translates to uncached if the
-        * MTRR is UC or WC.  UC_MINUS gets the real intention, of the
-        * user, which is "WC if the MTRR is WC, UC if you can't do that."
+        * For non-PAT systems, translate non-WB request to UC- just in
+        * case the caller set the PWT bit to prot directly without using
+        * pgprot_writecombine(). UC- translates to uncached if the MTRR
+        * is UC or WC. UC- gets the real intention, of the user, which is
+        * "WC if the MTRR is WC, UC if you can't do that."
         */
-       if (!pat_enabled && pgprot_val(prot) ==
-           (__PAGE_KERNEL | cachemode2protval(_PAGE_CACHE_MODE_WC)))
+       if (!pat_enabled() && pgprot2cachemode(prot) != _PAGE_CACHE_MODE_WB)
                prot = __pgprot(__PAGE_KERNEL |
                                cachemode2protval(_PAGE_CACHE_MODE_UC_MINUS));