KVM: arm64: nv: Add emulation for ERETAx instructions
authorMarc Zyngier <maz@kernel.org>
Fri, 19 Apr 2024 10:29:32 +0000 (11:29 +0100)
committerMarc Zyngier <maz@kernel.org>
Sat, 20 Apr 2024 11:42:51 +0000 (12:42 +0100)
commit6ccc971ee2c61a1ffb487e46bf6184f7df6aacfb
treedffea8d7389c8b24242f07ba27b1c642410b33f0
parent719f5206a8fd8336d23ccda6fe2a3287fbfb4c92
KVM: arm64: nv: Add emulation for ERETAx instructions

FEAT_NV has the interesting property of relying on ERET being
trapped. An added complexity is that it also traps ERETAA and
ERETAB, meaning that the Pointer Authentication aspect of these
instruction must be emulated.

Add an emulation of Pointer Authentication, limited to ERETAx
(always using SP_EL2 as the modifier and ELR_EL2 as the pointer),
using the Generic Authentication instructions.

The emulation, however small, is placed in its own compilation
unit so that it can be avoided if the configuration doesn't
include it (or the toolchan in not up to the task).

Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240419102935.1935571-13-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_nested.h
arch/arm64/include/asm/pgtable-hwdef.h
arch/arm64/kvm/Makefile
arch/arm64/kvm/pauth.c [new file with mode: 0644]