qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: Alexey Kardashevskiy <aik@au1.ibm.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Paul Mackerras <pmac@au1.ibm.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	David Gibson <dwg@au1.ibm.com>, chrisw <chrisw@sous-sol.org>,
	iommu <iommu@lists.linux-foundation.org>,
	Avi Kivity <avi@redhat.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"benve@cisco.com" <benve@cisco.com>
Subject: Re: [Qemu-devel] kvm PCI assignment & VFIO ramblings
Date: Wed, 24 Aug 2011 08:56:13 -0600	[thread overview]
Message-ID: <1314197775.2859.182.camel@bling.home> (raw)
In-Reply-To: <20110824084336.GA2079@amd.com>

On Wed, 2011-08-24 at 10:43 +0200, Joerg Roedel wrote:
> On Tue, Aug 23, 2011 at 03:30:06PM -0400, Alex Williamson wrote:
> > On Tue, 2011-08-23 at 07:01 +1000, Benjamin Herrenschmidt wrote:
> 
> > > Could be tho in what form ? returning sysfs pathes ?
> > 
> > I'm at a loss there, please suggest.  I think we need an ioctl that
> > returns some kind of array of devices within the group and another that
> > maybe takes an index from that array and returns an fd for that device.
> > A sysfs path string might be a reasonable array element, but it sounds
> > like a pain to work with.
> 
> Limiting to PCI we can just pass the BDF as the argument to optain the
> device-fd. For a more generic solution we need a unique identifier in
> some way which is unique across all 'struct device' instances in the
> system. As far as I know we don't have that yet (besides the sysfs-path)
> so we either add that or stick with bus-specific solutions.
> 
> > > 1:1 process has the advantage of linking to an -mm which makes the whole
> > > mmu notifier business doable. How do you want to track down mappings and
> > > do the second level translation in the case of explicit map/unmap (like
> > > on power) if you are not tied to an mm_struct ?
> > 
> > Right, I threw away the mmu notifier code that was originally part of
> > vfio because we can't do anything useful with it yet on x86.  I
> > definitely don't want to prevent it where it makes sense though.  Maybe
> > we just record current->mm on open and restrict subsequent opens to the
> > same.
> 
> Hmm, I think we need io-page-fault support in the iommu-api then.

Yeah, when we can handle iommu page faults, this gets more interesting.

> > > Another aspect I don't see discussed is how we represent these things to
> > > the guest.
> > > 
> > > On Power for example, I have a requirement that a given iommu domain is
> > > represented by a single dma window property in the device-tree. What
> > > that means is that that property needs to be either in the node of the
> > > device itself if there's only one device in the group or in a parent
> > > node (ie a bridge or host bridge) if there are multiple devices.
> > > 
> > > Now I do -not- want to go down the path of simulating P2P bridges,
> > > besides we'll quickly run out of bus numbers if we go there.
> > > 
> > > For us the most simple and logical approach (which is also what pHyp
> > > uses and what Linux handles well) is really to expose a given PCI host
> > > bridge per group to the guest. Believe it or not, it makes things
> > > easier :-)
> > 
> > I'm all for easier.  Why does exposing the bridge use less bus numbers
> > than emulating a bridge?
> > 
> > On x86, I want to maintain that our default assignment is at the device
> > level.  A user should be able to pick single or multiple devices from
> > across several groups and have them all show up as individual,
> > hotpluggable devices on bus 0 in the guest.  Not surprisingly, we've
> > also seen cases where users try to attach a bridge to the guest,
> > assuming they'll get all the devices below the bridge, so I'd be in
> > favor of making this "just work" if possible too, though we may have to
> > prevent hotplug of those.
> 
> A side-note: Might it be better to expose assigned devices in a guest on
> a seperate bus? This will make it easier to emulate an IOMMU for the
> guest inside qemu.

I think we want that option, sure.  A lot of guests aren't going to
support hotplugging buses though, so I think our default, map the entire
guest model should still be using bus 0.  The ACPI gets a lot more
complicated for that model too; dynamic SSDTs?  Thanks,

