powerpc: Fix _PAGE_CHG_MASK
PATCH 1/1 powerpc: Fix _PAGE_CHG_MASK
Fix _PAGE_CHG_MASK so that pte_modify() does not affect the _PAGE_SPECIAL bit.
Signed-off-by Philippe Gerum <[email protected]>
--
arch/powerpc/include/asm/pgtable-4k.h | 2 +- arch/powerpc/include/asm/pgtable-64k.h | 2 +- arch/powerpc/include/asm/pgtable-ppc32.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/pgtable-4k.h +1 -1
@@ -60,7 +60,7 @@/* It should be preserving the high 48 bits and then specifically */ /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */ #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ - _PAGE_HPTEFLAGS) + _PAGE_HPTEFLAGS | _PAGE_SPECIAL)/* Bits to mask out from a PMD to get to the PTE page */ #define PMD_MASKED_BITS 0
arch/powerpc/include/asm/pgtable-64k.h +1 -1
@@ -114,7 +114,7 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd)* pgprot changes */ #define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \ - _PAGE_ACCESSED) + _PAGE_ACCESSED | _PAGE_SPECIAL)/* Bits to mask out from a PMD to get to the PTE page */ #define PMD_MASKED_BITS 0x1ff
arch/powerpc/include/asm/pgtable-ppc32.h +2 -2
@@ -428,8 +428,8 @@ extern int icache_44x_need_flush;#define PMD_PAGE_SIZE (pmd) bad_call_to_PMD_PAGE_SIZE()#endif -#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_SPECIAL) - +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ + _PAGE_SPECIAL)#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ _PAGE_WRITETHRU | _PAGE_ENDIAN | \
Signature · 1 line
Philippe.
Quoted 3 lines · Philippe Gerum
Fix
_PAGE_CHG_MASKso thatpte_modify()does not affect the_PAGE_SPECIALbit.Signed-off-by Philippe Gerum <[email protected]>
Good catch ! Thanks !
Ben.
Quoted 49 lines
--
arch/powerpc/include/asm/pgtable-4k.h | 2 +- arch/powerpc/include/asm/pgtable-64k.h | 2 +- arch/powerpc/include/asm/pgtable-ppc32.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)arch/powerpc/include/asm/pgtable-4k.h +1
-1@@ -60,7 +60,7 @@/* It should be preserving the high 48 bits and then specifically */ /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */ #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ - _PAGE_HPTEFLAGS) + _PAGE_HPTEFLAGS | _PAGE_SPECIAL)/* Bits to mask out from a PMD to get to the PTE page */ #define PMD_MASKED_BITS 0arch/powerpc/include/asm/pgtable-64k.h +1
-1@@ -114,7 +114,7 @@ static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd)* pgprot changes */ #define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \ - _PAGE_ACCESSED) + _PAGE_ACCESSED | _PAGE_SPECIAL)/* Bits to mask out from a PMD to get to the PTE page */ #define PMD_MASKED_BITS 0x1ffarch/powerpc/include/asm/pgtable-ppc32.h +2
-2@@ -428,8 +428,8 @@ extern int icache_44x_need_flush;#define PMD_PAGE_SIZE (pmd) bad_call_to_PMD_PAGE_SIZE()#endif -#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_SPECIAL) - +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ + _PAGE_SPECIAL)#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ _PAGE_WRITETHRU | _PAGE_ENDIAN | \
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 8 lines
arch/powerpc/include/asm/pgtable-ppc32.h +0
-0@@ -428,8 +428,8 @@ extern int icache_44x_need_flush;#define PMD_PAGE_SIZE (pmd) bad_call_to_PMD_PAGE_SIZE()#endif
Quoted 8 lines
arch/powerpc/include/asm/pgtable-ppc32.h extern int icache_44x_need_flush; · line 435
Quoted 8 lines
arch/powerpc/include/asm/pgtable-ppc32.h +2
-2-#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_SPECIAL) - +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ + _PAGE_SPECIAL)#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ _PAGE_WRITETHRU | _PAGE_ENDIAN | \
BTW. That part of the patch looks bad (ie, the original line isn't what is upstream). I've fixed up locally.
Cheers,
Ben.
Quoted 15 lines · Benjamin Herrenschmidt
Quoted 13 lines · Benjamin Herrenschmidt
Quoted 13 lines
arch/powerpc/include/asm/pgtable-ppc32.h +2
-2@@ -428,8 +428,8 @@ extern int icache_44x_need_flush;#define PMD_PAGE_SIZE (pmd) bad_call_to_PMD_PAGE_SIZE()#endif -#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_SPECIAL) - +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \ + _PAGE_SPECIAL)
Quoted 7 lines
Quoted 3 lines
arch/powerpc/include/asm/pgtable-ppc32.h extern int icache_44x_need_flush; · line 435
Quoted 3 lines
arch/powerpc/include/asm/pgtable-ppc32.h +0
-0#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ _PAGE_WRITETHRU | _PAGE_ENDIAN | \BTW. That part of the patch looks bad (ie, the original line isn't what is upstream). I've fixed up locally.
Sorry for this. I forgot to rebase my patch on mainline.
Quoted 5 lines
Cheers,
Ben.
Signature · 1 line
Philippe.