From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH v2] x86: fix section mismatch warning - spp_getpage()
Date: Fri, 15 Aug 2008 18:32:24 +0200 [thread overview]
Message-ID: <20080815163212.GA5408@joi> (raw)
In-Reply-To: <20080815135027.GB14103@elte.hu>
On Fri, Aug 15, 2008 at 03:50:27PM +0200, Ingo Molnar wrote:
>
> * Marcin Slusarz <marcin.slusarz@gmail.com> wrote:
>
> > I looked at both implementations of arch_setup_additional_pages and
> > didn't see any call to native_set_fixmap or function which calls
> > directly native_set_fixmap... Can you tell me what's the callchain?
>
> the callchain would be:
>
> [ 20.116039] PM: Adding info for No Bus:vcsa1
> [ 20.180039] BUG: unable to handle kernel paging request at c0833e44
> [ 20.180039] IP: [<c0833e44>] native_set_fixmap+0x0/0x1d
> [ 20.180039] *pde = 36f2a163 *pte = 00833162
> [ 20.180039] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
> [ 20.180039] Modules linked in:
> [ 20.180039]
> [ 20.180039] Pid: 1, comm: init Not tainted (2.6.27-rc3-00005-g844342a-dirty #24071)
> [ 20.180039] EIP: 0060:[<c0833e44>] EFLAGS: 00010216 CPU: 0
> [ 20.180039] EIP is at native_set_fixmap+0x0/0x1d
> [ 20.180039] EAX: 00000001 EBX: 00000001 ECX: 00000025 EDX: 3782e000
> [ 20.180039] ESI: 00000000 EDI: f671c000 EBP: f7836e68 ESP: f7836e4c
> [ 20.180039] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
> [ 20.180039] Process init (pid: 1, ti=f7836000 task=f7870000 task.ti=f7836000)
> [ 20.180039] Stack: c011d580 f671c034 c018bbea 00000025 00000000 00000988 f6ef2000 f7836f1c
> [ 20.180039] c01b43d6 00000003 00000008 f7836f7c f782fd10 00000003 f78b6100 08048000
> [ 20.180039] 00000000 00000001 f67a2500 08050b99 08050b99 00000000 00000000 00000000
> [ 20.180039] Call Trace:
> [ 20.180039] [<c011d580>] ? arch_setup_additional_pages+0x8c/0x124
> [ 20.180039] [<c018bbea>] ? try_module_get+0x8/0x2f
> [ 20.180039] [<c01b43d6>] ? load_elf_binary+0xae6/0x1108
> [ 20.180039] [<c0144c6d>] ? lock_release_holdtime+0x43/0x48
> [ 20.180039] [<c018c0c0>] ? search_binary_handler+0x92/0x1e5
> [ 20.180039] [<c01b38f0>] ? load_elf_binary+0x0/0x1108
> [ 20.180039] [<c018d2d7>] ? do_execve+0x14c/0x1d8
> [ 20.180039] [<c0101dd8>] ? sys_execve+0x2e/0x56
> [ 20.180039] [<c01030ca>] ? syscall_call+0x7/0xb
> [ 20.180039] [<c01067c8>] ? kernel_execve+0x1c/0x21
> [ 20.180039] [<c0101286>] ? run_init_process+0x1c/0x1e
> [ 20.180039] [<c0101333>] ? init_post+0xab/0xd4
> [ 20.180039] [<c0103d07>] ? kernel_thread_helper+0x7/0x10
> [ 20.180039] =======================
> [ 20.180039] Code: Bad EIP value.
>
> Ingo
Thanks.
arch_setup_additional_pages -> map_compat_vdso -> __set_fixmap -> native_set_fixmap
How about this one?
---
From: Marcin Slusarz <marcin.slusarz@gmail.com>
Subject: [PATCH v2] x86: fix section mismatch warning - spp_getpage()
WARNING: vmlinux.o(.text+0x17a3e): Section mismatch in reference from the function set_pte_vaddr_pud() to the function .init.text:spp_getpage()
The function set_pte_vaddr_pud() references
the function __init spp_getpage().
This is often because set_pte_vaddr_pud lacks a __init
annotation or the annotation of spp_getpage is wrong.
spp_getpage is called from __init (__init_extra_mapping) and
non __init (set_pte_vaddr_pud) functions, so it can't be __init.
Unfortunately it calls alloc_bootmem_pages which is __init,
but does it only when bootmem allocator is available (after_bootmem == 0).
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
---
arch/x86/mm/init_64.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 129618c..f0923ce 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -88,7 +88,11 @@ early_param("gbpages", parse_direct_gbpages_on);
int after_bootmem;
-static __init void *spp_getpage(void)
+/*
+ * NOTE: This function is marked __ref because it calls __init function
+ * (alloc_bootmem_pages). It's safe to do it ONLY when after_bootmem == 0.
+ */
+static __ref void *spp_getpage(void)
{
void *ptr;
--
1.5.4.5
next prev parent reply other threads:[~2008-08-15 16:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-12 21:23 [PATCH] x86: fix 2 section mismatch warnings - find_and_reserve_crashkernel Marcin Slusarz
2008-08-13 11:10 ` Ingo Molnar
2008-08-13 14:05 ` Ingo Molnar
2008-08-15 12:32 ` Marcin Slusarz
2008-08-15 13:50 ` Ingo Molnar
2008-08-15 16:32 ` Marcin Slusarz [this message]
2008-08-15 17:14 ` [PATCH v2] x86: fix section mismatch warning - spp_getpage() 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=20080815163212.GA5408@joi \
--to=marcin.slusarz@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.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
all inboxes | Powered by JetHome®