public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: KVM <kvm@vger.kernel.org>, Janosch Frank <frankja@linux.ibm.com>,
	David Hildenbrand <david@kernel.org>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Thomas Huth <thuth@redhat.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [PATCH v3] KVM: s390: vsie: Avoid injecting machine check on signal
Date: Mon, 16 Mar 2026 14:13:58 +0100	[thread overview]
Message-ID: <20260316131358.17080E1f-hca@linux.ibm.com> (raw)
In-Reply-To: <20260316130947.40466-1-borntraeger@linux.ibm.com>

On Mon, Mar 16, 2026 at 02:09:47PM +0100, Christian Borntraeger wrote:
> The recent XFER_TO_GUEST_WORK change resulted in a situation, where the
> vsie code would interpret a signal during work as a machine check during
> SIE as both use the EINTR return code.
> The exit_reason of the sie64a function has nothing to do with the
> kvm_run exit_reason. Rename it and define a specific code for machine
> checks instead of abusing -EINTR.
> rename exit_reason into sie_return to avoid the naming conflict
> and change the code flow in vsie.c to have a separate variable for rc
> and sie_return.
> 
> Fixes: 2bd1337a1295e ("KVM: s390: Use generic VIRT_XFER_TO_GUEST_WORK functions")
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> ---
> v1->v2:
> instead of a band-aid, make the machine check more direct
> v2->v3:
> avoid overloading the rc variable in vsie.c
> 
>  arch/s390/include/asm/kvm_host.h   |  3 +++
>  arch/s390/include/asm/stacktrace.h |  2 +-
>  arch/s390/kernel/asm-offsets.c     |  2 +-
>  arch/s390/kernel/entry.S           |  4 ++--
>  arch/s390/kernel/nmi.c             |  4 ++--
>  arch/s390/kvm/kvm-s390.c           | 15 ++++++++-------
>  arch/s390/kvm/vsie.c               |  7 +++++--
>  7 files changed, 22 insertions(+), 15 deletions(-)

...

> diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
> index c0d36afd4023..42c53134e0b8 100644
> --- a/arch/s390/kvm/vsie.c
> +++ b/arch/s390/kvm/vsie.c
> @@ -1123,6 +1123,7 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page, struc
>  	struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s;
>  	struct kvm_s390_sie_block *scb_o = vsie_page->scb_o;
>  	int guest_bp_isolation;
> +	int sie_return = SIE64_RETURN_NORMAL;
>  	int rc = 0;

Move that one line up to keep the reverse x-mas style?

> +	WARN_ON(sie_return != SIE64_RETURN_NORMAL);

And as written in the previous version: both should be WARN_ON_ONCE() I guess.

Anyway:

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>

  reply	other threads:[~2026-03-16 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 13:09 [PATCH v3] KVM: s390: vsie: Avoid injecting machine check on signal Christian Borntraeger
2026-03-16 13:13 ` Heiko Carstens [this message]
2026-03-16 13:42 ` Claudio Imbrenda
2026-03-16 13:57 ` Janosch Frank
2026-03-16 14:47   ` Christian Borntraeger
2026-03-16 15:11     ` Janosch Frank

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=20260316131358.17080E1f-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=thuth@redhat.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