mbox series

[v2,0/3] arm64: PAC stripping cleanups

Message ID 20230412160134.306148-1-mark.rutland@arm.com (mailing list archive)
Headers show
Series arm64: PAC stripping cleanups | expand

Message

Mark Rutland April 12, 2023, 4:01 p.m. UTC
While working on some stacktrace and noinstr cleanups, I spotted that
we're doing a bunch of redundant work to strip PACs from pointers which
have already been stripped. Further, for historical reasons we use C
code to strip PACs when we can easily use XPACLRI.

These patches clean up the PAC stripping, removing the redundant work
and making better use of XPACLRI to strip PACs in the kernel.

Since v1 [1]:
* Use 'hint #7' to assemble with older binutils

[1] https://lore.kernel.org/linux-arm-kernel/20230314162044.888747-1-mark.rutland@arm.com/

Mark.

Mark Rutland (3):
  arm64: avoid redundant PAC stripping in __builtin_return_address()
  arm64: use XPACLRI to strip PAC
  arm64: move PAC masks to <asm/pointer_auth.h>

 arch/arm64/Kconfig                    | 14 +++++++++++
 arch/arm64/include/asm/compiler.h     | 36 +++++++++++++++++++--------
 arch/arm64/include/asm/pointer_auth.h | 13 +++++-----
 arch/arm64/kernel/crash_core.c        |  1 +
 arch/arm64/kernel/perf_callchain.c    |  2 +-
 arch/arm64/kernel/process.c           |  2 +-
 arch/arm64/kernel/stacktrace.c        |  2 +-
 7 files changed, 50 insertions(+), 20 deletions(-)

Comments

Will Deacon April 13, 2023, 2:41 p.m. UTC | #1
On Wed, 12 Apr 2023 17:01:31 +0100, Mark Rutland wrote:
> While working on some stacktrace and noinstr cleanups, I spotted that
> we're doing a bunch of redundant work to strip PACs from pointers which
> have already been stripped. Further, for historical reasons we use C
> code to strip PACs when we can easily use XPACLRI.
> 
> These patches clean up the PAC stripping, removing the redundant work
> and making better use of XPACLRI to strip PACs in the kernel.
> 
> [...]

Applied to arm64 (for-next/stacktrace), thanks!

[1/3] arm64: avoid redundant PAC stripping in __builtin_return_address()
      https://git.kernel.org/arm64/c/9df3f5082ff9
[2/3] arm64: use XPACLRI to strip PAC
      https://git.kernel.org/arm64/c/ca708599ca43
[3/3] arm64: move PAC masks to <asm/pointer_auth.h>
      https://git.kernel.org/arm64/c/de1702f65feb

Cheers,