linux/arch/x86/kernel/apic
Pallipadi, Venkatesh 6ec3cfeca0 x86, irq: Remove IRQ_DISABLED check in process context IRQ move
As discussed in the thread here:

  http://marc.info/?l=linux-kernel&m=123964468521142&w=2

Eric W. Biederman observed:

> It looks like some additional bugs have slipped in since last I looked.
>
> set_irq_affinity does this:
> ifdef CONFIG_GENERIC_PENDING_IRQ
>        if (desc->status & IRQ_MOVE_PCNTXT || desc->status & IRQ_DISABLED) {
>                cpumask_copy(desc->affinity, cpumask);
>                desc->chip->set_affinity(irq, cpumask);
>        } else {
>                desc->status |= IRQ_MOVE_PENDING;
>                cpumask_copy(desc->pending_mask, cpumask);
>        }
> #else
>
> That IRQ_DISABLED case is a software state and as such it has nothing to
> do with how safe it is to move an irq in process context.

[...]

>
> The only reason we migrate MSIs in interrupt context today is that there
> wasn't infrastructure for support migration both in interrupt context
> and outside of it.

Yes. The idea here was to force the MSI migration to happen in process
context. One of the patches in the series did

        disable_irq(dev->irq);
        irq_set_affinity(dev->irq, cpumask_of(dev->cpu));
        enable_irq(dev->irq);

with the above patch adding irq/manage code check for interrupt disabled
and moving the interrupt in process context.

IIRC, there was no IRQ_MOVE_PCNTXT when we were developing this HPET
code and we ended up having this ugly hack. IRQ_MOVE_PCNTXT was there
when we eventually submitted the patch upstream. But, looks like I did a
blind rebasing instead of using IRQ_MOVE_PCNTXT in hpet MSI code.

Below patch fixes this. i.e., revert commit 932775a4ab
and add PCNTXT to HPET MSI setup. Also removes copying of desc->affinity
in generic code as set_affinity routines are doing it internally.

Reported-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "Li Shaohua" <shaohua.li@intel.com>
Cc: Gary Hade <garyhade@us.ibm.com>
Cc: "lcm@us.ibm.com" <lcm@us.ibm.com>
Cc: suresh.b.siddha@intel.com
LKML-Reference: <20090413222058.GB8211@linux-os.sc.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-14 15:21:13 +02:00
..
apic_flat_64.c x86: make 64 bit to use default_inquire_remote_apic 2009-04-08 17:36:12 +02:00
apic.c x86 ACPI: Add support for Always Running APIC timer 2009-04-07 18:17:51 -04:00
bigsmp_32.c cpumask: use new cpumask functions throughout x86 2009-03-13 14:49:54 +10:30
es7000_32.c cpumask: remove x86 cpumask_t uses. 2009-03-13 14:49:57 +10:30
io_apic.c x86, irq: Remove IRQ_DISABLED check in process context IRQ move 2009-04-14 15:21:13 +02:00
ipi.c
Makefile
nmi.c cpumask: convert arch/x86/kernel/nmi.c's backtrace_mask to a cpumask_var_t 2009-03-13 14:49:49 +10:30
numaq_32.c cpumask: remove x86 cpumask_t uses. 2009-03-13 14:49:57 +10:30
probe_32.c cpumask: remove cpumask_t assignment from vector_allocation_domain() 2009-03-13 14:49:56 +10:30
probe_64.c x86, x2apic: cleanup ifdef CONFIG_INTR_REMAP in io_apic code 2009-03-17 15:45:07 -07:00
summit_32.c cpumask: remove x86 cpumask_t uses. 2009-03-13 14:49:57 +10:30
x2apic_cluster.c x86: add x2apic_wrmsr_fence() to x2apic flush tlb paths 2009-03-18 09:36:14 +01:00
x2apic_phys.c x86: add x2apic_wrmsr_fence() to x2apic flush tlb paths 2009-03-18 09:36:14 +01:00
x2apic_uv_x.c sgi-gru: add macros for using the UV hub to send interrupts 2009-04-02 19:05:05 -07:00