Skip to content

KVM/arm64: Enable PtrAuth on non-VHE KVM

Marc Zyngier kvm kvmarm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 6 repliesIn review
  2. v14 patches 12 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: arm64: Enable Address Authentication at EL2 if availablearch/arm64/kvm/hyp-init.S+5 -01 reply
2/5KVM: arm64: Allow ARM64_PTR_AUTH when ARM64_VHE=narch/arm64/Kconfig+1 -30 replies
3/5KVM: arm64: Allow PtrAuth to be enabled from userspace on non-VHE systemsarch/arm64/kvm/reset.c+10 -110 replies
4/5KVM: arm64: Check HCR_EL2 instead of shadow copy to swap PtrAuth registersarch/arm64/include/asm/kvm_ptrauth.h+2 -20 replies
5/5KVM: arm64: Simplify PtrAuth alternative patchingarch/arm64/include/asm/kvm_ptrauth.h+9 -175 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchAndrew ScullMark Rutland
1/5A-b A-b
2/5A-b A-b
3/5A-b A-b
4/5A-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] KVM/arm64: Enable PtrAuth on non-VHE KVM

Not having PtrAuth on non-VHE KVM (for whatever reason VHE is not enabled on a v8.3 system) has always looked like an oddity. This trivial series remedies it, and allows a non-VHE KVM to offer PtrAuth to its guests.

In the tradition of not having separate security between host-EL1 and EL2, EL2 reuses the keys set up by host-EL1. It is likely that, should we switch to a mode where EL2 is more distrusting of EL1, we'd have private keys there.

The last two patches are respectively an optimization when save/restoring the PtrAuth context, and a cleanup of the alternatives used by that same save/restore code.

* From v1 [1]:
- Move the hand-crafted literal load to using a mov_q macro (Andrew, Mark)
- Added a cleanup of the alternatives on the save/restore path (Mark)

[1] https://lore.kernel.org/kvm/[email protected]/

Marc Zyngier (5):
KVM: arm64: Enable Address Authentication at EL2 if available
KVM: arm64: Allow ARM64_PTR_AUTH when ARM64_VHE=n
KVM: arm64: Allow PtrAuth to be enabled from userspace on non-VHE
systems
KVM: arm64: Check HCR_EL2 instead of shadow copy to swap PtrAuth
registers
KVM: arm64: Simplify PtrAuth alternative patching

 arch/arm64/Kconfig                   |  4 +---
 arch/arm64/include/asm/kvm_ptrauth.h | 30 ++++++++++------------------
 arch/arm64/kvm/hyp-init.S            |  5 +++++
 arch/arm64/kvm/reset.c               | 21 ++++++++++---------
 4 files changed, 27 insertions(+), 33 deletions(-)
Signature · 1 line
2.27.0