vfio_zdev.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * VFIO Region definitions for ZPCI devices
  4. *
  5. * Copyright IBM Corp. 2020
  6. *
  7. * Author(s): Pierre Morel <pmorel@linux.ibm.com>
  8. * Matthew Rosato <mjrosato@linux.ibm.com>
  9. */
  10. #ifndef _VFIO_ZDEV_H_
  11. #define _VFIO_ZDEV_H_
  12. #include <linux/types.h>
  13. #include <linux/vfio.h>
  14. /**
  15. * VFIO_DEVICE_INFO_CAP_ZPCI_BASE - Base PCI Function information
  16. *
  17. * This capability provides a set of descriptive information about the
  18. * associated PCI function.
  19. */
  20. struct vfio_device_info_cap_zpci_base {
  21. struct vfio_info_cap_header header;
  22. __u64 start_dma; /* Start of available DMA addresses */
  23. __u64 end_dma; /* End of available DMA addresses */
  24. __u16 pchid; /* Physical Channel ID */
  25. __u16 vfn; /* Virtual function number */
  26. __u16 fmb_length; /* Measurement Block Length (in bytes) */
  27. __u8 pft; /* PCI Function Type */
  28. __u8 gid; /* PCI function group ID */
  29. /* End of version 1 */
  30. __u32 fh; /* PCI function handle */
  31. /* End of version 2 */
  32. };
  33. /**
  34. * VFIO_DEVICE_INFO_CAP_ZPCI_GROUP - Base PCI Function Group information
  35. *
  36. * This capability provides a set of descriptive information about the group of
  37. * PCI functions that the associated device belongs to.
  38. */
  39. struct vfio_device_info_cap_zpci_group {
  40. struct vfio_info_cap_header header;
  41. __u64 dasm; /* DMA Address space mask */
  42. __u64 msi_addr; /* MSI address */
  43. __u64 flags;
  44. #define VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH 1 /* Program-specified TLB refresh */
  45. __u16 mui; /* Measurement Block Update Interval */
  46. __u16 noi; /* Maximum number of MSIs */
  47. __u16 maxstbl; /* Maximum Store Block Length */
  48. __u8 version; /* Supported PCI Version */
  49. /* End of version 1 */
  50. __u8 reserved;
  51. __u16 imaxstbl; /* Maximum Interpreted Store Block Length */
  52. /* End of version 2 */
  53. };
  54. /**
  55. * VFIO_DEVICE_INFO_CAP_ZPCI_UTIL - Utility String
  56. *
  57. * This capability provides the utility string for the associated device, which
  58. * is a device identifier string made up of EBCDID characters. 'size' specifies
  59. * the length of 'util_str'.
  60. */
  61. struct vfio_device_info_cap_zpci_util {
  62. struct vfio_info_cap_header header;
  63. __u32 size;
  64. __u8 util_str[];
  65. };
  66. /**
  67. * VFIO_DEVICE_INFO_CAP_ZPCI_PFIP - PCI Function Path
  68. *
  69. * This capability provides the PCI function path string, which is an identifier
  70. * that describes the internal hardware path of the device. 'size' specifies
  71. * the length of 'pfip'.
  72. */
  73. struct vfio_device_info_cap_zpci_pfip {
  74. struct vfio_info_cap_header header;
  75. __u32 size;
  76. __u8 pfip[];
  77. };
  78. #endif