lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1656901409.0470793-4-xuanzhuo@linux.alibaba.com>
Date:   Mon, 4 Jul 2022 10:23:29 +0800
From:   Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
To:     Jason Wang <jasowang@...hat.com>
Cc:     Richard Weinberger <richard@....at>,
        Anton Ivanov <anton.ivanov@...bridgegreys.com>,
        Johannes Berg <johannes@...solutions.net>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Mark Gross <markgross@...nel.org>,
        Vadim Pasternak <vadimp@...dia.com>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Cornelia Huck <cohuck@...hat.com>,
        Halil Pasic <pasic@...ux.ibm.com>,
        Eric Farman <farman@...ux.ibm.com>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        Sven Schnelle <svens@...ux.ibm.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        Vincent Whitchurch <vincent.whitchurch@...s.com>,
        linux-um@...ts.infradead.org, netdev@...r.kernel.org,
        platform-driver-x86@...r.kernel.org,
        linux-remoteproc@...r.kernel.org, linux-s390@...r.kernel.org,
        kvm@...r.kernel.org, bpf@...r.kernel.org,
        kangjie.xu@...ux.alibaba.com,
        virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH v11 23/40] virtio_pci: move struct virtio_pci_common_cfg to virtio_pci_modern.h

On Fri, 1 Jul 2022 17:33:00 +0800, Jason Wang <jasowang@...hat.com> wrote:
>
> 在 2022/6/29 14:56, Xuan Zhuo 写道:
> > In order to facilitate the expansion of virtio_pci_common_cfg in the
> > future, move it from uapi to virtio_pci_modern.h. In this way, we can
> > freely expand virtio_pci_common_cfg in the future.
> >
> > Other projects using virtio_pci_common_cfg in uapi need to maintain a
> > separate virtio_pci_common_cfg or use the offset macro defined in uapi.
> >
> > Signed-off-by: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
> > ---
> >   include/linux/virtio_pci_modern.h | 26 ++++++++++++++++++++++++++
> >   include/uapi/linux/virtio_pci.h   | 26 --------------------------
> >   2 files changed, 26 insertions(+), 26 deletions(-)
> >
> > diff --git a/include/linux/virtio_pci_modern.h b/include/linux/virtio_pci_modern.h
> > index eb2bd9b4077d..c4f7ffbacb4e 100644
> > --- a/include/linux/virtio_pci_modern.h
> > +++ b/include/linux/virtio_pci_modern.h
> > @@ -5,6 +5,32 @@
> >   #include <linux/pci.h>
> >   #include <linux/virtio_pci.h>
> >
> > +/* Fields in VIRTIO_PCI_CAP_COMMON_CFG: */
> > +struct virtio_pci_common_cfg {
> > +	/* About the whole device. */
> > +	__le32 device_feature_select;	/* read-write */
> > +	__le32 device_feature;		/* read-only */
> > +	__le32 guest_feature_select;	/* read-write */
> > +	__le32 guest_feature;		/* read-write */
> > +	__le16 msix_config;		/* read-write */
> > +	__le16 num_queues;		/* read-only */
> > +	__u8 device_status;		/* read-write */
> > +	__u8 config_generation;		/* read-only */
> > +
> > +	/* About a specific virtqueue. */
> > +	__le16 queue_select;		/* read-write */
> > +	__le16 queue_size;		/* read-write, power of 2. */
> > +	__le16 queue_msix_vector;	/* read-write */
> > +	__le16 queue_enable;		/* read-write */
> > +	__le16 queue_notify_off;	/* read-only */
> > +	__le32 queue_desc_lo;		/* read-write */
> > +	__le32 queue_desc_hi;		/* read-write */
> > +	__le32 queue_avail_lo;		/* read-write */
> > +	__le32 queue_avail_hi;		/* read-write */
> > +	__le32 queue_used_lo;		/* read-write */
> > +	__le32 queue_used_hi;		/* read-write */
> > +};
> > +
> >   struct virtio_pci_modern_device {
> >   	struct pci_dev *pci_dev;
> >
> > diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
> > index 3a86f36d7e3d..247ec42af2c8 100644
> > --- a/include/uapi/linux/virtio_pci.h
> > +++ b/include/uapi/linux/virtio_pci.h
> > @@ -140,32 +140,6 @@ struct virtio_pci_notify_cap {
> >   	__le32 notify_off_multiplier;	/* Multiplier for queue_notify_off. */
> >   };
> >
> > -/* Fields in VIRTIO_PCI_CAP_COMMON_CFG: */
> > -struct virtio_pci_common_cfg {
> > -	/* About the whole device. */
> > -	__le32 device_feature_select;	/* read-write */
> > -	__le32 device_feature;		/* read-only */
> > -	__le32 guest_feature_select;	/* read-write */
> > -	__le32 guest_feature;		/* read-write */
> > -	__le16 msix_config;		/* read-write */
> > -	__le16 num_queues;		/* read-only */
> > -	__u8 device_status;		/* read-write */
> > -	__u8 config_generation;		/* read-only */
> > -
> > -	/* About a specific virtqueue. */
> > -	__le16 queue_select;		/* read-write */
> > -	__le16 queue_size;		/* read-write, power of 2. */
> > -	__le16 queue_msix_vector;	/* read-write */
> > -	__le16 queue_enable;		/* read-write */
> > -	__le16 queue_notify_off;	/* read-only */
> > -	__le32 queue_desc_lo;		/* read-write */
> > -	__le32 queue_desc_hi;		/* read-write */
> > -	__le32 queue_avail_lo;		/* read-write */
> > -	__le32 queue_avail_hi;		/* read-write */
> > -	__le32 queue_used_lo;		/* read-write */
> > -	__le32 queue_used_hi;		/* read-write */
> > -};
> > -
>
>
> I think it's better not delete those from uAPI. We can embed this struct
> in the private virito_pci_moden.h anyhow.

OK.

Thanks.

>
> Thanks
>
>
> >   /* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
> >   struct virtio_pci_cfg_cap {
> >   	struct virtio_pci_cap cap;
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