Alex

  reply	other threads:[~2011-08-24 14:56 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1311983933.8793.42.camel@pasglop>
2011-07-30 18:20 ` [Qemu-devel] kvm PCI assignment & VFIO ramblings Alex Williamson
2011-07-30 23:54   ` Benjamin Herrenschmidt
2011-08-01 18:59     ` Alex Williamson
2011-08-02  2:00       ` Benjamin Herrenschmidt
2011-07-30 23:55   ` Benjamin Herrenschmidt
2011-08-02  8:28   ` David Gibson
2011-08-02 18:14     ` Alex Williamson
2011-08-02 18:35       ` Alex Williamson
2011-08-03  2:04         ` David Gibson
2011-08-03  3:44           ` Alex Williamson
2011-08-04  0:39             ` David Gibson
2011-08-08  8:28           ` Avi Kivity
2011-08-09 23:24             ` Alex Williamson
2011-08-10  2:48               ` Benjamin Herrenschmidt
2011-08-20 16:51                 ` Alex Williamson
2011-08-22  5:55                   ` David Gibson
2011-08-22 15:45                     ` Alex Williamson
2011-08-22 21:01                       ` Benjamin Herrenschmidt
2011-08-23 19:30                         ` Alex Williamson
2011-08-23 23:51                           ` Benjamin Herrenschmidt
2011-08-24  3:40                             ` Alexander Graf
2011-08-24 14:47                             ` Alex Williamson
2011-08-24  8:43                           ` Joerg Roedel
2011-08-24 14:56                             ` Alex Williamson [this message]
2011-08-25 11:01                               ` Roedel, Joerg
2011-08-23  2:38                       ` David Gibson
2011-08-23 16:23                         ` Alex Williamson
2011-08-23 23:41                           ` Benjamin Herrenschmidt
2011-08-24  3:36                             ` Alexander Graf
2011-08-22  6:30                   ` Avi Kivity
2011-08-22 10:46                     ` Joerg Roedel
2011-08-22 10:51                       ` Avi Kivity
2011-08-22 12:36                         ` Roedel, Joerg
2011-08-22 12:42                           ` Avi Kivity
2011-08-22 12:55                             ` Roedel, Joerg
2011-08-22 13:06                               ` Avi Kivity
2011-08-22 13:15                                 ` Roedel, Joerg
2011-08-22 13:17                                   ` Avi Kivity
2011-08-22 14:37                                     ` Roedel, Joerg
2011-08-22 20:53                     ` Benjamin Herrenschmidt
2011-08-22 17:25                   ` Joerg Roedel
2011-08-22 19:17                     ` Alex Williamson
2011-08-23 13:14                       ` Roedel, Joerg
2011-08-23 17:08                         ` Alex Williamson
2011-08-24  8:52                           ` Roedel, Joerg
2011-08-24 15:07                             ` Alex Williamson
2011-08-25 12:31                               ` Roedel, Joerg
2011-08-25 13:25                                 ` Alexander Graf
2011-08-26  4:24                                   ` David Gibson
2011-08-26  9:24                                     ` Roedel, Joerg
2011-08-28 13:14                                       ` Avi Kivity
2011-08-28 13:56                                         ` Joerg Roedel
2011-08-28 14:04                                           ` Avi Kivity
2011-08-30 16:14                                             ` Joerg Roedel
2011-08-22 21:03                     ` Benjamin Herrenschmidt
2011-08-23 13:18                       ` Roedel, Joerg
2011-08-23 23:35                         ` Benjamin Herrenschmidt
2011-08-24  8:53                           ` Roedel, Joerg
2011-08-22 20:29                   ` aafabbri
2011-08-22 20:49                     ` Benjamin Herrenschmidt
2011-08-22 21:38                       ` aafabbri
2011-08-22 21:49                         ` Benjamin Herrenschmidt
2011-08-23  0:52                           ` aafabbri
2011-08-23  6:54                             ` Benjamin Herrenschmidt
2011-08-23 11:09                               ` Joerg Roedel
2011-08-23 17:01                               ` Alex Williamson
2011-08-23 17:33                                 ` Aaron Fabbri
2011-08-23 18:01                                   ` Alex Williamson
2011-08-24  9:10                                   ` Joerg Roedel
2011-08-24 21:13                                     ` Alex Williamson
2011-08-25 10:54                                       ` Roedel, Joerg
2011-08-25 15:38                                         ` Don Dutile
2011-08-25 16:46                                           ` Roedel, Joerg
2011-08-25 17:20                                         ` Alex Williamson
2011-08-25 18:05                                           ` Joerg Roedel
2011-08-26 18:04                                             ` Alex Williamson
2011-08-30 16:13                                               ` Joerg Roedel
2011-08-23 11:04                             ` Joerg Roedel
2011-08-23 16:54                               ` aafabbri
2011-08-24  9:14                                 ` Roedel, Joerg
2011-08-24  9:33                                   ` David Gibson
2011-08-24 11:03                                     ` Roedel, Joerg
2011-08-26  4:20                                       ` David Gibson
2011-08-26  9:33                                         ` Roedel, Joerg
2011-08-26 14:07                                           ` Alexander Graf
2011-08-26 15:24                                             ` Joerg Roedel
2011-08-26 15:29                                               ` Alexander Graf
2011-08-26 17:52                                             ` Aaron Fabbri
2011-08-26 19:35                                               ` Chris Wright
2011-08-26 20:17                                                 ` Aaron Fabbri
2011-08-26 21:06                                                   ` Chris Wright
2011-08-30  1:29                                                   ` David Gibson
2011-08-04 10:35   ` Joerg Roedel

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=1314197775.2859.182.camel@bling.home \
    --to=alex.williamson@redhat.com \
    --cc=aik@au1.ibm.com \
    --cc=avi@redhat.com \
    --cc=benve@cisco.com \
    --cc=chrisw@sous-sol.org \
    --cc=dwg@au1.ibm.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=pmac@au1.ibm.com \
    --cc=qemu-devel@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 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).