26
26
#define VFIO_AP_DRV_NAME "vfio_ap"
27
27
28
28
/**
29
- * ap_matrix_dev - the AP matrix device structure
29
+ * struct ap_matrix_dev - Contains the data for the matrix device.
30
+ *
30
31
* @device: generic device structure associated with the AP matrix device
31
32
* @available_instances: number of mediated matrix devices that can be created
32
33
* @info: the struct containing the output from the PQAP(QCI) instruction
33
- * mdev_list: the list of mediated matrix devices created
34
- * lock: mutex for locking the AP matrix device. This lock will be
34
+ * @ mdev_list: the list of mediated matrix devices created
35
+ * @ lock: mutex for locking the AP matrix device. This lock will be
35
36
* taken every time we fiddle with state managed by the vfio_ap
36
37
* driver, be it using @mdev_list or writing the state of a
37
38
* single ap_matrix_mdev device. It's quite coarse but we don't
38
39
* expect much contention.
40
+ * @vfio_ap_drv: the vfio_ap device driver
39
41
*/
40
42
struct ap_matrix_dev {
41
43
struct device device ;
@@ -49,17 +51,19 @@ struct ap_matrix_dev {
49
51
extern struct ap_matrix_dev * matrix_dev ;
50
52
51
53
/**
52
- * The AP matrix is comprised of three bit masks identifying the adapters,
53
- * queues (domains) and control domains that belong to an AP matrix. The bits i
54
- * each mask, from least significant to most significant bit, correspond to IDs
55
- * 0 to 255. When a bit is set, the corresponding ID belongs to the matrix.
54
+ * struct ap_matrix - matrix of adapters, domains and control domains
56
55
*
57
56
* @apm_max: max adapter number in @apm
58
- * @apm identifies the AP adapters in the matrix
57
+ * @apm: identifies the AP adapters in the matrix
59
58
* @aqm_max: max domain number in @aqm
60
- * @aqm identifies the AP queues (domains) in the matrix
59
+ * @aqm: identifies the AP queues (domains) in the matrix
61
60
* @adm_max: max domain number in @adm
62
- * @adm identifies the AP control domains in the matrix
61
+ * @adm: identifies the AP control domains in the matrix
62
+ *
63
+ * The AP matrix is comprised of three bit masks identifying the adapters,
64
+ * queues (domains) and control domains that belong to an AP matrix. The bits in
65
+ * each mask, from left to right, correspond to IDs 0 to 255. When a bit is set
66
+ * the corresponding ID belongs to the matrix.
63
67
*/
64
68
struct ap_matrix {
65
69
unsigned long apm_max ;
@@ -71,13 +75,20 @@ struct ap_matrix {
71
75
};
72
76
73
77
/**
74
- * struct ap_matrix_mdev - the mediated matrix device structure
75
- * @list: allows the ap_matrix_mdev struct to be added to a list
78
+ * struct ap_matrix_mdev - Contains the data associated with a matrix mediated
79
+ * device.
80
+ * @vdev: the vfio device
81
+ * @node: allows the ap_matrix_mdev struct to be added to a list
76
82
* @matrix: the adapters, usage domains and control domains assigned to the
77
83
* mediated matrix device.
78
84
* @group_notifier: notifier block used for specifying callback function for
79
85
* handling the VFIO_GROUP_NOTIFY_SET_KVM event
86
+ * @iommu_notifier: notifier block used for specifying callback function for
87
+ * handling the VFIO_IOMMU_NOTIFY_DMA_UNMAP even
80
88
* @kvm: the struct holding guest's state
89
+ * @pqap_hook: the function pointer to the interception handler for the
90
+ * PQAP(AQIC) instruction.
91
+ * @mdev: the mediated device
81
92
*/
82
93
struct ap_matrix_mdev {
83
94
struct vfio_device vdev ;
@@ -90,6 +101,14 @@ struct ap_matrix_mdev {
90
101
struct mdev_device * mdev ;
91
102
};
92
103
104
+ /**
105
+ * struct vfio_ap_queue - contains the data associated with a queue bound to the
106
+ * vfio_ap device driver
107
+ * @matrix_mdev: the matrix mediated device
108
+ * @saved_pfn: the guest PFN pinned for the guest
109
+ * @apqn: the APQN of the AP queue device
110
+ * @saved_isc: the guest ISC registered with the GIB interface
111
+ */
93
112
struct vfio_ap_queue {
94
113
struct ap_matrix_mdev * matrix_mdev ;
95
114
unsigned long saved_pfn ;
0 commit comments