Commit 8b32a3be authored by Lu Baolu's avatar Lu Baolu Committed by Joerg Roedel

iommu: Cleanup iopf data structure definitions

struct iommu_fault_page_request and struct iommu_page_response are not
part of uAPI anymore. Convert them to data structures for kAPI.
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Reviewed-by: default avatarYi Liu <yi.l.liu@intel.com>
Tested-by: default avatarYan Zhao <yan.y.zhao@intel.com>
Tested-by: default avatarLongfang Liu <liulongfang@huawei.com>
Link: https://lore.kernel.org/r/20240212012227.119381-5-baolu.lu@linux.intel.comSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 0edeab66
...@@ -56,7 +56,6 @@ static int iopf_complete_group(struct device *dev, struct iopf_fault *iopf, ...@@ -56,7 +56,6 @@ static int iopf_complete_group(struct device *dev, struct iopf_fault *iopf,
enum iommu_page_response_code status) enum iommu_page_response_code status)
{ {
struct iommu_page_response resp = { struct iommu_page_response resp = {
.version = IOMMU_PAGE_RESP_VERSION_1,
.pasid = iopf->fault.prm.pasid, .pasid = iopf->fault.prm.pasid,
.grpid = iopf->fault.prm.grpid, .grpid = iopf->fault.prm.grpid,
.code = status, .code = status,
......
...@@ -1494,10 +1494,6 @@ int iommu_page_response(struct device *dev, ...@@ -1494,10 +1494,6 @@ int iommu_page_response(struct device *dev,
if (!param || !param->fault_param) if (!param || !param->fault_param)
return -EINVAL; return -EINVAL;
if (msg->version != IOMMU_PAGE_RESP_VERSION_1 ||
msg->flags & ~IOMMU_PAGE_RESP_PASID_VALID)
return -EINVAL;
/* Only send response if there is a fault report pending */ /* Only send response if there is a fault report pending */
mutex_lock(&param->fault_param->lock); mutex_lock(&param->fault_param->lock);
if (list_empty(&param->fault_param->faults)) { if (list_empty(&param->fault_param->faults)) {
......
...@@ -71,12 +71,12 @@ struct iommu_fault_page_request { ...@@ -71,12 +71,12 @@ struct iommu_fault_page_request {
#define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE (1 << 1) #define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE (1 << 1)
#define IOMMU_FAULT_PAGE_REQUEST_PRIV_DATA (1 << 2) #define IOMMU_FAULT_PAGE_REQUEST_PRIV_DATA (1 << 2)
#define IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID (1 << 3) #define IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID (1 << 3)
__u32 flags; u32 flags;
__u32 pasid; u32 pasid;
__u32 grpid; u32 grpid;
__u32 perm; u32 perm;
__u64 addr; u64 addr;
__u64 private_data[2]; u64 private_data[2];
}; };
/** /**
...@@ -85,7 +85,7 @@ struct iommu_fault_page_request { ...@@ -85,7 +85,7 @@ struct iommu_fault_page_request {
* @prm: Page Request message, when @type is %IOMMU_FAULT_PAGE_REQ * @prm: Page Request message, when @type is %IOMMU_FAULT_PAGE_REQ
*/ */
struct iommu_fault { struct iommu_fault {
__u32 type; u32 type;
struct iommu_fault_page_request prm; struct iommu_fault_page_request prm;
}; };
...@@ -106,8 +106,6 @@ enum iommu_page_response_code { ...@@ -106,8 +106,6 @@ enum iommu_page_response_code {
/** /**
* struct iommu_page_response - Generic page response information * struct iommu_page_response - Generic page response information
* @argsz: User filled size of this data
* @version: API version of this structure
* @flags: encodes whether the corresponding fields are valid * @flags: encodes whether the corresponding fields are valid
* (IOMMU_FAULT_PAGE_RESPONSE_* values) * (IOMMU_FAULT_PAGE_RESPONSE_* values)
* @pasid: Process Address Space ID * @pasid: Process Address Space ID
...@@ -115,14 +113,11 @@ enum iommu_page_response_code { ...@@ -115,14 +113,11 @@ enum iommu_page_response_code {
* @code: response code from &enum iommu_page_response_code * @code: response code from &enum iommu_page_response_code
*/ */
struct iommu_page_response { struct iommu_page_response {
__u32 argsz;
#define IOMMU_PAGE_RESP_VERSION_1 1
__u32 version;
#define IOMMU_PAGE_RESP_PASID_VALID (1 << 0) #define IOMMU_PAGE_RESP_PASID_VALID (1 << 0)
__u32 flags; u32 flags;
__u32 pasid; u32 pasid;
__u32 grpid; u32 grpid;
__u32 code; u32 code;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment