From: Cornelia Huck <cohuck@redhat.com>
To: Eric Farman <farman@linux.ibm.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>,
Eric Farman <farman@linux.ibm.com>,
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 12:21:07 +0200 [thread overview]
Message-ID: <87fsxozoq4.fsf@redhat.com> (raw)
In-Reply-To: <87lf7gzxbh.fsf@redhat.com>
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. 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)?
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.
>
>> - 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 10:22 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 [this message]
2021-06-11 12:51 ` Eric Farman
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=87fsxozoq4.fsf@redhat.com \
--to=cohuck@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=david@redhat.com \
--cc=farman@linux.ibm.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).