From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: zhiyong.yang@intel.com,
Maxime Coquelin <maxime.coquelin@redhat.com>,
qemu-devel@nongnu.org, Wei Wang <wei.w.wang@intel.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [RFC 0/2] virtio-vhost-user: add virtio-vhost-user device
Date: Fri, 26 Jan 2018 11:49:43 +0800 [thread overview]
Message-ID: <97c35b6a-42da-6e8b-0815-00f181eb1bcf@redhat.com> (raw)
In-Reply-To: <20180125160916-mutt-send-email-mst@kernel.org>
On 2018年01月25日 22:48, Michael S. Tsirkin wrote:
> On Thu, Jan 25, 2018 at 03:07:23PM +0100, Paolo Bonzini wrote:
>> On 23/01/2018 17:07, Michael S. Tsirkin wrote:
>>>> It's not clear to me how to do this. E.g need a way to report failure to VM2
>>>> or #PF?
>>> Why would there be a failure? qemu running vm1 would be responsible for
>>> preventing access to vm2's memory not mapped through an IOMMU.
>>> Basically munmap these.
>> Access to VM2's memory would use VM2's configured IOVAs for VM1's
>> requester id. VM2's QEMU send device IOTLB messages to VM1's QEMU,
>> which would remap VM2's memory on the fly into VM1's BAR2.
> Right. Almost.
That would be extremely slow for dynamic mappings.
>
> One problem is that IOVA range is bigger than RAM range,
> so you will have trouble making arbitrary virtual addresses
> fit in a BAR.
>
> This is why I suggested a hybrid approach where
> translation happens within guest, qemu only does protection.
>
> Another problem with it is that IOMMU has page granularity
> while with hugetlbfs we might not be able to remap at that
> granularity.
>
> Not sure what to do about it - teach host to break
> up pages? Pass limitation to guest through virtio-iommu?
If we decide to go virtio IOMMU, maybe device can limit its IOVA range too.
Thanks
>
> Ideas?
>
>> It's not trivial to do it efficiently, but it's possible. The important
>> thing is that, if VM2 has an IOMMU, QEMU must *not* connect to a
>> virtio-vhost-user device that lacks IOTLB support. But that would be a
>> vhost-user bug, not a virtio-vhost-user bug---and that's the beauty of
>> Stefan's approach. :)
>>
>> Paolo
next prev parent reply other threads:[~2018-01-26 6:18 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 13:06 [Qemu-devel] [RFC 0/2] virtio-vhost-user: add virtio-vhost-user device Stefan Hajnoczi
2018-01-19 13:06 ` [Qemu-devel] [RFC 1/2] vhost-user: share the vhost-user protocol related structures Stefan Hajnoczi
2018-01-19 13:06 ` [Qemu-devel] [RFC 2/2] virtio-vhost-user: add virtio-vhost-user device Stefan Hajnoczi
2018-01-19 13:55 ` [Qemu-devel] [RFC 0/2] " Stefan Hajnoczi
2018-01-22 3:33 ` Jason Wang
2018-01-22 12:17 ` Stefan Hajnoczi
2018-01-22 20:04 ` Michael S. Tsirkin
2018-01-23 10:01 ` Jason Wang
2018-01-23 16:07 ` Michael S. Tsirkin
2018-01-25 14:07 ` Paolo Bonzini
2018-01-25 14:48 ` Michael S. Tsirkin
2018-01-26 3:49 ` Jason Wang [this message]
2018-01-23 10:09 ` Stefan Hajnoczi
2018-01-23 10:46 ` Wei Wang
2018-01-22 11:09 ` Wei Wang
2018-01-23 11:12 ` Stefan Hajnoczi
2018-01-23 13:06 ` Wei Wang
2018-01-24 11:40 ` Stefan Hajnoczi
2018-01-25 10:19 ` Wei Wang
2018-01-26 14:44 ` Stefan Hajnoczi
2018-01-30 12:09 ` Wei Wang
2018-02-01 17:08 ` Michael S. Tsirkin
2018-02-02 13:08 ` Wei Wang
2018-02-05 16:25 ` Stefan Hajnoczi
2018-02-06 1:28 ` Wang, Wei W
2018-02-06 9:31 ` Stefan Hajnoczi
2018-02-06 12:42 ` Wang, Wei W
2018-02-06 14:13 ` Stefan Hajnoczi
2018-02-02 15:25 ` Stefan Hajnoczi
2018-02-05 9:57 ` Wang, Wei W
2018-02-05 15:57 ` 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=97c35b6a-42da-6e8b-0815-00f181eb1bcf@redhat.com \
--to=jasowang@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=wei.w.wang@intel.com \
--cc=zhiyong.yang@intel.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).