All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] vfio-user: trivial VFIOProxy flags fix
@ 2026-01-21 10:59 Mark Cave-Ayland
  2026-01-21 10:59 ` [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value Mark Cave-Ayland
  2026-01-21 10:59 ` [PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro Mark Cave-Ayland
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Cave-Ayland @ 2026-01-21 10:59 UTC (permalink / raw)
  To: clg, john.levon, thanos.makatos, qemu-devel

This series contains a couple of trivial fixes for the VFIOProxy flags
found whilst rebasing some internal patches.

The first patch in the series fixes the incorrect value of the
VFIO_PROXY_USE_MULTI constant, whilst the second patch updates the
constants to use the BIT() macro (also removing a gap in the bit
numbering) to help prevent similar errors from occurring in future.

Note that the VFIOProxy flags are internal to QEMU and not included in
the migration stream so there are no visible effects from the bit
renumbering.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>

Mark Cave-Ayland (2):
  vfio-user: fix VFIO_PROXY_USE_MULTI constant value
  vfio-user: update VFIOProxy flag constants to use the BIT() macro

 hw/vfio-user/proxy.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value
  2026-01-21 10:59 [PATCH 0/2] vfio-user: trivial VFIOProxy flags fix Mark Cave-Ayland
@ 2026-01-21 10:59 ` Mark Cave-Ayland
  2026-01-21 11:13   ` John Levon
                     ` (2 more replies)
  2026-01-21 10:59 ` [PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro Mark Cave-Ayland
  1 sibling, 3 replies; 8+ messages in thread
From: Mark Cave-Ayland @ 2026-01-21 10:59 UTC (permalink / raw)
  To: clg, john.levon, thanos.makatos, qemu-devel

The constant value should represent the next bit in the VFIOProxy flags which
is 0x10 and not 0x16.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 hw/vfio-user/proxy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
index 61e64a0020..b09fd886f1 100644
--- a/hw/vfio-user/proxy.h
+++ b/hw/vfio-user/proxy.h
@@ -94,7 +94,7 @@ typedef struct VFIOUserProxy {
 #define VFIO_PROXY_CLIENT        0x1
 #define VFIO_PROXY_FORCE_QUEUED  0x4
 #define VFIO_PROXY_NO_POST       0x8
-#define VFIO_PROXY_USE_MULTI     0x16
+#define VFIO_PROXY_USE_MULTI     0x10
 
 /* coalescing high and low water marks for VFIOProxy num_outgoing */
 #define VFIO_USER_OUT_HIGH       1024
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro
  2026-01-21 10:59 [PATCH 0/2] vfio-user: trivial VFIOProxy flags fix Mark Cave-Ayland
  2026-01-21 10:59 ` [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value Mark Cave-Ayland
@ 2026-01-21 10:59 ` Mark Cave-Ayland
  2026-01-21 11:15   ` John Levon
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Cave-Ayland @ 2026-01-21 10:59 UTC (permalink / raw)
  To: clg, john.levon, thanos.makatos, qemu-devel

This should help avoid incorrect constant values being used in future. At
the same time we can remove the gap left for BIT(1) which was originally
intended for the VFIO_PROXY_NO_MMAP feature which was removed from later
versions of the vfio-user series.

Suggested-by: John Levon <john.levon@nutanix.com>
Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 hw/vfio-user/proxy.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
index b09fd886f1..7b97460cc5 100644
--- a/hw/vfio-user/proxy.h
+++ b/hw/vfio-user/proxy.h
@@ -91,10 +91,10 @@ typedef struct VFIOUserProxy {
 } VFIOUserProxy;
 
 /* VFIOProxy flags */
-#define VFIO_PROXY_CLIENT        0x1
-#define VFIO_PROXY_FORCE_QUEUED  0x4
-#define VFIO_PROXY_NO_POST       0x8
-#define VFIO_PROXY_USE_MULTI     0x10
+#define VFIO_PROXY_CLIENT        BIT(0)
+#define VFIO_PROXY_FORCE_QUEUED  BIT(1)
+#define VFIO_PROXY_NO_POST       BIT(2)
+#define VFIO_PROXY_USE_MULTI     BIT(3)
 
 /* coalescing high and low water marks for VFIOProxy num_outgoing */
 #define VFIO_USER_OUT_HIGH       1024
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value
  2026-01-21 10:59 ` [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value Mark Cave-Ayland
@ 2026-01-21 11:13   ` John Levon
  2026-01-21 11:15   ` Cédric Le Goater
  2026-01-21 11:16   ` John Levon
  2 siblings, 0 replies; 8+ messages in thread
From: John Levon @ 2026-01-21 11:13 UTC (permalink / raw)
  To: Mark Cave-Ayland; +Cc: clg, thanos.makatos, qemu-devel

On Wed, Jan 21, 2026 at 10:59:45AM +0000, Mark Cave-Ayland wrote:

> The constant value should represent the next bit in the VFIOProxy flags which
> is 0x10 and not 0x16.
> 
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>  hw/vfio-user/proxy.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
> index 61e64a0020..b09fd886f1 100644
> --- a/hw/vfio-user/proxy.h
> +++ b/hw/vfio-user/proxy.h
> @@ -94,7 +94,7 @@ typedef struct VFIOUserProxy {
>  #define VFIO_PROXY_CLIENT        0x1
>  #define VFIO_PROXY_FORCE_QUEUED  0x4
>  #define VFIO_PROXY_NO_POST       0x8
> -#define VFIO_PROXY_USE_MULTI     0x16
> +#define VFIO_PROXY_USE_MULTI     0x10
>  
>  /* coalescing high and low water marks for VFIOProxy num_outgoing */
>  #define VFIO_USER_OUT_HIGH       1024

Reviewed-by: John Levon <john.levon@nutanix.com>

thanks
john


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value
  2026-01-21 10:59 ` [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value Mark Cave-Ayland
  2026-01-21 11:13   ` John Levon
@ 2026-01-21 11:15   ` Cédric Le Goater
  2026-01-21 12:06     ` Mark Cave-Ayland
  2026-01-21 11:16   ` John Levon
  2 siblings, 1 reply; 8+ messages in thread
From: Cédric Le Goater @ 2026-01-21 11:15 UTC (permalink / raw)
  To: Mark Cave-Ayland, john.levon, thanos.makatos, qemu-devel

On 1/21/26 11:59, Mark Cave-Ayland wrote:
> The constant value should represent the next bit in the VFIOProxy flags which
> is 0x10 and not 0x16.
> 
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>

Should there be a Fixes tag ?

Thanks,

C.


> ---
>   hw/vfio-user/proxy.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
> index 61e64a0020..b09fd886f1 100644
> --- a/hw/vfio-user/proxy.h
> +++ b/hw/vfio-user/proxy.h
> @@ -94,7 +94,7 @@ typedef struct VFIOUserProxy {
>   #define VFIO_PROXY_CLIENT        0x1
>   #define VFIO_PROXY_FORCE_QUEUED  0x4
>   #define VFIO_PROXY_NO_POST       0x8
> -#define VFIO_PROXY_USE_MULTI     0x16
> +#define VFIO_PROXY_USE_MULTI     0x10
>   
>   /* coalescing high and low water marks for VFIOProxy num_outgoing */
>   #define VFIO_USER_OUT_HIGH       1024



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro
  2026-01-21 10:59 ` [PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro Mark Cave-Ayland
@ 2026-01-21 11:15   ` John Levon
  0 siblings, 0 replies; 8+ messages in thread
From: John Levon @ 2026-01-21 11:15 UTC (permalink / raw)
  To: Mark Cave-Ayland; +Cc: clg, thanos.makatos, qemu-devel

On Wed, Jan 21, 2026 at 10:59:46AM +0000, Mark Cave-Ayland wrote:

> This should help avoid incorrect constant values being used in future. At
> the same time we can remove the gap left for BIT(1) which was originally
> intended for the VFIO_PROXY_NO_MMAP feature which was removed from later
> versions of the vfio-user series.
> 
> Suggested-by: John Levon <john.levon@nutanix.com>
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>  hw/vfio-user/proxy.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
> index b09fd886f1..7b97460cc5 100644
> --- a/hw/vfio-user/proxy.h
> +++ b/hw/vfio-user/proxy.h
> @@ -91,10 +91,10 @@ typedef struct VFIOUserProxy {
>  } VFIOUserProxy;
>  
>  /* VFIOProxy flags */
> -#define VFIO_PROXY_CLIENT        0x1
> -#define VFIO_PROXY_FORCE_QUEUED  0x4
> -#define VFIO_PROXY_NO_POST       0x8
> -#define VFIO_PROXY_USE_MULTI     0x10
> +#define VFIO_PROXY_CLIENT        BIT(0)
> +#define VFIO_PROXY_FORCE_QUEUED  BIT(1)
> +#define VFIO_PROXY_NO_POST       BIT(2)
> +#define VFIO_PROXY_USE_MULTI     BIT(3)
>  
>  /* coalescing high and low water marks for VFIOProxy num_outgoing */
>  #define VFIO_USER_OUT_HIGH       1024

Reviewed-by: John Levon <john.levon@nutanix.com>

thanks
john


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value
  2026-01-21 10:59 ` [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value Mark Cave-Ayland
  2026-01-21 11:13   ` John Levon
  2026-01-21 11:15   ` Cédric Le Goater
@ 2026-01-21 11:16   ` John Levon
  2 siblings, 0 replies; 8+ messages in thread
From: John Levon @ 2026-01-21 11:16 UTC (permalink / raw)
  To: Mark Cave-Ayland; +Cc: clg, thanos.makatos, qemu-devel

On Wed, Jan 21, 2026 at 10:59:45AM +0000, Mark Cave-Ayland wrote:

> The constant value should represent the next bit in the VFIOProxy flags which
> is 0x10 and not 0x16.
> 
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>  hw/vfio-user/proxy.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
> index 61e64a0020..b09fd886f1 100644
> --- a/hw/vfio-user/proxy.h
> +++ b/hw/vfio-user/proxy.h
> @@ -94,7 +94,7 @@ typedef struct VFIOUserProxy {
>  #define VFIO_PROXY_CLIENT        0x1
>  #define VFIO_PROXY_FORCE_QUEUED  0x4
>  #define VFIO_PROXY_NO_POST       0x8
> -#define VFIO_PROXY_USE_MULTI     0x16
> +#define VFIO_PROXY_USE_MULTI     0x10
>  
>  /* coalescing high and low water marks for VFIOProxy num_outgoing */
>  #define VFIO_USER_OUT_HIGH       1024

In case anyone is wondering, this never bit us because the MULTI support is not
yet merged into libvfio-user

regards
john


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value
  2026-01-21 11:15   ` Cédric Le Goater
@ 2026-01-21 12:06     ` Mark Cave-Ayland
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Cave-Ayland @ 2026-01-21 12:06 UTC (permalink / raw)
  To: Cédric Le Goater, john.levon, thanos.makatos, qemu-devel

On 21/01/2026 11:15, Cédric Le Goater wrote:

> On 1/21/26 11:59, Mark Cave-Ayland wrote:
>> The constant value should represent the next bit in the VFIOProxy 
>> flags which
>> is 0x10 and not 0x16.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> 
> Should there be a Fixes tag ?

Yes indeed, it should be:

Fixes: 1a0c32a9da ("vfio-user: add coalesced posted writes")

Would you like me to resend a v2?


ATB,

Mark.

> Thanks,
> 
> C.
> 
> 
>> ---
>>   hw/vfio-user/proxy.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/vfio-user/proxy.h b/hw/vfio-user/proxy.h
>> index 61e64a0020..b09fd886f1 100644
>> --- a/hw/vfio-user/proxy.h
>> +++ b/hw/vfio-user/proxy.h
>> @@ -94,7 +94,7 @@ typedef struct VFIOUserProxy {
>>   #define VFIO_PROXY_CLIENT        0x1
>>   #define VFIO_PROXY_FORCE_QUEUED  0x4
>>   #define VFIO_PROXY_NO_POST       0x8
>> -#define VFIO_PROXY_USE_MULTI     0x16
>> +#define VFIO_PROXY_USE_MULTI     0x10
>>   /* coalescing high and low water marks for VFIOProxy num_outgoing */
>>   #define VFIO_USER_OUT_HIGH       1024




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-01-21 12:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-21 10:59 [PATCH 0/2] vfio-user: trivial VFIOProxy flags fix Mark Cave-Ayland
2026-01-21 10:59 ` [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value Mark Cave-Ayland
2026-01-21 11:13   ` John Levon
2026-01-21 11:15   ` Cédric Le Goater
2026-01-21 12:06     ` Mark Cave-Ayland
2026-01-21 11:16   ` John Levon
2026-01-21 10:59 ` [PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro Mark Cave-Ayland
2026-01-21 11:15   ` John Levon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.