Re: [PATCH] iommu/vt-d: Don't register bus-notifier under

From: Jan Kiszka
Date: Tue Oct 10 2017 - 03:24:54 EST


On 2017-10-10 09:21, Joerg Roedel wrote:
> On Mon, Oct 09, 2017 at 06:58:13PM +0200, Jan Kiszka wrote:
>>> extern int dmar_table_init(void);
>>> extern int dmar_dev_scope_init(void);
>>> +extern void dmar_register_bus_notifier(void);
>>> extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
>>> struct dmar_dev_scope **devices, u16 segment);
>>> extern void *dmar_alloc_dev_scope(void *start, void *end, int *cnt);
>>>
>>
>> Silences the warning, but locking in the init paths still smells fishy
>> to me.
>
> Yes, its certainly not optimal, but the code that runs in there also
> runs at iommu hotplug time, so we can't just remove the locking there
> entirely.

It may not just be "sub-optimal" but rather borken: "One example:
dmar_table_init is not consistently protected by dmar_global_lock."

Jan

>
> On the other side the warning you reported is a false-positive, it can
> never dead-lock because the reverse lock-order happens only at
> initialization time, but I don't know how to silence it otherwise.
>
>
> Regards,
>
> Joerg
>

--
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux