From: Oliver Upton <oupton@kernel.org>
To: kvmarm@lists.linux.dev
Cc: Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Wei-Lin Chang <weilin.chang@arm.com>,
Oliver Upton <oupton@kernel.org>
Subject: [PATCH 4/5] KVM: arm64: Restart instruction upon race in __kvm_at_s12()
Date: Tue, 2 Jun 2026 16:54:49 -0700 [thread overview]
Message-ID: <20260602235450.103057-5-oupton@kernel.org> (raw)
In-Reply-To: <20260602235450.103057-1-oupton@kernel.org>
__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 <oupton@kernel.org>
---
arch/arm64/kvm/at.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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;
--
2.47.3
next prev parent reply other threads:[~2026-06-02 23:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 23:54 [PATCH 0/5] KVM: arm64: nv: MMU fixes for 7.2 Oliver Upton
2026-06-02 23:54 ` [PATCH 1/5] KVM: arm64: Don't leak PFN when kvm_translate_vncr() races MMU notifier Oliver Upton
2026-06-02 23:54 ` [PATCH 2/5] KVM: arm64: nv: Fully update VNCR fixmap state in kvm_translate_vncr() Oliver Upton
2026-06-02 23:54 ` [PATCH 3/5] KVM: arm64: nv: Inject SEA TTW when desc update can't write to GPA Oliver Upton
2026-06-02 23:54 ` Oliver Upton [this message]
2026-06-02 23:54 ` [PATCH 5/5] KVM: arm64: nv: Restart stage-1 walk if stage-2 desc update fails Oliver Upton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260602235450.103057-5-oupton@kernel.org \
--to=oupton@kernel.org \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=weilin.chang@arm.com \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox