public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Antonios Motakis
	<a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
Cc: "kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"eric.auger-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<eric.auger-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Marc Zyngier <Marc.Zyngier-5wv7dgnIgG8@public.gmane.org>,
	Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	"a.rigo-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org"
	<a.rigo-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>,
	"stuart.yoder-KZfg59tc24xl57MIdRCFDg@public.gmane.org"
	<stuart.yoder-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	"tech-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org"
	<tech-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>,
	"kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org"
	<kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org>,
	"christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [RFC 4/5] vfio: amba: VFIO support for AMBA devices
Date: Tue, 26 Aug 2014 13:37:40 -0600	[thread overview]
Message-ID: <1409081860.2906.136.camel@ul30vt.home> (raw)
In-Reply-To: <CAG8rG2z5Jqwnpr49vX7=rgXMtuKd-4=eBaS2JaOrdT6Tgn0hqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, 2014-08-26 at 17:39 +0200, Antonios Motakis wrote:
> Hello WIll,
> 
> On Tue, Aug 26, 2014 at 12:50 PM, Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org> wrote:
> > Hi Antonios,
> >
> > On Fri, Aug 22, 2014 at 10:01:27AM +0100, Antonios Motakis wrote:
> >> Add support for discovering AMBA devices with VFIO and handle them
> >> similarly to Linux platform devices.
> >
> > [...]
> >
> >> +static struct amba_id pl330_ids[] = {
> >> +     { 0, 0 },
> >> +};
> >> +
> >> +MODULE_DEVICE_TABLE(amba, pl330_ids);
> >> +
> >> +static struct amba_driver vfio_amba_driver = {
> >> +     .probe = vfio_amba_probe,
> >> +     .remove = vfio_amba_remove,
> >> +     .id_table = pl330_ids,
> >> +     .drv = {
> >> +             .name = "vfio-amba",
> >> +             .owner = THIS_MODULE,
> >> +     },
> >> +};
> >
> > I don't understand what you're doing with the IDs here. What's the point in
> > the empty list?
> >
> 
> The empty list means VFIO will not bind to any AMBA devices by
> default. If the user wants to use an AMBA device with VFIO, the idea
> is to use the driver override proposed in [RFC 1/5] driver core: amba:
> add device binding path 'driver_override'.
> 
> > This also raises a larger question about whether or not it's safe to allow
> > device passthrough of arbitrary platform devices with VFIO. In the absence
> > of a bus/device standard like PCI, I really think this should be in opt-in
> > decision, where certain platform drivers can declare that their device can
> > be safely used with passthrough.
> 
> In a sense the driver_override is already an opt-in, although under
> control of the user. I don't know if we want to take the decision for
> the user and whitelist the devices one can safely use, and reject any
> other device one might want to try. I would argue that if a user
> decides to use driver_override, he should be able to do that (and then
> report the consequences to us ;)
> 
> Some of the differences between PLATFORM devices, could be handled at
> the QEMU level. With the addition of the VFIO device node info patches
> we also proposed recently, any VFIO user essentially sees a bunch of
> MMIO regions, IRQs and some device node properties that describe the
> device. So a VFIO user (e.g. QEMU) has access to more or less the same
> stuff a kernel driver does.
> 
> I could see this breaking if a device tries to do memory accesses that
> don't go through the IOMMU (maybe if it is directly connected with
> another device), but in that situation that device is probably
> unusable with VFIO even if we special-case it. Any other ideas?

It would be a flaw in the IOMMU group support of the platform to not
expose lack of isolation between such devices.  The platform IOMMU group
code is where decisions should be made about whether a device or set of
devices is safe to expose through VFIO.  If devices are unsafe they
should not have an IOMMU group.  If there is lack of isolation between
devices, they should be members of the same IOMMU group.  Adjust how
IOMMU grouping works and VFIO will follow.  Thanks,

Alex

  parent reply	other threads:[~2014-08-26 19:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22  9:01 [RFC 0/5] vfio: AMBA devices support Antonios Motakis
2014-08-22  9:01 ` [RFC 4/5] vfio: amba: VFIO support for AMBA devices Antonios Motakis
     [not found]   ` <1408698088-5349-5-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-08-26 10:50     ` Will Deacon
     [not found]       ` <20140826105027.GH23445-5wv7dgnIgG8@public.gmane.org>
2014-08-26 15:39         ` Antonios Motakis
     [not found]           ` <CAG8rG2z5Jqwnpr49vX7=rgXMtuKd-4=eBaS2JaOrdT6Tgn0hqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-26 19:37             ` Alex Williamson [this message]
     [not found] ` <1408698088-5349-1-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-08-22  9:01   ` [RFC 1/5] driver core: amba: add device binding path 'driver_override' Antonios Motakis
     [not found]     ` <1408698088-5349-2-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-08-25 20:29       ` Kim Phillips
     [not found]         ` <20140825152909.43a6a02d972823056108dd95-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-08-26  7:43           ` Antonios Motakis
2014-08-22  9:01   ` [RFC 2/5] vfio: platform: decouple code probing devices from the platform bus Antonios Motakis
2014-08-22  9:01   ` [RFC 3/5] vfio: platform: move code that can be shared with AMBA to a common file Antonios Motakis
2014-08-22  9:01   ` [RFC 5/5] vfio: amba: add the VFIO for AMBA devices module to Kconfig Antonios Motakis
2014-08-25 23:56 ` [RFC 0/5] vfio: AMBA devices support Kim Phillips
     [not found]   ` <20140825185611.cc359282a66d6afe7a4a590e-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-08-26  7:39     ` Antonios Motakis
2014-08-26  7:41     ` Antonios Motakis

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=1409081860.2906.136.camel@ul30vt.home \
    --to=alex.williamson-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=Marc.Zyngier-5wv7dgnIgG8@public.gmane.org \
    --cc=a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org \
    --cc=a.rigo-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org \
    --cc=christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=eric.auger-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org \
    --cc=stuart.yoder-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=tech-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.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