On 2017年05月20日 00:55, Michael S. Tsirkin wrote:
On Fri, May 19, 2017 at 11:19:49AM +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.

Signed-off-by: Peter Xu<pet...@redhat.com>
I don't really understand. Is this a performance optimization?
Can you post some #s please?

Also, if it's PT, can't we bypass iommu altogether?

The problem is, since device could be moved between domains, which means we need new notifier to notify vhost to enable or disable IOMMU_PLATFORM.

That would be
even faster ...


Should be the same (except for the first access in no CM mode), we pass and use vhost_memory_regions as what we've used for non iommu case.

Thanks

Reply via email to