From: Toshi Kani --- arch/x86/include/asm/pgtable_types.h | 1 + arch/x86/mm/pageattr.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 81a3859..a392b09 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -130,6 +130,7 @@ #define _HPAGE_CHG_MASK (_PAGE_CHG_MASK | _PAGE_PSE | _PAGE_NUMA) #define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) +#define _PAGE_CACHE_EXT_MASK (_PAGE_CACHE_MASK | _PAGE_PAT) #define _PAGE_CACHE_WB (0) #define _PAGE_CACHE_WC (_PAGE_PWT) #define _PAGE_CACHE_WT (_PAGE_PCD | _PAGE_PWT) diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index da597d0..348f206 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -1446,7 +1446,7 @@ int _set_memory_uc(unsigned long addr, int numpages) */ return change_page_attr_set_clr(&addr, numpages, __pgprot(_PAGE_CACHE_UC_MINUS), - __pgprot(_PAGE_CACHE_MASK), + __pgprot(_PAGE_CACHE_EXT_MASK), 0, 0, NULL); } @@ -1493,13 +1493,13 @@ static int _set_memory_array(unsigned long *addr, int addrinarray, ret = change_page_attr_set_clr(addr, addrinarray, __pgprot(_PAGE_CACHE_UC_MINUS), - __pgprot(_PAGE_CACHE_MASK), + __pgprot(_PAGE_CACHE_EXT_MASK), 0, CPA_ARRAY, NULL); if (!ret && new_type == _PAGE_CACHE_WC) ret = change_page_attr_set_clr(addr, addrinarray, __pgprot(_PAGE_CACHE_WC), - __pgprot(_PAGE_CACHE_MASK), + __pgprot(_PAGE_CACHE_EXT_MASK), 0, CPA_ARRAY, NULL); if (ret) goto out_free; @@ -1532,12 +1532,12 @@ int _set_memory_wc(unsigned long addr, int numpages) ret = change_page_attr_set_clr(&addr, numpages, __pgprot(_PAGE_CACHE_UC_MINUS), - __pgprot(_PAGE_CACHE_MASK), + __pgprot(_PAGE_CACHE_EXT_MASK), 0, 0, NULL); if (!ret) { ret = change_page_attr_set_clr(&addr_copy, numpages, __pgprot(_PAGE_CACHE_WC), - __pgprot(_PAGE_CACHE_MASK), + __pgprot(_PAGE_CACHE_EXT_MASK), 0, 0, NULL); } return ret; @@ -1578,7 +1578,7 @@ int _set_memory_wt(unsigned long addr, int numpages) { return change_page_attr_set_clr(&addr, numpages, __pgprot(_PAGE_CACHE_WT), - __pgprot(_PAGE_CACHE_MASK), + __pgprot(_PAGE_CACHE_EXT_MASK), 0, 0, NULL); } @@ -1611,7 +1611,7 @@ int _set_memory_wb(unsigned long addr, int numpages) { return change_page_attr_set_clr(&addr, numpages, __pgprot(_PAGE_CACHE_WB), - __pgprot(_PAGE_CACHE_MASK), + __pgprot(_PAGE_CACHE_EXT_MASK), 0, 0, NULL); } @@ -1635,7 +1635,7 @@ int set_memory_array_wb(unsigned long *addr, int addrinarray) ret = change_page_attr_set_clr(addr, addrinarray, __pgprot(_PAGE_CACHE_WB), - __pgprot(_PAGE_CACHE_MASK), + __pgprot(_PAGE_CACHE_EXT_MASK), 0, CPA_ARRAY, NULL); if (ret) return ret; @@ -1719,7 +1719,7 @@ static int _set_pages_array(struct page **pages, int addrinarray, if (!ret && new_type == _PAGE_CACHE_WC) ret = change_page_attr_set_clr(NULL, addrinarray, __pgprot(_PAGE_CACHE_WC), - __pgprot(_PAGE_CACHE_MASK), + __pgprot(_PAGE_CACHE_EXT_MASK), 0, CPA_PAGES_ARRAY, pages); if (ret) goto err_out; @@ -1770,7 +1770,7 @@ int set_pages_array_wb(struct page **pages, int addrinarray) int i; retval = cpa_clear_pages_array(pages, addrinarray, - __pgprot(_PAGE_CACHE_MASK)); + __pgprot(_PAGE_CACHE_EXT_MASK)); if (retval) return retval;