Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-03-08 Thread David Hildenbrand
So we tricked used_memslots to be smaller than it actually has to be, because we're ignoring the memslots filtered out by the vhost-user device. Now, this is all far from relevant in practice as of now I think, and usually would indicate user errors already (memory that's not shared with vhost-

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-03-08 Thread Igor Mammedov
On Tue, 7 Mar 2023 13:46:36 +0100 David Hildenbrand wrote: > On 07.03.23 11:51, Igor Mammedov wrote: > > On Thu, 16 Feb 2023 12:47:51 +0100 > > David Hildenbrand wrote: > > > >> Having multiple devices, some filtering memslots and some not filtering > >> memslots, messes up the "used_memslot"

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-03-07 Thread David Hildenbrand
On 07.03.23 11:51, Igor Mammedov wrote: On Thu, 16 Feb 2023 12:47:51 +0100 David Hildenbrand wrote: Having multiple devices, some filtering memslots and some not filtering memslots, messes up the "used_memslot" accounting. If we'd have a device the filters out less memory sections after a devi

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-03-07 Thread Igor Mammedov
On Thu, 16 Feb 2023 12:47:51 +0100 David Hildenbrand wrote: > Having multiple devices, some filtering memslots and some not filtering > memslots, messes up the "used_memslot" accounting. If we'd have a device > the filters out less memory sections after a device that filters out more, > we'd be i

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-02-16 Thread David Hildenbrand
On 16.02.23 13:21, Michael S. Tsirkin wrote: On Thu, Feb 16, 2023 at 01:10:54PM +0100, David Hildenbrand wrote: On 16.02.23 13:04, Michael S. Tsirkin wrote: On Thu, Feb 16, 2023 at 12:47:51PM +0100, David Hildenbrand wrote: Having multiple devices, some filtering memslots and some not filterin

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-02-16 Thread Michael S. Tsirkin
On Thu, Feb 16, 2023 at 01:13:07PM +0100, David Hildenbrand wrote: > On 16.02.23 13:10, David Hildenbrand wrote: > > On 16.02.23 13:04, Michael S. Tsirkin wrote: > > > On Thu, Feb 16, 2023 at 12:47:51PM +0100, David Hildenbrand wrote: > > > > Having multiple devices, some filtering memslots and som

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-02-16 Thread Michael S. Tsirkin
On Thu, Feb 16, 2023 at 01:10:54PM +0100, David Hildenbrand wrote: > On 16.02.23 13:04, Michael S. Tsirkin wrote: > > On Thu, Feb 16, 2023 at 12:47:51PM +0100, David Hildenbrand wrote: > > > Having multiple devices, some filtering memslots and some not filtering > > > memslots, messes up the "used_

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-02-16 Thread David Hildenbrand
On 16.02.23 13:10, David Hildenbrand wrote: On 16.02.23 13:04, Michael S. Tsirkin wrote: On Thu, Feb 16, 2023 at 12:47:51PM +0100, David Hildenbrand wrote: Having multiple devices, some filtering memslots and some not filtering memslots, messes up the "used_memslot" accounting. If we'd have a d

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-02-16 Thread David Hildenbrand
On 16.02.23 13:04, Michael S. Tsirkin wrote: On Thu, Feb 16, 2023 at 12:47:51PM +0100, David Hildenbrand wrote: Having multiple devices, some filtering memslots and some not filtering memslots, messes up the "used_memslot" accounting. If we'd have a device the filters out less memory sections af

Re: [PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-02-16 Thread Michael S. Tsirkin
On Thu, Feb 16, 2023 at 12:47:51PM +0100, David Hildenbrand wrote: > Having multiple devices, some filtering memslots and some not filtering > memslots, messes up the "used_memslot" accounting. If we'd have a device > the filters out less memory sections after a device that filters out more, > we'd

[PATCH v1 1/2] vhost: Defer filtering memory sections until building the vhost memory structure

2023-02-16 Thread David Hildenbrand
Having multiple devices, some filtering memslots and some not filtering memslots, messes up the "used_memslot" accounting. If we'd have a device the filters out less memory sections after a device that filters out more, we'd be in trouble, because our memslot checks stop working reliably. For examp