Commit 27672be7 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/nohash: Deduplicate _PAGE_CHG_MASK

_PAGE_CHG_MASK is identical between nohash/32 and nohash/64,
deduplicate it.

While at it, clean the #ifdef for PTE_RPN_MASK in nohash/32 as
it is already CONFIG_PPC32.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/c1a1893dbba4afb825bfa78b262f0b0e0fc3b490.1695659959.git.christophe.leroy@csgroup.eu
parent 7c929ad0
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
* The mask covered by the RPN must be a ULL on 32-bit platforms with * The mask covered by the RPN must be a ULL on 32-bit platforms with
* 64-bit PTEs. * 64-bit PTEs.
*/ */
#if defined(CONFIG_PPC32) && defined(CONFIG_PTE_64BIT) #ifdef CONFIG_PTE_64BIT
#define PTE_RPN_MASK (~((1ULL << PTE_RPN_SHIFT) - 1)) #define PTE_RPN_MASK (~((1ULL << PTE_RPN_SHIFT) - 1))
#define MAX_POSSIBLE_PHYSMEM_BITS 36 #define MAX_POSSIBLE_PHYSMEM_BITS 36
#else #else
...@@ -151,12 +151,6 @@ ...@@ -151,12 +151,6 @@
#define MAX_POSSIBLE_PHYSMEM_BITS 32 #define MAX_POSSIBLE_PHYSMEM_BITS 32
#endif #endif
/*
* _PAGE_CHG_MASK masks of bits that are to be preserved across
* pgprot changes.
*/
#define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SPECIAL)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#define pte_clear(mm, addr, ptep) \ #define pte_clear(mm, addr, ptep) \
......
...@@ -75,12 +75,6 @@ ...@@ -75,12 +75,6 @@
#define PTE_RPN_MASK (~((1UL << PTE_RPN_SHIFT) - 1)) #define PTE_RPN_MASK (~((1UL << PTE_RPN_SHIFT) - 1))
/*
* _PAGE_CHG_MASK masks of bits that are to be preserved across
* pgprot changes.
*/
#define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SPECIAL)
#define H_PAGE_4K_PFN 0 #define H_PAGE_4K_PFN 0
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
......
...@@ -13,6 +13,12 @@ static inline pte_basic_t pte_update(struct mm_struct *mm, unsigned long addr, p ...@@ -13,6 +13,12 @@ static inline pte_basic_t pte_update(struct mm_struct *mm, unsigned long addr, p
#include <asm/nohash/32/pgtable.h> #include <asm/nohash/32/pgtable.h>
#endif #endif
/*
* _PAGE_CHG_MASK masks of bits that are to be preserved across
* pgprot changes.
*/
#define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_SPECIAL)
/* Permission masks used for kernel mappings */ /* Permission masks used for kernel mappings */
#define PAGE_KERNEL __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW) #define PAGE_KERNEL __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW)
#define PAGE_KERNEL_NC __pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | _PAGE_NO_CACHE) #define PAGE_KERNEL_NC __pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | _PAGE_NO_CACHE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment