Re: [PATCH v5 14/18] iommufd: Implement ioctl to mark HWPT for preservation

From: Samiullah Khawaja

Date: Fri Oct 09 2026 - 23:52:20 EST


On Wed, Oct 07, 2026 at 01:17:32PM -0700, Nicolin Chen wrote:
On Mon, Sep 21, 2026 at 12:48:30AM +0000, Samiullah Khawaja wrote:
+int iommufd_hwpt_liveupdate_mark_preserve(struct iommufd_ucmd *ucmd)
+{
+ struct iommu_hwpt_liveupdate_mark_preserve *cmd = ucmd->cmd;
+ struct iommufd_hwpt_paging *hwpt_target;
+ struct iommufd_hwpt_paging *hwpt_paging;

I'd move hwpt_paging inside xa_for_each_marked() and rename it to
"hwpt_marked". Then, hwpt_target can be simply "hwpt".

Agreed. Will update.

+
+/**
+ * struct iommu_hwpt_liveupdate_mark_preserve - ioctl(IOMMU_HWPT_LIVEUPDATE_MARK_PRESERVE)
+ * @size: sizeof(struct iommu_hwpt_liveupdate_mark_preserve)
+ * @hwpt_id: Iommufd object ID of the target HWPT

HW pagetable ID to preserve for liveupdate

Will update

Nicolin

Thanks,
Sami