public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rusty/virtio-pci-new-layout] virtio: new layout minor header fixups
@ 2013-05-27 15:59 Michael S. Tsirkin
  2013-05-28  1:29 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2013-05-27 15:59 UTC (permalink / raw)
  To: virtualization
  Cc: kvm, linux-kernel, David Howells, Dave Jones, Paul E. McKenney

Fix issues observed with the new layout code, seen
when implementing device in qemu:
	- use of uXX in uapi header
	- incorrect readonly tag on one field
	- unconditional warning breaks builds with -Werr

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

This patch is on top of rusty/virtio-pci-new-layout.

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

diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 3e61d55..cda688f 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -86,8 +86,10 @@
 #define VIRTIO_PCI_LEGACY_VRING_ALIGN		4096
 
 #ifndef VIRTIO_PCI_NO_LEGACY
+#ifndef VIRTIO_PCI_LEGACY_COMPAT_NAMES
 /* Don't break compile of old userspace code.  These will go away. */
 #warning "Please support virtio_pci non-legacy mode!"
+#endif
 #define VIRTIO_PCI_HOST_FEATURES VIRTIO_PCI_LEGACY_HOST_FEATURES
 #define VIRTIO_PCI_GUEST_FEATURES VIRTIO_PCI_LEGACY_GUEST_FEATURES
 #define VIRTIO_PCI_QUEUE_PFN VIRTIO_PCI_LEGACY_QUEUE_PFN
@@ -125,10 +127,10 @@
 
 /* This is the PCI capability header: */
 struct virtio_pci_cap {
-	u8 cap_vndr;	/* Generic PCI field: PCI_CAP_ID_VNDR */
-	u8 cap_next;	/* Generic PCI field: next ptr. */
-	u8 cfg_type;	/* One of the VIRTIO_PCI_CAP_*_CFG. */
-	u8 bar;		/* Where to find it. */
+	__u8 cap_vndr;	/* Generic PCI field: PCI_CAP_ID_VNDR */
+	__u8 cap_next;	/* Generic PCI field: next ptr. */
+	__u8 cfg_type;	/* One of the VIRTIO_PCI_CAP_*_CFG. */
+	__u8 bar;		/* Where to find it. */
 	__le32 offset;	/* Offset within bar. */
 	__le32 length;	/* Length. */
 };
@@ -144,7 +146,7 @@ struct virtio_pci_common_cfg {
 	__le32 device_feature_select;	/* read-write */
 	__le32 device_feature;		/* read-only */
 	__le32 guest_feature_select;	/* read-write */
-	__le32 guest_feature;		/* read-only */
+	__le32 guest_feature;		/* read-write */
 	__le16 msix_config;		/* read-write */
 	__le16 num_queues;		/* read-only */
 	__u8 device_status;		/* read-write */
-- 
MST

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

* Re: [PATCH rusty/virtio-pci-new-layout] virtio: new layout minor header fixups
  2013-05-27 15:59 [PATCH rusty/virtio-pci-new-layout] virtio: new layout minor header fixups Michael S. Tsirkin
@ 2013-05-28  1:29 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2013-05-28  1:29 UTC (permalink / raw)
  To: Michael S. Tsirkin, virtualization
  Cc: David Howells, Dave Jones, Paul E. McKenney, linux-kernel, kvm

"Michael S. Tsirkin" <mst@redhat.com> writes:
> Fix issues observed with the new layout code, seen
> when implementing device in qemu:
> 	- use of uXX in uapi header
> 	- incorrect readonly tag on one field
> 	- unconditional warning breaks builds with -Werr
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Hmm, this means if we ever *do* remove those defines, qemu will break.

But perhaps that's OK, because we'll probably remove legacy support at
the same time as we break the header.

Applied, thanks!
Rusty.

> This patch is on top of rusty/virtio-pci-new-layout.
>
>  include/uapi/linux/virtio_pci.h | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
> index 3e61d55..cda688f 100644
> --- a/include/uapi/linux/virtio_pci.h
> +++ b/include/uapi/linux/virtio_pci.h
> @@ -86,8 +86,10 @@
>  #define VIRTIO_PCI_LEGACY_VRING_ALIGN		4096
>  
>  #ifndef VIRTIO_PCI_NO_LEGACY
> +#ifndef VIRTIO_PCI_LEGACY_COMPAT_NAMES
>  /* Don't break compile of old userspace code.  These will go away. */
>  #warning "Please support virtio_pci non-legacy mode!"
> +#endif
>  #define VIRTIO_PCI_HOST_FEATURES VIRTIO_PCI_LEGACY_HOST_FEATURES
>  #define VIRTIO_PCI_GUEST_FEATURES VIRTIO_PCI_LEGACY_GUEST_FEATURES
>  #define VIRTIO_PCI_QUEUE_PFN VIRTIO_PCI_LEGACY_QUEUE_PFN
> @@ -125,10 +127,10 @@
>  
>  /* This is the PCI capability header: */
>  struct virtio_pci_cap {
> -	u8 cap_vndr;	/* Generic PCI field: PCI_CAP_ID_VNDR */
> -	u8 cap_next;	/* Generic PCI field: next ptr. */
> -	u8 cfg_type;	/* One of the VIRTIO_PCI_CAP_*_CFG. */
> -	u8 bar;		/* Where to find it. */
> +	__u8 cap_vndr;	/* Generic PCI field: PCI_CAP_ID_VNDR */
> +	__u8 cap_next;	/* Generic PCI field: next ptr. */
> +	__u8 cfg_type;	/* One of the VIRTIO_PCI_CAP_*_CFG. */
> +	__u8 bar;		/* Where to find it. */
>  	__le32 offset;	/* Offset within bar. */
>  	__le32 length;	/* Length. */
>  };
> @@ -144,7 +146,7 @@ struct virtio_pci_common_cfg {
>  	__le32 device_feature_select;	/* read-write */
>  	__le32 device_feature;		/* read-only */
>  	__le32 guest_feature_select;	/* read-write */
> -	__le32 guest_feature;		/* read-only */
> +	__le32 guest_feature;		/* read-write */
>  	__le16 msix_config;		/* read-write */
>  	__le16 num_queues;		/* read-only */
>  	__u8 device_status;		/* read-write */
> -- 
> MST

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

end of thread, other threads:[~2013-05-28  1:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-27 15:59 [PATCH rusty/virtio-pci-new-layout] virtio: new layout minor header fixups Michael S. Tsirkin
2013-05-28  1:29 ` Rusty Russell

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