Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1382840
| From | Andy Lutomirski <luto@amacapital.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH RFC] fixup! virtio: convert to use DMA api |
| Date | 2016-04-19 23:10 +0200 |
| Message-ID | <rpL4e-4MC-9@gated-at.bofh.it> (permalink) |
| References | (6 earlier) <rpI6n-2bD-33@gated-at.bofh.it> <rpIg1-2AE-1@gated-at.bofh.it> <rpKhQ-41R-19@gated-at.bofh.it> <rpKrv-48k-1@gated-at.bofh.it> <rpKUy-4lU-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Apr 19, 2016 at 1:54 PM, Michael S. Tsirkin <mst@redhat.com> wrote: > On Tue, Apr 19, 2016 at 01:27:29PM -0700, Andy Lutomirski wrote: >> On Tue, Apr 19, 2016 at 1:16 PM, Michael S. Tsirkin <mst@redhat.com> wrote: >> > On Tue, Apr 19, 2016 at 11:01:38AM -0700, Andy Lutomirski wrote: >> >> On Tue, Apr 19, 2016 at 10:49 AM, Michael S. Tsirkin <mst@redhat.com> wrote: >> >> > On Tue, Apr 19, 2016 at 12:26:44PM -0400, David Woodhouse wrote: >> >> >> On Tue, 2016-04-19 at 19:20 +0300, Michael S. Tsirkin wrote: >> >> >> > >> >> >> > > I thought that PLATFORM served that purpose. Woudn't the host >> >> >> > > advertise PLATFORM support and, if the guest doesn't ack it, the host >> >> >> > > device would skip translation? Or is that problematic for vfio? >> >> >> > >> >> >> > Exactly that's problematic for security. >> >> >> > You can't allow guest driver to decide whether device skips security. >> >> >> >> >> >> Right. Because fundamentally, this *isn't* a property of the endpoint >> >> >> device, and doesn't live in virtio itself. >> >> >> >> >> >> It's a property of the platform IOMMU, and lives there. >> >> > >> >> > It's a property of the hypervisor virtio implementation, and lives there. >> >> >> >> It is now, but QEMU could, in principle, change the way it thinks >> >> about it so that virtio devices would use the QEMU DMA API but ask >> >> QEMU to pass everything through 1:1. This would be entirely invisible >> >> to guests but would make it be a property of the IOMMU implementation. >> >> At that point, maybe QEMU could find a (platform dependent) way to >> >> tell the guest what's going on. >> >> >> >> FWIW, as far as I can tell, PPC and SPARC really could, in principle, >> >> set up 1:1 mappings in the guest so that the virtio devices would work >> >> regardless of whether QEMU is ignoring the IOMMU or not -- I think the >> >> only obstacle is that the PPC and SPARC 1:1 mappings are currectly set >> >> up with an offset. I don't know too much about those platforms, but >> >> presumably the layout could be changed so that 1:1 really was 1:1. >> >> >> >> --Andy >> > >> > Sure. Do you see any reason why the decision to do this can't be >> > keyed off the virtio feature bit? >> >> I can think of three types of virtio host: >> >> a) virtio always bypasses the IOMMU. >> >> b) virtio never bypasses the IOMMU (unless DMAR tables or similar say >> it does) -- i.e. virtio works like any other device. >> >> c) virtio may bypass the IOMMU depending on what the guest asks it to do. > > d) some virtio devices bypass the IOMMU and some don't, > e.g. it's harder to support IOMMU with vhost. > > >> If this is keyed off a virtio feature bit and anyone tries to >> implement (c), the vfio is going to have a problem. And, if it's >> keyed off a virtio feature bit, then (a) won't work on Xen or similar >> setups unless the Xen hypervisor adds a giant and probably unreliable >> kludge to support it. Meanwhile, 4.6-rc works fine under Xen on a >> default x86 QEMU configuration, and I'd really like to keep it that >> way. >> >> What could plausibly work using a virtio feature bit is for a device >> to say "hey, I'm a new device and I support the platform-defined IOMMU >> mechanism". This bit would be *set* on default IOMMU-less QEMU >> configurations and on physical virtio PCI cards. > > And clear on xen. How? QEMU has no idea that the guest is running Xen.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-18 13:50 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-18 14:00 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-18 15:20 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-18 16:10 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-18 16:30 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-18 17:30 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-18 17:40 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-18 18:00 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-18 18:30 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-18 20:30 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-18 21:30 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-19 12:30 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-19 18:10 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-19 18:10 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-19 18:20 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-19 18:30 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-19 19:40 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-19 20:00 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-19 20:10 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-19 22:20 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-19 22:30 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-19 23:00 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-19 23:10 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-20 15:20 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-20 17:50 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-19 11:20 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api Alex Williamson <alex.williamson@redhat.com> - 2016-04-19 16:50 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-19 18:10 +0200
Re: [PATCH RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-19 18:10 +0200
csiph-web