vfio-user: trivial VFIOProxy flags fix
cover vfio-user: trivial VFIOProxy flags fix
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.
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(-)
Signature · 1 line
2.43.0
PATCH 1/2 vfio-user: fix VFIO_PROXY_USE_MULTI constant value
The constant value should represent the next bit in the VFIOProxy flags which is 0x10 and not 0x16.
--- hw/vfio-user/proxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio-user/proxy.h +1 -1
@@ -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
Signature · 1 line
2.43.0
Re: [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value
Quoted 13 lines · Mark Cave-Ayland
The constant value should represent the next bit in the VFIOProxy flags which is
0x10and not0x16.Signed-off-by Mark Cave-Ayland <[email protected]>--- hw/vfio-user/proxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/vfio-user/proxy.h +0
-0
hw/vfio-user/proxy.h typedef struct VFIOUserProxy { · line 100
Quoted 8 lines
hw/vfio-user/proxy.h +1
-1@@ -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
thanks
john
Re: [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value
In reply to Mark Cave-AylandQuoted 4 lines · Mark Cave-Ayland
The constant value should represent the next bit in the VFIOProxy flags which is
0x10and not0x16.Signed-off-by Mark Cave-Ayland <[email protected]>
Should there be a Fixes tag ?
Thanks,
C.
Quoted 17 lines
--- hw/vfio-user/proxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/vfio-user/proxy.h +1
-1@@ -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
Re: [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value
Quoted 7 lines · Cédric Le Goater
Quoted 4 lines · Mark Cave-Ayland
The constant value should represent the next bit in the VFIOProxy flags which is
0x10and not0x16.Signed-off-by Mark Cave-Ayland <[email protected]>Should there be a Fixes tag ?
Yes indeed, it should be:
Would you like me to resend a v2?
ATB,
Mark.
Quoted 21 lines
Thanks,
C.
Quoted 16 lines
---
hw/vfio-user/proxy.h| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)hw/vfio-user/proxy.h +1
-1@@ -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
Re: [PATCH 1/2] vfio-user: fix VFIO_PROXY_USE_MULTI constant value
In reply to Mark Cave-AylandQuoted 13 lines · Mark Cave-Ayland
The constant value should represent the next bit in the VFIOProxy flags which is
0x10and not0x16.Signed-off-by Mark Cave-Ayland <[email protected]>--- hw/vfio-user/proxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/vfio-user/proxy.h +0
-0
hw/vfio-user/proxy.h typedef struct VFIOUserProxy { · line 100
Quoted 8 lines
hw/vfio-user/proxy.h +1
-1@@ -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
PATCH 2/2 vfio-user: update VFIOProxy flag constants to use the BIT() macro
In reply to Mark Cave-AylandThis 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.
--- hw/vfio-user/proxy.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/vfio-user/proxy.h +4 -4
@@ -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
Signature · 1 line
2.43.0
Re: [PATCH 2/2] vfio-user: update VFIOProxy flag constants to use the BIT() macro
Quoted 20 lines · Mark Cave-Ayland
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_MMAPfeature which was removed from later versions of the vfio-user series.Suggested-by John Levon <[email protected]>Signed-off-by Mark Cave-Ayland <[email protected]>--- hw/vfio-user/proxy.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)hw/vfio-user/proxy.h +0
-1@@ -91,10 +91,10 @@ typedef struct VFIOUserProxy { } VFIOUserProxy;/* VFIOProxy flags */ -#define VFIO_PROXY_CLIENT 0x1
hw/vfio-user/proxy.h typedef struct VFIOUserProxy { · line 100
Quoted 10 lines
hw/vfio-user/proxy.h +4
-3-#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
thanks
john