All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>,
	yi.l.liu@intel.com, qemu-devel@nongnu.org,
	Peter Xu <peterx@redhat.com>,
	Jintack Lim <jintack@cs.columbia.edu>
Subject: Re: [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev
Date: Thu, 9 Mar 2017 17:29:12 +0200	[thread overview]
Message-ID: <20170309172619-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <d7bd30e6-c166-24c8-3cf2-31bb0d4f6525@redhat.com>

On Thu, Mar 09, 2017 at 01:31:45PM +0100, Paolo Bonzini wrote:
> 
> 
> On 23/02/2017 16:35, Alex Williamson wrote:
> > It's the architecture of vfio, the user only gets access to the device
> > when the container has iommu protection, therefore vfio needs to look
> > at the device address space to determine if it can share a container
> > with other devices.  Without an iommu all devices share the system
> > address space and use the same container.  With an iommu, each device
> > is in a separate address space and each gets its own container.
> > Without a container, the user doesn't get access to the device.
> > Deferring the address space to machine done would essentially defer the
> > entire vfio device initialization or else we'd need to close the
> > device and re-open and initialize it through a new container at that
> > time.  Thanks,
> 
> If you used only one container you could still provide a working VFIO
> configuration to the guest, even if the guest had an IOMMU.  All devices
> ending up in one IOMMU domain is not particularly useful, but it would work.
> 
> If VFIO had an iommu property, to be used like "-device
> intel_iommu,id=iommu0 -device vfio-pci,iommu=iommu0", It could tell VFIO
> to use separate containers and also ensure proper ordering of command
> line arguments.
> 
> Paolo

Lots of guests can't handle arbitrary stuff like this though.
Normally IOMMU attaches to a bus and that's the only bus it can
handle and that's the only IOMMU that can handle the devices
on this bus.

It's a fact of life that not all hardware dependencies are in a form of
a bus-device relashionship, while modelling it as a bus internally might
be feasible exposing that to users seems risky and confusing as that's
our artifact.

-- 
MST

  reply	other threads:[~2017-03-09 15:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22  5:49 [Qemu-devel] [PATCH] intel_iommu: make sure its init before PCI dev Peter Xu
2017-02-22 11:42 ` Jintack Lim
2017-02-22 13:37   ` Jintack Lim
2017-02-23  2:35     ` Peter Xu
2017-02-22 17:30 ` Alex Williamson
2017-02-23  3:06   ` Peter Xu
2017-02-23  3:24     ` Alex Williamson
2017-02-23  5:42       ` Peter Xu
2017-02-23 23:26         ` Michael S. Tsirkin
2017-02-23  8:10     ` Marcel Apfelbaum
2017-02-23  8:16       ` Peter Xu
2017-02-23 12:02         ` Marcel Apfelbaum
2017-02-23 15:35           ` Alex Williamson
2017-02-28 14:37             ` Marcel Apfelbaum
2017-03-09 12:31             ` Paolo Bonzini
2017-03-09 15:29               ` Michael S. Tsirkin [this message]
2017-03-09 15:34                 ` Paolo Bonzini
2017-02-23 23:21 ` Michael S. Tsirkin
2017-02-24  2:45   ` Peter Xu

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=20170309172619-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=jintack@cs.columbia.edu \
    --cc=marcel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yi.l.liu@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.