]> www.infradead.org Git - users/dwmw2/linux.git/commit
parisc: Fix handling off probe non-access faults
authorJohn David Anglin <dave.anglin@bell.net>
Wed, 9 Mar 2022 21:14:36 +0000 (21:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:40:32 +0000 (14:40 +0200)
commit7e4967e913ab822ed16e352f2ada9ac83fa0290f
treea0890026c95e0c2c76c8b17fdeb8bfa968247e2d
parentede1ef1a7de973321699736ef96d01a4b9a6fe9e
parisc: Fix handling off probe non-access faults

[ Upstream commit e00b0a2ab8ec019c344e53bfc76e31c18bb587b7 ]

Currently, the parisc kernel does not fully support non-access TLB
fault handling for probe instructions. In the fast path, we set the
target register to zero if it is not a shadowed register. The slow
path is not implemented, so we call do_page_fault. The architecture
indicates that non-access faults should not cause a page fault from
disk.

This change adds to code to provide non-access fault support for
probe instructions. It also modifies the handling of faults on
userspace so that if the address lies in a valid VMA and the access
type matches that for the VMA, the probe target register is set to
one. Otherwise, the target register is set to zero.

This was done to make probe instructions more useful for userspace.
Probe instructions are not very useful if they set the target register
to zero whenever a page is not present in memory. Nominally, the
purpose of the probe instruction is determine whether read or write
access to a given address is allowed.

This fixes a problem in function pointer comparison noticed in the
glibc testsuite (stdio-common/tst-vfprintf-user-type). The same
problem is likely in glibc (_dl_lookup_address).

V2 adds flush and lpa instruction support to handle_nadtlb_fault.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/parisc/include/asm/traps.h
arch/parisc/kernel/traps.c
arch/parisc/mm/fault.c