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

From: Nicolin Chen

Date: Wed Oct 07 2026 - 16:18:54 EST


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".

> +
> +/**
> + * 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

Nicolin