qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
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: Sat, 27 Apr 2013 14:17:54 +0200	[thread overview]
Message-ID: <517BC1F2.70405@redhat.com> (raw)
In-Reply-To: <20130427094927.GC20202@truffula.fritz.box>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Il 27/04/2013 11:49, David Gibson ha scritto:
>> There's no fundamental reason for VFIO to use multiple 
>> MemoryListeners.  It could use one for all VFIO instances.
> 
> Actually, there kind of is.  Using a new listener for each new 
> container means the listener framework automatically invokes
> callbacks for all the existing reasons, allowing us to map them
> into the container.  With a single listener, we'd have to manually
> write logic to map all the existing mappings into each new
> container.

Ah, thanks for teaching me.  It is indeed more convenient.

>>> 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.
>> 
>> Why?  All you want here is to look for appearance of an IOMMU 
>> MemoryRegion in the flat representation of the AddressSpace.
>> That's exactly what the MemoryListener does---of course that's a
>> different MemoryListener implementation than VFIO's current one.
>> 
>> The MemoryListener is used for a lot of different things, I find
>> it hard to believe that this is not a variation on one of them.
> 
> Uh.. so, yes we might actually want a memorylistener to watch for 
> appearance of iommu regions, if there are memoryregion layers
> between us and the iommu region itself.
> 
> But the point remains that from the code which implements the
> guest side IOMMU we have to somehow invoke a hook which will make
> parallel mappings in the vfio container.  That will need to go from
> the iommu code's handle on the address space - a MemoryRegion - to
> vfio's handle on the address space, the vfio container.  I don't
> see a way to do that without having a vfio private pointer in the
> memoryregion, that isn't much uglier than that minor encapsulation
> breach.

Ok, knowing about changes that happen in the IOMMU mapping is indeed
out of scope of MemoryListeners.  What about adding a NotifierList?
Then VFIO can register a notifier and use it to learn about "events"
in the IOMMU mapping.  The notifier data can be a MemoryRegionSection
or IOMMUTableEntry, whatever you find more convenient.

Paolo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRe8HyAAoJEBvWZb6bTYbyZCwP+gMnSTE/zmzYWXQtnXgS5XrD
ezsOO55RfV6awehSa0ITGzuMzatn3DHakp0YAfcWJaz3cdFlAT+xWg4PNbw4yilJ
a/kFoG7sG4xXQD0bEkgZmHxyPHhKhSeKQfTUJ7FRjjEDWCDXo/5fLBX01tvKefYF
DPUKK7vQANyxfsUFzqN8qJHQ4cZoA209sILCbRXdAsPIj++sBx9TPQYDoCAGNFZd
OlB60yLXdwMlb1VrUlNbZOvdut8Ky6L1RfalKgKXyZnkCFssp02CKLaubyPw0WRk
8N7xjvojEnQb82Kk5hSfsVOdwZNO03GkjhcgtuBhk90Hw43fO7JhbPYCg32EvX1E
4SX+NbbL7WYFMVqe019zjKLQ4ZX5/TdUoMJo1TqtATHUyn4k7G0cWpO52p1tr/Iw
FN8l6kzOZH1H0DbBYyc+4ifFxBJ9WiWUDUKr+CJF4EhDxzcceC2aXXTLYOA9mD2Y
oMh4gDdwlelzXO4JuGYXSU/dG8cZ0HdGnCrUO5KgQJwSio/BkUece5ga8X3qUVdG
p/Z2ZCI2xMVv/IbPVR5vJtDkPIxOmnyjQKQrMDjv7EQSf8yrW3rMcqgnxVgZZoob
o96krNwAr5tQT2a9a/U2qne6ueVe0BxcqPkd+8n5ybh/YKzjWed2r1K2Oe4ZNved
a+Qi/12Z+Pv9zTZrMH37
=AtuM
-----END PGP SIGNATURE-----

  reply	other threads:[~2013-04-27 12:18 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
2013-04-26 13:40       ` Paolo Bonzini
2013-04-27  9:49         ` David Gibson
2013-04-27 12:17           ` Paolo Bonzini [this message]
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=517BC1F2.70405@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --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).