Linux-parisc archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] parisc: Enable SPARSEMEM_VMEMMAP
@ 2019-05-01 13:14 Helge Deller
  0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2019-05-01 13:14 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, John David Anglin

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>

diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 26c215570adf..49212f31b461 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -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
diff --git a/arch/parisc/include/asm/fixmap.h b/arch/parisc/include/asm/fixmap.h
index 288da73d4cc0..c5ae85fc99ae 100644
--- a/arch/parisc/include/asm/fixmap.h
+++ b/arch/parisc/include/asm/fixmap.h
@@ -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*/
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 78e451ce0f1b..c4c71490ca36 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-01 13:14 [PATCH] parisc: Enable SPARSEMEM_VMEMMAP Helge Deller

Linux-parisc archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-parisc/0 linux-parisc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-parisc linux-parisc/ https://lore.kernel.org/linux-parisc \
		linux-parisc@vger.kernel.org linux-parisc@archiver.kernel.org
	public-inbox-index linux-parisc


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-parisc


AGPL code for this site: git clone https://public-inbox.org/ public-inbox