From: Oliver Upton Date: Tue, 2 Jun 2026 23:54:49 +0000 (-0700) Subject: KVM: arm64: Restart instruction upon race in __kvm_at_s12() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=699a2cc7f608145d55621e57828ccf6bfcb8d906;p=thirdparty%2Flinux.git KVM: arm64: Restart instruction upon race in __kvm_at_s12() __kvm_at_s*() are expected to return -EAGAIN if the page table walk raced with a concurrent update to a page table descriptor, which is interpreted as a signal to restart the trapping instruction. While this mostly works, __kvm_at_s12() silently eats the return from __kvm_at_s1e01() and consumes an uninitialized PAR value. Propagate the nonzero return instead. Fixes: 92c6443222ca ("KVM: arm64: Propagate PTW errors up to AT emulation") Signed-off-by: Oliver Upton Link: https://patch.msgid.link/20260602235450.103057-5-oupton@kernel.org Signed-off-by: Marc Zyngier --- diff --git a/arch/arm64/kvm/at.c b/arch/arm64/kvm/at.c index 119a603e636e..6cc5892023dd 100644 --- a/arch/arm64/kvm/at.c +++ b/arch/arm64/kvm/at.c @@ -1557,7 +1557,10 @@ int __kvm_at_s12(struct kvm_vcpu *vcpu, u32 op, u64 vaddr) return 0; } - __kvm_at_s1e01(vcpu, op, vaddr); + ret = __kvm_at_s1e01(vcpu, op, vaddr); + if (ret) + return ret; + par = vcpu_read_sys_reg(vcpu, PAR_EL1); if (par & SYS_PAR_EL1_F) return 0;