Re: [PATCH v3 01/15] iommu/vt-d: Handle race between registration and device probe

Lu Baolu
2022-07-19T00:06:25Z

Hi Robin,

On 2022/7/15 20:37, Robin Murphy wrote:
>> In fact the rmrr list in the Intel IOMMU driver is always static after
>> parsing the ACPI/DMAR tables. There's no need to protect it with a lock.
>> Hence we can safely remove below down/up_read().
>
> IIRC that leads to RCU warnings via for_each_dev_scope(), though. I did
> try replacing this down_read() with rcu_read_lock(), but then it doesn't
> like the GFP_KERNEL allocation in iommu_alloc_resv_region(), and that's
> where I gave up :)
>
> I'm mostly left wondering whether the dmar_drhd_units list really needs
> to be RCU protected at all, as that seems to be the root of most of the
> problems here.

I just posted a fix patch here:

https://lore.kernel.org/linux-iommu/20220718235325.3952426-1-baolu.lu@linux.intel.com/

It can remove the recursive locking and RCU warnings. Can you please
take a look at it?

Best regards,
baolu