linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86_64: remove kernel_physical_mapping_init() from init section
@ 2009-01-19 21:46 Gary Hade
  2009-01-19 23:32 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Gary Hade @ 2009-01-19 21:46 UTC (permalink / raw)
  To: linux-mm, linux-kernel, mingo; +Cc: yhlu.kernel, garyhade, lcm, x86


kernel_physical_mapping_init() is called during memory hotplug
so it does not belong in the init section.

If the kernel is built with CONFIG_DEBUG_SECTION_MISMATCH=y on
the make command line, arch/x86/mm/init_64.c is compiled with
the -fno-inline-functions-called-once gcc option defeating
inlining of kernel_physical_mapping_init() within init_memory_mapping().
When kernel_physical_mapping_init() is not inlined it is placed
in the .init.text section according to the __init in it's current
declaration.  A later call to kernel_physical_mapping_init() during
a memory hotplug operation encounters an int3 trap because the
.init.text section memory has been freed.  This patch eliminates
the crash caused by the int3 trap by moving the non-inlined
kernel_physical_mapping_init() from .init.text to .meminit.text.

Signed-off-by: Gary Hade <garyhade@us.ibm.com>

---

--- linux-2.6.29-rc2/arch/x86/mm/init_64.c.orig	2009-01-16 14:38:34.000000000 -0800
+++ linux-2.6.29-rc2/arch/x86/mm/init_64.c	2009-01-16 14:39:21.000000000 -0800
@@ -596,7 +596,7 @@ static void __init init_gbpages(void)
 		direct_gbpages = 0;
 }
 
-static unsigned long __init kernel_physical_mapping_init(unsigned long start,
+static unsigned long __meminit kernel_physical_mapping_init(unsigned long start,
 						unsigned long end,
 						unsigned long page_size_mask)
 {

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-19 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-19 21:46 [PATCH] x86_64: remove kernel_physical_mapping_init() from init section Gary Hade
2009-01-19 23:32 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).