From: Paolo Bonzini <pbonzini@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: aik@truffula.fritz.box, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 09/17] memory: iommu support
Date: Wed, 01 May 2013 18:10:47 +0200 [thread overview]
Message-ID: <51813E87.2030704@redhat.com> (raw)
In-Reply-To: <20130501043524.GO20202@truffula.fritz.box>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Il 01/05/2013 06:35, David Gibson ha scritto:
>> From: Avi Kivity <avi.kivity@gmail.com>
>>
>> Add a new memory region type that translates addresses it is
>> given, then forwards them to a target address space. This is
>> similar to an alias, except that the mapping is more flexible
>> than a linear translation and trucation, and also less efficient
>> since the translation happens at runtime.
>>
>> The implementation uses an AddressSpace mapping the target region
>> to avoid hierarchical dispatch all the way to the resolved
>> region; only iommu regions are looked up dynamically.
>>
>> Signed-off-by: Avi Kivity <avi.kivity@gmail.com> [Modified to put
>> translation in address_space_translate - Paolo] Signed-off-by:
>> Paolo Bonzini <pbonzini@redhat.com> --- exec.c |
>> 35 +++++++++++++++++++++++++++++------ include/exec/memory.h |
>> 44 ++++++++++++++++++++++++++++++++++++++++++++ memory.c
>> | 28 ++++++++++++++++++++++++++++ 3 files changed, 101
>> insertions(+), 6 deletions(-)
>
> [snip]
>> +void memory_region_init_iommu(MemoryRegion *mr, +
>> MemoryRegionIOMMUOps *ops, +
>> MemoryRegion *target, + const char
>> *name, + uint64_t size) +{ +
>> memory_region_init(mr, name, size); + mr->ops = NULL; +
>> mr->iommu_ops = ops, + mr->opaque = mr; + mr->terminates =
>> true; /* then re-forwards */ + mr->destructor =
>> memory_region_destructor_iommu; + mr->iommu_target_as =
>> g_new(AddressSpace, 1); +
>> address_space_init(mr->iommu_target_as, target);
>
> Since IOMMUs are very likely to share a target AS (in fact, it
> will nearly always be system memory), it seems odd to me to
> construct new AddressSpace objects for each one, rather than just
> giving the AddressSpace as the parameter to
> memory_region_init_iommu.
>
I think the problem is that we do not have reference counting, and
this makes it simpler to manage the lifetime. It can be changed later.
Paolo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJRgT6GAAoJEBvWZb6bTYbyk/cP/RCHjFrtXYas+TLti8vcbCS1
zCUGnURgNqKxI4529E9VGF4PlO6/uxDP/mpNgDx7FCkMyA6bNL6fxw7RhvWyKFjU
xvZt6l7HYVOxbuNVAraZ4JmQ+fnvgyxJn1djMKNdGKNuRdpXj6b2NC+xyw8rSSc2
bIR6FT0piAlFP+kXiNFyf3cIZzT84qVX1tqphCRov7jvWyYG8Zv5VHpEEjaY7fJS
LEJFQ4ZfjM94RAekhZ7GkGmmlh9vfTplKz0G+0/EOYcaWBNwd7bKjGf6hWNtLb3z
3chtMKyODe8JRR/FuWuLx0GDZzvKZOE9yRGHerhL0aDCMviNKILUTnES3twe82j9
F8ywYO4CnkdKRIzKXXDTd8hZkgzF60fWzMvtvjOg6oXHJFyNoXRLhD23sZsTFaMi
q+mk7JiPfXrvjrZcUlQ4YwN7gv9gkZ+2JO1di/R9Xq62aqYBLke9Fwke7fdX+qbR
RB7coXgfExheRJdyWB56Lqr9m2KAtnW7T6ISR1G/nV0yr+ye1N9LifUkCAg4MHa8
ANsMMA6NbwmwtqJ9DDqzH+RkK7ZzCzq/IkYGeEial/sUnxXLggu6LanyahTMun49
ZmJDbEUWVAbrA4bkbQ1XHM6B2EFLg//wen7uSdIR+UZKgjkhxpB+PKiLppvPyXW1
5LuT1XZmghaeE3nD/i3A
=GcNo
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2013-05-01 16:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-01 4:35 [Qemu-devel] [PATCH 09/17] memory: iommu support David Gibson
2013-05-01 16:10 ` Paolo Bonzini [this message]
2013-05-02 3:05 ` David Gibson
2013-05-02 5:24 ` Paolo Bonzini
2013-05-02 6:28 ` David Gibson
2013-05-02 7:36 ` Paolo Bonzini
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=51813E87.2030704@redhat.com \
--to=pbonzini@redhat.com \
--cc=aik@truffula.fritz.box \
--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).