linux/arch/arm64
Marc Zyngier 41011e2de3 KVM: arm64: nv: Fix relative priorities of exceptions generated by ERETAx
ERETAx can fail in multiple ways:

(1) ELR_EL2 points lalaland
(2) we get a PAC failure
(3) SPSR_EL2 has the wrong mode

(1) is easy, as we just let the CPU do its thing and deliver an
Instruction Abort. However, (2) and (3) are interesting, because
the PAC failure priority is way below that of the Illegal Execution
State exception.

Which means that if we have detected a PAC failure (and that we have
FPACCOMBINE), we must be careful to give priority to the Illegal
Execution State exception, should one be pending.

Solving this involves hoisting the SPSR calculation earlier and
testing for the IL bit before injecting the FPAC exception.

In the extreme case of a ERETAx returning to an invalid mode *and*
failing its PAC check, we end up with an Instruction Abort (due
to the new PC being mangled by the failed Auth) *and* PSTATE.IL
being set. Which matches the requirements of the architecture.

Whilst we're at it, remove a stale comment that states the obvious
and only confuses the reader.

Fixes: 213b3d1ea1 ("KVM: arm64: nv: Handle ERETA[AB] instructions")
Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240528100632.1831995-2-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
2024-05-30 17:36:22 +01:00
..
boot TTY/Serial changes for 6.10-rc1 2024-05-22 11:53:02 -07:00
configs USB / Thunderbolt changes for 6.10-rc1 2024-05-22 11:40:09 -07:00
crypto crypto: arm64/aes-ce - Simplify round key load sequence 2024-04-26 17:26:09 +08:00
hyperv x86/hyperv: Use Hyper-V entropy to seed guest random number generator 2024-03-18 22:01:52 +00:00
include Jeff Xu's implementation of the mseal() syscall. 2024-05-24 12:47:28 -07:00
kernel 16 hotfixes, 11 of which are cc:stable. 2024-05-25 15:10:33 -07:00
kvm KVM: arm64: nv: Fix relative priorities of exceptions generated by ERETAx 2024-05-30 17:36:22 +01:00
lib arm64: crypto: use CC_FLAGS_FPU for NEON CFLAGS 2024-05-19 14:36:18 -07:00
mm The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
net Modules changes for v6.10-rc1 2024-05-15 14:05:08 -07:00
tools arm64: errata: Add workaround for Arm errata 3194386 and 3312417 2024-05-10 12:21:57 +01:00
xen
Kbuild
Kconfig arm64 fixes for -rc1 2024-05-23 12:09:22 -07:00
Kconfig.debug
Kconfig.platforms Updates for the interrupt subsystem: 2024-05-14 09:47:14 -07:00
Makefile arm64: implement ARCH_HAS_KERNEL_FPU_SUPPORT 2024-05-19 14:36:18 -07:00