Skip to content

Commit 9744a7a

Browse files
committed
iommufd: Rename IOMMUFD_OBJ_HW_PAGETABLE to IOMMUFD_OBJ_HWPT_PAGING
To add a new IOMMUFD_OBJ_HWPT_NESTED, rename the HWPT object to confine it to PAGING hwpts/domains. The following patch will separate the hwpt structure as well. Link: https://lore.kernel.org/r/20231026043938.63898-3-yi.l.liu@intel.com Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 54d6068 commit 9744a7a

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

drivers/iommu/iommufd/device.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ static int iommufd_device_change_pt(struct iommufd_device *idev, u32 *pt_id,
563563
return PTR_ERR(pt_obj);
564564

565565
switch (pt_obj->type) {
566-
case IOMMUFD_OBJ_HW_PAGETABLE: {
566+
case IOMMUFD_OBJ_HWPT_PAGING: {
567567
struct iommufd_hw_pagetable *hwpt =
568568
container_of(pt_obj, struct iommufd_hw_pagetable, obj);
569569

@@ -601,8 +601,8 @@ static int iommufd_device_change_pt(struct iommufd_device *idev, u32 *pt_id,
601601
/**
602602
* iommufd_device_attach - Connect a device to an iommu_domain
603603
* @idev: device to attach
604-
* @pt_id: Input a IOMMUFD_OBJ_IOAS, or IOMMUFD_OBJ_HW_PAGETABLE
605-
* Output the IOMMUFD_OBJ_HW_PAGETABLE ID
604+
* @pt_id: Input a IOMMUFD_OBJ_IOAS, or IOMMUFD_OBJ_HWPT_PAGING
605+
* Output the IOMMUFD_OBJ_HWPT_PAGING ID
606606
*
607607
* This connects the device to an iommu_domain, either automatically or manually
608608
* selected. Once this completes the device could do DMA.
@@ -630,8 +630,8 @@ EXPORT_SYMBOL_NS_GPL(iommufd_device_attach, IOMMUFD);
630630
/**
631631
* iommufd_device_replace - Change the device's iommu_domain
632632
* @idev: device to change
633-
* @pt_id: Input a IOMMUFD_OBJ_IOAS, or IOMMUFD_OBJ_HW_PAGETABLE
634-
* Output the IOMMUFD_OBJ_HW_PAGETABLE ID
633+
* @pt_id: Input a IOMMUFD_OBJ_IOAS, or IOMMUFD_OBJ_HWPT_PAGING
634+
* Output the IOMMUFD_OBJ_HWPT_PAGING ID
635635
*
636636
* This is the same as::
637637
*

drivers/iommu/iommufd/hw_pagetable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ iommufd_hw_pagetable_alloc(struct iommufd_ctx *ictx, struct iommufd_ioas *ioas,
8686
if (flags && !ops->domain_alloc_user)
8787
return ERR_PTR(-EOPNOTSUPP);
8888

89-
hwpt = iommufd_object_alloc(ictx, hwpt, IOMMUFD_OBJ_HW_PAGETABLE);
89+
hwpt = iommufd_object_alloc(ictx, hwpt, IOMMUFD_OBJ_HWPT_PAGING);
9090
if (IS_ERR(hwpt))
9191
return hwpt;
9292

drivers/iommu/iommufd/iommufd_private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ enum iommufd_object_type {
123123
IOMMUFD_OBJ_NONE,
124124
IOMMUFD_OBJ_ANY = IOMMUFD_OBJ_NONE,
125125
IOMMUFD_OBJ_DEVICE,
126-
IOMMUFD_OBJ_HW_PAGETABLE,
126+
IOMMUFD_OBJ_HWPT_PAGING,
127127
IOMMUFD_OBJ_IOAS,
128128
IOMMUFD_OBJ_ACCESS,
129129
#ifdef CONFIG_IOMMUFD_TEST
@@ -256,7 +256,7 @@ static inline struct iommufd_hw_pagetable *
256256
iommufd_get_hwpt(struct iommufd_ucmd *ucmd, u32 id)
257257
{
258258
return container_of(iommufd_get_object(ucmd->ictx, id,
259-
IOMMUFD_OBJ_HW_PAGETABLE),
259+
IOMMUFD_OBJ_HWPT_PAGING),
260260
struct iommufd_hw_pagetable, obj);
261261
}
262262
int iommufd_hwpt_set_dirty_tracking(struct iommufd_ucmd *ucmd);

drivers/iommu/iommufd/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ static const struct iommufd_object_ops iommufd_object_ops[] = {
488488
[IOMMUFD_OBJ_IOAS] = {
489489
.destroy = iommufd_ioas_destroy,
490490
},
491-
[IOMMUFD_OBJ_HW_PAGETABLE] = {
491+
[IOMMUFD_OBJ_HWPT_PAGING] = {
492492
.destroy = iommufd_hw_pagetable_destroy,
493493
.abort = iommufd_hw_pagetable_abort,
494494
},

drivers/iommu/iommufd/selftest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ get_md_pagetable(struct iommufd_ucmd *ucmd, u32 mockpt_id,
437437
struct iommufd_object *obj;
438438

439439
obj = iommufd_get_object(ucmd->ictx, mockpt_id,
440-
IOMMUFD_OBJ_HW_PAGETABLE);
440+
IOMMUFD_OBJ_HWPT_PAGING);
441441
if (IS_ERR(obj))
442442
return ERR_CAST(obj);
443443
hwpt = container_of(obj, struct iommufd_hw_pagetable, obj);

0 commit comments

Comments
 (0)