From: Eric Farman <farman@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>,
qemu-devel@nongnu.org, qemu-s390x@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>,
Matthew Rosato <mjrosato@linux.ibm.com>,
David Hildenbrand <david@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Halil Pasic <pasic@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH 1/1] vfio-ccw: Keep passthrough sense data intact
Date: Fri, 11 Jun 2021 08:51:19 -0400 [thread overview]
Message-ID: <aba83201997c64ee11af5f1a5ca2ac2c76731a17.camel@linux.ibm.com> (raw)
In-Reply-To: <87fsxozoq4.fsf@redhat.com>
On Fri, 2021-06-11 at 12:21 +0200, Cornelia Huck wrote:
> On Fri, Jun 11 2021, Cornelia Huck <cohuck@redhat.com> wrote:
>
> > On Thu, Jun 10 2021, Eric Farman <farman@linux.ibm.com> wrote:
> > > diff --git a/hw/s390x/css.c b/hw/s390x/css.c
> > > index bed46f5ec3..29234daa27 100644
> > > --- a/hw/s390x/css.c
> > > +++ b/hw/s390x/css.c
> > > @@ -1661,7 +1661,8 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB
> > > *target_irb, int *irb_len)
> > > }
> > > /* If a unit check is pending, copy sense data. */
> > > if ((schib->scsw.dstat & SCSW_DSTAT_UNIT_CHECK) &&
> > > - (schib->pmcw.chars & PMCW_CHARS_MASK_CSENSE)) {
> > > + (schib->pmcw.chars & PMCW_CHARS_MASK_CSENSE) &&
> > > + (sch->sense_data[0] != 0)) {
> > > int i;
> > >
> > > irb.scsw.flags |= SCSW_FLAGS_MASK_ESWF |
> > > SCSW_FLAGS_MASK_ECTL;
>
> This function is where we build the esw/ecw...
>
> > > diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
> > > index 139a3d9d1b..a4dc4acb34 100644
> > > --- a/hw/vfio/ccw.c
> > > +++ b/hw/vfio/ccw.c
> > > @@ -371,12 +371,6 @@ static void
> > > vfio_ccw_io_notifier_handler(void *opaque)
> > > copy_scsw_to_guest(&s, &irb.scsw);
> > > schib->scsw = s;
> > >
> > > - /* If a uint check is pending, copy sense data. */
> > > - if ((schib->scsw.dstat & SCSW_DSTAT_UNIT_CHECK) &&
> > > - (schib->pmcw.chars & PMCW_CHARS_MASK_CSENSE)) {
>
> ...and here we actually do have the esw/ecw provided by the hardware.
>
> > If I'm reading the PoP correctly, turning on concurrent sense only
> > means
> > that we may have sense data already available, but not that it's
> > guaranteed.
Agreed.
> > Would it be enough to look at the relevant bit in the erw
> > and only copy sense data if it is actually set (here and/or above)?
Do we have the hardware ERW in the css_do_tsch routine?
Oh, but we have SCSW, and POPS says if ERW.S is set, SCSW.E is set. So
that would make this a pretty simple change then.
>
> Maybe the root of the problem is that we actually try to build the
> esw
> ourselves? If we copy it from the irb received by the hardware, we
> should already have the correct data, I think.
Yeah, that's part of the problem. As you note above, the PMCW.CSENSE
bit only says if concurrent sense is possible, not that it was actually
stored in the IRB.
I (mistakenly) thought that removing this hunk would get the whole IRB
copied over, but I see now that css_do_tsch_get_irb() only copies the
SCSW, and builds the ESW/ECW based off sch->sense_data.
>
> > > - memcpy(sch->sense_data, irb.ecw, sizeof(irb.ecw));
> > > - }
> > > -
> > > read_err:
> > > css_inject_io_interrupt(sch);
> > > }
next prev parent reply other threads:[~2021-06-11 12:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-10 20:20 [PATCH 0/1] vfio-ccw: Fix garbage sense data on I/O error Eric Farman
2021-06-10 20:20 ` [PATCH 1/1] vfio-ccw: Keep passthrough sense data intact Eric Farman
2021-06-11 7:15 ` Cornelia Huck
2021-06-11 10:21 ` Cornelia Huck
2021-06-11 12:51 ` Eric Farman [this message]
2021-06-11 14:37 ` Cornelia Huck
2021-06-10 20:25 ` [PATCH 0/1] vfio-ccw: Fix garbage sense data on I/O error Matthew Rosato
2021-06-10 20:38 ` Eric Farman
2021-06-11 7:12 ` Cornelia Huck
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=aba83201997c64ee11af5f1a5ca2ac2c76731a17.camel@linux.ibm.com \
--to=farman@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=mjrosato@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.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;
as well as URLs for NNTP newsgroup(s).