Skip to content

Commit d81e6f8

Browse files
chleroympe
authored andcommitted
powerpc/mm: don't use _PAGE_EXEC in book3s/32
book3s/32 doesn't define _PAGE_EXEC, so no need to use it. All other platforms define _PAGE_EXEC so no need to check it is not NUL when not book3s/32. Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent c766ee7 commit d81e6f8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/powerpc/include/asm/book3s/32/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
234234
int psize)
235235
{
236236
unsigned long set = pte_val(entry) &
237-
(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
237+
(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW);
238238
unsigned long clr = ~pte_val(entry) & _PAGE_RO;
239239

240240
pte_update(ptep, clr, set);

arch/powerpc/mm/pgtable.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static struct page *maybe_pte_to_page(pte_t pte)
7373
return page;
7474
}
7575

76-
#if defined(CONFIG_PPC_STD_MMU) || _PAGE_EXEC == 0
76+
#ifdef CONFIG_PPC_BOOK3S
7777

7878
/* Server-style MMU handles coherency when hashing if HW exec permission
7979
* is supposed per page (currently 64-bit only). If not, then, we always
@@ -106,7 +106,7 @@ static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma,
106106
return pte;
107107
}
108108

109-
#else /* defined(CONFIG_PPC_STD_MMU) || _PAGE_EXEC == 0 */
109+
#else /* CONFIG_PPC_BOOK3S */
110110

111111
/* Embedded type MMU with HW exec support. This is a bit more complicated
112112
* as we don't have two bits to spare for _PAGE_EXEC and _PAGE_HWEXEC so
@@ -179,7 +179,7 @@ static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma,
179179
return __pte(pte_val(pte) | _PAGE_EXEC);
180180
}
181181

182-
#endif /* !(defined(CONFIG_PPC_STD_MMU) || _PAGE_EXEC == 0) */
182+
#endif /* CONFIG_PPC_BOOK3S */
183183

184184
/*
185185
* set_pte stores a linux PTE into the linux page table.

0 commit comments

Comments
 (0)