aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/pgtable.h10
-rw-r--r--arch/x86/include/asm/pgtable_types.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 001a3831567a..c48ba055f693 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -325,6 +325,16 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
325 return __pte(val); 325 return __pte(val);
326} 326}
327 327
328static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
329{
330 pmdval_t val = pmd_val(pmd);
331
332 val &= _HPAGE_CHG_MASK;
333 val |= massage_pgprot(newprot) & ~_HPAGE_CHG_MASK;
334
335 return __pmd(val);
336}
337
328/* mprotect needs to preserve PAT bits when updating vm_page_prot */ 338/* mprotect needs to preserve PAT bits when updating vm_page_prot */
329#define pgprot_modify pgprot_modify 339#define pgprot_modify pgprot_modify
330static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) 340static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index a81a6bfc1437..7db7723d1f32 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -72,6 +72,7 @@
72/* Set of bits not changed in pte_modify */ 72/* Set of bits not changed in pte_modify */
73#define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \ 73#define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \
74 _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY) 74 _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY)
75#define _HPAGE_CHG_MASK (_PAGE_CHG_MASK | _PAGE_PSE)
75 76
76#define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) 77#define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT)
77#define _PAGE_CACHE_WB (0) 78#define _PAGE_CACHE_WB (0)