History

Merge tag 'vfio-v5.10-rc1' of git://github.com/awilliam/linux-vfio

Pull VFIO updates from Alex Williamson: - New fsl-mc vfio bus driver supporting userspace drivers of objects within NXP's DPAA2 architecture (Diana Craciun) - Support for exposing zPCI information on s390 (Matthew Rosato) - Fixes for "detached" VFs on s390 (Matthew Rosato) - Fixes for pin-pages and dma-rw accesses (Yan Zhao) - Cleanups and optimize vconfig regen (Zenghui Yu) - Fix duplicate irq-bypass token registration (Alex Williamson) * tag 'vfio-v5.10-rc1' of git://github.com/awilliam/linux-vfio: (30 commits) vfio iommu type1: Fix memory leak in vfio_iommu_type1_pin_pages vfio/pci: Clear token on bypass registration failure vfio/fsl-mc: fix the return of the uninitialized variable ret vfio/fsl-mc: Fix the dead code in vfio_fsl_mc_set_irq_trigger vfio/fsl-mc: Fixed vfio-fsl-mc driver compilation on 32 bit MAINTAINERS: Add entry for s390 vfio-pci vfio-pci/zdev: Add zPCI capabilities to VFIO_DEVICE_GET_INFO vfio/fsl-mc: Add support for device reset vfio/fsl-mc: Add read/write support for fsl-mc devices vfio/fsl-mc: trigger an interrupt via eventfd vfio/fsl-mc: Add irq infrastructure for fsl-mc devices vfio/fsl-mc: Added lock support in preparation for interrupt handling vfio/fsl-mc: Allow userspace to MMAP fsl-mc device MMIO regions vfio/fsl-mc: Implement VFIO_DEVICE_GET_REGION_INFO ioctl call vfio/fsl-mc: Implement VFIO_DEVICE_GET_INFO ioctl vfio/fsl-mc: Scan DPRC objects on vfio-fsl-mc driver bind vfio: Introduce capability definitions for VFIO_DEVICE_GET_INFO s390/pci: track whether util_str is valid in the zpci_dev s390/pci: stash version in the zpci_dev vfio/fsl-mc: Add VFIO framework skeleton for fsl-mc devices ...

Linus Torvalds committed 6 years ago

Commit fc996db2 parents 60573c2 2e6cfd424 files · +1330 −20Browse files

