qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Tiwei Bie <tiwei.bie@intel.com>,
	jasowang@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master
Date: Wed, 12 Sep 2018 10:34:43 -0600	[thread overview]
Message-ID: <20180912103443.3dd703a6@t450s.home> (raw)
In-Reply-To: <20180912121306-mutt-send-email-mst@kernel.org>

On Wed, 12 Sep 2018 12:14:44 -0400
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Wed, Sep 12, 2018 at 04:04:00PM +0800, Tiwei Bie wrote:
> > On Mon, Jul 30, 2018 at 12:30:58PM +0300, Michael S. Tsirkin wrote:
> > [...]  
> > > 
> > > I generally wonder how are restarts of the backend handled
> > > with this approach: closing the VFIO device tends to reset
> > > the whole device.  
> > 
> > Hi Michael,
> > 
> > I missed this comment previously.. This is a good point!
> > In this RFC, before sending the VFIO group fd to QEMU,
> > backend needs to close the VFIO device and unset the VFIO
> > container first. Otherwise, QEMU won't be able to set the
> > VFIO container for the VFIO group.
> > 
> > Another option is to share the container fd instead of
> > the group fd to QEMU. In this case, backend won't need
> > to close any fd. But there is one problem that, it's
> > hard to unmap the old mappings, especially when QEMU
> > crashes.  
> 
> What are these old mappings and who creates them?
> If you want to just reset everything the way it was
> on open, surely it would be easy to add such a reset ioctl.
> 
> > Do you have any suggestions? Thanks!
> > 
> > Best regards,
> > Tiwei Bie  
> 
> Donnu. Alex, any thoughts? Which approach would you prefer?

The existing UNMAP_DMA ioctl for the vfio type1 IOMMU only requires
that an unmap does not bisect previous mappings, ie. a previous mapping
cannot be partially unmapped.  Therefore you can already dump the
entire IOVA space for a container with one UNMAP_DMA call, iova = 0,
size = (u64)-1.  Thanks,

Alex

  reply	other threads:[~2018-09-12 16:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23  4:59 [Qemu-devel] [RFC 0/3] Supporting programming IOMMU in QEMU (vDPA/vhost-user) Tiwei Bie
2018-07-23  4:59 ` [Qemu-devel] [RFC 1/3] vfio: split vfio_get_group() into small functions Tiwei Bie
2018-07-23  4:59 ` [Qemu-devel] [RFC 2/3] vfio: support getting VFIOGroup from groupfd Tiwei Bie
2018-07-23  4:59 ` [Qemu-devel] [RFC 3/3] vhost-user: support programming VFIO group in master Tiwei Bie
2018-07-23  9:19   ` Michael S. Tsirkin
2018-07-23 11:59     ` Tiwei Bie
2018-07-23  9:20   ` Michael S. Tsirkin
2018-07-23 12:04     ` Tiwei Bie
2018-07-26 20:45   ` Alex Williamson
2018-07-27  1:58     ` Tiwei Bie
2018-07-27 20:03       ` Alex Williamson
2018-07-30  8:10         ` Tiwei Bie
2018-07-30  9:30           ` Michael S. Tsirkin
2018-07-30 16:20             ` Alex Williamson
2018-07-31  7:47             ` Tiwei Bie
2018-09-12  8:04             ` Tiwei Bie
2018-09-12 16:14               ` Michael S. Tsirkin
2018-09-12 16:34                 ` Alex Williamson [this message]
2018-09-12 16:44                   ` Michael S. Tsirkin
2018-09-12 17:15                     ` Alex Williamson
2018-09-12 17:29                       ` Michael S. Tsirkin
2018-09-12 18:09                         ` Alex Williamson
2018-09-13  5:26                           ` Tian, Kevin

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=20180912103443.3dd703a6@t450s.home \
    --to=alex.williamson@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tiwei.bie@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 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).