From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
"patches@linaro.org" <patches@linaro.org>,
Eric Auger <eric.auger@redhat.com>,
Alex Williamson <alex.williamson@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH v2 00/12] iommu: add MemTxAttrs argument to IOMMU translate function
Date: Tue, 15 May 2018 18:50:16 +0200 [thread overview]
Message-ID: <1738f78f-b310-3cde-ac5e-1a147d3ca5f6@redhat.com> (raw)
In-Reply-To: <CAFEAcA_Dei48HtKk6GnEgXYcXdY2htCXej4pSfY+q9V6f=abdA@mail.gmail.com>
On 15/05/2018 18:28, Peter Maydell wrote:
>
> Presumably we also want a way for notifier users like vfio to
> detect "I'm dealing with an IOMMU that is txattrs aware in a
> way I can't deal with" so they can usefully bail out rather than
> not working.
>
> Unfortunately I don't really know enough about our two current
> users of notifiers (vhost and vfio) to know what they actually
> need the iommu notifications for...
As you guessed on IRC, they basically establish a shadow IOMMU page
table or TLB. My proposal would be to add two MemTxAttrs arguments to
the IOMMUNotify typedef and to memory_region_notify_one, respectively to
indicate which attributes matter (0 = indifferent, 1 = matter) and their
value. So far so good.
Perhaps memory_region_register_iommu_notifier can also get an argument
with the supported attributes. The function would then fail if there
are fewer bits set in that argument than what the IOMMU supports...
The only problem with that is that memory_region_register_iommu_notifier
is called late from VFIO, and in a place that really cannot fail (a
MemoryListener's region_add callback). So I would not be sure about how
to deal with failure in the VFIO code.
Thanks,
Paolo
next prev parent reply other threads:[~2018-05-15 16:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-01 8:59 [Qemu-devel] [RFC PATCH v2 00/12] iommu: add MemTxAttrs argument to IOMMU translate function Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 01/12] Make tb_invalidate_phys_addr() take a MemTxAttrs argument Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 02/12] Make address_space_translate() " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 03/12] Make address_space_map() " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 04/12] Make address_space_access_valid() " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 05/12] Make flatview_extend_translation() " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 06/12] Make memory_region_access_valid() " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 07/12] Make MemoryRegion valid.accepts callback " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 08/12] Make flatview_access_valid() " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 09/12] Make flatview_translate() " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 10/12] Make address_space_get_iotlb_entry() " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 11/12] Make flatview_do_translate() " Peter Maydell
2018-05-01 8:59 ` [Qemu-devel] [RFC PATCH v2 12/12] Add MemTxAttrs argument to IOMMU translate function Peter Maydell
2018-05-02 9:25 ` [Qemu-devel] [RFC PATCH v2 00/12] iommu: add " Paolo Bonzini
2018-05-15 16:28 ` Peter Maydell
2018-05-15 16:50 ` Paolo Bonzini [this message]
2018-05-17 10:48 ` Peter Maydell
2018-05-17 12:46 ` Paolo Bonzini
2018-05-17 13:03 ` Peter Maydell
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=1738f78f-b310-3cde-ac5e-1a147d3ca5f6@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=eric.auger@redhat.com \
--cc=mst@redhat.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--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).