@@ -318,6 +318,7 @@ config ARCH_SELECT_MEMORY_MODEL
config ARCH_SPARSEMEM_ENABLE
def_bool y
depends on 64BIT
+ select SPARSEMEM_VMEMMAP_ENABLE
config ARCH_FLATMEM_ENABLE
def_bool y
@@ -43,6 +43,12 @@ extern void *parisc_vmalloc_start;
void set_fixmap(enum fixed_addresses idx, phys_addr_t phys);
void clear_fixmap(enum fixed_addresses idx);
+#if defined(CONFIG_SPARSEMEM_VMEMMAP)
+#define VMEMMAP_BASE (UL(1) << MAX_PHYSMEM_BITS)
+#define VMEMMAP_SIZE (UL(1) << (MAX_PHYSMEM_BITS - PAGE_SHIFT - 1 + STRUCT_PAGE_MAX_SHIFT))
+#define vmemmap ((struct page *) VMEMMAP_BASE)
+#endif
+
#endif /*__ASSEMBLY__*/
#endif /*_ASM_FIXMAP_H*/
@@ -609,8 +609,11 @@ void __init mem_init(void)
" memory : 0x%px - 0x%px (%4ld MB)\n"
" .init : 0x%px - 0x%px (%4ld kB)\n"
" .data : 0x%px - 0x%px (%4ld kB)\n"
- " .text : 0x%px - 0x%px (%4ld kB)\n",
-
+ " .text : 0x%px - 0x%px (%4ld kB)\n"
+#if defined(CONFIG_SPARSEMEM_VMEMMAP)
+ " vmemmap : 0x%px - 0x%px (%4ld MB)\n"
+#endif
+ ,
(void*)VMALLOC_START, (void*)VMALLOC_END,
(VMALLOC_END - VMALLOC_START) >> 20,
@@ -627,7 +630,15 @@ void __init mem_init(void)
((unsigned long)_edata - (unsigned long)_etext) >> 10,
_text, _etext,
- ((unsigned long)_etext - (unsigned long)_text) >> 10);
+ ((unsigned long)_etext - (unsigned long)_text) >> 10
+
+#if defined(CONFIG_SPARSEMEM_VMEMMAP)
+ ,
+ (void *)VMEMMAP_BASE, (void *)(VMEMMAP_BASE + VMEMMAP_SIZE),
+ (unsigned long)(VMEMMAP_SIZE >> 20)
+#endif
+ );
+
#endif
}
@@ -923,3 +934,11 @@ void free_initrd_mem(unsigned long start, unsigned long end)
free_reserved_area((void *)start, (void *)end, -1, "initrd");
}
#endif
+
+#if defined(CONFIG_SPARSEMEM_VMEMMAP)
+int __meminit vmemmap_populate(unsigned long vstart, unsigned long vend,
+ int node, struct vmem_altmap *altmap)
+{
+ return vmemmap_populate_basepages(vstart, vend, node);
+}
+#endif
Enable the SPARSEMEM VMEMMAP implementation on parisc. The vmemmap is mapped at a virtual address which is higher than the addressable physical address (0x8000000000). This patch could be optimized by rewriting vmemmap_populate() to utilize large pages. Signed-off-by: Helge Deller <deller@gmx.de>