All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Made VMALLOC_END of type unsigned long.
       [not found] <20090810213905.GA4046@n2100.arm.linux.org.uk>
@ 2009-10-01 10:48 ` Andreas Fenkart
  2009-10-01 10:48   ` [PATCH 1/6] Add "virtual kernel memory..." printout Andreas Fenkart
  2009-10-01 13:05   ` [PATCH 1/4] Made VMALLOC_END of type " Russell King - ARM Linux
  2010-01-14 10:36 ` [PATCH 0/5] Adding x86-like memory map printks to ARM Andreas Fenkart
  1 sibling, 2 replies; 20+ messages in thread
From: Andreas Fenkart @ 2009-10-01 10:48 UTC (permalink / raw)
  To: linux-arm-kernel

Here it is, rebased against commit
7fa07729e439a6184bd824746d06a49cca553f15.

I added macros simplifying the printout message, as your suggested.
Patches are now split/merged differently so they describe one logical
step.

Unfortunately the macros you suggested trigger a checkpatch.pl
warning:

ERROR: Macros with complex values should be enclosed in parenthesis
#628: FILE: arm/mm/init.c:628:
+#define MLM(b, t) b, t, ((t) - (b)) >> 20

Resolving these results in a compiler warning:
arch/arm/mm/init.c:649: warning: left-hand operand of comma expression
has no effect

I resolved the compiler warning, since it likes an error too.

king regards

Andreas

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

* [PATCH 1/6] Add "virtual kernel memory..." printout.
  2009-10-01 10:48 ` [PATCH 1/4] Made VMALLOC_END of type unsigned long Andreas Fenkart
@ 2009-10-01 10:48   ` Andreas Fenkart
  2009-10-01 10:48     ` [PATCH 2/6] Make delimiters of DMA area globally visibly Andreas Fenkart
  2009-10-01 13:05   ` [PATCH 1/4] Made VMALLOC_END of type " Russell King - ARM Linux
  1 sibling, 1 reply; 20+ messages in thread
From: Andreas Fenkart @ 2009-10-01 10:48 UTC (permalink / raw)
  To: linux-arm-kernel

Code based on parisc and x86_32.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 arch/arm/mm/init.c |   78 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index f982606..a49f97c 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -23,6 +23,7 @@
 #include <asm/setup.h>
 #include <asm/sizes.h>
 #include <asm/tlb.h>
