All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: "Zhang, Tina" <tina.zhang@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"zhenyuw@linux.intel.com" <zhenyuw@linux.intel.com>,
	"Yuan, Hang" <hang.yuan@intel.com>,
	"kraxel@redhat.com" <kraxel@redhat.com>,
	"intel-gvt-dev@lists.freedesktop.org" 
	<intel-gvt-dev@lists.freedesktop.org>,
	"Lv, Zhiyuan" <zhiyuan.lv@intel.com>
Subject: Re: [PATCH 1/2] vfio: ABI for setting mdev display flip eventfd
Date: Mon, 27 May 2019 22:18:31 -0600	[thread overview]
Message-ID: <20190527221831.71bddcc5@x1.home> (raw)
In-Reply-To: <237F54289DF84E4997F34151298ABEBC87620FF2@SHSMSX101.ccr.corp.intel.com>

On Tue, 28 May 2019 01:42:57 +0000
"Zhang, Tina" <tina.zhang@intel.com> wrote:

> > -----Original Message-----
> > From: intel-gvt-dev [mailto:intel-gvt-dev-bounces@lists.freedesktop.org] On
> > Behalf Of Alex Williamson
> > Sent: Monday, May 27, 2019 10:05 PM
> > To: Zhang, Tina <tina.zhang@intel.com>
> > Cc: kvm@vger.kernel.org; linux-kernel@vger.kernel.org;
> > zhenyuw@linux.intel.com; Yuan, Hang <hang.yuan@intel.com>;
> > kraxel@redhat.com; intel-gvt-dev@lists.freedesktop.org; Lv, Zhiyuan
> > <zhiyuan.lv@intel.com>
> > Subject: Re: [PATCH 1/2] vfio: ABI for setting mdev display flip eventfd
> > 
> > On Mon, 27 May 2019 16:43:11 +0800
> > Tina Zhang <tina.zhang@intel.com> wrote:
> >   
> > > Add VFIO_DEVICE_SET_GFX_FLIP_EVENTFD ioctl command to set eventfd
> > > based signaling mechanism to deliver vGPU framebuffer page flip event
> > > to userspace.
> > >
> > > Signed-off-by: Tina Zhang <tina.zhang@intel.com>
> > > ---
> > >  include/uapi/linux/vfio.h | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > >
> > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> > > index 02bb7ad6e986..27300597717f 100644
> > > --- a/include/uapi/linux/vfio.h
> > > +++ b/include/uapi/linux/vfio.h
> > > @@ -696,6 +696,18 @@ struct vfio_device_ioeventfd {
> > >
> > >  #define VFIO_DEVICE_IOEVENTFD		_IO(VFIO_TYPE, VFIO_BASE +  
> > 16)  
> > >
> > > +/**
> > > + * VFIO_DEVICE_SET_GFX_FLIP_EVENTFD - _IOW(VFIO_TYPE, VFIO_BASE  
> > + 17,  
> > > +__s32)
> > > + *
> > > + * Set eventfd based signaling mechanism to deliver vGPU framebuffer
> > > +page
> > > + * flip event to userspace. A value of -1 is used to stop the page
> > > +flip
> > > + * delivering.
> > > + *
> > > + * Return: 0 on success, -errno on failure.
> > > + */
> > > +
> > > +#define VFIO_DEVICE_SET_GFX_FLIP_EVENTFD _IO(VFIO_TYPE,  
> > VFIO_BASE +  
> > > +17)
> > > +
> > >  /* -------- API for Type1 VFIO IOMMU -------- */
> > >
> > >  /**  
> > 
> > Why can't we use VFIO_DEVICE_SET_IRQS for this?  We can add a capability
> > to vfio_irq_info in the same way that we did for regions to describe device
> > specific IRQ support.  Thanks,  
> Add a new kind of index, like this?
> enum {
>         VFIO_PCI_INTX_IRQ_INDEX,
>         VFIO_PCI_MSI_IRQ_INDEX,
>         VFIO_PCI_MSIX_IRQ_INDEX,
>         VFIO_PCI_ERR_IRQ_INDEX,
>         VFIO_PCI_REQ_IRQ_INDEX,
> +      VFIO_PCI_GFX_FLIP_EVENT_INDEX,
>         VFIO_PCI_NUM_IRQS
> };
> Perhaps this is what we don't want. This
> VFIO_PCI_GFX_FLIP_EVENT_INDEX is specific to graphics card and it's
> actually an event which is reported by INTX/MSI/ MSIX IRQ. Thanks.

Right, that is not what I'm suggesting.  What I'm looking for is a
similar conversion to what we did for regions, where we extended the
data returned in GET_REGION_INFO to include capabilities
(c84982adb23b), capped the number of regions we define with fixed
indexes (c7bb4cb40f89), and added device specific regions, such as IGD
OpRegion (5846ff54e87d) and IGD host and LPC bridges (f572a960a15e).
The same thing should happen here, the current value of
VFIO_PCI_NUM_IRQS becomes fixed and part of the vfio-pci ABI,
vfio_irq_info is extended with capability support following the same
mechanism, headers, and helpers we use for regions, then the mdev device
simply exposes the extended (and backwards compatible) API without
requiring a device specific ioctl.  Thanks,

Alex

  reply	other threads:[~2019-05-28  4:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27  8:43 [PATCH 0/2] Deliver vGPU page flip event to userspace Tina Zhang
2019-05-27  8:43 ` [PATCH 1/2] vfio: ABI for setting mdev display flip eventfd Tina Zhang
2019-05-27  9:07   ` Zhenyu Wang
2019-05-27 12:22     ` Gerd Hoffmann
2019-05-28  2:51       ` Zhenyu Wang
2019-05-27 14:04   ` Alex Williamson
2019-05-28  1:42     ` Zhang, Tina
2019-05-28  4:18       ` Alex Williamson [this message]
2019-05-27  8:43 ` [PATCH 2/2] drm/i915/gvt: Support delivering page flip event to userspace Tina Zhang
2019-05-27  9:11   ` Zhenyu Wang

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=20190527221831.71bddcc5@x1.home \
    --to=alex.williamson@redhat.com \
    --cc=hang.yuan@intel.com \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tina.zhang@intel.com \
    --cc=zhenyuw@linux.intel.com \
    --cc=zhiyuan.lv@intel.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 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.