All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Wei Liu <wei.liu2@citrix.com>, Andy Lutomirski <luto@kernel.org>,
	qemu-block@nongnu.org,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	peterx@redhat.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Amit Shah <amit.shah@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	kvm list <kvm@vger.kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Linux Virtualization <virtualization@lists.linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH RFC] fixup! virtio: convert to use DMA api
Date: Tue, 19 Apr 2016 14:07:01 -0700	[thread overview]
Message-ID: <CALCETrUif0iAFWFsz-i848yUO9WrXZ7q+Kx3-4wu-dQRiuCweg__6265.68169468573$1461100056$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <20160419235212-mutt-send-email-mst@redhat.com>

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.

  reply	other threads:[~2016-04-19 21:07 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 11:47 [PATCH RFC] fixup! virtio: convert to use DMA api Michael S. Tsirkin
2016-04-18 11:47 ` [Qemu-devel] " Michael S. Tsirkin
2016-04-18 11:58 ` David Woodhouse
2016-04-18 11:58   ` [Qemu-devel] " David Woodhouse
2016-04-18 13:12   ` Michael S. Tsirkin
2016-04-18 13:12   ` Michael S. Tsirkin
2016-04-18 13:12     ` [Qemu-devel] " Michael S. Tsirkin
2016-04-18 14:03     ` David Woodhouse
2016-04-18 14:03     ` David Woodhouse
2016-04-18 14:03       ` [Qemu-devel] " David Woodhouse
2016-04-18 14:23       ` Michael S. Tsirkin
2016-04-18 14:23         ` [Qemu-devel] " Michael S. Tsirkin
2016-04-18 14:23         ` Michael S. Tsirkin
2016-04-18 15:22         ` David Woodhouse
2016-04-18 15:22           ` [Qemu-devel] " David Woodhouse
2016-04-18 15:22           ` David Woodhouse
2016-04-18 15:30           ` Michael S. Tsirkin
2016-04-18 15:30             ` [Qemu-devel] " Michael S. Tsirkin
2016-04-18 15:30             ` Michael S. Tsirkin
2016-04-18 15:51             ` David Woodhouse
2016-04-18 15:51               ` [Qemu-devel] " David Woodhouse
2016-04-18 15:51               ` David Woodhouse
2016-04-18 16:27               ` Michael S. Tsirkin
2016-04-18 16:27                 ` [Qemu-devel] " Michael S. Tsirkin
2016-04-18 16:27                 ` Michael S. Tsirkin
2016-04-18 18:29                 ` David Woodhouse
2016-04-18 18:29                   ` [Qemu-devel] " David Woodhouse
2016-04-18 18:29                   ` David Woodhouse
2016-04-18 19:24                   ` Andy Lutomirski
2016-04-18 19:24                     ` [Qemu-devel] " Andy Lutomirski
2016-04-18 19:24                     ` Andy Lutomirski
2016-04-19 10:27                     ` Michael S. Tsirkin
2016-04-19 10:27                       ` [Qemu-devel] " Michael S. Tsirkin
2016-04-19 10:27                       ` Michael S. Tsirkin
2016-04-19 16:02                       ` Andy Lutomirski
2016-04-19 16:02                         ` [Qemu-devel] " Andy Lutomirski
2016-04-19 16:02                         ` Andy Lutomirski
2016-04-19 16:09                         ` Michael S. Tsirkin
2016-04-19 16:09                           ` [Qemu-devel] " Michael S. Tsirkin
2016-04-19 16:09                           ` Michael S. Tsirkin
2016-04-19 16:12                           ` Andy Lutomirski
2016-04-19 16:12                             ` [Qemu-devel] " Andy Lutomirski
2016-04-19 16:12                             ` Andy Lutomirski
2016-04-19 16:20                             ` Michael S. Tsirkin
2016-04-19 16:20                               ` [Qemu-devel] " Michael S. Tsirkin
2016-04-19 16:20                               ` Michael S. Tsirkin
2016-04-19 16:26                               ` David Woodhouse
2016-04-19 16:26                                 ` [Qemu-devel] " David Woodhouse
2016-04-19 16:26                                 ` David Woodhouse
2016-04-19 17:49                                 ` Michael S. Tsirkin
2016-04-19 17:49                                   ` [Qemu-devel] " Michael S. Tsirkin
2016-04-19 17:49                                   ` Michael S. Tsirkin
2016-04-19 18:01                                   ` Andy Lutomirski
2016-04-19 18:01                                   ` Andy Lutomirski
2016-04-19 18:01                                     ` [Qemu-devel] " Andy Lutomirski
2016-04-19 18:01                                     ` Andy Lutomirski
2016-04-19 20:16                                     ` Michael S. Tsirkin
2016-04-19 20:16                                       ` [Qemu-devel] " Michael S. Tsirkin
2016-04-19 20:16                                       ` Michael S. Tsirkin
2016-04-19 20:27                                       ` Andy Lutomirski
2016-04-19 20:27                                       ` Andy Lutomirski
2016-04-19 20:27                                         ` [Qemu-devel] " Andy Lutomirski
2016-04-19 20:27                                         ` Andy Lutomirski
2016-04-19 20:54                                         ` Michael S. Tsirkin
2016-04-19 20:54                                           ` [Qemu-devel] " Michael S. Tsirkin
2016-04-19 20:54                                           ` Michael S. Tsirkin
2016-04-19 21:07                                           ` Andy Lutomirski [this message]
2016-04-19 21:07                                           ` Andy Lutomirski
2016-04-19 21:07                                             ` [Qemu-devel] " Andy Lutomirski
2016-04-19 21:07                                             ` Andy Lutomirski
2016-04-20 13:14                                             ` Michael S. Tsirkin
2016-04-20 13:14                                               ` [Qemu-devel] " Michael S. Tsirkin
2016-04-20 13:14                                               ` Michael S. Tsirkin
2016-04-20 15:43                                               ` Andy Lutomirski
2016-04-20 15:43                                               ` Andy Lutomirski
2016-04-20 15:43                                                 ` [Qemu-devel] " Andy Lutomirski
2016-04-20 15:43                                                 ` Andy Lutomirski
2016-04-19 20:54                                         ` Michael S. Tsirkin
2016-04-19 20:16                                     ` Michael S. Tsirkin
2016-04-19 17:49                                 ` Michael S. Tsirkin
2016-04-19 16:09                         ` Michael S. Tsirkin
2016-04-19 16:02                       ` Andy Lutomirski
2016-04-19  9:13                   ` Michael S. Tsirkin
2016-04-19  9:13                     ` [Qemu-devel] " Michael S. Tsirkin
2016-04-19  9:13                     ` Michael S. Tsirkin
2016-04-19 14:44                     ` Alex Williamson
2016-04-19 14:44                       ` [Qemu-devel] " Alex Williamson
2016-04-19 14:44                       ` Alex Williamson
2016-04-19 16:00                     ` Andy Lutomirski
2016-04-19 16:00                       ` [Qemu-devel] " Andy Lutomirski
2016-04-19 16:00                       ` Andy Lutomirski
2016-04-19 16:04                       ` Michael S. Tsirkin
2016-04-19 16:04                       ` Michael S. Tsirkin
2016-04-19 16:04                         ` [Qemu-devel] " Michael S. Tsirkin
2016-04-19 16:00                     ` Andy Lutomirski
2016-04-18 11:58 ` David Woodhouse
2016-04-18 11:47 Michael S. Tsirkin

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='CALCETrUif0iAFWFsz-i848yUO9WrXZ7q+Kx3-4wu-dQRiuCweg__6265.68169468573$1461100056$gmane$org@mail.gmail.com' \
    --to=luto@amacapital.net \
    --cc=amit.shah@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=dwmw2@infradead.org \
    --cc=kvm@vger.kernel.org \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.