All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Johnson <john.g.johnson@oracle.com>
To: John Levon <levon@movementarian.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Walker, Benjamin" <benjamin.walker@intel.com>,
	"Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
	"Swapnil Ingle" <swapnil.ingle@nutanix.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Christophe de Dinechin" <cdupontd@redhat.com>,
	"Kirti Wankhede" <kwankhede@nvidia.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Raphael Norwitz" <raphael.norwitz@nutanix.com>,
	"Jag Raman" <jag.raman@oracle.com>,
	"Harris, James R" <james.r.harris@intel.com>,
	"John Levon" <john.levon@nutanix.com>,
	"Kanth Ghatraju" <kanth.ghatraju@oracle.com>,
	"Felipe Franciosi" <felipe@nutanix.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Yan Zhao" <yan.y.zhao@intel.com>,
	"Konrad Wilk" <konrad.wilk@oracle.com>,
	"yuvalkashtan@gmail.com" <yuvalkashtan@gmail.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"eafanasova@gmail.com" <eafanasova@gmail.com>,
	"ismael@linux.com" <ismael@linux.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Liu, Changpeng" <changpeng.liu@intel.com>,
	"tomassetti.andrea@gmail.com" <tomassetti.andrea@gmail.com>,
	"mpiszczek@ddn.com" <mpiszczek@ddn.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	"Zhang, Tina" <tina.zhang@intel.com>,
	"Lu,  Xiuchun" <xiuchun.lu@intel.com>,
	"Thanos Makatos" <thanos.makatos@nutanix.com>
Subject: Re: [PATCH v8] introduce vfio-user protocol specification
Date: Wed, 12 May 2021 05:08:29 +0000	[thread overview]
Message-ID: <59CFBE8E-3B92-4918-B68F-096CB25F84A6@oracle.com> (raw)
In-Reply-To: <20210510222541.GA1916565@li1368-133.members.linode.com>



> On May 10, 2021, at 3:25 PM, John Levon <levon@movementarian.org> wrote:
> 
> On Mon, May 10, 2021 at 05:57:37PM +0100, Stefan Hajnoczi wrote:
> 
> 
>>> +VFIO_USER_VM_INTERRUPT
>>> +----------------------
>>> +
>>> +Message format
>>> +^^^^^^^^^^^^^^
>>> +
>>> ++----------------+------------------------+
>>> +| Name           | Value                  |
>>> ++================+========================+
>>> +| Message ID     | <ID>                   |
>>> ++----------------+------------------------+
>>> +| Command        | 13                     |
>>> ++----------------+------------------------+
>>> +| Message size   | 20                     |
>>> ++----------------+------------------------+
>>> +| Flags          | Reply bit set in reply |
>>> ++----------------+------------------------+
>>> +| Error          | 0/errno                |
>>> ++----------------+------------------------+
>>> +| Interrupt info | <interrupt>            |
>>> ++----------------+------------------------+
>>> +
>>> +This command message is sent from the server to the client to signal the device
>>> +has raised an interrupt.
>> 
>> Except if the client set up irq eventfds?
> 
> Clarified.
> 
>>> +Interrupt info format
>>> +^^^^^^^^^^^^^^^^^^^^^
>>> +
>>> ++-----------+--------+------+
>>> +| Name      | Offset | Size |
>>> ++===========+========+======+
>>> +| Sub-index | 16     | 4    |
>>> ++-----------+--------+------+
>>> +
>>> +* *Sub-index* is relative to the IRQ index, e.g., the vector number used in PCI
>>> +  MSI/X type interrupts.
>> 
>> Hmm...this is weird. The server tells the client to raise an MSI-X
>> interrupt but does not include the MSI message that resides in the MSI-X
>> table BAR device region? Or should MSI-X interrupts be delivered to the
>> client via VFIO_USER_DMA_WRITE instead?
>> 
>> (Basically it's not clear to me how MSI-X interrupts would work with
>> vfio-user. Reading how they work in kernel VFIO might let me infer it,
>> but it's probably worth explaining this clearly in the spec.)
> 
> It doesn't. We don't have an implementation, and the qemu patches don't get this
> right either - it treats the sub-index as the IRQ index AKA IRQ type.
> 
> I'd be inclined to just remove this for now, until we have an implementation.
> Thoughts?
> 

	VFIO will set up 2 eventfds for each enabled MSI/X vector.  One is
terminated in KVM for direct injection into the guest.  The other terminates
back in QEMU, and triggers MSI/X SW emulation.  When informing the kernel of
which FDs to use, VFIO prefers the KVM FD, the QMEU one is only used if the
KVM one can’t be created (or is disabled by command line option)

	VFIO_USER_INTERRUPT would need an vector number in the request.  I
noticed this when I did the client, but delayed it because of what JohnL said
in another email: VFIO_USER_INTERRUPT is only be needed if the client and server
are in different VMs and can’t use eventfds.

	I’m fine with removing it for 1.0, since we don’t support cross-VM
emulation yet.

								JJ


  parent reply	other threads:[~2021-05-12  5:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 11:41 [PATCH v8] introduce vfio-user protocol specification Thanos Makatos
2021-04-26 15:48 ` Stefan Hajnoczi
2021-04-27 12:02   ` Thanos Makatos
2021-04-27 15:01     ` Stefan Hajnoczi
2021-05-04 13:51 ` Stefan Hajnoczi
2021-05-04 14:31   ` John Levon
2021-05-05 15:51     ` Stefan Hajnoczi
2021-06-14  9:57     ` Thanos Makatos
2021-05-05 16:19   ` John Levon
2021-05-06  8:49     ` Stefan Hajnoczi
2021-05-07 16:10     ` Thanos Makatos
2021-06-14 10:07   ` Thanos Makatos
2021-05-10 16:57 ` Stefan Hajnoczi
2021-05-10 22:25   ` John Levon
2021-05-11 10:09     ` Stefan Hajnoczi
2021-05-11 10:43       ` John Levon
2021-05-11 15:40         ` Stefan Hajnoczi
2021-05-12  5:08     ` John Johnson [this message]
2021-05-19 21:08 ` Alex Williamson
2021-05-19 22:38   ` John Levon
2021-06-14  9:47     ` Thanos Makatos

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=59CFBE8E-3B92-4918-B68F-096CB25F84A6@oracle.com \
    --to=john.g.johnson@oracle.com \
    --cc=alex.williamson@redhat.com \
    --cc=benjamin.walker@intel.com \
    --cc=cdupontd@redhat.com \
    --cc=changpeng.liu@intel.com \
    --cc=cohuck@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eafanasova@gmail.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=felipe@nutanix.com \
    --cc=ismael@linux.com \
    --cc=jag.raman@oracle.com \
    --cc=james.r.harris@intel.com \
    --cc=jasowang@redhat.com \
    --cc=john.levon@nutanix.com \
    --cc=kanth.ghatraju@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kraxel@redhat.com \
    --cc=kwankhede@nvidia.com \
    --cc=levon@movementarian.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=mpiszczek@ddn.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael.norwitz@nutanix.com \
    --cc=stefanha@redhat.com \
    --cc=swapnil.ingle@nutanix.com \
    --cc=thanos.makatos@nutanix.com \
    --cc=tina.zhang@intel.com \
    --cc=tomassetti.andrea@gmail.com \
    --cc=xiuchun.lu@intel.com \
    --cc=yan.y.zhao@intel.com \
    --cc=yuvalkashtan@gmail.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.