From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Sam Ravnborg <sam@ravnborg.org>, Yinghai Lu <yinghai@kernel.org>,
David Howells <dhowells@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
mel@csn.ul.ie
Subject: Re: [BUG] next-20081216 - WARNING: at kernel/smp.c:333 smp_call_function_mask
Date: Sat, 27 Dec 2008 12:41:38 +0530 [thread overview]
Message-ID: <20081227071138.GA4530@linux.vnet.ibm.com> (raw)
In-Reply-To: <20081226181733.GA24439@elte.hu>
* Ingo Molnar <mingo@elte.hu> [2008-12-26 19:17:34]:
>
> * Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> wrote:
>
> > > how about the patch below, does that work too? (after removing
> > > Yinghai's patch)
> >
> > Hi Ingo,
> >
> > Kernel crashes with the same trace, after the applying the patch.
>
> okay, thanks - does the below cleaner variant of Yinghai's patch solve the
> problem too?
>
> Ingo
>
> -------------------->
> From 9c93fc72ec95dc97d65b840978f9d605f4e5823a Mon Sep 17 00:00:00 2001
> From: Yinghai Lu <yinghai@kernel.org>
> Date: Fri, 26 Dec 2008 02:05:47 -0800
> Subject: [PATCH] sparseirq: work around compiler optimizing away __weak functions
>
> Impact: fix panic on null pointer with sparseirq
>
> Some GCC versions seem to inline the weak global function,
> when that function is empty.
>
> Work it around, by putting a barrier into the function.
>
> Signed-off-by: Yinghai <yinghai@kernel.org>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
> init/main.c | 9 +++++++++
> kernel/irq/handle.c | 3 ++-
> 2 files changed, 11 insertions(+), 1 deletions(-)
>
> diff --git a/init/main.c b/init/main.c
> index c1f999a..841d2b2 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -531,20 +531,29 @@ static void __init boot_cpu_init(void)
> cpu_set(cpu, cpu_possible_map);
> }
>
> +/*
> + * The barriers are needed to keep a GCC bug from optimizing
> + * away these weak functions:
> + */
> +
> void __init __weak smp_setup_processor_id(void)
> {
> + barrier();
> }
>
> void __init __weak thread_info_cache_init(void)
> {
> + barrier();
> }
>
> void __init __weak arch_early_irq_init(void)
> {
> + barrier();
> }
>
> void __init __weak early_irq_init(void)
> {
> + barrier();
> arch_early_irq_init();
> }
>
> diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
> index 06b05a4..a6d16a4 100644
> --- a/kernel/irq/handle.c
> +++ b/kernel/irq/handle.c
> @@ -86,8 +86,9 @@ void init_kstat_irqs(struct irq_desc *desc, int cpu, int nr)
> desc->kstat_irqs = (unsigned int *)ptr;
> }
>
> -void __attribute__((weak)) arch_init_chip_data(struct irq_desc *desc, int cpu)
> +void __weak arch_init_chip_data(struct irq_desc *desc, int cpu)
> {
> + barrier();
> }
>
> static void init_one_irq_desc(int irq, struct irq_desc *desc, int cpu)
> --
Hi Ingo,
Kernel still crashes after applying the patch,
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
ACPI: Core revision 20080926
Setting APIC routing to flat
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
IP: [<ffffffff8021f8fd>] add_pin_to_irq_cpu+0x14/0x73
PGD 0
Oops: 0000 [#1] SMP
last sysfs file:
CPU 0
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.28-rc8-autotest-tip #1
RIP: 0010:[<ffffffff8021f8fd>] [<ffffffff8021f8fd>] add_pin_to_irq_cpu+0x14/0x73
RSP: 0018:ffff88003f9d7e40 EFLAGS: 00010282
RAX: ffffffff806e7300 RBX: 0000000000000001 RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000018 R09: 0000000000000002
R10: 000000000000000f R11: ffffffff8021e74a R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000002 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffffffff806f1480(0000) knlGS:0000000000000000
CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000000000000000 CR3: 0000000000201000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 1, threadinfo ffff88003f9d6000, task ffff88003f9d8000)
Stack:
0000000000000000 0000000000000001 ffffffff806e7300 0000000000000001
0000000000000001 ffffffff8071819e 0000000000000286 0000000000000286
0000000000010000 0000000000000206 0000000000000002 0000000000000002
Call Trace:
[<ffffffff8071819e>] setup_IO_APIC+0x12f/0x720
[<ffffffff80524bf1>] _spin_lock_irqsave+0x9/0xe
[<ffffffff8022221b>] get_apic_id+0x0/0x9
[<ffffffff80715087>] native_smp_prepare_cpus+0x256/0x2f1
[<ffffffff807077c8>] kernel_init+0x50/0x1eb
[<ffffffff8020ceda>] child_rip+0xa/0x20
[<ffffffff80707778>] kernel_init+0x0/0x1eb
[<ffffffff8020ced0>] child_rip+0x0/0x20
Code: 48 c7 c7 9a 29 5f 80 31 c0 e8 83 85 01 00 5b 4c 89 e0 41 5c 41 5d c3 41 55 49 89 fd 89 f7 41 54 41 89 cc 55 89 d5 53 48 83 ec 08 <49> 8b 5d 00 48 85 db 75 35 e8 88 ff ff ff 48 85 c0 75 18 5b 5b
RIP [<ffffffff8021f8fd>] add_pin_to_irq_cpu+0x14/0x73
RSP <ffff88003f9d7e40>
CR2: 0000000000000000
---[ end trace 4eaa2a86a8e2da22 ]---
Kernel panic - not syncing: Attempted to kill init!
Pid: 1, comm: swapper Tainted: G D 2.6.28-rc8-autotest-tip #1
Call Trace:
[<ffffffff80237321>] panic+0x86/0x144
[<ffffffff80236bc8>] mm_release+0x3f/0xd3
[<ffffffff80238b4f>] exit_fs+0x35/0x46
[<ffffffff80239fd7>] do_exit+0x75/0x78f
[<ffffffff805257ae>] oops_end+0xa8/0xad
[<ffffffff80526ffd>] do_page_fault+0x756/0x80f
[<ffffffff80524dbf>] page_fault+0x1f/0x30
[<ffffffff8021e74a>] native_apic_mem_write+0x0/0x9
[<ffffffff8021f8fd>] add_pin_to_irq_cpu+0x14/0x73
[<ffffffff8071819e>] setup_IO_APIC+0x12f/0x720
[<ffffffff80524bf1>] _spin_lock_irqsave+0x9/0xe
[<ffffffff8022221b>] get_apic_id+0x0/0x9
[<ffffffff80715087>] native_smp_prepare_cpus+0x256/0x2f1
[<ffffffff807077c8>] kernel_init+0x50/0x1eb
[<ffffffff8020ceda>] child_rip+0xa/0x20
[<ffffffff80707778>] kernel_init+0x0/0x1eb
[<ffffffff8020ced0>] child_rip+0x0/0x20
--
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
next prev parent reply other threads:[~2008-12-27 7:11 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-16 11:37 linux-next: Tree for December 16 Stephen Rothwell
2008-12-16 23:26 ` Andrew Morton
2008-12-17 6:59 ` linux-next: mtd tree build failures (Was: Re: linux-next: Tree for December 16) Stephen Rothwell
2008-12-17 9:32 ` Artem Bityutskiy
2008-12-17 9:57 ` Stephen Rothwell
2008-12-17 7:07 ` linux-next: Tree for December 16 Artem Bityutskiy
2008-12-17 7:08 ` next-20081216 - powerpc link error 'dynreloc miscount' Kamalesh Babulal
2008-12-17 7:08 ` Kamalesh Babulal
2008-12-17 7:28 ` Sam Ravnborg
2008-12-17 7:28 ` Sam Ravnborg
2008-12-17 7:30 ` Stephen Rothwell
2008-12-19 10:54 ` [BUG] next-20081216 - WARNING: at kernel/smp.c:333 smp_call_function_mask Kamalesh Babulal
2008-12-19 11:51 ` Yinghai Lu
2008-12-19 13:46 ` Kamalesh Babulal
2008-12-19 21:02 ` Yinghai Lu
2008-12-23 13:21 ` Kamalesh Babulal
2008-12-23 21:09 ` Yinghai Lu
2008-12-24 16:34 ` Kamalesh Babulal
2008-12-24 20:34 ` Yinghai Lu
2008-12-26 9:12 ` Kamalesh Babulal
2008-12-26 10:05 ` Yinghai Lu
2008-12-26 10:27 ` Sam Ravnborg
2008-12-26 13:33 ` Ingo Molnar
2008-12-26 13:42 ` [PATCH] kbuild, sparseirq: work around GCC bug with __weak aliases Ingo Molnar
2008-12-27 4:09 ` Paul Mackerras
2008-12-27 10:59 ` Ingo Molnar
2008-12-28 23:27 ` Paul Mackerras
2008-12-26 15:28 ` [BUG] next-20081216 - WARNING: at kernel/smp.c:333 smp_call_function_mask Kamalesh Babulal
2008-12-26 15:33 ` Ingo Molnar
2008-12-26 17:04 ` Kamalesh Babulal
2008-12-26 18:17 ` Ingo Molnar
2008-12-27 7:11 ` Kamalesh Babulal [this message]
2008-12-27 7:14 ` Yinghai Lu
2008-12-27 7:39 ` Yinghai Lu
2008-12-27 8:37 ` Ingo Molnar
2008-12-27 8:39 ` Ingo Molnar
2008-12-27 11:21 ` Kamalesh Babulal
2008-12-27 11:24 ` Ingo Molnar
2008-12-27 11:57 ` Kamalesh Babulal
2008-12-27 12:26 ` Ingo Molnar
2008-12-27 15:29 ` Kamalesh Babulal
2008-12-27 21:10 ` Yinghai Lu
2008-12-27 21:10 ` Yinghai Lu
2008-12-28 12:55 ` Ingo Molnar
2008-12-28 16:11 ` Kamalesh Babulal
2008-12-28 23:09 ` Yinghai Lu
2008-12-27 5:05 ` [PATCH] perf_counter: more barrier in blank weak function Yinghai Lu
2008-12-27 5:06 ` [PATCH] kgdb: " Yinghai Lu
2008-12-27 8:17 ` Ingo Molnar
2008-12-27 8:34 ` Andrew Morton
2008-12-27 6:07 ` [PATCH] perf_counter: " KOSAKI Motohiro
2008-12-27 9:46 ` [BUG] next-20081216 - WARNING: at kernel/smp.c:333 smp_call_function_mask David Howells
2008-12-27 9:50 ` 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=20081227071138.GA4530@linux.vnet.ibm.com \
--to=kamalesh@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=mingo@elte.hu \
--cc=sam@ravnborg.org \
--cc=sfr@canb.auug.org.au \
--cc=yinghai@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.