All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: Pierre Morel <pmorel@linux.vnet.ibm.com>,
	Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	kvm@vger.kernel.org, qemu-devel@nongnu.org,
	qemu-s390x@nongnu.org, borntraeger@de.ibm.com,
	pasic@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [RFC PATCH 1/3] vfio: ccw: introduce schib region
Date: Tue, 16 Jan 2018 11:03:40 +0800	[thread overview]
Message-ID: <20180116030340.GD12499@bjsdjshi@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180115132422.6a1a805d.cohuck@redhat.com>

* Cornelia Huck <cohuck@redhat.com> [2018-01-15 13:24:22 +0100]:

> On Mon, 15 Jan 2018 10:50:00 +0100
> Pierre Morel <pmorel@linux.vnet.ibm.com> wrote:
> 
> > On 11/01/2018 04:04, Dong Jia Shi wrote:
> > > This introduces a new region for vfio-ccw to provide subchannel
> > > information for user space.
> > >
> > > Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
> > > ---
> > >   drivers/s390/cio/vfio_ccw_fsm.c     | 21 ++++++++++
> > >   drivers/s390/cio/vfio_ccw_ops.c     | 79 +++++++++++++++++++++++++++----------
> > >   drivers/s390/cio/vfio_ccw_private.h |  3 ++
> > >   include/uapi/linux/vfio.h           |  1 +
> > >   include/uapi/linux/vfio_ccw.h       |  6 +++
> > >   5 files changed, 90 insertions(+), 20 deletions(-)
> > >
> 
> > > diff --git a/drivers/s390/cio/vfio_ccw_private.h b/drivers/s390/cio/vfio_ccw_private.h
> > > index 78a66d96756b..460c8b90d834 100644
> > > --- a/drivers/s390/cio/vfio_ccw_private.h
> > > +++ b/drivers/s390/cio/vfio_ccw_private.h
> > > @@ -28,6 +28,7 @@
> > >    * @mdev: pointer to the mediated device
> > >    * @nb: notifier for vfio events
> > >    * @io_region: MMIO region to input/output I/O arguments/results
> > > + * @schib_region: MMIO region of subchannel information
> > >    * @cp: channel program for the current I/O operation
> > >    * @irb: irb info received from interrupt
> > >    * @scsw: scsw info
> > > @@ -42,6 +43,7 @@ struct vfio_ccw_private {
> > >   	struct mdev_device	*mdev;
> > >   	struct notifier_block	nb;
> > >   	struct ccw_io_region	io_region;
> > > +	struct ccw_schib_region	schib_region;
> > >
> > >   	struct channel_program	cp;
> > >   	struct irb		irb;  
> > 
> > Hi,
> > 
> > I have a problem with these patches: you have 3 definitions for the 
> > subchannel status word:
> > 1: direct in the scsw entry of the vfio_ccw_private structure
> > 2: indirect in the IRB structure irb
> > 3: now in the scsw of the schib_region
> > 
> > How do you keep them all in sync?
> > 
For the first two cases, we might need to keep them synced in the kernel
if upper level application requires. Otherwise, we can let upper level
application do the sync.

The 3rd one is used only as an input parameter to indicate function
types. To be more specific, we currently only has interests for its
Function Control field. So, sync of this one is not applicable.

> > The direct scsw in io region seems to only serve as a trigger used by 
> > userland, while
> > the IRB in the io region and the SCHIB in the schib region are updated 
> > asynchronously,
> > from hardware, one by polling (scsw in schib region), one by IRQ (scsw 
> > in irb in io region).
> > 
> > I find this at least a source for obfuscation.
> 
> I agree that this wants some more documentation.
Ok.

> 
> However, some of this structure duplication is a consequence of the
> hardware design, because the scsw is present in both the schib (updated
> by stsch) and the irb (updated by tsch). There are cases where the irb
> is simply not enough (it does not contain a pmcw, and you can only do
> tsch on an enabled subchannel). So I think that we really need two
> structures for those two distinct operations (and everything
> interfacing with this needs to keep synced on the scsw, as current
> users of stsch/tsch already need to do now).
> 
Nod.

> The direct scsw entry is used for initiating the different functions
> (only start right now), I don't really see a good alternative for that
> (and I also don't really see any problem with needed syncing.)
> 
+1

-- 
Dong Jia Shi

  reply	other threads:[~2018-01-16  3:03 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  3:04 [RFC PATCH 0/3] vfio: ccw: basic channel path event handling Dong Jia Shi
2018-01-11  3:04 ` [Qemu-devel] " Dong Jia Shi
2018-01-11  3:04 ` [RFC PATCH 1/3] vfio: ccw: introduce schib region Dong Jia Shi
2018-01-11  3:04   ` [Qemu-devel] " Dong Jia Shi
2018-01-11 14:16   ` Cornelia Huck
2018-01-11 14:16     ` [Qemu-devel] " Cornelia Huck
2018-01-15  6:43     ` Dong Jia Shi
2018-01-15 10:24       ` Cornelia Huck
2018-01-15 10:24         ` [Qemu-devel] " Cornelia Huck
2018-01-15  9:50   ` Pierre Morel
2018-01-15  9:50     ` [Qemu-devel] " Pierre Morel
2018-01-15 12:24     ` Cornelia Huck
2018-01-15 12:24       ` [Qemu-devel] " Cornelia Huck
2018-01-16  3:03       ` Dong Jia Shi [this message]
2018-01-11  3:04 ` [RFC PATCH 2/3] vfio: ccw: introduce channel path irq Dong Jia Shi
2018-01-11  3:04   ` [Qemu-devel] " Dong Jia Shi
2018-01-11  3:04 ` [RFC PATCH 3/3] vfio: ccw: handle chp event Dong Jia Shi
2018-01-11  3:04   ` [Qemu-devel] " Dong Jia Shi
2018-01-11 10:54 ` [RFC PATCH 0/3] vfio: ccw: basic channel path event handling Cornelia Huck
2018-01-11 10:54   ` [Qemu-devel] " Cornelia Huck
2018-01-15  8:57   ` Dong Jia Shi
2018-01-15 10:21     ` Pierre Morel
2018-01-15 10:21       ` [Qemu-devel] " Pierre Morel
2018-01-16  3:16       ` Dong Jia Shi
2018-01-16 15:53         ` Cornelia Huck
2018-01-16 15:53           ` [Qemu-devel] " Cornelia Huck
2018-01-12 18:10 ` Halil Pasic
2018-01-15  8:59   ` Dong Jia Shi
2018-01-16 15:57     ` Halil Pasic
2018-01-23  6:23       ` Dong Jia Shi
2018-01-25 11:12         ` Cornelia Huck
2018-01-25 12:56         ` Halil Pasic
2018-01-25 12:56           ` Halil Pasic
2018-01-30  3:37           ` Dong Jia Shi
2018-01-30  3:44             ` Dong Jia Shi
2018-01-30  3:44             ` [Qemu-devel] " Dong Jia Shi
2018-01-30  5:27           ` Dong Jia Shi

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=20180116030340.GD12499@bjsdjshi@linux.vnet.ibm.com \
    --to=bjsdjshi@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=pmorel@linux.vnet.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.