Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1390301

Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api

From David Woodhouse <dwmw2@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api
Date 2016-04-28 17:20 +0200
Message-ID <rsVTt-5A5-35@gated-at.bofh.it> (permalink)
References (6 earlier) <rszge-3gp-11@gated-at.bofh.it> <rszpV-3jV-29@gated-at.bofh.it> <rsCe7-5LS-25@gated-at.bofh.it> <rsDaa-6Ba-15@gated-at.bofh.it> <rsVgK-4Ob-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, 2016-04-28 at 17:34 +0300, Michael S. Tsirkin wrote:
> I see work-arounds for broken IOMMUs but not for
> individual devices. Could you point me to a more specific
> example?

I think the closest example is probably quirk_ioat_snb_local_iommu().

If we see this particular device, we *know* what the topology actually
looks like. We check the hardware setup, and if we're *not* being told
the truth, then we stick it in bypass mode because we know it *isn't*
actually being translated.

Actually, that's almost *identical* to what we want, isn't it?

Except instead of checking undocumented chipset registers, it wants to
be checking "am I on a version of qemu known to lie about virtio being
translated?"

> > We don't actually *need* it for the Intel IOMMU; all we need is for
> > QEMU to stop lying in its DMAR tables.
> We need it for legacy QEMU anyway, and it's not easy for QEMU to stop
> lying about virtio, so we'll need it for a while.
> I think it's easy for QEMU to stop lying about assigned devices,
> so we don't need it for non-virtio devices.

Why is it easier for QEMU to tell the truth about assigned devices,
than it is for virtio? Assuming they both remain actually untranslated
for now, why's it easier to fix the DMAR table for one and not the
other?

(Implementing translation of assigned devices is on my list, but it's a
long way off).

> I don't see why how fwcfg can work here. It's a static thing,
> devices can come and go with hotplug.

This touches on something you said elsewhere, that it's
painful/impossible to hot-unplug a translated device and hot-plug an
untranslated device in the same slot (and vice versa).

So let's assume for now that a given slot is indeed static, and either
translated or untranslated. Like the DMAR table, the fwcfg can just
give a list of slot which are (or aren't) translated.

And then you can *only* add a translated device to a translated slot,
or an untranslated device to an untranslated slot.

All the internally-emulated devices *can* be either translated or
untranslated. That's just a matter of software. Surely, you currently
*can't* have translated assigned devices (until someone implements the
whole VT-d page table shadowing or whatever), so you'll be barred from
assigning a device to a slot which *previously* had an untranslated
device. But so what? Put it in a different slot instead.

-- 
dwmw2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-21 15:50 +0200
  Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Wei Liu <wei.liu2@citrix.com> - 2016-04-21 16:00 +0200
    Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-27 14:20 +0200
      Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-27 15:40 +0200
        Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Joerg Roedel <joro@8bytes.org> - 2016-04-27 16:30 +0200
          Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-27 16:40 +0200
            Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Joerg Roedel <joro@8bytes.org> - 2016-04-27 17:00 +0200
              Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-27 17:10 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-27 17:20 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-27 20:20 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-27 21:20 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-28 16:40 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-28 17:20 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-28 17:40 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api David Woodhouse <dwmw2@infradead.org> - 2016-04-28 17:50 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-05-01 12:40 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Paolo Bonzini <pbonzini@redhat.com> - 2016-05-09 13:10 +0200
          Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-27 16:40 +0200
            Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-27 16:50 +0200
              Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-27 17:00 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Joerg Roedel <joro@8bytes.org> - 2016-04-27 17:00 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-27 17:10 +0200
                Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-27 17:20 +0200
          Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Andy Lutomirski <luto@amacapital.net> - 2016-04-27 16:40 +0200
  Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Stefan Hajnoczi <stefanha@redhat.com> - 2016-04-21 17:00 +0200
    Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api "Michael S. Tsirkin" <mst@redhat.com> - 2016-04-21 17:20 +0200
      Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api Stefan Hajnoczi <stefanha@gmail.com> - 2016-04-22 11:40 +0200

csiph-web