From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
"KOSAKI Motohiro" <kosaki.motohiro@gmail.com>,
linux-kernel@vger.kernel.org,
"Andrew Morton" <akpm@linux-foundation.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
"Jesse Barnes" <jbarnes@virtuousgeek.org>,
"Kamalesh Babulal" <kamalesh@linux.vnet.ibm.com>
Subject: Re: [git pull] sparseirq / irq updates for v2.6.29
Date: Sun, 28 Dec 2008 16:01:13 -0800 [thread overview]
Message-ID: <86802c440812281601j57fe5ecdif4b63b72280c65cd@mail.gmail.com> (raw)
In-Reply-To: <20081228233028.GA14697@elte.hu>
[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]
On Sun, Dec 28, 2008 at 3:30 PM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Ingo Molnar <mingo@elte.hu> 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@elte.hu>
> 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@linux.vnet.ibm.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
> kernel/irq/handle.c | 5 -----
> kernel/irq/manage.c | 9 +++++++++
> 2 files changed, 9 insertions(+), 5 deletions(-)
>
that is not enough.
please check
need one printk, and move two functions into chip.c
YH
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sparse_irq_fix6.patch --]
[-- Type: text/x-patch; name=sparse_irq_fix6.patch, Size: 1699 bytes --]
[PATCH] sparseirq: mvoe two weak functions to chip.c
Impact: fix panic
some gcc compiler will remove the weak global blank function
Linus noted that we could move those function to other unit to workaround it.
try to workaround it:
1. one time path: add printk
2. multi time path: move to chip.c
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
diff --git a/init/main.c b/init/main.c
index d0c5e02..6a7a308 100644
--- a/init/main.c
+++ b/init/main.c
@@ -542,14 +542,11 @@ void __init __weak thread_info_cache_init(void)
{
}
-int __init __weak arch_early_irq_init(void)
-{
- return 0;
-}
-
int __init __weak early_irq_init(void)
{
- return arch_early_irq_init();
+ printk(KERN_DEBUG "calling __weak early_irq_init()\n");
+
+ return 0;
}
asmlinkage void __init start_kernel(void)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index f63c706..2ba0c84 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -18,6 +18,16 @@
#include "internals.h"
+int __init __weak arch_early_irq_init(void)
+{
+ return 0;
+}
+
+int __weak arch_init_chip_data(struct irq_desc *desc, int cpu)
+{
+ return 0;
+}
+
/**
* dynamic_irq_init - initialize a dynamically allocated irq
* @irq: irq number to initialize
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));
next prev parent reply other threads:[~2008-12-29 0:01 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-25 16:07 Ingo Molnar
2008-12-27 13:32 ` Ingo Molnar
2008-12-27 17:27 ` KOSAKI Motohiro
2008-12-27 17:38 ` Ingo Molnar
2008-12-28 23:11 ` Linus Torvalds
2008-12-28 23:23 ` Yinghai Lu
2008-12-28 23:27 ` Ingo Molnar
2008-12-28 23:30 ` Ingo Molnar
2008-12-29 0:01 ` Yinghai Lu [this message]
2008-12-29 8:39 ` KOSAKI Motohiro
2008-12-29 11:09 ` Ingo Molnar
2008-12-29 11:20 ` KOSAKI Motohiro
2008-12-29 0:28 ` Yinghai Lu
2008-12-29 0:53 ` Yinghai Lu
2008-12-29 9:44 ` Ingo Molnar
2008-12-29 9:52 ` Ingo Molnar
2008-12-29 11:00 ` Kamalesh Babulal
2008-12-29 11:05 ` Ingo Molnar
2008-12-29 16:05 ` Kamalesh Babulal
2008-12-29 16:20 ` Ingo Molnar
2008-12-29 16:22 ` KOSAKI Motohiro
2008-12-29 16:36 ` Ingo Molnar
2008-12-28 23:55 ` H. Peter Anvin
2008-12-29 0:06 ` Yinghai Lu
2008-12-29 0:38 ` H. Peter Anvin
2008-12-29 9:34 ` Ingo Molnar
2008-12-28 23:10 ` [git pull] sparseirq / irq fixes Ingo Molnar
2008-12-29 12:52 ` Ingo Molnar
2008-12-31 0:22 ` Linus Torvalds
2008-12-31 6:48 ` Ingo Molnar
2008-12-31 12:00 ` [sparseirq] remove debug printks (io_apic.c) Markus Trippelsdorf
2009-01-02 22:21 ` Ingo Molnar
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=86802c440812281601j57fe5ecdif4b63b72280c65cd@mail.gmail.com \
--to=yhlu.kernel@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=jbarnes@virtuousgeek.org \
--cc=kamalesh@linux.vnet.ibm.com \
--cc=kosaki.motohiro@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®