parisc: Fix lpa and lpa_user defines
authorJohn David Anglin <dave.anglin@bell.net>
Wed, 22 Dec 2021 16:01:31 +0000 (16:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:54:26 +0000 (10:54 +0100)
commiteb44b1386af5751e0faec3a06e65078f146f81a7
tree2b84da38c5a7008fbbc48f41c9cb9dcba7190a0b
parent9b78ee2341d4496688a157ae3fc901cc6c3c4385
parisc: Fix lpa and lpa_user defines

commit db19c6f1a2a353cc8dec35b4789733a3cf6e2838 upstream.

While working on the rewrite to the light-weight syscall and futex code, I
experimented with using a hash index based on the user physical address of
atomic variable. This exposed two problems with the lpa and lpa_user defines.

Because of the copy instruction, the pa argument needs to be an early clobber
argument. This prevents gcc from allocating the va and pa arguments to the same
register.

Secondly, the lpa instruction can cause a page fault so we need to catch
exceptions.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Fixes: 116d753308cf ("parisc: Use lpa instruction to load physical addresses in driver code")
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/parisc/include/asm/special_insns.h