Re: [PATCH v3 5/8] iommufd: Associate fault object with iommufd_hw_pgtable

From: Baolu Lu
Date: Wed Feb 21 2024 - 01:06:33 EST


On 2024/2/7 16:14, Tian, Kevin wrote:
From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
Sent: Monday, January 22, 2024 3:39 PM

+
+int iommufd_fault_iopf_handler(struct iopf_group *group)
+{
+ struct iommufd_hw_pagetable *hwpt = group->cookie->domain-
fault_data;
+ struct iommufd_fault *fault = hwpt->fault;
+

why not directly using iommufd_fault as the fault_data?

The relationship among these structures is:

iommufd_hwpt -> iommu_domain
^
|
v
iommufd_fault

It appears preferable to hook the hwpt instead of iommufd_fault to an
iommu_domain structure.

Best regards,
baolu