xtensa: fix pgprot_noncached assumptions
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 17 Feb 2021 09:36:57 +0000 (01:36 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Sun, 4 Apr 2021 22:39:03 +0000 (15:39 -0700)
pgprot_noncached assumes that cache bypass attribute is represented as
zero. This may not always be true. Fix pgprot_noncached definition by
adding _PAGE_CA_BYPASS to the result.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/pgtable.h

index 4dc04e6..d7fc45c 100644 (file)
@@ -280,7 +280,9 @@ static inline pte_t pte_mkyoung(pte_t pte)
 static inline pte_t pte_mkwrite(pte_t pte)
        { pte_val(pte) |= _PAGE_WRITABLE; return pte; }
 
-#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) & ~_PAGE_CA_MASK))
+#define pgprot_noncached(prot) \
+               ((__pgprot((pgprot_val(prot) & ~_PAGE_CA_MASK) | \
+                          _PAGE_CA_BYPASS)))
 
 /*
  * Conversion functions: convert a page and protection to a page entry,