From: Heiko Carstens <hca@linux.ibm.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, borntraeger@de.ibm.com,
nsg@linux.ibm.com, nrb@linux.ibm.com, frankja@linux.ibm.com,
seiden@linux.ibm.com, agordeev@linux.ibm.com, gor@linux.ibm.com,
kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH v1 1/1] s390/kvm: mask extra bits from program interrupt code
Date: Thu, 31 Oct 2024 16:24:48 +0100 [thread overview]
Message-ID: <20241031152448.8297-B-hca@linux.ibm.com> (raw)
In-Reply-To: <20241031140113.4123b8ee@p-imbrenda>
On Thu, Oct 31, 2024 at 02:01:13PM +0100, Claudio Imbrenda wrote:
> On Thu, 31 Oct 2024 13:38:15 +0100
> Heiko Carstens <hca@linux.ibm.com> wrote:
> > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> > > index 8b3afda99397..f2d1351f6992 100644
> > > --- a/arch/s390/kvm/kvm-s390.c
> > > +++ b/arch/s390/kvm/kvm-s390.c
> > > @@ -4737,7 +4737,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)
> > > if (kvm_s390_cur_gmap_fault_is_write())
> > > flags = FAULT_FLAG_WRITE;
> > >
> > > - switch (current->thread.gmap_int_code) {
> > > + switch (current->thread.gmap_int_code & PGM_INT_CODE_MASK) {
> >
> > Can you give an example? When reviewing your patch I was aware of this, but
> > actually thought we do want to know when this happens, since the kernel did
> > something which causes such bits to be set; e.g. single stepping with PER
> > on the sie instruction. If that happens then such program interruptions
> > should not be passed for kvm handling, since that would indicate a host
> > kernel bug (the sie instruction is not allowed to be single stepped).
> >
> > Or in other words: this should never happen. Of course I might have missed
> > something; so when could this happen where this is not a bug and the bits
> > should be ignored?
>
> in some cases some guest indication bits might be set when a
> host exception happens.
>
> I was also unaware of those and found out the hard way.
Thanks for explaining. Chances are that we need another patch to
address this for the vsie code as well (handle_fault()). But that
would be another patch.
Applied, thanks!
next prev parent reply other threads:[~2024-10-31 15:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 12:03 [PATCH v1 1/1] s390/kvm: mask extra bits from program interrupt code Claudio Imbrenda
2024-10-31 12:38 ` Heiko Carstens
2024-10-31 13:01 ` Claudio Imbrenda
2024-10-31 15:24 ` Heiko Carstens [this message]
2024-10-31 15:01 ` Christian Borntraeger
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=20241031152448.8297-B-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--cc=seiden@linux.ibm.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