diff mbox series

[v2,2/2] powerpc/book3s64: Avoid __pte_protnone() check in __pte_flags_need_flush()

Message ID 20231204093638.71503-2-aneesh.kumar@kernel.org (mailing list archive)
State Accepted
Commit a59c14f6b4caad7671dfb81737beba0b313897e4
Headers show
Series [v2,1/2] powerpc/book3s/hash: Drop _PAGE_PRIVILEGED from PAGE_NONE | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 6 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 23 jobs.

Commit Message

Aneesh Kumar K.V (IBM) Dec. 4, 2023, 9:36 a.m. UTC
From: "Aneesh Kumar K.V (IBM)" <aneesh.kumar@kernel.org>

This reverts commit 1abce0580b89 ("powerpc/64s: Fix __pte_needs_flush()
false positive warning")

The previous patch dropped the usage of _PAGE_PRIVILEGED with PAGE_NONE.
Hence this check can be dropped.

Signed-off-by: Aneesh Kumar K.V (IBM) <aneesh.kumar@kernel.org>
---
 arch/powerpc/include/asm/book3s/64/tlbflush.h | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Christophe Leroy Dec. 5, 2023, 11:01 a.m. UTC | #1
Le 04/12/2023 à 10:36, aneesh.kumar@kernel.org a écrit :
> From: "Aneesh Kumar K.V (IBM)" <aneesh.kumar@kernel.org>
> 
> This reverts commit 1abce0580b89 ("powerpc/64s: Fix __pte_needs_flush()
> false positive warning")
> 
> The previous patch dropped the usage of _PAGE_PRIVILEGED with PAGE_NONE.
> Hence this check can be dropped.
> 
> Signed-off-by: Aneesh Kumar K.V (IBM) <aneesh.kumar@kernel.org>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
>   arch/powerpc/include/asm/book3s/64/tlbflush.h | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush.h b/arch/powerpc/include/asm/book3s/64/tlbflush.h
> index 1950c1b825b4..fd642b729775 100644
> --- a/arch/powerpc/include/asm/book3s/64/tlbflush.h
> +++ b/arch/powerpc/include/asm/book3s/64/tlbflush.h
> @@ -158,11 +158,6 @@ static inline void flush_tlb_fix_spurious_fault(struct vm_area_struct *vma,
>   	 */
>   }
>   
> -static inline bool __pte_protnone(unsigned long pte)
> -{
> -	return (pte & (pgprot_val(PAGE_NONE) | _PAGE_RWX)) == pgprot_val(PAGE_NONE);
> -}
> -
>   static inline bool __pte_flags_need_flush(unsigned long oldval,
>   					  unsigned long newval)
>   {
> @@ -179,8 +174,8 @@ static inline bool __pte_flags_need_flush(unsigned long oldval,
>   	/*
>   	 * We do not expect kernel mappings or non-PTEs or not-present PTEs.
>   	 */
> -	VM_WARN_ON_ONCE(!__pte_protnone(oldval) && oldval & _PAGE_PRIVILEGED);
> -	VM_WARN_ON_ONCE(!__pte_protnone(newval) && newval & _PAGE_PRIVILEGED);
> +	VM_WARN_ON_ONCE(oldval & _PAGE_PRIVILEGED);
> +	VM_WARN_ON_ONCE(newval & _PAGE_PRIVILEGED);
>   	VM_WARN_ON_ONCE(!(oldval & _PAGE_PTE));
>   	VM_WARN_ON_ONCE(!(newval & _PAGE_PTE));
>   	VM_WARN_ON_ONCE(!(oldval & _PAGE_PRESENT));
diff mbox series

Patch

diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush.h b/arch/powerpc/include/asm/book3s/64/tlbflush.h
index 1950c1b825b4..fd642b729775 100644
--- a/arch/powerpc/include/asm/book3s/64/tlbflush.h
+++ b/arch/powerpc/include/asm/book3s/64/tlbflush.h
@@ -158,11 +158,6 @@  static inline void flush_tlb_fix_spurious_fault(struct vm_area_struct *vma,
 	 */
 }
 
-static inline bool __pte_protnone(unsigned long pte)
-{
-	return (pte & (pgprot_val(PAGE_NONE) | _PAGE_RWX)) == pgprot_val(PAGE_NONE);
-}
-
 static inline bool __pte_flags_need_flush(unsigned long oldval,
 					  unsigned long newval)
 {
@@ -179,8 +174,8 @@  static inline bool __pte_flags_need_flush(unsigned long oldval,
 	/*
 	 * We do not expect kernel mappings or non-PTEs or not-present PTEs.
 	 */
-	VM_WARN_ON_ONCE(!__pte_protnone(oldval) && oldval & _PAGE_PRIVILEGED);
-	VM_WARN_ON_ONCE(!__pte_protnone(newval) && newval & _PAGE_PRIVILEGED);
+	VM_WARN_ON_ONCE(oldval & _PAGE_PRIVILEGED);
+	VM_WARN_ON_ONCE(newval & _PAGE_PRIVILEGED);
 	VM_WARN_ON_ONCE(!(oldval & _PAGE_PTE));
 	VM_WARN_ON_ONCE(!(newval & _PAGE_PTE));
 	VM_WARN_ON_ONCE(!(oldval & _PAGE_PRESENT));