mbox series

[0/2] arm64: pointer authentication initialization cleanup

Message ID 20200423101606.37601-1-mark.rutland@arm.com (mailing list archive)
Headers show
Series arm64: pointer authentication initialization cleanup | expand

Message

Mark Rutland April 23, 2020, 10:16 a.m. UTC
These patches refactor the pointer authentication initialization code to make
it easier to reason about and to reduce duplication of code.

The big wins are:

* Moving the initialization after the MMU has been enabled. This means we can
  initialize the keys using the same helpers as context switch, and don't need
  to temporarily duplicate them in secondary_data.

* Moving primary/secondary conditional initialization into the respective
  primary/secondary boot paths. This minimizes potentially-confusing control
  flow and still allows for code sharing via helper macros.

I've given this a spin on a foundation model, with userspace and kernel tests,
playing with CPU hotplug, etc.

Patches based on v5.7-rc2. These have no dependency on my fix queued in
for-next/core.

Thanks,
Mark.

Mark Rutland (2):
  arm64: remove ptrauth_keys_install_kernel sync arg
  arm64: simplify ptrauth initialization

 arch/arm64/include/asm/asm_pointer_auth.h | 43 +++++++++++++++++++++++++----
 arch/arm64/include/asm/smp.h              | 11 --------
 arch/arm64/kernel/asm-offsets.c           |  3 --
 arch/arm64/kernel/entry.S                 |  4 +--
 arch/arm64/kernel/head.S                  | 12 ++++++--
 arch/arm64/kernel/sleep.S                 |  1 -
 arch/arm64/kernel/smp.c                   |  8 ------
 arch/arm64/mm/proc.S                      | 46 +------------------------------
 8 files changed, 51 insertions(+), 77 deletions(-)

Comments

Will Deacon April 28, 2020, 10:43 a.m. UTC | #1
On Thu, 23 Apr 2020 11:16:04 +0100, Mark Rutland wrote:
> These patches refactor the pointer authentication initialization code to make
> it easier to reason about and to reduce duplication of code.
> 
> The big wins are:
> 
> * Moving the initialization after the MMU has been enabled. This means we can
>   initialize the keys using the same helpers as context switch, and don't need
>   to temporarily duplicate them in secondary_data.
> 
> [...]

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

[1/2] arm64: remove ptrauth_keys_install_kernel sync arg
      https://git.kernel.org/arm64/c/d0055da5266a
[2/2] arm64: simplify ptrauth initialization
      https://git.kernel.org/arm64/c/62a679cb2825

Cheers,