Re: [PATCH v3 1/3] vhost: Rework memslot filtering and fix "used_memslot" tracking

2023-05-23 Thread David Hildenbrand
[...] --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -46,20 +46,33 @@ static struct vhost_log *vhost_log; static struct vhost_log *vhost_log_shm; +/* Memslots used by backends that support private memslots (without an fd). */ static unsigned int used_memslots; + +/* Memslots used

Re: [PATCH v3 1/3] vhost: Rework memslot filtering and fix "used_memslot" tracking

2023-05-23 Thread Peter Xu
On Wed, May 03, 2023 at 07:21:19PM +0200, David Hildenbrand wrote: > Having multiple vhost devices, some filtering out fd-less memslots and > some not, can mess up the "used_memslot" accounting. Consequently our > "free memslot" checks become unreliable and we might run out of free > memslots at

[PATCH v3 1/3] vhost: Rework memslot filtering and fix "used_memslot" tracking

2023-05-03 Thread David Hildenbrand
Having multiple vhost devices, some filtering out fd-less memslots and some not, can mess up the "used_memslot" accounting. Consequently our "free memslot" checks become unreliable and we might run out of free memslots at runtime later. An example sequence which can trigger a potential issue that