From: Alex Williamson <alex.williamson@redhat.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
Peter Maydell <peter.maydell@linaro.org>,
Auger Eric <eric.auger@redhat.com>,
Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>,
Arnd Bergmann <arnd@arndb.de>, Alexander Graf <agraf@suse.de>,
Magnus Damm <magnus.damm@gmail.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
qemu-arm <qemu-arm@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [Qemu-devel] [PATCH/RFC 4/5] vfio: No-IOMMU mode support
Date: Fri, 9 Feb 2018 10:06:34 -0700 [thread overview]
Message-ID: <20180209100634.7a908eb9@w520.home> (raw)
In-Reply-To: <CAMuHMdWaoutP+oFL0Vtw+Z-986_=3wLAu+58N9ZT7t+uZb1ycA@mail.gmail.com>
On Fri, 9 Feb 2018 17:06:34 +0100
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Alex,
>
> On Fri, Feb 9, 2018 at 4:50 PM, Alex Williamson
> <alex.williamson@redhat.com> wrote:
> > On Fri, 9 Feb 2018 16:17:35 +0100
> > Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> >> From: Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
> >>
> >> Add qemu support for the newly introduced VFIO No-IOMMU driver.
> >>
> >> We need to add special handling for:
> >> - Group character device is /dev/vfio/noiommu-$GROUP.
> >> - No-IOMMU does not rely on a memory listener.
> >> - No IOMMU will be set for its group, so no need to call
> >> vfio_kvm_device_add_group.
> >>
> >> Signed-off-by: Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
> >> [geert: Rebase]
> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >> ---
> >> hw/vfio/common.c | 61 ++++++++++++++++++++++++++++++++++---------
> >> include/hw/vfio/vfio-common.h | 2 ++
> >> 2 files changed, 50 insertions(+), 13 deletions(-)
> >
> > NAK. I'm opposed to no-iommu support in QEMU in general, but accepting
> > vfio devices with no-iommu (which provide no DMA translation!!!)
> > transparently as if they might actually work like a regular vfio device
> > is absolutely unacceptable. Without DMA translation and isolation, you
> > might want to think about another interface, I'm not keen on the idea
>
> What if the device cannot do DMA?
>
> There are other devices that cannot do DMA, but that can be useful to
> access from a guest in an embedded system.
> E.g. smart ADC monitor blocks that monitor and average several ADCs in an
> automotive environment (drivers/iio/adc/rcar-gyroadc.c).
>
> Should all such devices be paravirtualized?
How do we know that a device is not capable of DMA? The moment we add
no-iommu support generically to QEMU, I get to deal with a swarm of
people trying to use it to assign DMA capable PCI devices to VMs and
failing miserably. We added no-iommu support because the UIO PCI driver
was under pressure to add support for MSI/X interrupts and we figured
we could at least taint the kernel an give people a path to a more
secure setup with an IOMMU by allowing use of the vfio device
interface. For PCI, this makes some sense because PCI has architected
interrupts and config space and standard layouts. What's the value of
vfio over UIO for ad-hoc, non-DMA platform devices? UIO is intended for
non-DMA devices. vfio is intended for IOMMU protected, DMA capable
devices. vfio no-IOMMU is a band-aide that hopefully goes away
eventually.
> > of corrupting vfio support in order to blink some LEDs. Thanks,
>
> This GPIO+LED prototype is just a proof-of-concept. There's no plan to
> upstream it.
If vfio with no-IOMMU is to be used, it must not enable users to
casually assign DMA capable devices. Certainly any PCI/e device needs
to be assumed to be DMA capable. I don't know how you tell with
platform devices since there's no standard interface. Thanks,
Alex
next prev parent reply other threads:[~2018-02-09 17:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 15:17 [Qemu-devel] [PATCH/RFC 0/5] R-Car Gen3 GPIO Pass-Through Prototype (QEMU) Geert Uytterhoeven
2018-02-09 15:17 ` [Qemu-devel] [PATCH/RFC 1/5] vfio/platform: make the vfio-platform device non abstract Geert Uytterhoeven
2018-02-09 15:17 ` [Qemu-devel] [PATCH/RFC 2/5] hw/arm/sysbus-fdt: Allow device matching with compat string Geert Uytterhoeven
2018-02-09 15:17 ` [Qemu-devel] [PATCH/RFC 3/5] hw/arm/virt: Allow dynamic sysbus devices again Geert Uytterhoeven
2018-02-09 15:27 ` Peter Maydell
2018-02-09 15:37 ` Geert Uytterhoeven
2018-02-09 15:46 ` Peter Maydell
2018-02-14 10:37 ` Auger Eric
2018-04-12 12:50 ` Geert Uytterhoeven
2018-02-09 15:17 ` [Qemu-devel] [PATCH/RFC 4/5] vfio: No-IOMMU mode support Geert Uytterhoeven
2018-02-09 15:50 ` Alex Williamson
2018-02-09 16:06 ` Geert Uytterhoeven
2018-02-09 17:06 ` Alex Williamson [this message]
2018-02-09 15:17 ` [Qemu-devel] [PATCH/RFC 5/5] hw/arm/sysbus-fdt: Enable rcar-gen3-gpio dynamic instantiation Geert Uytterhoeven
2018-02-14 10:52 ` Auger Eric
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=20180209100634.7a908eb9@w520.home \
--to=alex.williamson@redhat.com \
--cc=agraf@suse.de \
--cc=arnd@arndb.de \
--cc=eric.auger@redhat.com \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=renxiaof@linux.vnet.ibm.com \
--cc=wsa+renesas@sang-engineering.com \
/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).