[PATCH] x86: fix CONFIG_DEBUG_VIRTUAL=y boot crash on x86-64

From: Jiri Slaby
Date: Mon Oct 13 2008 - 11:11:33 EST


Alan reported a bootup crash in the module loader:

> BUG? vmalloc_to_page (from text_poke+0x30/0x14a): ffffffffa01e40b1

SMP kernel is running on UP, in such a case the module .text
is patched to use UP locks before the module is added to the modules
list and it thinks there are no valid data at that place while
patching.

Also the !is_module_address(addr) test is useless now.

Reported-by: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Tested-by: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
---
include/linux/mm.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index c61ba10..45772fd 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -267,6 +267,10 @@ static inline int is_vmalloc_addr(const void *x)
#ifdef CONFIG_MMU
unsigned long addr = (unsigned long)x;

+#ifdef CONFIG_X86_64
+ if (addr >= MODULES_VADDR && addr < MODULES_END)
+ return 1;
+#endif
return addr >= VMALLOC_START && addr < VMALLOC_END;
#else
return 0;
--
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/