public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Farman <farman@linux.ibm.com>
To: Christian Borntraeger <borntraeger@linux.ibm.com>,
	Hendrik Brueckner <brueckner@linux.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	David Hildenbrand <david@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH v1 2/4] KVM: s390: vsie: Disable some bits when in ESA mode
Date: Wed, 01 Apr 2026 09:46:02 -0400	[thread overview]
Message-ID: <ca84cb51f1d4f6520012ef2e2df475a5d2a344f2.camel@linux.ibm.com> (raw)
In-Reply-To: <91feaccb-9d28-4519-8e89-43f75e88b8bd@linux.ibm.com>

On Wed, 2026-04-01 at 14:58 +0200, Christian Borntraeger wrote:
> 
> Am 01.04.26 um 04:09 schrieb Eric Farman:
> > In the event that a nested guest is put in ESA mode,
> > ensure that some bits are scrubbed from the shadow SCB.
> > 
> > Signed-off-by: Eric Farman <farman@linux.ibm.com>
> 
> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> apart from one thing below
> 
> > ---
> >   arch/s390/kvm/vsie.c | 14 ++++++++++++++
> >   1 file changed, 14 insertions(+)
> > 
> > diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
> > index 888370a02ef7..584fc7803632 100644
> > --- a/arch/s390/kvm/vsie.c
> > +++ b/arch/s390/kvm/vsie.c
> > @@ -387,6 +387,17 @@ static int shadow_crycb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
> >   	return 0;
> >   }
> >   
> > +static void shadow_esa(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
> > +{
> > +	struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s;
> > +
> > +	/* Ensure these bits are indeed turned off */
> > +	scb_s->eca &= ~ECA_VX;
> > +	scb_s->ecb &= ~ECB_GS;
> > +	scb_s->ecb3 &= ~ECB3_RI;
> > +	scb_s->ecd &= ~ECD_HOSTREGMGMT;
> 
> shouldnt we also remove the TE bit (transactional execution)?

Ahh, good point. Yeah, that should be removed.

@Janosch, I'll spin a quick v2 with this and the other nits, so you don't have to do the fixups.
Just want to doublecheck this one.

> 
> > +}
> > +
> >   /* shadow (round up/down) the ibc to avoid validity icpt */
> >   static void prepare_ibc(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
> >   {
> > @@ -590,6 +601,9 @@ static int shadow_scb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
> >   	scb_s->hpid = HPID_VSIE;
> >   	scb_s->cpnc = scb_o->cpnc;
> >   
> > +	if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_ZARCH))
> > +		shadow_esa(vcpu, vsie_page);
> > +
> >   	prepare_ibc(vcpu, vsie_page);
> >   	rc = shadow_crycb(vcpu, vsie_page);
> >   out:

  reply	other threads:[~2026-04-01 13:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01  2:09 [PATCH v1 0/4] KVM: s390: Permit ESA mode guests in VSIE Eric Farman
2026-04-01  2:09 ` [PATCH v1 1/4] KVM: s390: vsie: Allow non-zarch guests Eric Farman
2026-04-01 11:25   ` Janosch Frank
2026-04-01 13:31     ` Eric Farman
2026-04-01  2:09 ` [PATCH v1 2/4] KVM: s390: vsie: Disable some bits when in ESA mode Eric Farman
2026-04-01 12:58   ` Christian Borntraeger
2026-04-01 13:46     ` Eric Farman [this message]
2026-04-01 14:50       ` Janosch Frank
2026-04-01  2:09 ` [PATCH v1 3/4] KVM: s390: vsie: Accommodate ESA prefix pages Eric Farman
2026-04-01 11:45   ` Janosch Frank
2026-04-01 13:44     ` Eric Farman
2026-04-01  2:09 ` [PATCH v1 4/4] KVM: s390: Add KVM capability for ESA mode guests Eric Farman
2026-04-01 11:52   ` Janosch Frank
2026-04-01  6:40 ` [PATCH v1 0/4] KVM: s390: Permit ESA mode guests in VSIE Christoph Hellwig
2026-04-01 10:00   ` Janosch Frank
2026-04-06  5:37     ` Christoph Hellwig

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=ca84cb51f1d4f6520012ef2e2df475a5d2a344f2.camel@linux.ibm.com \
    --to=farman@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=brueckner@linux.ibm.com \
    --cc=corbet@lwn.net \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=skhan@linuxfoundation.org \
    /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