Skip to content

Commit 8b32a3b

Browse files
LuBaolujoergroedel
authored andcommitted
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: Lu Baolu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Yi Liu <[email protected]> Tested-by: Yan Zhao <[email protected]> Tested-by: Longfang Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 0edeab6 commit 8b32a3b

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

drivers/iommu/io-pgfault.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ static int iopf_complete_group(struct device *dev, struct iopf_fault *iopf,
5656
enum iommu_page_response_code status)
5757
{
5858
struct iommu_page_response resp = {
59-
.version = IOMMU_PAGE_RESP_VERSION_1,
6059
.pasid = iopf->fault.prm.pasid,
6160
.grpid = iopf->fault.prm.grpid,
6261
.code = status,

drivers/iommu/iommu.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,10 +1494,6 @@ int iommu_page_response(struct device *dev,
14941494
if (!param || !param->fault_param)
14951495
return -EINVAL;
14961496

1497-
if (msg->version != IOMMU_PAGE_RESP_VERSION_1 ||
1498-
msg->flags & ~IOMMU_PAGE_RESP_PASID_VALID)
1499-
return -EINVAL;
1500-
15011497
/* Only send response if there is a fault report pending */
15021498
mutex_lock(&param->fault_param->lock);
15031499
if (list_empty(&param->fault_param->faults)) {

include/linux/iommu.h

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ struct iommu_fault_page_request {
7171
#define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE (1 << 1)
7272
#define IOMMU_FAULT_PAGE_REQUEST_PRIV_DATA (1 << 2)
7373
#define IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID (1 << 3)
74-
__u32 flags;
75-
__u32 pasid;
76-
__u32 grpid;
77-
__u32 perm;
78-
__u64 addr;
79-
__u64 private_data[2];
74+
u32 flags;
75+
u32 pasid;
76+
u32 grpid;
77+
u32 perm;
78+
u64 addr;
79+
u64 private_data[2];
8080
};
8181

8282
/**
@@ -85,7 +85,7 @@ struct iommu_fault_page_request {
8585
* @prm: Page Request message, when @type is %IOMMU_FAULT_PAGE_REQ
8686
*/
8787
struct iommu_fault {
88-
__u32 type;
88+
u32 type;
8989
struct iommu_fault_page_request prm;
9090
};
9191

@@ -106,23 +106,18 @@ enum iommu_page_response_code {
106106

107107
/**
108108
* struct iommu_page_response - Generic page response information
109-
* @argsz: User filled size of this data
110-
* @version: API version of this structure
111109
* @flags: encodes whether the corresponding fields are valid
112110
* (IOMMU_FAULT_PAGE_RESPONSE_* values)
113111
* @pasid: Process Address Space ID
114112
* @grpid: Page Request Group Index
115113
* @code: response code from &enum iommu_page_response_code
116114
*/
117115
struct iommu_page_response {
118-
__u32 argsz;
119-
#define IOMMU_PAGE_RESP_VERSION_1 1
120-
__u32 version;
121116
#define IOMMU_PAGE_RESP_PASID_VALID (1 << 0)
122-
__u32 flags;
123-
__u32 pasid;
124-
__u32 grpid;
125-
__u32 code;
117+
u32 flags;
118+
u32 pasid;
119+
u32 grpid;
120+
u32 code;
126121
};
127122

128123

0 commit comments

Comments
 (0)