qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] vhost: iommu: cache static mapping if there


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH 3/3] vhost: iommu: cache static mapping if there is
Date: Mon, 5 Jun 2017 12:07:22 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1



On 2017年06月05日 11:15, Peter Xu wrote:
On Fri, Jun 02, 2017 at 06:45:05PM +0300, Michael S. Tsirkin wrote:
On Fri, Jun 02, 2017 at 07:50:54PM +0800, Peter Xu wrote:
This patch pre-heat vhost iotlb cache when passthrough mode enabled.

Sometimes, even if user specified iommu_platform for vhost devices,
IOMMU might still be disabled. One case is passthrough mode in VT-d
implementation. We can detect this by observing iommu_list. If it's
empty, it means IOMMU translation is disabled, then we can actually
pre-heat the translation (it'll be static mapping then) by first
invalidating all IOTLB, then cache existing memory ranges into vhost
backend iotlb using 1:1 mapping.

Reviewed-by: Jason Wang <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
This is still a hack I think. What if there's an invalidation?
I think the right thing is to send updates only when requested,
but sent the largest mapping including the iova, not from iova until end
of page. Thoughts?
Indeed it's kind of a hack, but it does not hurt anything but will
definitely boost performance in most cases...

Yes "sent the largest mapping including the iova" is okay, but the
first IO on one region would be delayed as well, so IMHO it's not the
best solution as well. I think the best solution should be (for sure)
that vhost knows it's PT, then it just skips the translation
completely. I just don't sure whether there's simple/good way to do
this.

Thanks,

We can disabled device IOTLB completely in this case. But looks like there's a minor kernel bug prevent us from doing this. Let me post a fix and let's see then.

Thanks



reply via email to

[Prev in Thread] Current Thread [Next in Thread]