RE: [PATCH v2 4/6] iommu/vt-d: Remove unnecessary check in intel_iommu_add()

From: Tian, Kevin
Date: Wed Jul 06 2022 - 21:01:58 EST


> From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Saturday, July 2, 2022 9:56 AM
>
> The Intel IOMMU hot-add process starts from dmar_device_hotplug(). It
> uses the global dmar_global_lock to synchronize all the hot-add and
> hot-remove paths. In the hot-add path, the new IOMMU data structures
> are allocated firstly by dmar_parse_one_drhd() and then initialized by
> dmar_hp_add_drhd(). All the IOMMU units are allocated and initialized
> in the same synchronized path. There is no case where any IOMMU unit
> is created and then initialized for multiple times.
>
> This removes the unnecessary check in intel_iommu_add() which is the
> last reference place of the global IOMMU array.
>
> Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>