@@ -107,10 +107,6 @@ static inline bool is_pci_tsm_pf0(struct pci_dev *pdev)
return PCI_FUNC(pdev->devfn) == 0;
}
-enum pci_tsm_guest_req_type {
- PCI_TSM_GUEST_REQ_TDXC,
-};
-
/**
* struct pci_tsm_guest_req_info - parameter for pci_tsm_ops.guest_req()
* @type: identify the format of the following blobs
@@ -123,12 +119,12 @@ enum pci_tsm_guest_req_type {
* for output, the size of actual response data filled by host
*/
struct pci_tsm_guest_req_info {
- enum pci_tsm_guest_req_type type;
- void *type_info;
+ u32 type;
+ void __user *type_info;
size_t type_info_len;
- void *req;
+ void __user *req;
size_t req_len;
- void *resp;
+ void __user *resp;
size_t resp_len;
};
@@ -1143,6 +1143,14 @@ struct iommu_veventq_alloc {
};
#define IOMMU_VEVENTQ_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VEVENTQ_ALLOC)
+/**
+ * enum pci_tsm_guest_req_type - Specify the format of guest request blobs
+ * @PCI_TSM_GUEST_REQ_TDXC: Intel TDX Connect specific type
+ */
+enum pci_tsm_guest_req_type {
+ PCI_TSM_GUEST_REQ_TDXC,
+};
+
/**
* struct iommu_vdevice_tsm_guest_request - ioctl(IOMMU_VDEVICE_TSM_GUEST_REQUEST)
* @size: sizeof(struct iommu_vdevice_tsm_guest_request)
Move the guest_request_type to IOMMUFD uAPI header file so that userspace could use it for IOMMUFD uAPI - IOMMU_VDEVICE_TSM_GUEST_REQUEST. Add __user marker to all blob pointers to indicate the TSM drivers' responsibility to read out/fill in user data. Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com> --- include/linux/pci-tsm.h | 12 ++++-------- include/uapi/linux/iommufd.h | 8 ++++++++ 2 files changed, 12 insertions(+), 8 deletions(-)