From 21ecd75362aadc5a86bae11bd4e370854bef0f04 Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Thu, 13 Jan 2011 15:47:02 -0800 Subject: [PATCH] --- yaml --- r: 230787 b: refs/heads/master c: c489f1257b8cacd4881a18da1e93659f934a8e98 h: refs/heads/master i: 230785: cb30b9dc597e350540dd7ce9e984540850b0ac69 230783: 0bb77c67a20369c0d109e35622430e93746bc565 v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/pgtable.h | 10 ++++++++++ trunk/arch/x86/include/asm/pgtable_types.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 67834ce97c9d..f0dd8bfedd2d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0ca1634d4143c3579273ca53b993df19f5c98e92 +refs/heads/master: c489f1257b8cacd4881a18da1e93659f934a8e98 diff --git a/trunk/arch/x86/include/asm/pgtable.h b/trunk/arch/x86/include/asm/pgtable.h index 001a3831567a..c48ba055f693 100644 --- a/trunk/arch/x86/include/asm/pgtable.h +++ b/trunk/arch/x86/include/asm/pgtable.h @@ -325,6 +325,16 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) return __pte(val); } +static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) +{ + pmdval_t val = pmd_val(pmd); + + val &= _HPAGE_CHG_MASK; + val |= massage_pgprot(newprot) & ~_HPAGE_CHG_MASK; + + return __pmd(val); +} + /* mprotect needs to preserve PAT bits when updating vm_page_prot */ #define pgprot_modify pgprot_modify static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) diff --git a/trunk/arch/x86/include/asm/pgtable_types.h b/trunk/arch/x86/include/asm/pgtable_types.h index a81a6bfc1437..7db7723d1f32 100644 --- a/trunk/arch/x86/include/asm/pgtable_types.h +++ b/trunk/arch/x86/include/asm/pgtable_types.h @@ -72,6 +72,7 @@ /* Set of bits not changed in pte_modify */ #define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \ _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY) +#define _HPAGE_CHG_MASK (_PAGE_CHG_MASK | _PAGE_PSE) #define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) #define _PAGE_CACHE_WB (0)