From: Steffen Eiden <seiden@linux.ibm.com>
To: Dan Carpenter <dan@pereq.eu>
Cc: sashiko-reviews@lists.linux.dev, kvmarm@lists.linux.dev,
kvm@vger.kernel.org, "Oliver Upton" <oupton@kernel.org>,
"Marc Zyngier" <maz@kernel.org>,
linux-s390@vger.kernel.org,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Janosch Frank" <frankja@linux.ibm.com>,
"Claudio Imbrenda" <imbrenda@linux.ibm.com>,
"Karthik Bhargavan" <karthik@pereq.eu>,
"Clément Blaudeau" <clement@cryspen.com>
Subject: Re: [PATCH v2 2/8] KVM: arm64: Reset SP_EL1, ELR_EL1 and SPSR_EL1 when resetting a vcpu
Date: Thu, 26 Nov 2026 14:37:44 +0100 [thread overview]
Message-ID: <20261126133744.219929-A-seiden@linux.ibm.com> (raw)
In-Reply-To: <awan8mSx5cbzXzJ7@stanley.mountain>
On Wed, Nov 25, 2026 at 12:18:42PM +0300, Dan Carpenter wrote:
> On Wed, Nov 25, 2026 at 12:14:10PM +0300, Dan Carpenter wrote:
> > Let me add the s390 maintainers to the CC list.
> >
> > I considered doing it the way Sashiko suggests but s390 doesn't have the
> > __vcpu_assign_sys_reg() helpers so it broke the build. The registers are
> > not the same so, either way, some of this is going to be specific to
> > arm64. But Sashiko is correct that s390 probably keeps a stale SP_EL1
> > across a reset. The s390 maintainers could probably take the selftest in
> > patch 8 and modify it for s390. :)
> >
FYI: the arm on s390 KVM in the current upstream state has no idea what
SP_EL1 is :)
>
> Actually, never mind. This can be done in kvm_reset_vcpu_core() like
> Suzuki Poulose suggests.
>
We share kvm_reset_vcpu_core() as well :)
I assume this fix series should go into 7.4. right?
I have a series posted adding the required functions and infrastructure
for s390 [1]. This will likely go to 7.5.
For 7.4: Add a patch just providing a stub that does nothing for the
required helper (untested):
diff --git a/arch/s390/include/asm/kvm_host_arm64.h b/arch/s390/include/asm/kvm_host_arm64.h
index 3e69724f17c9..bdca7ebf6405 100644
--- a/arch/s390/include/asm/kvm_host_arm64.h
+++ b/arch/s390/include/asm/kvm_host_arm64.h
@@ -206,4 +206,6 @@ static inline void kvm_arch_async_page_present_queued(struct kvm_vcpu *vcpu)
#define kvm_supports_32bit_el0() false
+#define __vcpu_assign_sys_reg(__vcpu, __reg, __val) (void)
+
#endif /* ASM_KVM_HOST_ARM64_H */
If this does goes to 7.5 queuing that after the corresponding s390
patches would be the simpler approach.
Thanks for fixing the bugs
Steffen
[1] https://lore.kernel.org/all/20261106-sysreg-v3-0-75e95980fb10@linux.ibm.com
next prev parent reply other threads:[~2026-11-26 13:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 6:56 [PATCH v2 0/8] KVM: arm64: Fix kvm_reset_vcpu() and SError handling for nested virt Dan Carpenter
2026-11-25 6:56 ` [PATCH v2 1/8] KVM: arm64: Drop an incomplete MMIO access when resetting a vcpu Dan Carpenter
2026-11-25 6:56 ` [PATCH v2 2/8] KVM: arm64: Reset SP_EL1, ELR_EL1 and SPSR_EL1 " Dan Carpenter
2026-11-25 7:15 ` sashiko-bot
2026-11-25 9:14 ` Dan Carpenter
2026-11-25 9:18 ` Dan Carpenter
2026-11-26 13:37 ` Steffen Eiden [this message]
2026-11-26 14:04 ` Dan Carpenter
2026-11-25 9:08 ` Suzuki K Poulose
2026-11-25 9:32 ` Dan Carpenter
2026-11-25 6:56 ` [PATCH v2 3/8] KVM: arm64: Discard a pending SError " Dan Carpenter
2026-11-25 6:56 ` [PATCH v2 4/8] KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu() Dan Carpenter
2026-11-25 6:56 ` [PATCH v2 5/8] KVM: arm64: nv: Replace a pending SError when injecting a new one Dan Carpenter
2026-11-25 8:00 ` Oliver Upton
2026-11-25 9:51 ` Dan Carpenter
2026-11-25 6:56 ` [PATCH v2 6/8] KVM: arm64: nv: Don't deliver a pending SError to the wrong guest Dan Carpenter
2026-11-25 7:24 ` sashiko-bot
2026-11-25 8:04 ` Oliver Upton
2026-11-25 11:11 ` Dan Carpenter
2026-11-25 11:05 ` Dan Carpenter
2026-11-25 6:56 ` [PATCH v2 7/8] KVM: arm64: nv: Re-inject a stored SError after the exit is handled Dan Carpenter
2026-11-25 6:56 ` [PATCH v2 8/8] KVM: arm64: selftests: Test that a vcpu reset clears the vcpu's state Dan Carpenter
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=20261126133744.219929-A-seiden@linux.ibm.com \
--to=seiden@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=clement@cryspen.com \
--cc=dan@pereq.eu \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=karthik@pereq.eu \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-s390@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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