All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Halil Pasic <pasic@linux.ibm.com>
Cc: qemu-s390x@nongnu.org, Jason Herne <jjherne@linux.ibm.com>,
	Eric Farman <farman@linux.ibm.com>,
	qemu-devel@nongnu.org, Jared Rossi <jrossi@linux.ibm.com>
Subject: Re: [RFC PATCH v1 1/8] vfio-ccw: Return IOINST_CC_NOT_OPERATIONAL for EIO
Date: Wed, 20 Nov 2019 11:11:55 +0100	[thread overview]
Message-ID: <20191120111155.200b3a2c.cohuck@redhat.com> (raw)
In-Reply-To: <20191119185911.0ccec0c9.pasic@linux.ibm.com>

On Tue, 19 Nov 2019 18:59:11 +0100
Halil Pasic <pasic@linux.ibm.com> wrote:

> On Tue, 19 Nov 2019 13:02:20 +0100
> Cornelia Huck <cohuck@redhat.com> wrote:
> 
> > On Tue, 19 Nov 2019 12:23:40 +0100
> > Halil Pasic <pasic@linux.ibm.com> wrote:
> >   
> > > On Mon, 18 Nov 2019 19:13:34 +0100
> > > Cornelia Huck <cohuck@redhat.com> wrote:
> > >   
> > > > > EIO is returned by vfio-ccw mediated device when the backing
> > > > > host subchannel is not operational anymore. So return cc=3
> > > > > back to the guest, rather than returning a unit check.
> > > > > This way the guest can take appropriate action such as
> > > > > issue an 'stsch'.      
> > > > 
> > > > Hnm, I'm trying to recall whether that was actually a conscious choice,
> > > > but I can't quite remember... the change does make sense at a glance,
> > > > however.    
> > > 
> > > Is EIO returned if and only if the host subchannel/device is not
> > > operational any more, or are there cases as well?   
> > 
> > Ok, I walked through the kernel code, and it seems -EIO can happen  
> 
> Thanks Connie for having a look.
> 
> > - when we try to do I/O while in the NOT_OPER or STANDBY states... cc 3
> >   makes sense in those cases  
> 
> I do understand NOT_OPER, but I'm not sure about STANDBY.
> 
> Here is what the PoP says about cc 3 for SSCH.
> """
> Condition code 3 is set, and no other action is
> taken, when the subchannel is not operational for
> START SUBCHANNEL. A subchannel is not opera-
> tional for START SUBCHANNEL if the subchannel is
> not provided in the channel subsystem, has no valid
> device number associated with it, or is not enabled.
> """
> 
> Are we guaranteed to reflect one of these conditions back?
> 
> Under what circumstances do we expect that our request will
> find the device in STANDBY?

IIRC, the subchannel is not enabled when the device is in STANDBY?

Anyway, it seems the check here is more like a safety measure, in case
we messed up.

> 
> > - when the cp is not initialized when trying to fetch the orb... which
> >   is an internal vfio-ccw kernel module error  
> 
> 
> So the answer seems to be, no EIO is also used for something else than
> 'device not operational' in a sense of the s390 IO architecture (cc=3
> and stuff).
> 
> AFAIR the idea was that EIO means something is broken, and we decided
> to reflect that as an unit check (because the broader device -- the
> actual device + our pass-through code == device for the guest) is broken.
> So I think it was a conscious choice.

Hm, if you put it like that... maybe leaving it as -EIO makes more sense.

The main question is: What happens if userspace triggers I/O to be
started and we find the device to have become not operational? Can we
even switch the state to NOT_OPER before we try the ssch (which will
fail with cc 3)? If not, it's probably safe to leave the -EIO in place.



  reply	other threads:[~2019-11-20 10:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15  3:34 [RFC PATCH v1 0/8] s390x/vfio-ccw: Channel Path Handling Eric Farman
2019-11-15  3:34 ` [RFC PATCH v1 1/8] vfio-ccw: Return IOINST_CC_NOT_OPERATIONAL for EIO Eric Farman
2019-11-18 18:13   ` Cornelia Huck
2019-11-19 11:23     ` Halil Pasic
2019-11-19 12:02       ` Cornelia Huck
2019-11-19 15:42         ` Eric Farman
2019-11-19 17:59         ` Halil Pasic
2019-11-20 10:11           ` Cornelia Huck [this message]
2019-11-19 15:49     ` Eric Farman
2019-11-15  3:34 ` [RFC PATCH v1 2/8] vfio-ccw: Don't inject an I/O interrupt if the subchannel is not enabled Eric Farman
2019-11-18 18:23   ` Cornelia Huck
2019-11-19 15:47     ` Eric Farman
2019-11-15  3:34 ` [RFC PATCH v1 3/8] linux-headers: update Eric Farman
2019-11-15  3:34 ` [RFC PATCH v1 4/8] vfio-ccw: Refactor cleanup of regions Eric Farman
2019-11-20 10:31   ` Cornelia Huck
2019-11-15  3:34 ` [RFC PATCH v1 5/8] vfio-ccw: Add support for the schib region Eric Farman
2019-11-20 11:13   ` Cornelia Huck
2020-01-31 20:15     ` Eric Farman
2020-02-03 10:43       ` Cornelia Huck
2019-11-15  3:34 ` [RFC PATCH v1 6/8] vfio-ccw: Add support for the crw region Eric Farman
2019-11-20 12:30   ` Cornelia Huck
2019-11-15  3:34 ` [RFC PATCH v1 7/8] vfio-ccw: Refactor ccw irq handler Eric Farman
2019-11-20 12:39   ` Cornelia Huck
2019-12-03 20:01     ` Eric Farman
2019-11-15  3:34 ` [RFC PATCH v1 8/8] vfio-ccw: Add support for the CRW irq Eric Farman
2019-11-20 12:50   ` 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=20191120111155.200b3a2c.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=jjherne@linux.ibm.com \
    --cc=jrossi@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.