Re: [PATCH 1/2] dmar: fix fault interrupt setup

From: Kenji Kaneshige
Date: Wed Dec 01 2010 - 00:14:46 EST


(2010/12/01 5:18), Suresh Siddha wrote:
> On Tue, 2010-11-30 at 00:30 -0800, Kenji Kaneshige wrote:
>> Fix the problem dmar fault event is not notified in x2apic cluster mode.
>>
>> In the current code, dmar fault event is configured before setting up
>> the x86_cpu_to_logical_apicid percpu variable in x2apic cluster
>> mode. Because of this, invalid apic ID is used for dmar fault
>> interrupt and this cuases the problem.
>>
>> To fix the problem, do dmar fault event configuration after local apic
>> setup (after end_local_APIC_setup()).
>>
>> Signed-off-by: Kenji Kaneshige<kaneshige.kenji@xxxxxxxxxxxxxx>
>>
>>
>> ---
>> arch/x86/kernel/apic/apic.c | 9 +++++++++
>> arch/x86/kernel/apic/probe_64.c | 7 -------
>> 2 files changed, 9 insertions(+), 7 deletions(-)
>>
>> Index: linux-next-20101125/arch/x86/kernel/apic/apic.c
>> ===================================================================
>> --- linux-next-20101125.orig/arch/x86/kernel/apic/apic.c
>> +++ linux-next-20101125/arch/x86/kernel/apic/apic.c
>> @@ -1745,6 +1745,15 @@ int __init APIC_init_uniprocessor(void)
>>
>> end_local_APIC_setup();
>>
>> +#ifdef CONFIG_INTR_REMAP
>> + /*
>> + * Now that local APIC setup is completed, configure the fault
>> + * handling for interrupt remapping.
>> + */
>> + if (intr_remapping_enabled)
>> + enable_drhd_fault_handling();
>> +#endif
>
> BTW, this is wrong. APIC_init_uniprocessor() gets called only for UP
> kernel. I will move it to the end_local_APIC_setup()
>

Oh, it's totally wrong. I'm sorry about that.

Maybe even with my wrong patch, dmar interrupt is configured in the
intel_iommu_init()->init_dmars()->dmar_set_interrupt() code path. I
think this is why I could not noticed my badness in my test.

By the way, why do we need to try to configure dmar interrupt in the
intel_iommu_init() code path again?

Regards,
Kenji Kaneshige

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/