linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Joerg Roedel <joro@8bytes.org>, Kevin Wolf <kwolf@redhat.com>,
	Wei Liu <wei.liu2@citrix.com>, Andy Lutomirski <luto@kernel.org>,
	qemu-block@nongnu.org,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Jason Wang <jasowang@redhat.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	qemu-devel@nongnu.org, peterx@redhat.com,
	linux-kernel@vger.kernel.org, Amit Shah <amit.shah@redhat.com>,
	iommu@lists.linux-foundation.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	kvm@vger.kernel.org, cornelia.huck@de.ibm.com,
	pbonzini@redhat.com, virtualization@lists.linux-foundation.org,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [PATCH V2 RFC] fixup! virtio: convert to use DMA api
Date: Thu, 28 Apr 2016 16:11:54 +0100	[thread overview]
Message-ID: <1461856314.33870.98.camel@infradead.org> (raw)
In-Reply-To: <20160428172039-mutt-send-email-mst@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2444 bytes --]

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


[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5760 bytes --]

  reply	other threads:[~2016-04-28 15:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21 13:43 [PATCH V2 RFC] fixup! virtio: convert to use DMA api Michael S. Tsirkin
2016-04-21 13:54 ` Wei Liu
2016-04-27 12:18   ` David Woodhouse
2016-04-27 13:37     ` Michael S. Tsirkin
2016-04-27 14:23       ` Joerg Roedel
2016-04-27 14:31         ` Andy Lutomirski
2016-04-27 14:38           ` Michael S. Tsirkin
2016-04-27 14:43             ` Andy Lutomirski
2016-04-27 14:54               ` Michael S. Tsirkin
2016-04-27 14:58                 ` Joerg Roedel
2016-04-27 15:09                   ` Michael S. Tsirkin
2016-04-27 15:10                 ` Andy Lutomirski
2016-04-27 14:34         ` Michael S. Tsirkin
2016-04-27 14:56           ` Joerg Roedel
2016-04-27 15:05             ` Michael S. Tsirkin
2016-04-27 15:15               ` David Woodhouse
2016-04-27 18:17                 ` Michael S. Tsirkin
2016-04-27 19:16                   ` David Woodhouse
2016-04-28 14:34                     ` Michael S. Tsirkin
2016-04-28 15:11                       ` David Woodhouse [this message]
2016-04-28 15:37                         ` Michael S. Tsirkin
2016-04-28 15:48                           ` David Woodhouse
2016-05-01 10:37                             ` Michael S. Tsirkin
2016-05-09 11:09                           ` Paolo Bonzini
2016-04-21 14:56 ` Stefan Hajnoczi
2016-04-21 15:11   ` Michael S. Tsirkin
2016-04-22  9:33     ` Stefan Hajnoczi

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=1461856314.33870.98.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=amit.shah@redhat.com \
    --cc=anthony.perard@citrix.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jasowang@redhat.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wei.liu2@citrix.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).