From: David Gibson <david@gibson.dropbear.id.au>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: aik@ozlabs.ru, alex.williamson@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/4] vfio: Move container list to iommu MemoryRegion
Date: Fri, 26 Apr 2013 21:31:21 +1000 [thread overview]
Message-ID: <20130426113121.GB4360@truffula.fritz.box> (raw)
In-Reply-To: <517A398C.6030104@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1894 bytes --]
On Fri, Apr 26, 2013 at 10:23:40AM +0200, Paolo Bonzini wrote:
> Il 26/04/2013 08:02, David Gibson ha scritto:
> > At the moment, vfio maintains a global list of containers that are assumed
> > to be more or less interchangeable, since they are all set up with a
> > MemoryListener to have all of system memory mapped. However, that only
> > makes sense if all the containers are used on devices which really do
> > expect a dma address space identical to system memory.
> >
> > This patch moves towards that by making the list of containers per
> > MemoryRegion (which corresponds to a dma address space) instead of global.
>
> This is the same violation of encapsulation that Alex pointed out in
> v1.
As I said in response to that, I can't see any way to avoid this that
isn't much uglier. Fundamentally we need to associate the in-kernel
notion of an address space (the vfio container) with the qemu object.
Adding a opaque pointer to the MemoryRegion seems a lot cleaner than
having some data structure in the vfio code that's indexed by
MemoryRegion.
> You need to add this capability to VFIO's MemoryListener (either the
> one that's already there, or a new one), looking for IOMMU regions in
> the region_add callback.
Putting it in the MemoryListener doesn't work. First, there could be
multiple listeners if there are multiple containers attached to the
MemoryRegion - the information we have here needs to be per
MemoryRegion. More importantly, what I'm working towards here is
vfio support for guest visible IOMMUs that don't have all of guest RAM
mapped into them initially. In that case there won't (and can't) be
any MemoryListener at all.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2013-04-26 11:31 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-26 6:02 [Qemu-devel] [0/4] RFC: Preparations for VFIO and guest IOMMUs (v2) David Gibson
2013-04-26 6:02 ` [Qemu-devel] [PATCH 1/4] Fix vmw_pvscsi.c for iommu support changes David Gibson
2013-04-26 8:19 ` Paolo Bonzini
2013-04-26 11:04 ` David Gibson
2013-04-26 6:02 ` [Qemu-devel] [PATCH 2/4] vfio: Associate VFIO groups with (guest) IOMMU address spaces David Gibson
2013-04-26 6:02 ` [Qemu-devel] [PATCH 3/4] vfio: Move container list to iommu MemoryRegion David Gibson
2013-04-26 8:23 ` Paolo Bonzini
2013-04-26 11:31 ` David Gibson [this message]
2013-04-26 13:40 ` Paolo Bonzini
2013-04-27 9:49 ` David Gibson
2013-04-27 12:17 ` Paolo Bonzini
2013-04-28 1:58 ` David Gibson
2013-04-29 8:11 ` Paolo Bonzini
2013-04-29 11:00 ` David Gibson
2013-04-29 11:38 ` Paolo Bonzini
2013-04-29 11:56 ` David Gibson
2013-04-29 13:44 ` Paolo Bonzini
2013-04-30 2:05 ` David Gibson
2013-04-30 2:23 ` David Gibson
2013-04-30 7:30 ` Paolo Bonzini
2013-04-30 7:54 ` David Gibson
2013-04-29 2:11 ` [Qemu-devel] [PATCH] memory: give name every AddressSpace Alexey Kardashevskiy
2013-04-29 8:16 ` Paolo Bonzini
2013-04-29 8:21 ` Alexey Kardashevskiy
2013-04-29 9:25 ` Paolo Bonzini
2013-04-29 11:09 ` David Gibson
2013-04-30 2:14 ` Alexey Kardashevskiy
2013-04-26 6:02 ` [Qemu-devel] [PATCH 4/4] vfio: Only use memory listeners when appropriate David Gibson
2013-04-26 15:42 ` [Qemu-devel] [0/4] RFC: Preparations for VFIO and guest IOMMUs (v2) Alex Williamson
2013-04-27 9:51 ` David Gibson
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=20130426113121.GB4360@truffula.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=pbonzini@redhat.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).