+#include <asm/fixmap.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -542,7 +543,7 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
  */
 void __init mem_init(void)
 {
-	unsigned int codesize, datasize, initsize;
+	unsigned long reserved_pages, free_pages;
 	int i, node;
 
 #ifndef CONFIG_DISCONTIGMEM
@@ -578,6 +579,33 @@ void __init mem_init(void)
 	totalram_pages += totalhigh_pages;
 #endif
 
+	reserved_pages = free_pages = 0;
+
+	for_each_online_node(node) {
+		pg_data_t *n = NODE_DATA(node);
+		struct page *map = pgdat_page_nr(n, 0) - n->node_start_pfn;
+
+		for_each_nodebank(i, &meminfo, node) {
+			struct membank *bank = &meminfo.bank[i];
+			unsigned int pfn1, pfn2;
+			struct page *page, *end;
+
+			pfn1 = bank_pfn_start(bank);
+			pfn2 = bank_pfn_end(bank);
+
+			page = map + pfn1;
+			end  = map + pfn2;
+
+			do {
+				if (PageReserved(page))
+					reserved_pages++;
+				else if (!page_count(page))
+					free_pages++;
+				page++;
+			} while (page < end);
+		}
+	}
+
 	/*
 	 * Since our memory may not be contiguous, calculate the
 	 * real number of pages we have in this system
@@ -590,16 +618,48 @@ void __init mem_init(void)
 	}
 	printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT));
 
-	codesize = _etext - _text;
-	datasize = _end - _data;
-	initsize = __init_end - __init_begin;
-
-	printk(KERN_NOTICE "Memory: %luKB available (%dK code, "
-		"%dK data, %dK init, %luK highmem)\n",
-		nr_free_pages() << (PAGE_SHIFT-10), codesize >> 10,
-		datasize >> 10, initsize >> 10,
+	printk(KERN_NOTICE "Memory: %luk/%luk available, %luk reserved, %luK highmem\n",
+		nr_free_pages() << (PAGE_SHIFT-10),
+		free_pages << (PAGE_SHIFT-10),
+		reserved_pages << (PAGE_SHIFT-10),
 		(unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
 
+#define MLK(b, t) b, t, ((t) - (b)) >> 10
+#define MLM(b, t) b, t, ((t) - (b)) >> 20
+#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K)
+
+	printk(KERN_NOTICE "virtual kernel memory layout:\n"
+			"    vector  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
+			"    fixmap  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
+			"    vmalloc : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+			"    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+#ifdef CONFIG_HIGHMEM
+			"    pkmap   : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+#endif
+			"    modules : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+			"      .init : 0x%p" " - 0x%p" "   (%4d kB)\n"
+			"      .text : 0x%p" " - 0x%p" "   (%4d kB)\n"
+			"      .data : 0x%p" " - 0x%p" "   (%4d kB)\n",
+
+			MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
+				(PAGE_SIZE)),
+			MLK(FIXADDR_START, FIXADDR_TOP),
+			MLM(VMALLOC_START, (unsigned long)VMALLOC_END),
+			MLM(PAGE_SIZE, (unsigned long)high_memory),
+#ifdef CONFIG_HIGHMEM
+			MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) *
+				(PAGE_SIZE)),
+#endif
+			MLM(MODULES_VADDR, MODULES_END),
+
+			MLK_ROUNDUP(__init_begin, __init_end),
+			MLK_ROUNDUP(_text, _etext),
+			MLK_ROUNDUP(_data, _edata));
+
+#undef MLK
+#undef MLM
+#undef MLK_ROUNDUP
+
 	if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
 		extern int sysctl_overcommit_memory;
 		/*
-- 
1.6.4.3

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

* [PATCH 2/6] Make delimiters of DMA area globally visibly.
  2009-10-01 10:48   ` [PATCH 1/6] Add "virtual kernel memory..." printout Andreas Fenkart
@ 2009-10-01 10:48     ` Andreas Fenkart
  2009-10-01 10:48       ` [PATCH 3/6] Change type of VMALLOC_END to unsigned long Andreas Fenkart
  0 siblings, 1 reply; 20+ messages in thread
From: Andreas Fenkart @ 2009-10-01 10:48 UTC (permalink / raw)
  To: linux-arm-kernel

Adds DMA area to 'virtual memory map' startup message

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 arch/arm/include/asm/memory.h |   19 +++++++++++--------
 arch/arm/mm/dma-mapping.c     |    3 ---
 arch/arm/mm/init.c            |    6 ++++++
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index cefedf0..38b6a78 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -76,6 +76,17 @@
  */
 #define IOREMAP_MAX_ORDER	24
 
+/*
+ * Size of DMA-consistent memory region.  Must be multiple of 2M,
+ * between 2MB and 14MB inclusive.
+ */
+#ifndef CONSISTENT_DMA_SIZE
+#define CONSISTENT_DMA_SIZE 	SZ_2M
+#endif
+
+#define CONSISTENT_END		(0xffe00000UL)
+#define CONSISTENT_BASE		(CONSISTENT_END - CONSISTENT_DMA_SIZE)
+
 #else /* CONFIG_MMU */
 
 /*
@@ -113,14 +124,6 @@
 #endif /* !CONFIG_MMU */
 
 /*
- * Size of DMA-consistent memory region.  Must be multiple of 2M,
- * between 2MB and 14MB inclusive.
- */
-#ifndef CONSISTENT_DMA_SIZE
-#define CONSISTENT_DMA_SIZE SZ_2M
-#endif
-
-/*
  * Physical vs virtual RAM address space conversion.  These are
  * private definitions which should NOT be used outside memory.h
  * files.  Use virt_to_phys/phys_to_virt/__pa/__va instead.
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index b30925f..010ce4a 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -29,9 +29,6 @@
 #error "CONSISTENT_DMA_SIZE must be multiple of 2MiB"
 #endif
 
-#define CONSISTENT_END	(0xffe00000)
-#define CONSISTENT_BASE	(CONSISTENT_END - CONSISTENT_DMA_SIZE)
-
 #define CONSISTENT_OFFSET(x)	(((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
 #define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT)
 #define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT)
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index a49f97c..22735f6 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -631,6 +631,9 @@ void __init mem_init(void)
 	printk(KERN_NOTICE "virtual kernel memory layout:\n"
 			"    vector  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
 			"    fixmap  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
+#ifdef CONFIG_MMU
+			"    DMA     : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+#endif
 			"    vmalloc : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 			"    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 #ifdef CONFIG_HIGHMEM
@@ -644,6 +647,9 @@ void __init mem_init(void)
 			MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
 				(PAGE_SIZE)),
 			MLK(FIXADDR_START, FIXADDR_TOP),
+#ifdef CONFIG_MMU
+			MLM(CONSISTENT_BASE, CONSISTENT_END),
+#endif
 			MLM(VMALLOC_START, (unsigned long)VMALLOC_END),
 			MLM(PAGE_SIZE, (unsigned long)high_memory),
 #ifdef CONFIG_HIGHMEM
-- 
1.6.4.3

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

* [PATCH 3/6] Change type of VMALLOC_END to unsigned long.
  2009-10-01 10:48     ` [PATCH 2/6] Make delimiters of DMA area globally visibly Andreas Fenkart
@ 2009-10-01 10:48       ` Andreas Fenkart
  2009-10-01 10:48         ` [PATCH 4/6] Made totalhigh_pages " Andreas Fenkart
  2009-10-04 12:21         ` [PATCH 3/6] Change type of VMALLOC_END to " Russell King - ARM Linux
  0 siblings, 2 replies; 20+ messages in thread
From: Andreas Fenkart @ 2009-10-01 10:48 UTC (permalink / raw)
  To: linux-arm-kernel

Makes it consistent with VMALLOC_START

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 arch/arm/include/asm/memory.h                 |    4 ++--
 arch/arm/include/asm/pgtable-nommu.h          |    4 ++--
 arch/arm/mach-davinci/include/mach/hardware.h |    2 +-
 arch/arm/mach-ep93xx/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-gemini/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-iop32x/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-iop33x/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-ixp2000/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-ixp23xx/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-ixp4xx/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-kirkwood/include/mach/vmalloc.h |    2 +-
 arch/arm/mach-lh7a40x/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-loki/include/mach/vmalloc.h     |    2 +-
 arch/arm/mach-mmp/include/mach/vmalloc.h      |    2 +-
 arch/arm/mach-mv78xx0/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-nomadik/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-ns9xxx/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-orion5x/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-pxa/include/mach/vmalloc.h      |    2 +-
 arch/arm/mach-realview/include/mach/vmalloc.h |    2 +-
 arch/arm/mach-s3c24a0/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-sa1100/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-w90x900/include/mach/vmalloc.h  |    2 +-
 arch/arm/mm/init.c                            |    2 +-
 arch/arm/plat-mxc/include/mach/vmalloc.h      |    2 +-
 arch/arm/plat-s3c/include/mach/vmalloc.h      |    2 +-
 arch/arm/plat-stmp3xxx/include/mach/vmalloc.h |    2 +-
 27 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 38b6a78..0cc3c4b 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -104,11 +104,11 @@
 #endif
 
 #ifndef PHYS_OFFSET
-#define PHYS_OFFSET 		(CONFIG_DRAM_BASE)
+#define PHYS_OFFSET 		UL(CONFIG_DRAM_BASE)
 #endif
 
 #ifndef END_MEM
-#define END_MEM     		(CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)
+#define END_MEM     		UL(CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)
 #endif
 
 #ifndef PAGE_OFFSET
diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h
index b011f2e..013cfcd 100644
--- a/arch/arm/include/asm/pgtable-nommu.h
+++ b/arch/arm/include/asm/pgtable-nommu.h
@@ -86,8 +86,8 @@ extern unsigned int kobjsize(const void *objp);
  * All 32bit addresses are effectively valid for vmalloc...
  * Sort of meaningless for non-VM targets.
  */
-#define	VMALLOC_START	0
-#define	VMALLOC_END	0xffffffff
+#define	VMALLOC_START	0UL
+#define	VMALLOC_END	0xffffffffUL
 
 #define FIRST_USER_ADDRESS      (0)
 
diff --git a/arch/arm/mach-davinci/include/mach/hardware.h b/arch/arm/mach-davinci/include/mach/hardware.h
index 41c8938..5fd3784 100644
--- a/arch/arm/mach-davinci/include/mach/hardware.h
+++ b/arch/arm/mach-davinci/include/mach/hardware.h
@@ -30,7 +30,7 @@
 #define IO_PHYS				0x01c00000
 #define IO_OFFSET			0xfd000000 /* Virtual IO = 0xfec00000 */
 #define IO_SIZE				0x00400000
-#define IO_VIRT				(IO_PHYS + IO_OFFSET)
+#define IO_VIRT				UL(IO_PHYS + IO_OFFSET)
 #define io_v2p(va)			((va) - IO_OFFSET)
 #define __IO_ADDRESS(x)			((x) + IO_OFFSET)
 #define IO_ADDRESS(pa)			IOMEM(__IO_ADDRESS(pa))
diff --git a/arch/arm/mach-ep93xx/include/mach/vmalloc.h b/arch/arm/mach-ep93xx/include/mach/vmalloc.h
index aed21cd..1b3f25d 100644
--- a/arch/arm/mach-ep93xx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ep93xx/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-ep93xx/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe800000
+#define VMALLOC_END	0xfe800000UL
diff --git a/arch/arm/mach-gemini/include/mach/vmalloc.h b/arch/arm/mach-gemini/include/mach/vmalloc.h
index 83e536d..45371eb 100644
--- a/arch/arm/mach-gemini/include/mach/vmalloc.h
+++ b/arch/arm/mach-gemini/include/mach/vmalloc.h
@@ -7,4 +7,4 @@
  * (at your option) any later version.
  */
 
-#define VMALLOC_END	0xF0000000
+#define VMALLOC_END	0xf0000000UL
diff --git a/arch/arm/mach-iop32x/include/mach/vmalloc.h b/arch/arm/mach-iop32x/include/mach/vmalloc.h
index 85ceb09..c4862d4 100644
--- a/arch/arm/mach-iop32x/include/mach/vmalloc.h
+++ b/arch/arm/mach-iop32x/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-iop32x/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe000000
+#define VMALLOC_END	0xfe000000UL
diff --git a/arch/arm/mach-iop33x/include/mach/vmalloc.h b/arch/arm/mach-iop33x/include/mach/vmalloc.h
index f9f99de..48331dc 100644
--- a/arch/arm/mach-iop33x/include/mach/vmalloc.h
+++ b/arch/arm/mach-iop33x/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-iop33x/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe000000
+#define VMALLOC_END	0xfe000000UL
diff --git a/arch/arm/mach-ixp2000/include/mach/vmalloc.h b/arch/arm/mach-ixp2000/include/mach/vmalloc.h
index d195e35..61c8dae 100644
--- a/arch/arm/mach-ixp2000/include/mach/vmalloc.h
+++ b/arch/arm/mach-ixp2000/include/mach/vmalloc.h
@@ -17,4 +17,4 @@
  * The vmalloc() routines leaves a hole of 4kB between each vmalloced
  * area for the same reason. ;)
  */
-#define VMALLOC_END	    0xfb000000
+#define VMALLOC_END	    0xfb000000UL
diff --git a/arch/arm/mach-ixp23xx/include/mach/vmalloc.h b/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
index dd519f6..896c56a 100644
--- a/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
@@ -7,4 +7,4 @@
  * specific static I/O.
  */
 
-#define VMALLOC_END	(0xec000000)
+#define VMALLOC_END	(0xec000000UL)
diff --git a/arch/arm/mach-ixp4xx/include/mach/vmalloc.h b/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
index 7b3580b..9bcd64d 100644
--- a/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
@@ -1,5 +1,5 @@
 /*
  * arch/arm/mach-ixp4xx/include/mach/vmalloc.h
  */
-#define VMALLOC_END       (0xFF000000)
+#define VMALLOC_END       (0xff000000UL)
 
diff --git a/arch/arm/mach-kirkwood/include/mach/vmalloc.h b/arch/arm/mach-kirkwood/include/mach/vmalloc.h
index 8f48260..bf162ca 100644
--- a/arch/arm/mach-kirkwood/include/mach/vmalloc.h
+++ b/arch/arm/mach-kirkwood/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-kirkwood/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe800000
+#define VMALLOC_END	0xfe800000UL
diff --git a/arch/arm/mach-lh7a40x/include/mach/vmalloc.h b/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
index 3fbd494..d62da73 100644
--- a/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
+++ b/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
@@ -7,4 +7,4 @@
  *  version 2 as published by the Free Software Foundation.
  *
  */
-#define VMALLOC_END       (0xe8000000)
+#define VMALLOC_END       (0xe8000000UL)
diff --git a/arch/arm/mach-loki/include/mach/vmalloc.h b/arch/arm/mach-loki/include/mach/vmalloc.h
index 8dc3bfc..5dcbd86 100644
--- a/arch/arm/mach-loki/include/mach/vmalloc.h
+++ b/arch/arm/mach-loki/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-loki/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe800000
+#define VMALLOC_END	0xfe800000UL
diff --git a/arch/arm/mach-mmp/include/mach/vmalloc.h b/arch/arm/mach-mmp/include/mach/vmalloc.h
index b60ccaf..1d0bac0 100644
--- a/arch/arm/mach-mmp/include/mach/vmalloc.h
+++ b/arch/arm/mach-mmp/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * linux/arch/arm/mach-mmp/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe000000
+#define VMALLOC_END	0xfe000000UL
diff --git a/arch/arm/mach-mv78xx0/include/mach/vmalloc.h b/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
index 1c49543..ba26fe9 100644
--- a/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
+++ b/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-mv78xx0/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe000000
+#define VMALLOC_END	0xfe000000UL
diff --git a/arch/arm/mach-nomadik/include/mach/vmalloc.h b/arch/arm/mach-nomadik/include/mach/vmalloc.h
index be12e31..f83d574 100644
--- a/arch/arm/mach-nomadik/include/mach/vmalloc.h
+++ b/arch/arm/mach-nomadik/include/mach/vmalloc.h
@@ -1,2 +1,2 @@
 
-#define VMALLOC_END       0xe8000000
+#define VMALLOC_END       0xe8000000UL
diff --git a/arch/arm/mach-ns9xxx/include/mach/vmalloc.h b/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
index fe964d3..c865197 100644
--- a/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
@@ -11,6 +11,6 @@
 #ifndef __ASM_ARCH_VMALLOC_H
 #define __ASM_ARCH_VMALLOC_H
 
-#define VMALLOC_END     (0xf0000000)
+#define VMALLOC_END     (0xf0000000UL)
 
 #endif /* ifndef __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-orion5x/include/mach/vmalloc.h b/arch/arm/mach-orion5x/include/mach/vmalloc.h
index 7147a29..06b50ae 100644
--- a/arch/arm/mach-orion5x/include/mach/vmalloc.h
+++ b/arch/arm/mach-orion5x/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-orion5x/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END       0xfd800000
+#define VMALLOC_END       0xfd800000UL
diff --git a/arch/arm/mach-pxa/include/mach/vmalloc.h b/arch/arm/mach-pxa/include/mach/vmalloc.h
index e90c5ee..bfecfbf 100644
--- a/arch/arm/mach-pxa/include/mach/vmalloc.h
+++ b/arch/arm/mach-pxa/include/mach/vmalloc.h
@@ -8,4 +8,4 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#define VMALLOC_END       (0xe8000000)
+#define VMALLOC_END       (0xe8000000UL)
diff --git a/arch/arm/mach-realview/include/mach/vmalloc.h b/arch/arm/mach-realview/include/mach/vmalloc.h
index fe0de1b..a2a4c68 100644
--- a/arch/arm/mach-realview/include/mach/vmalloc.h
+++ b/arch/arm/mach-realview/include/mach/vmalloc.h
@@ -18,4 +18,4 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define VMALLOC_END		0xf8000000
+#define VMALLOC_END		0xf8000000UL
diff --git a/arch/arm/mach-s3c24a0/include/mach/vmalloc.h b/arch/arm/mach-s3c24a0/include/mach/vmalloc.h
index 4d4fe48..9146568 100644
--- a/arch/arm/mach-s3c24a0/include/mach/vmalloc.h
+++ b/arch/arm/mach-s3c24a0/include/mach/vmalloc.h
@@ -12,6 +12,6 @@
 #ifndef __ASM_ARCH_VMALLOC_H
 #define __ASM_ARCH_VMALLOC_H
 
-#define VMALLOC_END	  (0xE0000000)
+#define VMALLOC_END	  (0xe0000000UL)
 
 #endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-sa1100/include/mach/vmalloc.h b/arch/arm/mach-sa1100/include/mach/vmalloc.h
index ec8fdc5..b3d0023 100644
--- a/arch/arm/mach-sa1100/include/mach/vmalloc.h
+++ b/arch/arm/mach-sa1100/include/mach/vmalloc.h
@@ -1,4 +1,4 @@
 /*
  * arch/arm/mach-sa1100/include/mach/vmalloc.h
  */
-#define VMALLOC_END       (0xe8000000)
+#define VMALLOC_END       (0xe8000000UL)
diff --git a/arch/arm/mach-w90x900/include/mach/vmalloc.h b/arch/arm/mach-w90x900/include/mach/vmalloc.h
index 2f9dfb9..b067e44 100644
--- a/arch/arm/mach-w90x900/include/mach/vmalloc.h
+++ b/arch/arm/mach-w90x900/include/mach/vmalloc.h
@@ -18,6 +18,6 @@
 #ifndef __ASM_ARCH_VMALLOC_H
 #define __ASM_ARCH_VMALLOC_H
 
-#define VMALLOC_END	  (0xE0000000)
+#define VMALLOC_END	  (0xe0000000UL)
 
 #endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 22735f6..2217041 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -650,7 +650,7 @@ void __init mem_init(void)
 #ifdef CONFIG_MMU
 			MLM(CONSISTENT_BASE, CONSISTENT_END),
 #endif
-			MLM(VMALLOC_START, (unsigned long)VMALLOC_END),
+			MLM(VMALLOC_START, VMALLOC_END),
 			MLM(PAGE_SIZE, (unsigned long)high_memory),
 #ifdef CONFIG_HIGHMEM
 			MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) *
diff --git a/arch/arm/plat-mxc/include/mach/vmalloc.h b/arch/arm/plat-mxc/include/mach/vmalloc.h
index 62d9762..44243a2 100644
--- a/arch/arm/plat-mxc/include/mach/vmalloc.h
+++ b/arch/arm/plat-mxc/include/mach/vmalloc.h
@@ -21,6 +21,6 @@
 #define __ASM_ARCH_MXC_VMALLOC_H__
 
 /* vmalloc ending address */
-#define VMALLOC_END       0xF4000000
+#define VMALLOC_END       0xf4000000UL
 
 #endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
diff --git a/arch/arm/plat-s3c/include/mach/vmalloc.h b/arch/arm/plat-s3c/include/mach/vmalloc.h
index bfd2ca6..299d95f 100644
--- a/arch/arm/plat-s3c/include/mach/vmalloc.h
+++ b/arch/arm/plat-s3c/include/mach/vmalloc.h
@@ -15,6 +15,6 @@
 #ifndef __ASM_ARCH_VMALLOC_H
 #define __ASM_ARCH_VMALLOC_H
 
-#define VMALLOC_END	  (0xE0000000)
+#define VMALLOC_END	  (0xe0000000UL)
 
 #endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h b/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
index 541b880..943c1a2 100644
--- a/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
+++ b/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
@@ -9,4 +9,4 @@
  * http://www.opensource.org/licenses/gpl-license.html
  * http://www.gnu.org/copyleft/gpl.html
  */
-#define VMALLOC_END       (0xF0000000)
+#define VMALLOC_END       0xf0000000UL
-- 
1.6.4.3

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

* [PATCH 4/6] Made totalhigh_pages unsigned long.
  2009-10-01 10:48       ` [PATCH 3/6] Change type of VMALLOC_END to unsigned long Andreas Fenkart
@ 2009-10-01 10:48         ` Andreas Fenkart
  2009-10-01 10:49           ` [PATCH 5/6] Add checks to detect overlap of memory regions Andreas Fenkart
  2009-10-04 12:22           ` [PATCH 4/6] Made totalhigh_pages unsigned long Russell King - ARM Linux
  2009-10-04 12:21         ` [PATCH 3/6] Change type of VMALLOC_END to " Russell King - ARM Linux
  1 sibling, 2 replies; 20+ messages in thread
From: Andreas Fenkart @ 2009-10-01 10:48 UTC (permalink / raw)
  To: linux-arm-kernel

Makes it consistent with the extern declaration, used when
CONFIG_HIGHMEM is set

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 arch/arm/mm/init.c      |    2 +-
 include/linux/highmem.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 2217041..4685611 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -622,7 +622,7 @@ void __init mem_init(void)
 		nr_free_pages() << (PAGE_SHIFT-10),
 		free_pages << (PAGE_SHIFT-10),
 		reserved_pages << (PAGE_SHIFT-10),
-		(unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
+		totalhigh_pages << (PAGE_SHIFT-10));
 
 #define MLK(b, t) b, t, ((t) - (b)) >> 10
 #define MLM(b, t) b, t, ((t) - (b)) >> 20
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 211ff44..ab2cc20 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -46,7 +46,7 @@ void kmap_flush_unused(void);
 
 static inline unsigned int nr_free_highpages(void) { return 0; }
 
-#define totalhigh_pages 0
+#define totalhigh_pages 0UL
 
 #ifndef ARCH_HAS_KMAP
 static inline void *kmap(struct page *page)
-- 
1.6.4.3

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

* [PATCH 5/6] Add checks to detect overlap of memory regions.
  2009-10-01 10:48         ` [PATCH 4/6] Made totalhigh_pages " Andreas Fenkart
@ 2009-10-01 10:49           ` Andreas Fenkart
  2009-10-01 10:49             ` [PATCH 6/6] Add PKMAP area description to memory.txt Andreas Fenkart
  2009-10-04 12:24             ` [PATCH 5/6] Add checks to detect overlap of memory regions Russell King - ARM Linux
  2009-10-04 12:22           ` [PATCH 4/6] Made totalhigh_pages unsigned long Russell King - ARM Linux
  1 sibling, 2 replies; 20+ messages in thread
From: Andreas Fenkart @ 2009-10-01 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 arch/arm/mm/init.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 4685611..5c1a69c 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -666,6 +666,26 @@ void __init mem_init(void)
 #undef MLM
 #undef MLK_ROUNDUP
 
+	/*
+	 * Check boundaries twice: Some fundamental inconsistencies can
+	 * be detected at build time already.
+	 */
+	BUILD_BUG_ON(VMALLOC_START			>= VMALLOC_END);
+	BUG_ON(VMALLOC_START				>= VMALLOC_END);
+
+#ifdef CONFIG_MMU
+	BUILD_BUG_ON(VMALLOC_END			> CONSISTENT_BASE);
+	BUG_ON(VMALLOC_END				> CONSISTENT_BASE);
+
+	BUILD_BUG_ON(TASK_SIZE 			> MODULES_VADDR);
+	BUG_ON(TASK_SIZE 				> MODULES_VADDR);
+#endif
+
+#ifdef CONFIG_HIGHMEM
+	BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
+	BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE	> PAGE_OFFSET);
+#endif
+
 	if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
 		extern int sysctl_overcommit_memory;
 		/*
-- 
1.6.4.3

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

* [PATCH 6/6] Add PKMAP area description to memory.txt.
  2009-10-01 10:49           ` [PATCH 5/6] Add checks to detect overlap of memory regions Andreas Fenkart
@ 2009-10-01 10:49             ` Andreas Fenkart
  2009-10-04 12:24             ` [PATCH 5/6] Add checks to detect overlap of memory regions Russell King - ARM Linux
  1 sibling, 0 replies; 20+ messages in thread
From: Andreas Fenkart @ 2009-10-01 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

Also adapts delimiters of neighbouring modules area.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 Documentation/arm/memory.txt |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt
index 9d58c7c..eb0fae1 100644
--- a/Documentation/arm/memory.txt
+++ b/Documentation/arm/memory.txt
@@ -59,7 +59,11 @@ PAGE_OFFSET	high_memory-1	Kernel direct-mapped RAM region.
 				This maps the platforms RAM, and typically
 				maps all platform RAM in a 1:1 relationship.
 
-TASK_SIZE	PAGE_OFFSET-1	Kernel module space
+PKMAP_BASE	PAGE_OFFSET-1	Permanent kernel mappings
+				One way of mapping HIGHMEM pages into kernel
+				space.
+
+MODULES_VADDR	MODULES_END-1	Kernel module space
 				Kernel modules inserted via insmod are
 				placed here using dynamic mappings.
 
-- 
1.6.4.3

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

* [PATCH 1/4] Made VMALLOC_END of type unsigned long.
  2009-10-01 10:48 ` [PATCH 1/4] Made VMALLOC_END of type unsigned long Andreas Fenkart
  2009-10-01 10:48   ` [PATCH 1/6] Add "virtual kernel memory..." printout Andreas Fenkart
@ 2009-10-01 13:05   ` Russell King - ARM Linux
  1 sibling, 0 replies; 20+ messages in thread
From: Russell King - ARM Linux @ 2009-10-01 13:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 01, 2009 at 12:48:55PM +0200, Andreas Fenkart wrote:
> Here it is, rebased against commit
> 7fa07729e439a6184bd824746d06a49cca553f15.
> 
> I added macros simplifying the printout message, as your suggested.
> Patches are now split/merged differently so they describe one logical
> step.
> 
> Unfortunately the macros you suggested trigger a checkpatch.pl
> warning:
> 
> ERROR: Macros with complex values should be enclosed in parenthesis
> #628: FILE: arm/mm/init.c:628:
> +#define MLM(b, t) b, t, ((t) - (b)) >> 20

This is a case where ignoring checkpatch.pl is the right thing to do.
It doesn't know what is trying to be achieved, and is trying to apply
an inappropriate rule.

I'd ignore this warning.

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

* [PATCH 3/6] Change type of VMALLOC_END to unsigned long.
  2009-10-01 10:48       ` [PATCH 3/6] Change type of VMALLOC_END to unsigned long Andreas Fenkart
  2009-10-01 10:48         ` [PATCH 4/6] Made totalhigh_pages " Andreas Fenkart
@ 2009-10-04 12:21         ` Russell King - ARM Linux
  1 sibling, 0 replies; 20+ messages in thread
From: Russell King - ARM Linux @ 2009-10-04 12:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 01, 2009 at 12:48:58PM +0200, Andreas Fenkart wrote:
> diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
> index 38b6a78..0cc3c4b 100644
> --- a/arch/arm/include/asm/memory.h
> +++ b/arch/arm/include/asm/memory.h
> @@ -104,11 +104,11 @@
>  #endif
>  
>  #ifndef PHYS_OFFSET
> -#define PHYS_OFFSET 		(CONFIG_DRAM_BASE)
> +#define PHYS_OFFSET 		UL(CONFIG_DRAM_BASE)
>  #endif
>  
>  #ifndef END_MEM
> -#define END_MEM     		(CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)
> +#define END_MEM     		UL(CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)

This is still not correct usage of UL().  This becomes:

	CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE##UL

or, in the case of these being defined as zero:

	0 + 0UL

That might end up ultimately being an unsigned long expression, but it
would be far better to explicitly cast the right thing - the base.

Basically, UL() should not be used with an expression argument.  UL()'s
purpose is to allow the numerical value enclosed to be used in both C
as an unsigned long constant, and also in assembly without the UL suffix
(which would cause the assembler to error out.)  It's not there as a
generic "cast to unsigned long" operator.

> diff --git a/arch/arm/mach-davinci/include/mach/hardware.h b/arch/arm/mach-davinci/include/mach/hardware.h
> index 41c8938..5fd3784 100644
> --- a/arch/arm/mach-davinci/include/mach/hardware.h
> +++ b/arch/arm/mach-davinci/include/mach/hardware.h
> @@ -30,7 +30,7 @@
>  #define IO_PHYS				0x01c00000
>  #define IO_OFFSET			0xfd000000 /* Virtual IO = 0xfec00000 */
>  #define IO_SIZE				0x00400000
> -#define IO_VIRT				(IO_PHYS + IO_OFFSET)
> +#define IO_VIRT				UL(IO_PHYS + IO_OFFSET)

Same thing.

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

* [PATCH 4/6] Made totalhigh_pages unsigned long.
  2009-10-01 10:48         ` [PATCH 4/6] Made totalhigh_pages " Andreas Fenkart
  2009-10-01 10:49           ` [PATCH 5/6] Add checks to detect overlap of memory regions Andreas Fenkart
@ 2009-10-04 12:22           ` Russell King - ARM Linux
  1 sibling, 0 replies; 20+ messages in thread
From: Russell King - ARM Linux @ 2009-10-04 12:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 01, 2009 at 12:48:59PM +0200, Andreas Fenkart wrote:
> Makes it consistent with the extern declaration, used when
> CONFIG_HIGHMEM is set

The linux/highmem.h part needs to go to someone like Andrew Morton,
cc'd LKML.

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

* [PATCH 5/6] Add checks to detect overlap of memory regions.
  2009-10-01 10:49           ` [PATCH 5/6] Add checks to detect overlap of memory regions Andreas Fenkart
  2009-10-01 10:49             ` [PATCH 6/6] Add PKMAP area description to memory.txt Andreas Fenkart
@ 2009-10-04 12:24             ` Russell King - ARM Linux
  1 sibling, 0 replies; 20+ messages in thread
From: Russell King - ARM Linux @ 2009-10-04 12:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 01, 2009 at 12:49:00PM +0200, Andreas Fenkart wrote:
> +	/*
> +	 * Check boundaries twice: Some fundamental inconsistencies can
> +	 * be detected at build time already.
> +	 */
> +	BUILD_BUG_ON(VMALLOC_START			>= VMALLOC_END);
> +	BUG_ON(VMALLOC_START				>= VMALLOC_END);

This one is now guaranteed by other parts of the code, and doesn't
need to be checked anymore - we enforce a minimum size of 32M for
the vmalloc region now.

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

* [PATCH 0/5] Adding x86-like memory map printks to ARM.
       [not found] <20090810213905.GA4046@n2100.arm.linux.org.uk>
  2009-10-01 10:48 ` [PATCH 1/4] Made VMALLOC_END of type unsigned long Andreas Fenkart
@ 2010-01-14 10:36 ` Andreas Fenkart
  2010-01-14 10:36   ` [PATCH 1/5] Add "virtual kernel memory..." printout Andreas Fenkart
  2010-01-15 22:53   ` [PATCH 0/5] Adding x86-like memory map printks to ARM Russell King - ARM Linux
  1 sibling, 2 replies; 20+ messages in thread
From: Andreas Fenkart @ 2010-01-14 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

This version has the following changes:

* Reworked UL() macro usage, as suggested

* Appended 'UL' to VMALLOC_END define of new machines:
mach-dove
mach-u300
mach-ux500

* Patch 'Make totalhigh_pages unsigned long' has been submitted separately

* Removed superfluous (VMALLOC_START < VMALLOC_END) boundary check

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

* [PATCH 1/5] Add "virtual kernel memory..." printout.
  2010-01-14 10:36 ` [PATCH 0/5] Adding x86-like memory map printks to ARM Andreas Fenkart
@ 2010-01-14 10:36   ` Andreas Fenkart
  2010-01-14 10:36     ` [PATCH 2/5] Make delimiters of DMA area globally visibly Andreas Fenkart
  2010-01-15 23:14     ` [PATCH 1/5] Add "virtual kernel memory..." printout Russell King - ARM Linux
  2010-01-15 22:53   ` [PATCH 0/5] Adding x86-like memory map printks to ARM Russell King - ARM Linux
  1 sibling, 2 replies; 20+ messages in thread
From: Andreas Fenkart @ 2010-01-14 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

Code based on parisc and x86_32.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 arch/arm/mm/init.c |   78 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index a04ffbb..29d5866 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -23,6 +23,7 @@
 #include <asm/setup.h>
 #include <asm/sizes.h>
 #include <asm/tlb.h>
+#include <asm/fixmap.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -560,7 +561,7 @@ static void __init free_unused_memmap_node(int node, struct meminfo *mi)
  */
 void __init mem_init(void)
 {
-	unsigned int codesize, datasize, initsize;
+	unsigned long reserved_pages, free_pages;
 	int i, node;
 
 #ifndef CONFIG_DISCONTIGMEM
@@ -596,6 +597,33 @@ void __init mem_init(void)
 	totalram_pages += totalhigh_pages;
 #endif
 
+	reserved_pages = free_pages = 0;
+
+	for_each_online_node(node) {
+		pg_data_t *n = NODE_DATA(node);
+		struct page *map = pgdat_page_nr(n, 0) - n->node_start_pfn;
+
+		for_each_nodebank(i, &meminfo, node) {
+			struct membank *bank = &meminfo.bank[i];
+			unsigned int pfn1, pfn2;
+			struct page *page, *end;
+
+			pfn1 = bank_pfn_start(bank);
+			pfn2 = bank_pfn_end(bank);
+
+			page = map + pfn1;
+			end  = map + pfn2;
+
+			do {
+				if (PageReserved(page))
+					reserved_pages++;
+				else if (!page_count(page))
+					free_pages++;
+				page++;
+			} while (page < end);
+		}
+	}
+
 	/*
 	 * Since our memory may not be contiguous, calculate the
 	 * real number of pages we have in this system
@@ -608,16 +636,48 @@ void __init mem_init(void)
 	}
 	printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT));
 
-	codesize = _etext - _text;
-	datasize = _end - _data;
-	initsize = __init_end - __init_begin;
-
-	printk(KERN_NOTICE "Memory: %luKB available (%dK code, "
-		"%dK data, %dK init, %luK highmem)\n",
-		nr_free_pages() << (PAGE_SHIFT-10), codesize >> 10,
-		datasize >> 10, initsize >> 10,
+	printk(KERN_NOTICE "Memory: %luk/%luk available, %luk reserved, %luK highmem\n",
+		nr_free_pages() << (PAGE_SHIFT-10),
+		free_pages << (PAGE_SHIFT-10),
+		reserved_pages << (PAGE_SHIFT-10),
 		totalhigh_pages << (PAGE_SHIFT-10));
 
+#define MLK(b, t) b, t, ((t) - (b)) >> 10
+#define MLM(b, t) b, t, ((t) - (b)) >> 20
+#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), SZ_1K)
+
+	printk(KERN_NOTICE "virtual kernel memory layout:\n"
+			"    vector  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
+			"    fixmap  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
+			"    vmalloc : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+			"    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+#ifdef CONFIG_HIGHMEM
+			"    pkmap   : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+#endif
+			"    modules : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+			"      .init : 0x%p" " - 0x%p" "   (%4d kB)\n"
+			"      .text : 0x%p" " - 0x%p" "   (%4d kB)\n"
+			"      .data : 0x%p" " - 0x%p" "   (%4d kB)\n",
+
+			MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
+				(PAGE_SIZE)),
+			MLK(FIXADDR_START, FIXADDR_TOP),
+			MLM(VMALLOC_START, (unsigned long)VMALLOC_END),
+			MLM(PAGE_SIZE, (unsigned long)high_memory),
+#ifdef CONFIG_HIGHMEM
+			MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) *
+				(PAGE_SIZE)),
+#endif
+			MLM(MODULES_VADDR, MODULES_END),
+
+			MLK_ROUNDUP(__init_begin, __init_end),
+			MLK_ROUNDUP(_text, _etext),
+			MLK_ROUNDUP(_data, _edata));
+
+#undef MLK
+#undef MLM
+#undef MLK_ROUNDUP
+
 	if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
 		extern int sysctl_overcommit_memory;
 		/*
-- 
1.6.6

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

* [PATCH 2/5] Make delimiters of DMA area globally visibly.
  2010-01-14 10:36   ` [PATCH 1/5] Add "virtual kernel memory..." printout Andreas Fenkart
@ 2010-01-14 10:36     ` Andreas Fenkart
  2010-01-14 10:36       ` [PATCH 3/5] Change type of VMALLOC_END to unsigned long Andreas Fenkart
  2010-01-15 23:14     ` [PATCH 1/5] Add "virtual kernel memory..." printout Russell King - ARM Linux
  1 sibling, 1 reply; 20+ messages in thread
From: Andreas Fenkart @ 2010-01-14 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

Adds DMA area to 'virtual memory map' startup message

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 arch/arm/include/asm/memory.h |   19 +++++++++++--------
 arch/arm/mm/dma-mapping.c     |    3 ---
 arch/arm/mm/init.c            |    6 ++++++
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 5421d82..f5e693b 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -76,6 +76,17 @@
  */
 #define IOREMAP_MAX_ORDER	24
 
+/*
+ * Size of DMA-consistent memory region.  Must be multiple of 2M,
+ * between 2MB and 14MB inclusive.
+ */
+#ifndef CONSISTENT_DMA_SIZE
+#define CONSISTENT_DMA_SIZE 	SZ_2M
+#endif
+
+#define CONSISTENT_END		(0xffe00000UL)
+#define CONSISTENT_BASE		(CONSISTENT_END - CONSISTENT_DMA_SIZE)
+
 #else /* CONFIG_MMU */
 
 /*
@@ -113,14 +124,6 @@
 #endif /* !CONFIG_MMU */
 
 /*
- * Size of DMA-consistent memory region.  Must be multiple of 2M,
- * between 2MB and 14MB inclusive.
- */
-#ifndef CONSISTENT_DMA_SIZE
-#define CONSISTENT_DMA_SIZE SZ_2M
-#endif
-
-/*
  * Physical vs virtual RAM address space conversion.  These are
  * private definitions which should NOT be used outside memory.h
  * files.  Use virt_to_phys/phys_to_virt/__pa/__va instead.
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 26325cb..48eedab 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -29,9 +29,6 @@
 #error "CONSISTENT_DMA_SIZE must be multiple of 2MiB"
 #endif
 
-#define CONSISTENT_END	(0xffe00000)
-#define CONSISTENT_BASE	(CONSISTENT_END - CONSISTENT_DMA_SIZE)
-
 #define CONSISTENT_OFFSET(x)	(((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
 #define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT)
 #define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT)
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 29d5866..c06edd3 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -649,6 +649,9 @@ void __init mem_init(void)
 	printk(KERN_NOTICE "virtual kernel memory layout:\n"
 			"    vector  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
 			"    fixmap  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
+#ifdef CONFIG_MMU
+			"    DMA     : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+#endif
 			"    vmalloc : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 			"    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 #ifdef CONFIG_HIGHMEM
@@ -662,6 +665,9 @@ void __init mem_init(void)
 			MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
 				(PAGE_SIZE)),
 			MLK(FIXADDR_START, FIXADDR_TOP),
+#ifdef CONFIG_MMU
+			MLM(CONSISTENT_BASE, CONSISTENT_END),
+#endif
 			MLM(VMALLOC_START, (unsigned long)VMALLOC_END),
 			MLM(PAGE_SIZE, (unsigned long)high_memory),
 #ifdef CONFIG_HIGHMEM
-- 
1.6.6

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

* [PATCH 3/5] Change type of VMALLOC_END to unsigned long.
  2010-01-14 10:36     ` [PATCH 2/5] Make delimiters of DMA area globally visibly Andreas Fenkart
@ 2010-01-14 10:36       ` Andreas Fenkart
  2010-01-14 10:36         ` [PATCH 4/5] Add checks to detect overlap of memory regions Andreas Fenkart
  0 siblings, 1 reply; 20+ messages in thread
From: Andreas Fenkart @ 2010-01-14 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

Makes it consistent with VMALLOC_START

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 arch/arm/include/asm/memory.h                 |    4 ++--
 arch/arm/include/asm/pgtable-nommu.h          |    4 ++--
 arch/arm/mach-davinci/include/mach/hardware.h |    2 +-
 arch/arm/mach-dove/include/mach/vmalloc.h     |    2 +-
 arch/arm/mach-ep93xx/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-gemini/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-iop32x/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-iop33x/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-ixp2000/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-ixp23xx/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-ixp4xx/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-kirkwood/include/mach/vmalloc.h |    2 +-
 arch/arm/mach-lh7a40x/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-loki/include/mach/vmalloc.h     |    2 +-
 arch/arm/mach-mmp/include/mach/vmalloc.h      |    2 +-
 arch/arm/mach-mv78xx0/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-nomadik/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-ns9xxx/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-orion5x/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-pxa/include/mach/vmalloc.h      |    2 +-
 arch/arm/mach-realview/include/mach/vmalloc.h |    2 +-
 arch/arm/mach-s3c24a0/include/mach/vmalloc.h  |    2 +-
 arch/arm/mach-sa1100/include/mach/vmalloc.h   |    2 +-
 arch/arm/mach-u300/include/mach/vmalloc.h     |    2 +-
 arch/arm/mach-ux500/include/mach/vmalloc.h    |    2 +-
 arch/arm/mach-w90x900/include/mach/vmalloc.h  |    2 +-
 arch/arm/mm/init.c                            |    2 +-
 arch/arm/plat-mxc/include/mach/vmalloc.h      |    2 +-
 arch/arm/plat-s3c/include/mach/vmalloc.h      |    2 +-
 arch/arm/plat-stmp3xxx/include/mach/vmalloc.h |    2 +-
 30 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index f5e693b..4312ee5 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -104,11 +104,11 @@
 #endif
 
 #ifndef PHYS_OFFSET
-#define PHYS_OFFSET 		(CONFIG_DRAM_BASE)
+#define PHYS_OFFSET 		UL(CONFIG_DRAM_BASE)
 #endif
 
 #ifndef END_MEM
-#define END_MEM     		(CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)
+#define END_MEM     		(UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE)
 #endif
 
 #ifndef PAGE_OFFSET
diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h
index b011f2e..013cfcd 100644
--- a/arch/arm/include/asm/pgtable-nommu.h
+++ b/arch/arm/include/asm/pgtable-nommu.h
@@ -86,8 +86,8 @@ extern unsigned int kobjsize(const void *objp);
  * All 32bit addresses are effectively valid for vmalloc...
  * Sort of meaningless for non-VM targets.
  */
-#define	VMALLOC_START	0
-#define	VMALLOC_END	0xffffffff
+#define	VMALLOC_START	0UL
+#define	VMALLOC_END	0xffffffffUL
 
 #define FIRST_USER_ADDRESS      (0)
 
diff --git a/arch/arm/mach-davinci/include/mach/hardware.h b/arch/arm/mach-davinci/include/mach/hardware.h
index 41c8938..c45ba1f 100644
--- a/arch/arm/mach-davinci/include/mach/hardware.h
+++ b/arch/arm/mach-davinci/include/mach/hardware.h
@@ -27,7 +27,7 @@
 /*
  * I/O mapping
  */
-#define IO_PHYS				0x01c00000
+#define IO_PHYS				0x01c00000UL
 #define IO_OFFSET			0xfd000000 /* Virtual IO = 0xfec00000 */
 #define IO_SIZE				0x00400000
 #define IO_VIRT				(IO_PHYS + IO_OFFSET)
diff --git a/arch/arm/mach-dove/include/mach/vmalloc.h b/arch/arm/mach-dove/include/mach/vmalloc.h
index 8b2c974..a28792c 100644
--- a/arch/arm/mach-dove/include/mach/vmalloc.h
+++ b/arch/arm/mach-dove/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-dove/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfd800000
+#define VMALLOC_END	0xfd800000UL
diff --git a/arch/arm/mach-ep93xx/include/mach/vmalloc.h b/arch/arm/mach-ep93xx/include/mach/vmalloc.h
index aed21cd..1b3f25d 100644
--- a/arch/arm/mach-ep93xx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ep93xx/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-ep93xx/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe800000
+#define VMALLOC_END	0xfe800000UL
diff --git a/arch/arm/mach-gemini/include/mach/vmalloc.h b/arch/arm/mach-gemini/include/mach/vmalloc.h
index 83e536d..45371eb 100644
--- a/arch/arm/mach-gemini/include/mach/vmalloc.h
+++ b/arch/arm/mach-gemini/include/mach/vmalloc.h
@@ -7,4 +7,4 @@
  * (at your option) any later version.
  */
 
-#define VMALLOC_END	0xF0000000
+#define VMALLOC_END	0xf0000000UL
diff --git a/arch/arm/mach-iop32x/include/mach/vmalloc.h b/arch/arm/mach-iop32x/include/mach/vmalloc.h
index 85ceb09..c4862d4 100644
--- a/arch/arm/mach-iop32x/include/mach/vmalloc.h
+++ b/arch/arm/mach-iop32x/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-iop32x/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe000000
+#define VMALLOC_END	0xfe000000UL
diff --git a/arch/arm/mach-iop33x/include/mach/vmalloc.h b/arch/arm/mach-iop33x/include/mach/vmalloc.h
index f9f99de..48331dc 100644
--- a/arch/arm/mach-iop33x/include/mach/vmalloc.h
+++ b/arch/arm/mach-iop33x/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-iop33x/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe000000
+#define VMALLOC_END	0xfe000000UL
diff --git a/arch/arm/mach-ixp2000/include/mach/vmalloc.h b/arch/arm/mach-ixp2000/include/mach/vmalloc.h
index d195e35..61c8dae 100644
--- a/arch/arm/mach-ixp2000/include/mach/vmalloc.h
+++ b/arch/arm/mach-ixp2000/include/mach/vmalloc.h
@@ -17,4 +17,4 @@
  * The vmalloc() routines leaves a hole of 4kB between each vmalloced
  * area for the same reason. ;)
  */
-#define VMALLOC_END	    0xfb000000
+#define VMALLOC_END	    0xfb000000UL
diff --git a/arch/arm/mach-ixp23xx/include/mach/vmalloc.h b/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
index dd519f6..896c56a 100644
--- a/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ixp23xx/include/mach/vmalloc.h
@@ -7,4 +7,4 @@
  * specific static I/O.
  */
 
-#define VMALLOC_END	(0xec000000)
+#define VMALLOC_END	(0xec000000UL)
diff --git a/arch/arm/mach-ixp4xx/include/mach/vmalloc.h b/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
index 7b3580b..9bcd64d 100644
--- a/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ixp4xx/include/mach/vmalloc.h
@@ -1,5 +1,5 @@
 /*
  * arch/arm/mach-ixp4xx/include/mach/vmalloc.h
  */
-#define VMALLOC_END       (0xFF000000)
+#define VMALLOC_END       (0xff000000UL)
 
diff --git a/arch/arm/mach-kirkwood/include/mach/vmalloc.h b/arch/arm/mach-kirkwood/include/mach/vmalloc.h
index 8f48260..bf162ca 100644
--- a/arch/arm/mach-kirkwood/include/mach/vmalloc.h
+++ b/arch/arm/mach-kirkwood/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-kirkwood/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe800000
+#define VMALLOC_END	0xfe800000UL
diff --git a/arch/arm/mach-lh7a40x/include/mach/vmalloc.h b/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
index 3fbd494..d62da73 100644
--- a/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
+++ b/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
@@ -7,4 +7,4 @@
  *  version 2 as published by the Free Software Foundation.
  *
  */
-#define VMALLOC_END       (0xe8000000)
+#define VMALLOC_END       (0xe8000000UL)
diff --git a/arch/arm/mach-loki/include/mach/vmalloc.h b/arch/arm/mach-loki/include/mach/vmalloc.h
index 8dc3bfc..5dcbd86 100644
--- a/arch/arm/mach-loki/include/mach/vmalloc.h
+++ b/arch/arm/mach-loki/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-loki/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe800000
+#define VMALLOC_END	0xfe800000UL
diff --git a/arch/arm/mach-mmp/include/mach/vmalloc.h b/arch/arm/mach-mmp/include/mach/vmalloc.h
index b60ccaf..1d0bac0 100644
--- a/arch/arm/mach-mmp/include/mach/vmalloc.h
+++ b/arch/arm/mach-mmp/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * linux/arch/arm/mach-mmp/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe000000
+#define VMALLOC_END	0xfe000000UL
diff --git a/arch/arm/mach-mv78xx0/include/mach/vmalloc.h b/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
index 1c49543..ba26fe9 100644
--- a/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
+++ b/arch/arm/mach-mv78xx0/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-mv78xx0/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END	0xfe000000
+#define VMALLOC_END	0xfe000000UL
diff --git a/arch/arm/mach-nomadik/include/mach/vmalloc.h b/arch/arm/mach-nomadik/include/mach/vmalloc.h
index be12e31..f83d574 100644
--- a/arch/arm/mach-nomadik/include/mach/vmalloc.h
+++ b/arch/arm/mach-nomadik/include/mach/vmalloc.h
@@ -1,2 +1,2 @@
 
-#define VMALLOC_END       0xe8000000
+#define VMALLOC_END       0xe8000000UL
diff --git a/arch/arm/mach-ns9xxx/include/mach/vmalloc.h b/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
index fe964d3..c865197 100644
--- a/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
+++ b/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
@@ -11,6 +11,6 @@
 #ifndef __ASM_ARCH_VMALLOC_H
 #define __ASM_ARCH_VMALLOC_H
 
-#define VMALLOC_END     (0xf0000000)
+#define VMALLOC_END     (0xf0000000UL)
 
 #endif /* ifndef __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-orion5x/include/mach/vmalloc.h b/arch/arm/mach-orion5x/include/mach/vmalloc.h
index 7147a29..06b50ae 100644
--- a/arch/arm/mach-orion5x/include/mach/vmalloc.h
+++ b/arch/arm/mach-orion5x/include/mach/vmalloc.h
@@ -2,4 +2,4 @@
  * arch/arm/mach-orion5x/include/mach/vmalloc.h
  */
 
-#define VMALLOC_END       0xfd800000
+#define VMALLOC_END       0xfd800000UL
diff --git a/arch/arm/mach-pxa/include/mach/vmalloc.h b/arch/arm/mach-pxa/include/mach/vmalloc.h
index e90c5ee..bfecfbf 100644
--- a/arch/arm/mach-pxa/include/mach/vmalloc.h
+++ b/arch/arm/mach-pxa/include/mach/vmalloc.h
@@ -8,4 +8,4 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#define VMALLOC_END       (0xe8000000)
+#define VMALLOC_END       (0xe8000000UL)
diff --git a/arch/arm/mach-realview/include/mach/vmalloc.h b/arch/arm/mach-realview/include/mach/vmalloc.h
index fe0de1b..a2a4c68 100644
--- a/arch/arm/mach-realview/include/mach/vmalloc.h
+++ b/arch/arm/mach-realview/include/mach/vmalloc.h
@@ -18,4 +18,4 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define VMALLOC_END		0xf8000000
+#define VMALLOC_END		0xf8000000UL
diff --git a/arch/arm/mach-s3c24a0/include/mach/vmalloc.h b/arch/arm/mach-s3c24a0/include/mach/vmalloc.h
index 4d4fe48..9146568 100644
--- a/arch/arm/mach-s3c24a0/include/mach/vmalloc.h
+++ b/arch/arm/mach-s3c24a0/include/mach/vmalloc.h
@@ -12,6 +12,6 @@
 #ifndef __ASM_ARCH_VMALLOC_H
 #define __ASM_ARCH_VMALLOC_H
 
-#define VMALLOC_END	  (0xE0000000)
+#define VMALLOC_END	  (0xe0000000UL)
 
 #endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-sa1100/include/mach/vmalloc.h b/arch/arm/mach-sa1100/include/mach/vmalloc.h
index ec8fdc5..b3d0023 100644
--- a/arch/arm/mach-sa1100/include/mach/vmalloc.h
+++ b/arch/arm/mach-sa1100/include/mach/vmalloc.h
@@ -1,4 +1,4 @@
 /*
  * arch/arm/mach-sa1100/include/mach/vmalloc.h
  */
-#define VMALLOC_END       (0xe8000000)
+#define VMALLOC_END       (0xe8000000UL)
diff --git a/arch/arm/mach-u300/include/mach/vmalloc.h b/arch/arm/mach-u300/include/mach/vmalloc.h
index b00c51a..ec423b9 100644
--- a/arch/arm/mach-u300/include/mach/vmalloc.h
+++ b/arch/arm/mach-u300/include/mach/vmalloc.h
@@ -9,4 +9,4 @@
  * End must be above the I/O registers and on an even 2MiB boundary.
  * Author: Linus Walleij <linus.walleij@stericsson.com>
  */
-#define VMALLOC_END	0xfe800000
+#define VMALLOC_END	0xfe800000UL
diff --git a/arch/arm/mach-ux500/include/mach/vmalloc.h b/arch/arm/mach-ux500/include/mach/vmalloc.h
index 86cdbbc..a4945cb 100644
--- a/arch/arm/mach-ux500/include/mach/vmalloc.h
+++ b/arch/arm/mach-ux500/include/mach/vmalloc.h
@@ -15,4 +15,4 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define VMALLOC_END	0xf0000000
+#define VMALLOC_END	0xf0000000UL
diff --git a/arch/arm/mach-w90x900/include/mach/vmalloc.h b/arch/arm/mach-w90x900/include/mach/vmalloc.h
index 2f9dfb9..b067e44 100644
--- a/arch/arm/mach-w90x900/include/mach/vmalloc.h
+++ b/arch/arm/mach-w90x900/include/mach/vmalloc.h
@@ -18,6 +18,6 @@
 #ifndef __ASM_ARCH_VMALLOC_H
 #define __ASM_ARCH_VMALLOC_H
 
-#define VMALLOC_END	  (0xE0000000)
+#define VMALLOC_END	  (0xe0000000UL)
 
 #endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index c06edd3..f4d67bf 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -668,7 +668,7 @@ void __init mem_init(void)
 #ifdef CONFIG_MMU
 			MLM(CONSISTENT_BASE, CONSISTENT_END),
 #endif
-			MLM(VMALLOC_START, (unsigned long)VMALLOC_END),
+			MLM(VMALLOC_START, VMALLOC_END),
 			MLM(PAGE_SIZE, (unsigned long)high_memory),
 #ifdef CONFIG_HIGHMEM
 			MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) *
diff --git a/arch/arm/plat-mxc/include/mach/vmalloc.h b/arch/arm/plat-mxc/include/mach/vmalloc.h
index 62d9762..44243a2 100644
--- a/arch/arm/plat-mxc/include/mach/vmalloc.h
+++ b/arch/arm/plat-mxc/include/mach/vmalloc.h
@@ -21,6 +21,6 @@
 #define __ASM_ARCH_MXC_VMALLOC_H__
 
 /* vmalloc ending address */
-#define VMALLOC_END       0xF4000000
+#define VMALLOC_END       0xf4000000UL
 
 #endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
diff --git a/arch/arm/plat-s3c/include/mach/vmalloc.h b/arch/arm/plat-s3c/include/mach/vmalloc.h
index bfd2ca6..299d95f 100644
--- a/arch/arm/plat-s3c/include/mach/vmalloc.h
+++ b/arch/arm/plat-s3c/include/mach/vmalloc.h
@@ -15,6 +15,6 @@
 #ifndef __ASM_ARCH_VMALLOC_H
 #define __ASM_ARCH_VMALLOC_H
 
-#define VMALLOC_END	  (0xE0000000)
+#define VMALLOC_END	  (0xe0000000UL)
 
 #endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h b/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
index 541b880..943c1a2 100644
--- a/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
+++ b/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
@@ -9,4 +9,4 @@
  * http://www.opensource.org/licenses/gpl-license.html
  * http://www.gnu.org/copyleft/gpl.html
  */
-#define VMALLOC_END       (0xF0000000)
+#define VMALLOC_END       0xf0000000UL
-- 
1.6.6

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

* [PATCH 4/5] Add checks to detect overlap of memory regions.
  2010-01-14 10:36       ` [PATCH 3/5] Change type of VMALLOC_END to unsigned long Andreas Fenkart
@ 2010-01-14 10:36         ` Andreas Fenkart
  2010-01-14 10:36           ` [PATCH 5/5] Add PKMAP area description to memory.txt Andreas Fenkart
  0 siblings, 1 reply; 20+ messages in thread
From: Andreas Fenkart @ 2010-01-14 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 arch/arm/mm/init.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index f4d67bf..3e73724 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -684,6 +684,23 @@ void __init mem_init(void)
 #undef MLM
 #undef MLK_ROUNDUP
 
+	/*
+	 * Check boundaries twice: Some fundamental inconsistencies can
+	 * be detected at build time already.
+	 */
+#ifdef CONFIG_MMU
+	BUILD_BUG_ON(VMALLOC_END			> CONSISTENT_BASE);
+	BUG_ON(VMALLOC_END				> CONSISTENT_BASE);
+
+	BUILD_BUG_ON(TASK_SIZE				> MODULES_VADDR);
+	BUG_ON(TASK_SIZE 				> MODULES_VADDR);
+#endif
+
+#ifdef CONFIG_HIGHMEM
+	BUILD_BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE > PAGE_OFFSET);
+	BUG_ON(PKMAP_BASE + LAST_PKMAP * PAGE_SIZE	> PAGE_OFFSET);
+#endif
+
 	if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
 		extern int sysctl_overcommit_memory;
 		/*
-- 
1.6.6

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

* [PATCH 5/5] Add PKMAP area description to memory.txt.
  2010-01-14 10:36         ` [PATCH 4/5] Add checks to detect overlap of memory regions Andreas Fenkart
@ 2010-01-14 10:36           ` Andreas Fenkart
  0 siblings, 0 replies; 20+ messages in thread
From: Andreas Fenkart @ 2010-01-14 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

Also adapts delimiters of neighbouring modules area.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
 Documentation/arm/memory.txt |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt
index 9d58c7c..eb0fae1 100644
--- a/Documentation/arm/memory.txt
+++ b/Documentation/arm/memory.txt
@@ -59,7 +59,11 @@ PAGE_OFFSET	high_memory-1	Kernel direct-mapped RAM region.
 				This maps the platforms RAM, and typically
 				maps all platform RAM in a 1:1 relationship.
 
-TASK_SIZE	PAGE_OFFSET-1	Kernel module space
+PKMAP_BASE	PAGE_OFFSET-1	Permanent kernel mappings
+				One way of mapping HIGHMEM pages into kernel
+				space.
+
+MODULES_VADDR	MODULES_END-1	Kernel module space
 				Kernel modules inserted via insmod are
 				placed here using dynamic mappings.
 
-- 
1.6.6

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

* [PATCH 0/5] Adding x86-like memory map printks to ARM.
  2010-01-14 10:36 ` [PATCH 0/5] Adding x86-like memory map printks to ARM Andreas Fenkart
  2010-01-14 10:36   ` [PATCH 1/5] Add "virtual kernel memory..." printout Andreas Fenkart
@ 2010-01-15 22:53   ` Russell King - ARM Linux
  2010-01-15 23:54     ` H Hartley Sweeten
  1 sibling, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2010-01-15 22:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 14, 2010 at 11:36:05AM +0100, Andreas Fenkart wrote:
> This version has the following changes:
> 
> * Reworked UL() macro usage, as suggested
> 
> * Appended 'UL' to VMALLOC_END define of new machines:
> mach-dove
> mach-u300
> mach-ux500
> 
> * Patch 'Make totalhigh_pages unsigned long' has been submitted separately
> 
> * Removed superfluous (VMALLOC_START < VMALLOC_END) boundary check
> 

What I get from the Integrator/CP platform is this:

virtual kernel memory layout:                                                   
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)                               
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)                               
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)                               
    vmalloc : 0xc8800000 - 0xd0000000   ( 120 MB)                               
    lowmem  : 0x00001000 - 0xc8000000   (3199 MB)                               
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)                               
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)                               
      .init : 0xc0008000 - 0xc0024000   ( 112 kB)                               
      .text : 0xc0024000 - 0xc0325000   (3076 kB)                               
      .data : 0xc0326000 - 0xc033f360   ( 101 kB)                               

which looks fine, except for the 'lowmem' entry - the start of it should
be PAGE_OFFSET, not PAGE_SIZE.  Apart from that, seems fine.

If you can correct that bug, and no one else has any objections, it can
go into the patch system.  Thanks.

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

* [PATCH 1/5] Add "virtual kernel memory..." printout.
  2010-01-14 10:36   ` [PATCH 1/5] Add "virtual kernel memory..." printout Andreas Fenkart
  2010-01-14 10:36     ` [PATCH 2/5] Make delimiters of DMA area globally visibly Andreas Fenkart
@ 2010-01-15 23:14     ` Russell King - ARM Linux
  1 sibling, 0 replies; 20+ messages in thread
From: Russell King - ARM Linux @ 2010-01-15 23:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 14, 2010 at 11:36:06AM +0100, Andreas Fenkart wrote:
> Code based on parisc and x86_32.

Oh, the only other thing to request is:

> +	printk(KERN_NOTICE "virtual kernel memory layout:\n"

Can the first letter of the message be capitalised please?

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

* [PATCH 0/5] Adding x86-like memory map printks to ARM.
  2010-01-15 22:53   ` [PATCH 0/5] Adding x86-like memory map printks to ARM Russell King - ARM Linux
@ 2010-01-15 23:54     ` H Hartley Sweeten
  0 siblings, 0 replies; 20+ messages in thread
From: H Hartley Sweeten @ 2010-01-15 23:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday, January 15, 2010 3:54 PM, Russell King wrote:
> On Thu, Jan 14, 2010 at 11:36:05AM +0100, Andreas Fenkart wrote:
>> This version has the following changes:
>> 
>> * Reworked UL() macro usage, as suggested
>> 
>> * Appended 'UL' to VMALLOC_END define of new machines:
>> mach-dove
>> mach-u300
>> mach-ux500
>> 
>> * Patch 'Make totalhigh_pages unsigned long' has been submitted separately
>> 
>> * Removed superfluous (VMALLOC_START < VMALLOC_END) boundary check
>> 
>
> What I get from the Integrator/CP platform is this:
>
> virtual kernel memory layout:                                                   
>     vector  : 0xffff0000 - 0xffff1000   (   4 kB)                               
>     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)                               
>     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)                               
>     vmalloc : 0xc8800000 - 0xd0000000   ( 120 MB)                               
>     lowmem  : 0x00001000 - 0xc8000000   (3199 MB)                               
>     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)                               
>     modules : 0xbf000000 - 0xbfe00000   (  14 MB)                               
>       .init : 0xc0008000 - 0xc0024000   ( 112 kB)                               
>       .text : 0xc0024000 - 0xc0325000   (3076 kB)                               
>       .data : 0xc0326000 - 0xc033f360   ( 101 kB)                               
>
> which looks fine, except for the 'lowmem' entry - the start of it should
> be PAGE_OFFSET, not PAGE_SIZE.  Apart from that, seems fine.
>
> If you can correct that bug, and no one else has any objections, it can
> go into the patch system.  Thanks.

Almost forgot about this....

With Russell's corrected bug and his request to capitalize the first letter
I get the following on the ep93xx platform:

Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc6800000 - 0xfe800000   ( 896 MB)
    lowmem  : 0xc0000000 - 0xc6000000   (  96 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0028000   ( 128 kB)
      .text : 0xc0028000 - 0xc03a0000   (3552 kB)
      .data : 0xc03ba000 - 0xc03e2aa0   ( 163 kB)

which looks fine.  My only issue is, shouldn't the 'end' values all be -1.

Other than that you can add for ep93xx:

Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Regards,
Hartley

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

end of thread, other threads:[~2010-01-15 23:54 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20090810213905.GA4046@n2100.arm.linux.org.uk>
2009-10-01 10:48 ` [PATCH 1/4] Made VMALLOC_END of type unsigned long Andreas Fenkart
2009-10-01 10:48   ` [PATCH 1/6] Add "virtual kernel memory..." printout Andreas Fenkart
2009-10-01 10:48     ` [PATCH 2/6] Make delimiters of DMA area globally visibly Andreas Fenkart
2009-10-01 10:48       ` [PATCH 3/6] Change type of VMALLOC_END to unsigned long Andreas Fenkart
2009-10-01 10:48         ` [PATCH 4/6] Made totalhigh_pages " Andreas Fenkart
2009-10-01 10:49           ` [PATCH 5/6] Add checks to detect overlap of memory regions Andreas Fenkart
2009-10-01 10:49             ` [PATCH 6/6] Add PKMAP area description to memory.txt Andreas Fenkart
2009-10-04 12:24             ` [PATCH 5/6] Add checks to detect overlap of memory regions Russell King - ARM Linux
2009-10-04 12:22           ` [PATCH 4/6] Made totalhigh_pages unsigned long Russell King - ARM Linux
2009-10-04 12:21         ` [PATCH 3/6] Change type of VMALLOC_END to " Russell King - ARM Linux
2009-10-01 13:05   ` [PATCH 1/4] Made VMALLOC_END of type " Russell King - ARM Linux
2010-01-14 10:36 ` [PATCH 0/5] Adding x86-like memory map printks to ARM Andreas Fenkart
2010-01-14 10:36   ` [PATCH 1/5] Add "virtual kernel memory..." printout Andreas Fenkart
2010-01-14 10:36     ` [PATCH 2/5] Make delimiters of DMA area globally visibly Andreas Fenkart
2010-01-14 10:36       ` [PATCH 3/5] Change type of VMALLOC_END to unsigned long Andreas Fenkart
2010-01-14 10:36         ` [PATCH 4/5] Add checks to detect overlap of memory regions Andreas Fenkart
2010-01-14 10:36           ` [PATCH 5/5] Add PKMAP area description to memory.txt Andreas Fenkart
2010-01-15 23:14     ` [PATCH 1/5] Add "virtual kernel memory..." printout Russell King - ARM Linux
2010-01-15 22:53   ` [PATCH 0/5] Adding x86-like memory map printks to ARM Russell King - ARM Linux
2010-01-15 23:54     ` H Hartley Sweeten

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.