Displaying 20 results from an estimated 82 matches for "vhost_iotlb_upd".
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...t 11:30:11AM +0800, Jason Wang wrote:
>>>> 5) generate diffs of memory table and using IOMMU API to setup the dma
>>>> mapping in this method
>>> Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
>>>
>> Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
> Do you mean we let userspace to only use VHOST_IOTLB_UPDATE/INVALIDATE
> to do the DMA mapping in vhost-vdpa case? When vIOMMU isn't available,
> userspace will set msg->iova to GPA, otherwise userspace will set
> msg->iova to GIOVA, and vhost-vdpa mod...
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...t 11:30:11AM +0800, Jason Wang wrote:
>>>> 5) generate diffs of memory table and using IOMMU API to setup the dma
>>>> mapping in this method
>>> Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
>>>
>> Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
> Do you mean we let userspace to only use VHOST_IOTLB_UPDATE/INVALIDATE
> to do the DMA mapping in vhost-vdpa case? When vIOMMU isn't available,
> userspace will set msg->iova to GPA, otherwise userspace will set
> msg->iova to GIOVA, and vhost-vdpa mod...
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...t;>>>>> 5) generate diffs of memory table and using IOMMU API to setup the dma
>>>>>> mapping in this method
>>>>> Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
>>>>>
>>>> Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
>>> Do you mean we let userspace to only use VHOST_IOTLB_UPDATE/INVALIDATE
>>> to do the DMA mapping in vhost-vdpa case? When vIOMMU isn't available,
>>> userspace will set msg->iova to GPA, otherwise userspace will set
>>> msg->i...
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...t;>>>>> 5) generate diffs of memory table and using IOMMU API to setup the dma
>>>>>> mapping in this method
>>>>> Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
>>>>>
>>>> Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
>>> Do you mean we let userspace to only use VHOST_IOTLB_UPDATE/INVALIDATE
>>> to do the DMA mapping in vhost-vdpa case? When vIOMMU isn't available,
>>> userspace will set msg->iova to GPA, otherwise userspace will set
>>> msg->i...
2020 Feb 05
1
[PATCH] vhost: introduce vDPA based backend
...ng IOMMU API to setup the dma
>>>>>>>>>> mapping in this method
>>>>>>>>> Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
>>>>>>>>>
>>>>>>>> Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
>>>>>>> Do you mean we let userspace to only use VHOST_IOTLB_UPDATE/INVALIDATE
>>>>>>> to do the DMA mapping in vhost-vdpa case? When vIOMMU isn't available,
>>>>>>> userspace will set msg->iova to GPA, oth...
2018 May 22
3
[PATCH net] vhost: synchronize IOTLB message with dev cleanup
DaeRyong Jeong reports a race between vhost_dev_cleanup() and
vhost_process_iotlb_msg():
Thread interleaving:
CPU0 (vhost_process_iotlb_msg) CPU1 (vhost_dev_cleanup)
(In the case of both VHOST_IOTLB_UPDATE and
VHOST_IOTLB_INVALIDATE)
===== =====
vhost_umem_clean(dev->iotlb);
if (!dev->iotlb) {
ret = -EFAULT;
break;
}
dev->iotlb = NULL;
The reason is we don't synchronize between them, fixing by protecting
vhost_process_iotlb_msg() with dev mutex.
R...
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...te diffs of memory table and using IOMMU API to setup the dma
>>>>>>>> mapping in this method
>>>>>>> Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
>>>>>>>
>>>>>> Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
>>>>> Do you mean we let userspace to only use VHOST_IOTLB_UPDATE/INVALIDATE
>>>>> to do the DMA mapping in vhost-vdpa case? When vIOMMU isn't available,
>>>>> userspace will set msg->iova to GPA, otherwise userspace will se...
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...te diffs of memory table and using IOMMU API to setup the dma
>>>>>>>> mapping in this method
>>>>>>> Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
>>>>>>>
>>>>>> Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
>>>>> Do you mean we let userspace to only use VHOST_IOTLB_UPDATE/INVALIDATE
>>>>> to do the DMA mapping in vhost-vdpa case? When vIOMMU isn't available,
>>>>> userspace will set msg->iova to GPA, otherwise userspace will se...
2020 Feb 04
2
[PATCH] vhost: introduce vDPA based backend
...irkin wrote:
> On Tue, Feb 04, 2020 at 11:30:11AM +0800, Jason Wang wrote:
>> 5) generate diffs of memory table and using IOMMU API to setup the dma
>> mapping in this method
> Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
>
Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
Thanks
2020 Feb 04
2
[PATCH] vhost: introduce vDPA based backend
...irkin wrote:
> On Tue, Feb 04, 2020 at 11:30:11AM +0800, Jason Wang wrote:
>> 5) generate diffs of memory table and using IOMMU API to setup the dma
>> mapping in this method
> Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
>
Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
Thanks
2018 May 21
2
KASAN: use-after-free Read in vhost_chr_write_iter
...> > > keep executing without returning -EFAULT. Consequently, use-after-free
> > > occures
> > >
> > >
> > > Thread interleaving:
> > > CPU0 (vhost_process_iotlb_msg)??????????????? CPU1 (vhost_dev_cleanup)
> > > (In the case of both VHOST_IOTLB_UPDATE and
> > > VHOST_IOTLB_INVALIDATE)
> > > =====??????????????????????????? =====
> > > ??????????????????????????? vhost_umem_clean(dev->iotlb);
> > > if (!dev->iotlb) {
> > > ??????????? ret = -EFAULT;
> > > ??????????????? break;
> &...
2018 May 21
2
KASAN: use-after-free Read in vhost_chr_write_iter
...> > > keep executing without returning -EFAULT. Consequently, use-after-free
> > > occures
> > >
> > >
> > > Thread interleaving:
> > > CPU0 (vhost_process_iotlb_msg)??????????????? CPU1 (vhost_dev_cleanup)
> > > (In the case of both VHOST_IOTLB_UPDATE and
> > > VHOST_IOTLB_INVALIDATE)
> > > =====??????????????????????????? =====
> > > ??????????????????????????? vhost_umem_clean(dev->iotlb);
> > > if (!dev->iotlb) {
> > > ??????????? ret = -EFAULT;
> > > ??????????????? break;
> &...
2020 Jul 01
5
[PATCH 0/5]
....
Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it
can only forward one mapping to IOMMU or device through IOMMU API or
dma_map(). Though set_map() is designed to have the capability to pass
an rbtree based mapping to vDPA device, it's still be called at least
once for each VHOST_IOTLB_UPDATE or VHOST_IOTLB_INVALIDATE. This is
because vhost-vdpa doesn't know the userspace start or stop then
updating.
So this patch introduces two flags as hints for vhost-vdpa to call
set_map() only when userspace finish a batch of IOTLB updating.
So instead of:
1) VHOST_IOTLB_UPDATE/VHOST_IOTLB...
2020 Jun 18
6
[PATCH RFC 0/5] support batched IOTLB updating in vhost-vdpa
....
Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it
can only forward one mapping to IOMMU or device through IOMMU API or
dma_map(). Though set_map() is deisgend to have the capability to pass
an rbtree based mapping to vDPA device, it's still be called at least
once for each VHOST_IOTLB_UPDATE or VHOST_IOTLB_INVALIDATE. This is
because vhost-vdpa doesn't know the userspace start or stop then
updating.
So this patch introduces two flags as hints for vhost-vdpa to call
set_map() only when userspace finish a batch of IOTLB updating.
So instead of:
1) VHOST_IOTLB_UPDATE/VHOST_IOTLB...
2018 May 18
3
KASAN: use-after-free Read in vhost_chr_write_iter
...s
> dev->iotlb, vhost_process_iotlb_msg() still sees the non-null value and it
> keep executing without returning -EFAULT. Consequently, use-after-free
> occures
>
>
> Thread interleaving:
> CPU0 (vhost_process_iotlb_msg) CPU1 (vhost_dev_cleanup)
> (In the case of both VHOST_IOTLB_UPDATE and
> VHOST_IOTLB_INVALIDATE)
> ===== =====
> vhost_umem_clean(dev->iotlb);
> if (!dev->iotlb) {
> ret = -EFAULT;
> break;
> }
> dev->iotlb = NULL;
>
>
> Call Sequence:
> CPU0
> =====
> vhost_net_chr_write_...
2018 May 18
3
KASAN: use-after-free Read in vhost_chr_write_iter
...s
> dev->iotlb, vhost_process_iotlb_msg() still sees the non-null value and it
> keep executing without returning -EFAULT. Consequently, use-after-free
> occures
>
>
> Thread interleaving:
> CPU0 (vhost_process_iotlb_msg) CPU1 (vhost_dev_cleanup)
> (In the case of both VHOST_IOTLB_UPDATE and
> VHOST_IOTLB_INVALIDATE)
> ===== =====
> vhost_umem_clean(dev->iotlb);
> if (!dev->iotlb) {
> ret = -EFAULT;
> break;
> }
> dev->iotlb = NULL;
>
>
> Call Sequence:
> CPU0
> =====
> vhost_net_chr_write_...
2020 Jun 28
2
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...n Wang wrote:
> This patches extend the vhost IOTLB API to accept batch updating hints
> form userspace. When userspace wants update the device IOTLB in a
> batch, it may do:
>
> 1) Write vhost_iotlb_msg with VHOST_IOTLB_BATCH_BEGIN flag
> 2) Perform a batch of IOTLB updating via VHOST_IOTLB_UPDATE/INVALIDATE
> 3) Write vhost_iotlb_msg with VHOST_IOTLB_BATCH_END flag
As long as we are extending the interface,
is there some way we could cut down the number of system calls needed
here?
>
> Vhost-vdpa may decide to batch the IOMMU/IOTLB updating in step 3 when
> vDPA device su...
2020 Jun 28
2
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...n Wang wrote:
> This patches extend the vhost IOTLB API to accept batch updating hints
> form userspace. When userspace wants update the device IOTLB in a
> batch, it may do:
>
> 1) Write vhost_iotlb_msg with VHOST_IOTLB_BATCH_BEGIN flag
> 2) Perform a batch of IOTLB updating via VHOST_IOTLB_UPDATE/INVALIDATE
> 3) Write vhost_iotlb_msg with VHOST_IOTLB_BATCH_END flag
As long as we are extending the interface,
is there some way we could cut down the number of system calls needed
here?
>
> Vhost-vdpa may decide to batch the IOMMU/IOTLB updating in step 3 when
> vDPA device su...
2020 Feb 05
0
[PATCH] vhost: introduce vDPA based backend
...ffs of memory table and using IOMMU API to setup the dma
> > > > > > > mapping in this method
> > > > > > Frankly I think that's a bunch of work. Why not a MAP/UNMAP interface?
> > > > > >
> > > > > Sure, so that basically VHOST_IOTLB_UPDATE/INVALIDATE I think?
> > > > Do you mean we let userspace to only use VHOST_IOTLB_UPDATE/INVALIDATE
> > > > to do the DMA mapping in vhost-vdpa case? When vIOMMU isn't available,
> > > > userspace will set msg->iova to GPA, otherwise userspace will set
&...
2023 Aug 24
1
[PATCH v2] vhost: Allow null msg.size on VHOST_IOTLB_INVALIDATE
...("vhost: fix hung thread due to erroneous iotlb
entries") Forbade vhost iotlb msg with null size to prevent entries
with size = start = 0 and last = ULONG_MAX to end up in the iotlb.
Then commit 95932ab2ea07 ("vhost: allow batching hint without size")
only applied the check for VHOST_IOTLB_UPDATE and VHOST_IOTLB_INVALIDATE
message types to fix a regression observed with batching hit.
Still, the introduction of that check introduced a regression for
some users attempting to invalidate the whole ULONG_MAX range by
setting the size to 0. This is the case with qemu/smmuv3/vhost
integration...