Showing the changes to include/uapi/linux (2 of 24 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/vfio.h +28 −1
  2. include/uapi/linux/vfio_zdev.h +78 −0
include/uapi/linux/vfio.h+28−1
@@ -201,8 +201,11 @@ struct vfio_device_info { · 200 unmodified lines
201#define VFIO_DEVICE_FLAGS_AMBA (1 << 3) /* vfio-amba device */201#define VFIO_DEVICE_FLAGS_AMBA (1 << 3) /* vfio-amba device */
202#define VFIO_DEVICE_FLAGS_CCW (1 << 4) /* vfio-ccw device */202#define VFIO_DEVICE_FLAGS_CCW (1 << 4) /* vfio-ccw device */
203#define VFIO_DEVICE_FLAGS_AP (1 << 5) /* vfio-ap device */203#define VFIO_DEVICE_FLAGS_AP (1 << 5) /* vfio-ap device */
204#define VFIO_DEVICE_FLAGS_FSL_MC (1 << 6) /* vfio-fsl-mc device */
205#define VFIO_DEVICE_FLAGS_CAPS (1 << 7) /* Info supports caps */
204 __u32 num_regions; /* Max region index + 1 */206 __u32 num_regions; /* Max region index + 1 */
205 __u32 num_irqs; /* Max IRQ index + 1 */207 __u32 num_irqs; /* Max IRQ index + 1 */
208 __u32 cap_offset; /* Offset within info struct of first cap */
206};209};
207#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)210#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
208 211
@@ -218,6 +221,15 @@ struct vfio_device_info { · 9 unmodified lines
218#define VFIO_DEVICE_API_CCW_STRING "vfio-ccw"221#define VFIO_DEVICE_API_CCW_STRING "vfio-ccw"
219#define VFIO_DEVICE_API_AP_STRING "vfio-ap"222#define VFIO_DEVICE_API_AP_STRING "vfio-ap"
220 223
224/*
225 * The following capabilities are unique to s390 zPCI devices. Their contents
226 * are further-defined in vfio_zdev.h
227 */
228#define VFIO_DEVICE_INFO_CAP_ZPCI_BASE 1
229#define VFIO_DEVICE_INFO_CAP_ZPCI_GROUP 2
230#define VFIO_DEVICE_INFO_CAP_ZPCI_UTIL 3
231#define VFIO_DEVICE_INFO_CAP_ZPCI_PFIP 4
232
221/**233/**
222 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,234 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
223 * struct vfio_region_info)235 * struct vfio_region_info)
@@ -462,7 +474,7 @@ struct vfio_region_gfx_edid { · 238 unmodified lines
462 * 5. Resumed474 * 5. Resumed
463 * |--------->|475 * |--------->|
464 *476 *
465 * 0. Default state of VFIO device is _RUNNNG when the user application starts.477 * 0. Default state of VFIO device is _RUNNING when the user application starts.
466 * 1. During normal shutdown of the user application, the user application may478 * 1. During normal shutdown of the user application, the user application may
467 * optionally change the VFIO device state from _RUNNING to _STOP. This479 * optionally change the VFIO device state from _RUNNING to _STOP. This
468 * transition is optional. The vendor driver must support this transition but480 * transition is optional. The vendor driver must support this transition but
@@ -1039,6 +1051,21 @@ struct vfio_iommu_type1_info_cap_migration { · 570 unmodified lines
1039 __u64 max_dirty_bitmap_size; /* in bytes */1051 __u64 max_dirty_bitmap_size; /* in bytes */
1040};1052};
1041 1053
1054/*
1055 * The DMA available capability allows to report the current number of
1056 * simultaneously outstanding DMA mappings that are allowed.
1057 *
1058 * The structure below defines version 1 of this capability.
1059 *
1060 * avail: specifies the current number of outstanding DMA mappings allowed.
1061 */
1062#define VFIO_IOMMU_TYPE1_INFO_DMA_AVAIL 3
1063
1064struct vfio_iommu_type1_info_dma_avail {
1065 struct vfio_info_cap_header header;
1066 __u32 avail;
1067};
1068
1042#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)1069#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
1043 1070
1044/**1071/**
include/uapi/linux/vfio_zdev.h+78−0
@@ -0,0 +1,78 @@
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
11#ifndef _VFIO_ZDEV_H_
12#define _VFIO_ZDEV_H_
13
14#include <linux/types.h>
15#include <linux/vfio.h>
16
17/**
18 * VFIO_DEVICE_INFO_CAP_ZPCI_BASE - Base PCI Function information
19 *
20 * This capability provides a set of descriptive information about the
21 * associated PCI function.
22 */
23struct vfio_device_info_cap_zpci_base {
24 struct vfio_info_cap_header header;
25 __u64 start_dma; /* Start of available DMA addresses */
26 __u64 end_dma; /* End of available DMA addresses */
27 __u16 pchid; /* Physical Channel ID */
28 __u16 vfn; /* Virtual function number */
29 __u16 fmb_length; /* Measurement Block Length (in bytes) */
30 __u8 pft; /* PCI Function Type */
31 __u8 gid; /* PCI function group ID */
32};
33
34/**
35 * VFIO_DEVICE_INFO_CAP_ZPCI_GROUP - Base PCI Function Group information
36 *
37 * This capability provides a set of descriptive information about the group of
38 * PCI functions that the associated device belongs to.
39 */
40struct vfio_device_info_cap_zpci_group {
41 struct vfio_info_cap_header header;
42 __u64 dasm; /* DMA Address space mask */
43 __u64 msi_addr; /* MSI address */
44 __u64 flags;
45#define VFIO_DEVICE_INFO_ZPCI_FLAG_REFRESH 1 /* Program-specified TLB refresh */
46 __u16 mui; /* Measurement Block Update Interval */
47 __u16 noi; /* Maximum number of MSIs */
48 __u16 maxstbl; /* Maximum Store Block Length */
49 __u8 version; /* Supported PCI Version */
50};
51
52/**
53 * VFIO_DEVICE_INFO_CAP_ZPCI_UTIL - Utility String
54 *
55 * This capability provides the utility string for the associated device, which
56 * is a device identifier string made up of EBCDID characters. 'size' specifies
57 * the length of 'util_str'.
58 */
59struct vfio_device_info_cap_zpci_util {
60 struct vfio_info_cap_header header;
61 __u32 size;
62 __u8 util_str[];
63};
64
65/**
66 * VFIO_DEVICE_INFO_CAP_ZPCI_PFIP - PCI Function Path
67 *
68 * This capability provides the PCI function path string, which is an identifier
69 * that describes the internal hardware path of the device. 'size' specifies
70 * the length of 'pfip'.
71 */
72struct vfio_device_info_cap_zpci_pfip {
73 struct vfio_info_cap_header header;
74 __u32 size;
75 __u8 pfip[];
76};
77
78#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t