[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 21/31] util: Add iova_tree_alloc
|
From: |
Peter Xu |
|
Subject: |
Re: [PATCH 21/31] util: Add iova_tree_alloc |
|
Date: |
Thu, 27 Jan 2022 16:06:19 +0800 |
On Tue, Jan 25, 2022 at 10:40:01AM +0100, Eugenio Perez Martin wrote:
> So I think that the first step to remove complexity from the old one
> is to remove iova_begin and iova_end.
>
> As Jason points out, removing iova_end is easier. It has the drawback
> of having to traverse all the list beyond iova_end, but a well formed
> iova tree should contain none. If the guest can manipulate it, it's
> only hurting itself adding nodes to it.
>
> It's possible to extract the check for hole_right (or this in Jason's
> proposal) as a special case too.
>
> But removing the iova_begin parameter is more complicated. We cannot
> know if it's a valid hole without knowing iova_begin, and we cannot
> resume traversing. Could we assume iova_begin will always be 0? I
> think not, the vdpa device can return anything through syscall.
Frankly I don't know what's the syscall you're talking about, but after a 2nd
thought and after I went back and re-read your previous version more carefully
(the one without the list) I think it seems working to me in general. I should
have tried harder when reviewing the first time!
I mean this one:
https://lore.kernel.org/qemu-devel/20211029183525.1776416-24-eperezma@redhat.com/
Though this time I have some comments on the details.
Personally I like that one (probably with some amendment upon the old version)
more than the current list-based approach. But I'd like to know your thoughts
too (including Jason). I'll further comment in that thread soon.
Thanks,
--
Peter Xu
- [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq, (continued)
- [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq, Eugenio Pérez, 2022/01/21
- [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding, Eugenio Pérez, 2022/01/21
- [PATCH 19/31] utils: Add internal DMAMap to iova-tree, Eugenio Pérez, 2022/01/21
- [PATCH 21/31] util: Add iova_tree_alloc, Eugenio Pérez, 2022/01/21
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Peter Xu, 2022/01/23
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Eugenio Perez Martin, 2022/01/24
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Peter Xu, 2022/01/24
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Eugenio Perez Martin, 2022/01/25
- Re: [PATCH 21/31] util: Add iova_tree_alloc,
Peter Xu <=
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Eugenio Perez Martin, 2022/01/27
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Peter Xu, 2022/01/27
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Jason Wang, 2022/01/28
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Eugenio Perez Martin, 2022/01/28
- Re: [PATCH 21/31] util: Add iova_tree_alloc, Jason Wang, 2022/01/30
[PATCH 20/31] util: Store DMA entries in a list, Eugenio Pérez, 2022/01/21
[PATCH 22/31] vhost: Add VhostIOVATree, Eugenio Pérez, 2022/01/21
[PATCH 24/31] vhost: Add vhost_svq_get_last_used_idx, Eugenio Pérez, 2022/01/21
[PATCH 23/31] vdpa: Add custom IOTLB translations to SVQ, Eugenio Pérez, 2022/01/21