]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: arm64: Set IL for injected FPAC exceptions during ERET emulation
authorFuad Tabba <tabba@google.com>
Thu, 18 Jun 2026 12:16:40 +0000 (13:16 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 22 Jun 2026 09:44:08 +0000 (10:44 +0100)
The FPAC syndrome constructed during nested ERET emulation does not set
IL. For FPAC (EC=0x1C), IL reflects the instruction length. ERET and
its authenticated variants are always A64 32-bit instructions, so IL
must be 1.

Fixes: 213b3d1ea161 ("KVM: arm64: nv: Handle ERETA[AB] instructions")
Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260618121643.4105064-5-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/emulate-nested.c

index 96ebe7e3b408106bc8c51121bb469b4b59da0e80..a15b2f41a12c81bcbd81844ed8cb0bce2fe15f9c 100644 (file)
@@ -2800,7 +2800,7 @@ void kvm_emulate_nested_eret(struct kvm_vcpu *vcpu)
                 * ERET handling, and the guest will have a little surprise.
                 */
                if (kvm_has_pauth(vcpu->kvm, FPACCOMBINE) && !(spsr & PSR_IL_BIT)) {
-                       esr &= ESR_ELx_ERET_ISS_ERETA;
+                       esr &= (ESR_ELx_ERET_ISS_ERETA | ESR_ELx_IL);
                        esr |= FIELD_PREP(ESR_ELx_EC_MASK, ESR_ELx_EC_FPAC);
                        kvm_inject_nested_sync(vcpu, esr);
                        return;