Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1427949 > unrolled thread

Re: [RFC PATCH V3 0/3] basic device IOTLB support

Started by"Michael S. Tsirkin" <mst@redhat.com>
First post2016-06-21 18:50 +0200
Last post2016-06-22 12:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC PATCH V3 0/3] basic device IOTLB support "Michael S. Tsirkin" <mst@redhat.com> - 2016-06-21 18:50 +0200
    Re: [RFC PATCH V3 0/3] basic device IOTLB support Jason Wang <jasowang@redhat.com> - 2016-06-22 12:10 +0200

#1427949 — Re: [RFC PATCH V3 0/3] basic device IOTLB support

From"Michael S. Tsirkin" <mst@redhat.com>
Date2016-06-21 18:50 +0200
SubjectRe: [RFC PATCH V3 0/3] basic device IOTLB support
Message-ID<rMx29-8iu-25@gated-at.bofh.it>
On Tue, May 24, 2016 at 05:36:22PM +0800, Jason Wang wrote:
> This patch tries to implement an device IOTLB for vhost. This could be
> used with for co-operation with userspace IOMMU implementation (qemu)
> for a secure DMA environment (DMAR) in guest.
> 
> The idea is simple. When vhost meets an IOTLB miss, it will request
> the assistance of userspace to do the translation, this is done
> through:
> 
> - when there's a IOTLB miss, it will notify userspace through
>   vhost_net fd and then userspace read the fault address, size and
>   access from vhost fd.
> - userspace write the translation result back to vhost fd, vhost can
>   then update its IOTLB.
> 
> The codes were optimized for fixed mapping users e.g dpdk in guest. It
> will be slow if dynamic mappings were used in guest. We could do
> optimizations on top.
> 
> The codes were designed to be architecture independent. It should be
> easily ported to any architecture.
> 
> Stress tested with l2fwd/vfio in guest with 4K/2M/1G page size. On 1G
> hugepage case, 100% TLB hit rate were noticed.
> 
> Changes from V2:
> - introduce memory accessors for vhost
> - switch from ioctls to oridinary file read/write for iotlb miss and
>   updating
> - do not assume virtqueue were virtually mapped contiguously, all
>   virtqueue access were done throug IOTLB
> - verify memory access during IOTLB update and fail early
> - introduce a module parameter for the size of IOTLB
> 
> Changes from V1:
> - support any size/range of updating and invalidation through
>   introducing the interval tree.
> - convert from per device iotlb request to per virtqueue iotlb
>   request, this solves the possible deadlock in V1.
> - read/write permission check support.
> 
> Please review.

Nice, this looks good to me. Can you post a non-rfc please?


> Jason Wang (3):
>   vhost: introduce vhost memory accessors
>   vhost: convert pre sorted vhost memory array to interval tree
>   vhost: device IOTLB API
> 
>  drivers/vhost/net.c        |  63 +++-
>  drivers/vhost/vhost.c      | 760 ++++++++++++++++++++++++++++++++++++++-------
>  drivers/vhost/vhost.h      |  60 +++-
>  include/uapi/linux/vhost.h |  28 ++
>  4 files changed, 790 insertions(+), 121 deletions(-)
> 
> -- 
> 2.7.4

[toc] | [next] | [standalone]


#1428646

FromJason Wang <jasowang@redhat.com>
Date2016-06-22 12:10 +0200
Message-ID<rMNgC-221-41@gated-at.bofh.it>
In reply to#1427949

On 2016年06月22日 00:44, Michael S. Tsirkin wrote:
> On Tue, May 24, 2016 at 05:36:22PM +0800, Jason Wang wrote:
>> This patch tries to implement an device IOTLB for vhost. This could be
>> used with for co-operation with userspace IOMMU implementation (qemu)
>> for a secure DMA environment (DMAR) in guest.
>>
>> The idea is simple. When vhost meets an IOTLB miss, it will request
>> the assistance of userspace to do the translation, this is done
>> through:
>>
>> - when there's a IOTLB miss, it will notify userspace through
>>    vhost_net fd and then userspace read the fault address, size and
>>    access from vhost fd.
>> - userspace write the translation result back to vhost fd, vhost can
>>    then update its IOTLB.
>>
>> The codes were optimized for fixed mapping users e.g dpdk in guest. It
>> will be slow if dynamic mappings were used in guest. We could do
>> optimizations on top.
>>
>> The codes were designed to be architecture independent. It should be
>> easily ported to any architecture.
>>
>> Stress tested with l2fwd/vfio in guest with 4K/2M/1G page size. On 1G
>> hugepage case, 100% TLB hit rate were noticed.
>>
>> Changes from V2:
>> - introduce memory accessors for vhost
>> - switch from ioctls to oridinary file read/write for iotlb miss and
>>    updating
>> - do not assume virtqueue were virtually mapped contiguously, all
>>    virtqueue access were done throug IOTLB
>> - verify memory access during IOTLB update and fail early
>> - introduce a module parameter for the size of IOTLB
>>
>> Changes from V1:
>> - support any size/range of updating and invalidation through
>>    introducing the interval tree.
>> - convert from per device iotlb request to per virtqueue iotlb
>>    request, this solves the possible deadlock in V1.
>> - read/write permission check support.
>>
>> Please review.
> Nice, this looks good to me. Can you post a non-rfc please?
>
>

Posted, thanks.

>> Jason Wang (3):
>>    vhost: introduce vhost memory accessors
>>    vhost: convert pre sorted vhost memory array to interval tree
>>    vhost: device IOTLB API
>>
>>   drivers/vhost/net.c        |  63 +++-
>>   drivers/vhost/vhost.c      | 760 ++++++++++++++++++++++++++++++++++++++-------
>>   drivers/vhost/vhost.h      |  60 +++-
>>   include/uapi/linux/vhost.h |  28 ++
>>   4 files changed, 790 insertions(+), 121 deletions(-)
>>
>> -- 
>> 2.7.4
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web