From: Yinghai Lu <yinghai@kernel.org>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [patch] x86: handle legacy PIC interrupts on all the cpu's
Date: Mon, 15 Mar 2010 14:51:36 -0700 [thread overview]
Message-ID: <4B9EABE8.1020203@kernel.org> (raw)
In-Reply-To: <1268692386.3296.43.camel@sbs-t61.sc.intel.com>
On 03/15/2010 03:33 PM, Suresh Siddha wrote:
> Ingo Molnar reported that with the recent changes of not statically blocking
> IRQ0_VECTOR..IRQ15_VECTOR's on all the cpu's, broke an AMD platform
> (with Nvidia chipset) boot when "noapic" boot option is used.
>
> On this platform, legacy PIC interrupts are getting delivered to all the
> cpu's instead of just the boot cpu. Thus not initializing the vector to irq
> mapping for the legacy irq's resulted in not handling certain interrupts
> causing boot hang.
>
> Fix this by initializing the vector to irq mapping on all the logical cpu's,
> if the legacy IRQ is handled by the legacy PIC.
>
> Reported-by: Ingo Molnar <mingo@elte.hu>
> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
> ---
>
> diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
> index a929c9e..46c0fe0 100644
> --- a/arch/x86/include/asm/hw_irq.h
> +++ b/arch/x86/include/asm/hw_irq.h
> @@ -133,6 +133,7 @@ extern void (*__initconst interrupt[NR_VECTORS-FIRST_EXTERNAL_VECTOR])(void);
>
> typedef int vector_irq_t[NR_VECTORS];
> DECLARE_PER_CPU(vector_irq_t, vector_irq);
> +extern void setup_vector_irq(int cpu);
>
> #ifdef CONFIG_X86_IO_APIC
> extern void lock_vector_lock(void);
> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> index e4e0ddc..10f0a1a 100644
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -1268,6 +1268,14 @@ void __setup_vector_irq(int cpu)
> /* Mark the inuse vectors */
> for_each_irq_desc(irq, desc) {
> cfg = desc->chip_data;
> +
> + /*
> + * If it is a legacy IRQ handled by the legacy PIC, this cpu
> + * will be part of the irq_cfg's domain.
> + */
> + if (irq < legacy_pic->nr_legacy_irqs && !IO_APIC_IRQ(irq))
> + cpumask_set_cpu(cpu, cfg->domain);
> +
> if (!cpumask_test_cpu(cpu, cfg->domain))
> continue;
> vector = cfg->vector;
> diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
> index ef257fc..daaf413 100644
> --- a/arch/x86/kernel/irqinit.c
> +++ b/arch/x86/kernel/irqinit.c
> @@ -141,6 +141,27 @@ void __init init_IRQ(void)
> x86_init.irqs.intr_init();
> }
>
> +/*
> + * Setup the vector to irq mappings.
> + */
> +void setup_vector_irq(int cpu)
> +{
> + int irq;
> +
> + /*
> + * On most of the platforms, legacy PIC delivers the interrupts on the
> + * boot cpu. But there are certain platforms where PIC interrupts are
> + * delivered to multiple cpu's. If the legacy IRQ is handled by the
> + * legacy PIC, for the new cpu that is coming online, setup the static
> + * legacy vector to irq mapping.
> + */
> + for (irq = 0; irq < legacy_pic->nr_legacy_irqs; irq++)
> + if (!IO_APIC_IRQ(irq))
> + per_cpu(vector_irq, cpu)[IRQ0_VECTOR + irq] = irq;
seems those three lines are not needed...
YH
next prev parent reply other threads:[~2010-03-15 21:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-15 22:33 [patch] x86: handle legacy PIC interrupts on all the cpu's Suresh Siddha
2010-03-15 21:51 ` Yinghai Lu [this message]
2010-03-15 22:56 ` Suresh Siddha
2010-03-15 22:15 ` Yinghai Lu
2010-03-16 5:37 ` Ingo Molnar
2010-03-16 5:57 ` Ingo Molnar
2010-03-16 6:54 ` Suresh Siddha
2010-03-16 6:35 ` Yinghai Lu
2010-03-16 7:29 ` Ingo Molnar
2010-03-16 6:00 ` [tip:x86/urgent] x86: Handle " tip-bot for Suresh Siddha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B9EABE8.1020203@kernel.org \
--to=yinghai@kernel.org \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox