Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86, MM: virtual address debug, v2

I've removed the test from phys_to_nid and made a function from __phys_addr
only when the debugging is enabled (on x86_32).

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: tglx@linutronix.de
Cc: hpa@zytor.com
Cc: Mike Travis <travis@sgi.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: <x86@kernel.org>
Cc: linux-mm@kvack.org
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Jiri Slaby and committed by
Ingo Molnar
a1bf9631 59ea7463

+6 -1
+2
arch/x86/mm/ioremap.c
··· 51 51 return 1; 52 52 } 53 53 54 + #ifdef CONFIG_DEBUG_VIRTUAL 54 55 unsigned long __phys_addr(unsigned long x) 55 56 { 56 57 /* VMALLOC_* aren't constants; not available at the boot time */ ··· 60 59 return x - PAGE_OFFSET; 61 60 } 62 61 EXPORT_SYMBOL(__phys_addr); 62 + #endif 63 63 64 64 #endif 65 65
-1
include/asm-x86/mmzone_64.h
··· 29 29 { 30 30 unsigned nid; 31 31 VIRTUAL_BUG_ON(!memnodemap); 32 - VIRTUAL_BUG_ON((addr >> memnode_shift) >= memnodemapsize); 33 32 nid = memnodemap[addr >> memnode_shift]; 34 33 VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); 35 34 return nid;
+4
include/asm-x86/page_32.h
··· 65 65 66 66 #ifndef __ASSEMBLY__ 67 67 #define __phys_addr_const(x) ((x) - PAGE_OFFSET) 68 + #ifdef CONFIG_DEBUG_VIRTUAL 68 69 extern unsigned long __phys_addr(unsigned long); 70 + #else 71 + #define __phys_addr(x) ((x) - PAGE_OFFSET) 72 + #endif 69 73 #define __phys_reloc_hide(x) RELOC_HIDE((x), 0) 70 74 71 75 #ifdef CONFIG_FLATMEM