public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h:
@ 2024-01-24 17:23 Suzuki K Poulose
  2024-01-24 18:22 ` Jean-Philippe Brucker
  2024-01-25 22:48 ` Michael S. Tsirkin
  0 siblings, 2 replies; 7+ messages in thread
From: Suzuki K Poulose @ 2024-01-24 17:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: kvm, Suzuki K Poulose, Feng Liu, Michael S . Tsirkin,
	Yishai Hadas, Alex Williamson, Jean-Philippe Brucker

Commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
added "__packed" structures to UAPI header linux/virtio_pci.h. This triggers
build failures in the consumer userspace applications without proper "definition"
of __packed (e.g., kvmtool build fails).

Moreover, the structures are already packed well, and doesn't need explicit
packing, similar to the rest of the structures in all virtio_* headers. Remove
the __packed attribute.

Fixes: commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
Cc: Feng Liu <feliu@nvidia.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Yishai Hadas <yishaih@nvidia.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 include/uapi/linux/virtio_pci.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index ef3810dee7ef..a8208492e822 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -240,7 +240,7 @@ struct virtio_pci_cfg_cap {
 #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ		0x5
 #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO		0x6
 
-struct __packed virtio_admin_cmd_hdr {
+struct virtio_admin_cmd_hdr {
 	__le16 opcode;
 	/*
 	 * 1 - SR-IOV
@@ -252,20 +252,20 @@ struct __packed virtio_admin_cmd_hdr {
 	__le64 group_member_id;
 };
 
-struct __packed virtio_admin_cmd_status {
+struct virtio_admin_cmd_status {
 	__le16 status;
 	__le16 status_qualifier;
 	/* Unused, reserved for future extensions. */
 	__u8 reserved2[4];
 };
 
-struct __packed virtio_admin_cmd_legacy_wr_data {
+struct virtio_admin_cmd_legacy_wr_data {
 	__u8 offset; /* Starting offset of the register(s) to write. */
 	__u8 reserved[7];
 	__u8 registers[];
 };
 
-struct __packed virtio_admin_cmd_legacy_rd_data {
+struct virtio_admin_cmd_legacy_rd_data {
 	__u8 offset; /* Starting offset of the register(s) to read. */
 };
 
@@ -275,7 +275,7 @@ struct __packed virtio_admin_cmd_legacy_rd_data {
 
 #define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4
 
-struct __packed virtio_admin_cmd_notify_info_data {
+struct virtio_admin_cmd_notify_info_data {
 	__u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */
 	__u8 bar; /* BAR of the member or the owner device */
 	__u8 padding[6];
-- 
2.34.1


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

* Re: [PATCH] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h:
  2024-01-24 17:23 [PATCH] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h: Suzuki K Poulose
@ 2024-01-24 18:22 ` Jean-Philippe Brucker
  2024-01-25 22:48 ` Michael S. Tsirkin
  1 sibling, 0 replies; 7+ messages in thread
From: Jean-Philippe Brucker @ 2024-01-24 18:22 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: linux-kernel, kvm, Feng Liu, Michael S . Tsirkin, Yishai Hadas,
	Alex Williamson

On Wed, Jan 24, 2024 at 05:23:45PM +0000, Suzuki K Poulose wrote:
> Commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
> added "__packed" structures to UAPI header linux/virtio_pci.h. This triggers
> build failures in the consumer userspace applications without proper "definition"
> of __packed (e.g., kvmtool build fails).
> 
> Moreover, the structures are already packed well, and doesn't need explicit
> packing, similar to the rest of the structures in all virtio_* headers. Remove
> the __packed attribute.
> 
> Fixes: commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
> Cc: Feng Liu <feliu@nvidia.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Yishai Hadas <yishaih@nvidia.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

> ---
>  include/uapi/linux/virtio_pci.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
> index ef3810dee7ef..a8208492e822 100644
> --- a/include/uapi/linux/virtio_pci.h
> +++ b/include/uapi/linux/virtio_pci.h
> @@ -240,7 +240,7 @@ struct virtio_pci_cfg_cap {
>  #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ		0x5
>  #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO		0x6
>  
> -struct __packed virtio_admin_cmd_hdr {
> +struct virtio_admin_cmd_hdr {
>  	__le16 opcode;
>  	/*
>  	 * 1 - SR-IOV
> @@ -252,20 +252,20 @@ struct __packed virtio_admin_cmd_hdr {
>  	__le64 group_member_id;
>  };
>  
> -struct __packed virtio_admin_cmd_status {
> +struct virtio_admin_cmd_status {
>  	__le16 status;
>  	__le16 status_qualifier;
>  	/* Unused, reserved for future extensions. */
>  	__u8 reserved2[4];
>  };
>  
> -struct __packed virtio_admin_cmd_legacy_wr_data {
> +struct virtio_admin_cmd_legacy_wr_data {
>  	__u8 offset; /* Starting offset of the register(s) to write. */
>  	__u8 reserved[7];
>  	__u8 registers[];
>  };
>  
> -struct __packed virtio_admin_cmd_legacy_rd_data {
> +struct virtio_admin_cmd_legacy_rd_data {
>  	__u8 offset; /* Starting offset of the register(s) to read. */
>  };
>  
> @@ -275,7 +275,7 @@ struct __packed virtio_admin_cmd_legacy_rd_data {
>  
>  #define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4
>  
> -struct __packed virtio_admin_cmd_notify_info_data {
> +struct virtio_admin_cmd_notify_info_data {
>  	__u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */
>  	__u8 bar; /* BAR of the member or the owner device */
>  	__u8 padding[6];
> -- 
> 2.34.1
> 

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

* Re: [PATCH] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h:
  2024-01-24 17:23 [PATCH] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h: Suzuki K Poulose
  2024-01-24 18:22 ` Jean-Philippe Brucker
@ 2024-01-25 22:48 ` Michael S. Tsirkin
  2024-01-25 23:10   ` Suzuki K Poulose
  1 sibling, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2024-01-25 22:48 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: linux-kernel, kvm, Feng Liu, Yishai Hadas, Alex Williamson,
	Jean-Philippe Brucker

On Wed, Jan 24, 2024 at 05:23:45PM +0000, Suzuki K Poulose wrote:
> Commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
> added "__packed" structures to UAPI header linux/virtio_pci.h. This triggers
> build failures in the consumer userspace applications without proper "definition"
> of __packed (e.g., kvmtool build fails).
> 
> Moreover, the structures are already packed well, and doesn't need explicit
> packing, similar to the rest of the structures in all virtio_* headers. Remove
> the __packed attribute.
> 
> Fixes: commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")


Proper form is:

Fixes: 92792ac752aa ("virtio-pci: Introduce admin command sending function")

> Cc: Feng Liu <feliu@nvidia.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Yishai Hadas <yishaih@nvidia.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  include/uapi/linux/virtio_pci.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
> index ef3810dee7ef..a8208492e822 100644
> --- a/include/uapi/linux/virtio_pci.h
> +++ b/include/uapi/linux/virtio_pci.h
> @@ -240,7 +240,7 @@ struct virtio_pci_cfg_cap {
>  #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ		0x5
>  #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO		0x6
>  
> -struct __packed virtio_admin_cmd_hdr {
> +struct virtio_admin_cmd_hdr {
>  	__le16 opcode;
>  	/*
>  	 * 1 - SR-IOV
> @@ -252,20 +252,20 @@ struct __packed virtio_admin_cmd_hdr {
>  	__le64 group_member_id;
>  };
>  
> -struct __packed virtio_admin_cmd_status {
> +struct virtio_admin_cmd_status {
>  	__le16 status;
>  	__le16 status_qualifier;
>  	/* Unused, reserved for future extensions. */
>  	__u8 reserved2[4];
>  };
>  
> -struct __packed virtio_admin_cmd_legacy_wr_data {
> +struct virtio_admin_cmd_legacy_wr_data {
>  	__u8 offset; /* Starting offset of the register(s) to write. */
>  	__u8 reserved[7];
>  	__u8 registers[];
>  };
>  
> -struct __packed virtio_admin_cmd_legacy_rd_data {
> +struct virtio_admin_cmd_legacy_rd_data {
>  	__u8 offset; /* Starting offset of the register(s) to read. */
>  };
>  
> @@ -275,7 +275,7 @@ struct __packed virtio_admin_cmd_legacy_rd_data {
>  
>  #define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4
>  
> -struct __packed virtio_admin_cmd_notify_info_data {
> +struct virtio_admin_cmd_notify_info_data {
>  	__u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */
>  	__u8 bar; /* BAR of the member or the owner device */
>  	__u8 padding[6];


Acked-by: Michael S. Tsirkin <mst@redhat.com>

I will queue this.

> -- 
> 2.34.1


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

* Re: [PATCH] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h:
  2024-01-25 22:48 ` Michael S. Tsirkin
@ 2024-01-25 23:10   ` Suzuki K Poulose
  2024-01-25 23:12     ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Suzuki K Poulose @ 2024-01-25 23:10 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: linux-kernel, kvm, Feng Liu, Yishai Hadas, Alex Williamson,
	Jean-Philippe Brucker

On 25/01/2024 22:48, Michael S. Tsirkin wrote:
> On Wed, Jan 24, 2024 at 05:23:45PM +0000, Suzuki K Poulose wrote:
>> Commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
>> added "__packed" structures to UAPI header linux/virtio_pci.h. This triggers
>> build failures in the consumer userspace applications without proper "definition"
>> of __packed (e.g., kvmtool build fails).
>>
>> Moreover, the structures are already packed well, and doesn't need explicit
>> packing, similar to the rest of the structures in all virtio_* headers. Remove
>> the __packed attribute.
>>
>> Fixes: commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
> 
> 
> Proper form is:
> 
> Fixes: 92792ac752aa ("virtio-pci: Introduce admin command sending function")

Apologies, for messing that up.

> 
>> Cc: Feng Liu <feliu@nvidia.com>
>> Cc: Michael S. Tsirkin <mst@redhat.com>
>> Cc: Yishai Hadas <yishaih@nvidia.com>
>> Cc: Alex Williamson <alex.williamson@redhat.com>
>> Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> ---
>>   include/uapi/linux/virtio_pci.h | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
>> index ef3810dee7ef..a8208492e822 100644
>> --- a/include/uapi/linux/virtio_pci.h
>> +++ b/include/uapi/linux/virtio_pci.h
>> @@ -240,7 +240,7 @@ struct virtio_pci_cfg_cap {
>>   #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ		0x5
>>   #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO		0x6
>>   
>> -struct __packed virtio_admin_cmd_hdr {
>> +struct virtio_admin_cmd_hdr {
>>   	__le16 opcode;
>>   	/*
>>   	 * 1 - SR-IOV
>> @@ -252,20 +252,20 @@ struct __packed virtio_admin_cmd_hdr {
>>   	__le64 group_member_id;
>>   };
>>   
>> -struct __packed virtio_admin_cmd_status {
>> +struct virtio_admin_cmd_status {
>>   	__le16 status;
>>   	__le16 status_qualifier;
>>   	/* Unused, reserved for future extensions. */
>>   	__u8 reserved2[4];
>>   };
>>   
>> -struct __packed virtio_admin_cmd_legacy_wr_data {
>> +struct virtio_admin_cmd_legacy_wr_data {
>>   	__u8 offset; /* Starting offset of the register(s) to write. */
>>   	__u8 reserved[7];
>>   	__u8 registers[];
>>   };
>>   
>> -struct __packed virtio_admin_cmd_legacy_rd_data {
>> +struct virtio_admin_cmd_legacy_rd_data {
>>   	__u8 offset; /* Starting offset of the register(s) to read. */
>>   };
>>   
>> @@ -275,7 +275,7 @@ struct __packed virtio_admin_cmd_legacy_rd_data {
>>   
>>   #define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4
>>   
>> -struct __packed virtio_admin_cmd_notify_info_data {
>> +struct virtio_admin_cmd_notify_info_data {
>>   	__u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */
>>   	__u8 bar; /* BAR of the member or the owner device */
>>   	__u8 padding[6];
> 
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> 
> I will queue this.

Thanks
Suzuki

> 
>> -- 
>> 2.34.1
> 


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

* Re: [PATCH] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h:
  2024-01-25 23:10   ` Suzuki K Poulose
@ 2024-01-25 23:12     ` Michael S. Tsirkin
  2024-01-25 23:20       ` [PATCH v2] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h Suzuki K Poulose
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2024-01-25 23:12 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: linux-kernel, kvm, Feng Liu, Yishai Hadas, Alex Williamson,
	Jean-Philippe Brucker

On Thu, Jan 25, 2024 at 11:10:16PM +0000, Suzuki K Poulose wrote:
> On 25/01/2024 22:48, Michael S. Tsirkin wrote:
> > On Wed, Jan 24, 2024 at 05:23:45PM +0000, Suzuki K Poulose wrote:
> > > Commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
> > > added "__packed" structures to UAPI header linux/virtio_pci.h. This triggers
> > > build failures in the consumer userspace applications without proper "definition"
> > > of __packed (e.g., kvmtool build fails).
> > > 
> > > Moreover, the structures are already packed well, and doesn't need explicit
> > > packing, similar to the rest of the structures in all virtio_* headers. Remove
> > > the __packed attribute.
> > > 
> > > Fixes: commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
> > 
> > 
> > Proper form is:
> > 
> > Fixes: 92792ac752aa ("virtio-pci: Introduce admin command sending function")
> 
> Apologies, for messing that up.


Pls repost a fixed one.

> > 
> > > Cc: Feng Liu <feliu@nvidia.com>
> > > Cc: Michael S. Tsirkin <mst@redhat.com>
> > > Cc: Yishai Hadas <yishaih@nvidia.com>
> > > Cc: Alex Williamson <alex.williamson@redhat.com>
> > > Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>
> > > Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> > > ---
> > >   include/uapi/linux/virtio_pci.h | 10 +++++-----
> > >   1 file changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
> > > index ef3810dee7ef..a8208492e822 100644
> > > --- a/include/uapi/linux/virtio_pci.h
> > > +++ b/include/uapi/linux/virtio_pci.h
> > > @@ -240,7 +240,7 @@ struct virtio_pci_cfg_cap {
> > >   #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ		0x5
> > >   #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO		0x6
> > > -struct __packed virtio_admin_cmd_hdr {
> > > +struct virtio_admin_cmd_hdr {
> > >   	__le16 opcode;
> > >   	/*
> > >   	 * 1 - SR-IOV
> > > @@ -252,20 +252,20 @@ struct __packed virtio_admin_cmd_hdr {
> > >   	__le64 group_member_id;
> > >   };
> > > -struct __packed virtio_admin_cmd_status {
> > > +struct virtio_admin_cmd_status {
> > >   	__le16 status;
> > >   	__le16 status_qualifier;
> > >   	/* Unused, reserved for future extensions. */
> > >   	__u8 reserved2[4];
> > >   };
> > > -struct __packed virtio_admin_cmd_legacy_wr_data {
> > > +struct virtio_admin_cmd_legacy_wr_data {
> > >   	__u8 offset; /* Starting offset of the register(s) to write. */
> > >   	__u8 reserved[7];
> > >   	__u8 registers[];
> > >   };
> > > -struct __packed virtio_admin_cmd_legacy_rd_data {
> > > +struct virtio_admin_cmd_legacy_rd_data {
> > >   	__u8 offset; /* Starting offset of the register(s) to read. */
> > >   };
> > > @@ -275,7 +275,7 @@ struct __packed virtio_admin_cmd_legacy_rd_data {
> > >   #define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4
> > > -struct __packed virtio_admin_cmd_notify_info_data {
> > > +struct virtio_admin_cmd_notify_info_data {
> > >   	__u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */
> > >   	__u8 bar; /* BAR of the member or the owner device */
> > >   	__u8 padding[6];
> > 
> > 
> > Acked-by: Michael S. Tsirkin <mst@redhat.com>
> > 
> > I will queue this.
> 
> Thanks
> Suzuki
> 
> > 
> > > -- 
> > > 2.34.1
> > 


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

* [PATCH v2] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h
  2024-01-25 23:12     ` Michael S. Tsirkin
@ 2024-01-25 23:20       ` Suzuki K Poulose
  2024-02-01 16:03         ` Suzuki K Poulose
  0 siblings, 1 reply; 7+ messages in thread
From: Suzuki K Poulose @ 2024-01-25 23:20 UTC (permalink / raw)
  To: linux-kernel, mst
  Cc: kvm, Suzuki K Poulose, Feng Liu, Yishai Hadas, Alex Williamson,
	Jean-Philippe Brucker

Commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
added "__packed" structures to UAPI header linux/virtio_pci.h. This triggers
build failures in the consumer userspace applications without proper "definition"
of __packed (e.g., kvmtool build fails).

Moreover, the structures are already packed well, and doesn't need explicit
packing, similar to the rest of the structures in all virtio_* headers. Remove
the __packed attribute.

Fixes: 92792ac752aa ("virtio-pci: Introduce admin command sending function")
Cc: Feng Liu <feliu@nvidia.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Yishai Hadas <yishaih@nvidia.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---

Changes since v1:
 - Fix description for the "Fixes" tag format
 - Collect Tags from Jean-Philippe and Michael

---
 include/uapi/linux/virtio_pci.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index ef3810dee7ef..a8208492e822 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -240,7 +240,7 @@ struct virtio_pci_cfg_cap {
 #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ		0x5
 #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO		0x6
 
-struct __packed virtio_admin_cmd_hdr {
+struct virtio_admin_cmd_hdr {
 	__le16 opcode;
 	/*
 	 * 1 - SR-IOV
@@ -252,20 +252,20 @@ struct __packed virtio_admin_cmd_hdr {
 	__le64 group_member_id;
 };
 
-struct __packed virtio_admin_cmd_status {
+struct virtio_admin_cmd_status {
 	__le16 status;
 	__le16 status_qualifier;
 	/* Unused, reserved for future extensions. */
 	__u8 reserved2[4];
 };
 
-struct __packed virtio_admin_cmd_legacy_wr_data {
+struct virtio_admin_cmd_legacy_wr_data {
 	__u8 offset; /* Starting offset of the register(s) to write. */
 	__u8 reserved[7];
 	__u8 registers[];
 };
 
-struct __packed virtio_admin_cmd_legacy_rd_data {
+struct virtio_admin_cmd_legacy_rd_data {
 	__u8 offset; /* Starting offset of the register(s) to read. */
 };
 
@@ -275,7 +275,7 @@ struct __packed virtio_admin_cmd_legacy_rd_data {
 
 #define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4
 
-struct __packed virtio_admin_cmd_notify_info_data {
+struct virtio_admin_cmd_notify_info_data {
 	__u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */
 	__u8 bar; /* BAR of the member or the owner device */
 	__u8 padding[6];
-- 
2.34.1


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

* Re: [PATCH v2] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h
  2024-01-25 23:20       ` [PATCH v2] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h Suzuki K Poulose
@ 2024-02-01 16:03         ` Suzuki K Poulose
  0 siblings, 0 replies; 7+ messages in thread
From: Suzuki K Poulose @ 2024-02-01 16:03 UTC (permalink / raw)
  To: linux-kernel, mst
  Cc: kvm, Feng Liu, Yishai Hadas, Alex Williamson,
	Jean-Philippe Brucker

On 25/01/2024 23:20, Suzuki K Poulose wrote:
> Commit 92792ac752aa ("virtio-pci: Introduce admin command sending function")
> added "__packed" structures to UAPI header linux/virtio_pci.h. This triggers
> build failures in the consumer userspace applications without proper "definition"
> of __packed (e.g., kvmtool build fails).
> 
> Moreover, the structures are already packed well, and doesn't need explicit
> packing, similar to the rest of the structures in all virtio_* headers. Remove
> the __packed attribute.
> 
> Fixes: 92792ac752aa ("virtio-pci: Introduce admin command sending function")
> Cc: Feng Liu <feliu@nvidia.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Yishai Hadas <yishaih@nvidia.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>
> Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---

Gentle ping.

Suzuki


> 
> Changes since v1:
>   - Fix description for the "Fixes" tag format
>   - Collect Tags from Jean-Philippe and Michael
> 
> ---
>   include/uapi/linux/virtio_pci.h | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
> index ef3810dee7ef..a8208492e822 100644
> --- a/include/uapi/linux/virtio_pci.h
> +++ b/include/uapi/linux/virtio_pci.h
> @@ -240,7 +240,7 @@ struct virtio_pci_cfg_cap {
>   #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ		0x5
>   #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO		0x6
>   
> -struct __packed virtio_admin_cmd_hdr {
> +struct virtio_admin_cmd_hdr {
>   	__le16 opcode;
>   	/*
>   	 * 1 - SR-IOV
> @@ -252,20 +252,20 @@ struct __packed virtio_admin_cmd_hdr {
>   	__le64 group_member_id;
>   };
>   
> -struct __packed virtio_admin_cmd_status {
> +struct virtio_admin_cmd_status {
>   	__le16 status;
>   	__le16 status_qualifier;
>   	/* Unused, reserved for future extensions. */
>   	__u8 reserved2[4];
>   };
>   
> -struct __packed virtio_admin_cmd_legacy_wr_data {
> +struct virtio_admin_cmd_legacy_wr_data {
>   	__u8 offset; /* Starting offset of the register(s) to write. */
>   	__u8 reserved[7];
>   	__u8 registers[];
>   };
>   
> -struct __packed virtio_admin_cmd_legacy_rd_data {
> +struct virtio_admin_cmd_legacy_rd_data {
>   	__u8 offset; /* Starting offset of the register(s) to read. */
>   };
>   
> @@ -275,7 +275,7 @@ struct __packed virtio_admin_cmd_legacy_rd_data {
>   
>   #define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4
>   
> -struct __packed virtio_admin_cmd_notify_info_data {
> +struct virtio_admin_cmd_notify_info_data {
>   	__u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */
>   	__u8 bar; /* BAR of the member or the owner device */
>   	__u8 padding[6];


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

end of thread, other threads:[~2024-02-01 16:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 17:23 [PATCH] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h: Suzuki K Poulose
2024-01-24 18:22 ` Jean-Philippe Brucker
2024-01-25 22:48 ` Michael S. Tsirkin
2024-01-25 23:10   ` Suzuki K Poulose
2024-01-25 23:12     ` Michael S. Tsirkin
2024-01-25 23:20       ` [PATCH v2] virtio: uapi: Drop __packed attribute in linux/virtio_pci.h Suzuki K Poulose
2024-02-01 16:03         ` Suzuki K Poulose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox