Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * VFIO Region definitions for ZPCI devices
0004  *
0005  * Copyright IBM Corp. 2020
0006  *
0007  * Author(s): Pierre Morel <pmorel@linux.ibm.com>
0008  *            Matthew Rosato <mjrosato@linux.ibm.com>
0009  */
0010 
0011 #ifndef _VFIO_ZDEV_H_
0012 #define _VFIO_ZDEV_H_
0013 
0014 #include <linux/types.h>
0015 #include <linux/vfio.h>
0016 
0017 /**
0018  * VFIO_DEVICE_INFO_CAP_ZPCI_BASE - Base PCI Function information
0019  *
0020  * This capability provides a set of descriptive information about the
0021  * associated PCI function.
0022  */
0023 struct vfio_device_info_cap_zpci_base {
0024     struct vfio_info_cap_header header;
0025     __u64 start_dma;    /* Start of available DMA addresses */
0026     __u64 end_dma;      /* End of available DMA addresses */
0027     __u16 pchid;        /* Physical Channel ID */
0028     __u16 vfn;      /* Virtual function number */
0029     __u16 fmb_length;   /* Measurement Block Length (in bytes) */
0030     __u8 pft;       /* PCI Function Type */
0031     __u8 gid;       /* PCI function group ID */
0032     /* End of version 1 */
0033     __u32 fh;       /* PCI function handle */
0034     /* End of version 2 */
0035 };
0036 
0037 /**
0038  * VFIO_DEVICE_INFO_CAP_ZPCI_GROUP - Base PCI Function Group information
0039  *
0040  * This capability provides a set of descriptive information about the group of
0041  * PCI functions that the associated device belongs to.
0042  */
0043 struct vfio_device_info_cap_zpci_group {
0044     struct vfio_info_cap_header header;
0045     __u64 dasm;     /* DMA Address space mask */
0046     __u64 msi_addr;     /* MSI address */
0047     __u64 flags;
0048 #define VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH 1 /* Program-specified TLB refresh */
0049     __u16 mui;      /* Measurement Block Update Interval */
0050     __u16 noi;      /* Maximum number of MSIs */
0051     __u16 maxstbl;      /* Maximum Store Block Length */
0052     __u8 version;       /* Supported PCI Version */
0053     /* End of version 1 */
0054     __u8 reserved;
0055     __u16 imaxstbl;     /* Maximum Interpreted Store Block Length */
0056     /* End of version 2 */
0057 };
0058 
0059 /**
0060  * VFIO_DEVICE_INFO_CAP_ZPCI_UTIL - Utility String
0061  *
0062  * This capability provides the utility string for the associated device, which
0063  * is a device identifier string made up of EBCDID characters.  'size' specifies
0064  * the length of 'util_str'.
0065  */
0066 struct vfio_device_info_cap_zpci_util {
0067     struct vfio_info_cap_header header;
0068     __u32 size;
0069     __u8 util_str[];
0070 };
0071 
0072 /**
0073  * VFIO_DEVICE_INFO_CAP_ZPCI_PFIP - PCI Function Path
0074  *
0075  * This capability provides the PCI function path string, which is an identifier
0076  * that describes the internal hardware path of the device. 'size' specifies
0077  * the length of 'pfip'.
0078  */
0079 struct vfio_device_info_cap_zpci_pfip {
0080     struct vfio_info_cap_header header;
0081     __u32 size;
0082     __u8 pfip[];
0083 };
0084 
0085 #endif