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: <CACGkMEsmU4LjUzKFfyoY1ao8pRCETHRqPM3X8uK9KO-TCN8Trg@mail.gmail.com>
Date: Fri, 13 Dec 2024 11:55:47 +0800
From: Jason Wang <jasowang@...hat.com>
To: Shijith Thotton <sthotton@...vell.com>
Cc: virtualization@...ts.linux.dev, mst@...hat.com, dan.carpenter@...aro.org, 
	schalla@...vell.com, vattunuru@...vell.com, ndabilpuram@...vell.com, 
	jerinj@...vell.com, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>, 
	Eugenio Pérez <eperezma@...hat.com>, 
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 3/4] virtio-pci: define type and header for PCI vendor data

On Mon, Dec 9, 2024 at 11:16 PM Shijith Thotton <sthotton@...vell.com> wrote:
>
> Added macro definition for VIRTIO_PCI_CAP_VENDOR_CFG to identify the PCI
> vendor data type in the virtio_pci_cap structure. Defined a new struct
> virtio_pci_vndr_data for the vendor data capability header as per the
> specification.
>
> Signed-off-by: Shijith Thotton <sthotton@...vell.com>
> ---
>  include/uapi/linux/virtio_pci.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
> index a8208492e822..1f3ea5d2a6af 100644
> --- a/include/uapi/linux/virtio_pci.h
> +++ b/include/uapi/linux/virtio_pci.h
> @@ -115,6 +115,8 @@
>  #define VIRTIO_PCI_CAP_PCI_CFG         5
>  /* Additional shared memory capability */
>  #define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8
> +/* PCI vendor data configuration */
> +#define VIRTIO_PCI_CAP_VENDOR_CFG      9
>
>  /* This is the PCI capability header: */
>  struct virtio_pci_cap {
> @@ -129,6 +131,15 @@ struct virtio_pci_cap {
>         __le32 length;          /* Length of the structure, in bytes. */
>  };
>
> +/* This is the PCI vendor data capability header: */
> +struct virtio_pci_vndr_data {
> +       __u8 cap_vndr;          /* Generic PCI field: PCI_CAP_ID_VNDR */
> +       __u8 cap_next;          /* Generic PCI field: next ptr. */
> +       __u8 cap_len;           /* Generic PCI field: capability length */
> +       __u8 cfg_type;          /* Identifies the structure. */
> +       __u16 vendor_id;        /* Identifies the vendor-specific format. */
> +};

Nit: I would have the following comments from the virtio spec:

"""
 /* For Vendor Definition */
  /* Pads structure to a multiple of 4 bytes */
  /* Reads must not have side effects */
"""

Thanks

> +
>  struct virtio_pci_cap64 {
>         struct virtio_pci_cap cap;
>         __le32 offset_hi;             /* Most sig 32 bits of offset */
> --
> 2.25.1
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