]> www.infradead.org Git - users/jedix/linux-maple.git/commit
powerpc/64s: Fix __pte_needs_flush() false positive warning
authorBenjamin Gray <bgray@linux.ibm.com>
Thu, 2 Mar 2023 22:59:47 +0000 (09:59 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:54 +0000 (12:10 +0200)
commit3f5ded246953dd41608444a61b5ae1cfda3ef61e
treed763f6626146f3cc5820f72f245c867405c83120
parent0bb88976bdd2936caf8a2b35746f43c2d7cb6c27
powerpc/64s: Fix __pte_needs_flush() false positive warning

commit 1abce0580b89464546ae06abd5891ebec43c9470 upstream.

Userspace PROT_NONE ptes set _PAGE_PRIVILEGED, triggering a false
positive debug assertion that __pte_flags_need_flush() is not called
on a kernel mapping.

Detect when it is a userspace PROT_NONE page by checking the required
bits of PAGE_NONE are set, and none of the RWX bits are set.
pte_protnone() is insufficient here because it always returns 0 when
CONFIG_NUMA_BALANCING=n.

Fixes: b11931e9adc1 ("powerpc/64s: add pte_needs_flush and huge_pmd_needs_flush")
Cc: stable@vger.kernel.org # v6.1+
Reported-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230302225947.81083-1-bgray@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/book3s/64/tlbflush.h