Re: [git pull] sparseirq / irq updates for v2.6.29




* Ingo Molnar <mingo@xxxxxxx> wrote:

b2e2fe9: sparseirq: work around __weak alias bug

here's that fix, standalone too. Kamalesh, i think this should finally fix
the crash you are seeing.

Ingo

---------------->
From b2e2fe99628c4f944c3075258e536197b5a4f3f8 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@xxxxxxx>
Date: Mon, 29 Dec 2008 00:16:45 +0100
Subject: [PATCH] sparseirq: work around __weak alias bug

Impact: fix boot crash if the kernel is built with certain GCC versions

GCC has a bug with __weak alias functions: if the functions are in
the same compilation unit as their call site, GCC can decide to
inline them - and thus rob the linker of the opportunity to override
the weak alias with the real thing.

This can lead to the boot crash reported by Kamalesh Babulal:

ACPI: Core revision 20080926
Setting APIC routing to flat
BUG: unable to handle kernel NULL pointer dereference at
0000000000000000
IP: [<ffffffff8021f9a8>] add_pin_to_irq_cpu+0x14/0x74
PGD 0
Oops: 0000 [#1] SMP
[...]

So move the arch_init_chip_data() function from handle.c to manage.c.

Reported-by: Kamalesh Babulal <kamalesh@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
kernel/irq/handle.c | 5 -----
kernel/irq/manage.c | 9 +++++++++
2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 157c04c..c20db0b 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -86,11 +86,6 @@ void init_kstat_irqs(struct irq_desc *desc, int cpu, int nr)
desc->kstat_irqs = (unsigned int *)ptr;
}

-int __weak arch_init_chip_data(struct irq_desc *desc, int cpu)
-{
- return 0;
-}
-
static void init_one_irq_desc(int irq, struct irq_desc *desc, int cpu)
{
memcpy(desc, &irq_desc_init, sizeof(struct irq_desc));
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 46953a0..c2741b0 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -261,6 +261,15 @@ void enable_irq(unsigned int irq)
}
EXPORT_SYMBOL(enable_irq);

+/*
+ * [ Not in kernel/irq/handle.c, so that GCC does not
+ * inline the __weak alias: ]
+ */
+int __weak arch_init_chip_data(struct irq_desc *desc, int cpu)
+{
+ return 0;
+}
+
static int set_irq_wake_real(unsigned int irq, unsigned int on)
{
struct irq_desc *desc = irq_to_desc(irq);
--
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/



Relevant Pages

  • Re: [git pull] sparseirq / irq updates for v2.6.29
    ... i think this should finally fix ... Subject: sparseirq: work around __weak alias bug ... fix boot crash if the kernel is built with certain GCC versions ...
    (Linux-Kernel)
  • Re: [git pull] sparseirq / irq updates for v2.6.29
    ... i think this should finally fix ... Subject: sparseirq: work around __weak alias bug ... fix boot crash if the kernel is built with certain GCC versions ...
    (Linux-Kernel)
  • Re: OE 6 Address book crash
    ... and the fix you cite must have coincided with the bug and the fix from McAfee. ... Just before the crash, i happened to have in my inbox 2 e-mail messages that I wanted to forward to the same recipient. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Stick a spork in it, its done?
    ... As a developer I just can't stand to have known crash bugs in my ... Deallocated wielded objects bug fix http://bilious.homelinux.org/?342 ... The description on bilious details what official bugs these patches ...
    (rec.games.roguelike.nethack)
  • Re: [git pull] sparseirq / irq updates for v2.6.29
    ... i think this should finally fix ... Subject: sparseirq: work around __weak alias bug ... fix boot crash if the kernel is built with certain GCC versions ...
    (Linux-Kernel)