Re: [PATCH] Allocate DMAR fault interrupts locally

From: Thomas Gleixner
Date: Fri Mar 01 2024 - 14:59:35 EST


Jacob!

On Fri, Mar 01 2024 at 11:50, Jacob Pan wrote:
> On Thu, 29 Feb 2024 23:18:37 +0100, Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> wrote:
>> On Thu, Feb 29 2024 at 14:07, Dimitri Sivanich wrote:
>> The real problems are:
>>
>> 1) This approach only works when _ALL_ APs have been brought up during
>> boot. With 'maxcpus=N' on the command line this will fail to enable
>> fault handling when the APs which have not been brought up initially
>> are onlined later on.
>>
>> This might be working in practice because intel_iommu_init() will
>> enable the interrupts later on via init_dmars() unconditionally, but
>> that's far from correct because IRQ_REMAP does not depend on
>> INTEL_IOMMU.
> The dmar fault interrupt is VT-d's own interrupt, not subject to IRQ_REMAP.
> So this set up has nothing to do with IR, right?

Both interrupt remap and the IOMMU use DMAR and both set the DMAR's
fault interrupt up, whatever comes first. If IR is enabled then IR does
it, if not then the IOMMU init handles it.

But yes, the interrupt is part of DMAR.

> Maybe we should not call it irq_remap_work, call it dmar_fault_irq_work
> instead?

This work thing does not work at all as I explained in detail. No matter
how you name it. The only sane way to do that is with a hotplug state.

Thanks,

tglx