SUPERH platform development
 help / color / mirror / Atom feed
* [PATCH 00/16] Generic infrastructure for unloading initramfs
@ 2018-03-24 17:44 Shea Levy
  2018-03-24 17:44 ` [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
                   ` (16 more replies)
  0 siblings, 17 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel

This patch series extracts out code for unloading the initramfs that
was identical across 14 architectures, and moves those architectures
to the common code path. Additionally, RISC-V is newly moved to the
common code path.

In addition to reducing duplication, this allows us to bring future
improvements (such as generalizing existing "keep initrd" command line
options) to multiple architectures at once.


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

* [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic.
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-25 17:17   ` LEROY Christophe
  2018-03-28 12:04   ` Christoph Hellwig
  2018-03-24 17:44 ` [PATCH 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD Shea Levy
                   ` (15 subsequent siblings)
  16 siblings, 2 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 init/initramfs.c | 7 +++++++
 usr/Kconfig      | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..de5ce873eb5a 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,13 @@ extern unsigned long __initramfs_size;
 #include <linux/initrd.h>
 #include <linux/kexec.h>
 
+#ifdef CONFIG_INITRAMFS_GENERIC_UNLOAD
+void free_initrd_mem(unsigned long start, unsigned long end)
+{
+       free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+#endif
+
 static void __init free_initrd(void)
 {
 #ifdef CONFIG_KEXEC_CORE
diff --git a/usr/Kconfig b/usr/Kconfig
index 43658b8a975e..fd79d4d6fa26 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -233,3 +233,7 @@ config INITRAMFS_COMPRESSION
 	default ".lzma" if RD_LZMA
 	default ".bz2"  if RD_BZIP2
 	default ""
+
+# Arches can select this for a generic initrd unloading codepath
+config INITRAMFS_GENERIC_UNLOAD
+	bool
-- 
2.16.2


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

* [PATCH 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD.
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
  2018-03-24 17:44 ` [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 03/16] alpha: " Shea Levy
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/riscv/Kconfig   | 1 +
 arch/riscv/mm/init.c | 6 ------
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c22ebe08e902..ab1b4cee84fc 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -37,6 +37,7 @@ config RISCV
 	select THREAD_INFO_IN_TASK
 	select RISCV_TIMER
 	select GENERIC_IRQ_MULTI_HANDLER
+	select INITRAMFS_GENERIC_UNLOAD
 
 config MMU
 	def_bool y
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index c77df8142be2..36f83fe8a726 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -62,9 +62,3 @@ void free_initmem(void)
 {
 	free_initmem_default(0);
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-}
-#endif /* CONFIG_BLK_DEV_INITRD */
-- 
2.16.2


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

* [PATCH 03/16] alpha: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
  2018-03-24 17:44 ` [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
  2018-03-24 17:44 ` [PATCH 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 04/16] arc: " Shea Levy
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/alpha/Kconfig   | 1 +
 arch/alpha/mm/init.c | 8 --------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index e96adcbcab41..238d743ae8f2 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -27,6 +27,7 @@ config ALPHA
 	select ODD_RT_SIGACTION
 	select OLD_SIGSUSPEND
 	select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67
+	select INITRAMFS_GENERIC_UNLOAD
 	help
 	  The Alpha is a 64-bit general-purpose processor designed and
 	  marketed by the Digital Equipment Corporation of blessed memory,
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 9d74520298ab..55f7c8efa962 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -291,11 +291,3 @@ free_initmem(void)
 {
 	free_initmem_default(-1);
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void
-free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH 04/16] arc: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (2 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 03/16] alpha: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 05/16] c6x: " Shea Levy
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/arc/Kconfig   | 1 +
 arch/arc/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index d76bf4a83740..2844ce5b910c 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -44,6 +44,7 @@ config ARC
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_LZMA
+	select INITRAMFS_GENERIC_UNLOAD
 
 config MIGHT_HAVE_PCI
 	bool
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index ba145065c579..7bcf23ab1756 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -229,10 +229,3 @@ void __ref free_initmem(void)
 {
 	free_initmem_default(-1);
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH 05/16] c6x: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (3 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 04/16] arc: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 06/16] frv: " Shea Levy
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/c6x/Kconfig   | 1 +
 arch/c6x/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig
index c6b4dd1418b4..857f95f9a6a4 100644
--- a/arch/c6x/Kconfig
+++ b/arch/c6x/Kconfig
@@ -19,6 +19,7 @@ config C6X
 	select GENERIC_CLOCKEVENTS
 	select MODULES_USE_ELF_RELA
 	select ARCH_NO_COHERENT_DMA_MMAP
+	select INITRAMFS_GENERIC_UNLOAD
 
 config MMU
 	def_bool n
diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c
index 4cc72b0d1c1d..a11cb657182a 100644
--- a/arch/c6x/mm/init.c
+++ b/arch/c6x/mm/init.c
@@ -66,13 +66,6 @@ void __init mem_init(void)
 	mem_init_print_info(NULL);
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void __init free_initmem(void)
 {
 	free_initmem_default(-1);
-- 
2.16.2


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

* [PATCH 06/16] frv: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (4 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 05/16] c6x: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 07/16] h8300: " Shea Levy
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/frv/Kconfig   |  1 +
 arch/frv/mm/init.c | 11 -----------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index af369b05fed5..5c104b800cb1 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -17,6 +17,7 @@ config FRV
 	select OLD_SIGACTION
 	select HAVE_DEBUG_STACKOVERFLOW
 	select ARCH_NO_COHERENT_DMA_MMAP
+	select INITRAMFS_GENERIC_UNLOAD
 
 config CPU_BIG_ENDIAN
 	def_bool y
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index cf464100e838..345edc4dc462 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -131,14 +131,3 @@ void free_initmem(void)
 	free_initmem_default(-1);
 #endif
 } /* end free_initmem() */
-
-/*****************************************************************************/
-/*
- * free the initial ramdisk memory
- */
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-} /* end free_initrd_mem() */
-#endif
-- 
2.16.2


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

* [PATCH 07/16] h8300: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (5 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 06/16] frv: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 08/16] m32r: " Shea Levy
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/h8300/Kconfig   | 1 +
 arch/h8300/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 091d6d04b5e5..58c9b6b1df16 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -24,6 +24,7 @@ config H8300
 	select HAVE_ARCH_HASH
 	select CPU_NO_EFFICIENT_FFS
 	select DMA_DIRECT_OPS
+	select INITRAMFS_GENERIC_UNLOAD
 
 config CPU_BIG_ENDIAN
 	def_bool y
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 015287ac8ce8..37574332b202 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -102,13 +102,6 @@ void __init mem_init(void)
 }
 
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void
 free_initmem(void)
 {
-- 
2.16.2


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

* [PATCH 08/16] m32r: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (6 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 07/16] h8300: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 09/16] m68k: " Shea Levy
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/m32r/Kconfig   |  1 +
 arch/m32r/mm/init.c | 11 -----------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index dd84ee194579..010a2b999181 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -21,6 +21,7 @@ config M32R
 	select CPU_NO_EFFICIENT_FFS
 	select DMA_DIRECT_OPS
 	select ARCH_NO_COHERENT_DMA_MMAP if !MMU
+	select INITRAMFS_GENERIC_UNLOAD
 
 config SBUS
 	bool
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 93abc8c3a46e..e2b5f09209ee 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -139,14 +139,3 @@ void free_initmem(void)
 {
 	free_initmem_default(-1);
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-/*===================================*
- * free_initrd_mem() :
- * orig : arch/sh/mm/init.c
- *===================================*/
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH 09/16] m68k: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (7 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 08/16] m32r: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 10/16] microblaze: " Shea Levy
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/m68k/Kconfig   | 1 +
 arch/m68k/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 785612b576f7..47913a68529e 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -24,6 +24,7 @@ config M68K
 	select MODULES_USE_ELF_RELA
 	select OLD_SIGSUSPEND3
 	select OLD_SIGACTION
+	select INITRAMFS_GENERIC_UNLOAD
 
 config CPU_BIG_ENDIAN
 	def_bool y
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index e85acd131fa8..e20bef09258c 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -172,10 +172,3 @@ void __init mem_init(void)
 	mem_init_print_info(NULL);
 	print_memmap();
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH 10/16] microblaze: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (8 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 09/16] m68k: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 11/16] nios2: " Shea Levy
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/microblaze/Kconfig   | 1 +
 arch/microblaze/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 3817a3e2146c..ef23e8410b4b 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -36,6 +36,7 @@ config MICROBLAZE
 	select TRACING_SUPPORT
 	select VIRT_TO_BUS
 	select CPU_NO_EFFICIENT_FFS
+	select INITRAMFS_GENERIC_UNLOAD
 
 # Endianness selection
 choice
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index df6de7ccdc2e..ea058dfda222 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -187,13 +187,6 @@ void __init setup_memory(void)
 	paging_init();
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void free_initmem(void)
 {
 	free_initmem_default(-1);
-- 
2.16.2


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

* [PATCH 11/16] nios2: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (9 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 10/16] microblaze: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 12/16] openrisc: " Shea Levy
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/nios2/Kconfig   | 1 +
 arch/nios2/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig
index 3d4ec88f1db1..d3b72d5c8967 100644
--- a/arch/nios2/Kconfig
+++ b/arch/nios2/Kconfig
@@ -19,6 +19,7 @@ config NIOS2
 	select SPARSE_IRQ
 	select USB_ARCH_HAS_HCD if USB_SUPPORT
 	select CPU_NO_EFFICIENT_FFS
+	select INITRAMFS_GENERIC_UNLOAD
 
 config GENERIC_CSUM
 	def_bool y
diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c
index c92fe4234009..3df75ff8c768 100644
--- a/arch/nios2/mm/init.c
+++ b/arch/nios2/mm/init.c
@@ -82,13 +82,6 @@ void __init mmu_init(void)
 	flush_tlb_all();
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void __ref free_initmem(void)
 {
 	free_initmem_default(-1);
-- 
2.16.2


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

* [PATCH 12/16] openrisc: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (10 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 11/16] nios2: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 13/16] parisc: " Shea Levy
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/openrisc/Kconfig   | 1 +
 arch/openrisc/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index dfb6a79ba7ff..0f8d2132baa5 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -36,6 +36,7 @@ config OPENRISC
 	select OMPIC if SMP
 	select ARCH_WANT_FRAME_POINTERS
 	select GENERIC_IRQ_MULTI_HANDLER
+	select INITRAMFS_GENERIC_UNLOAD
 
 config CPU_BIG_ENDIAN
 	def_bool y
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
index 6972d5d6f23f..c1a3dcf9ad40 100644
--- a/arch/openrisc/mm/init.c
+++ b/arch/openrisc/mm/init.c
@@ -222,13 +222,6 @@ void __init mem_init(void)
 	return;
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void free_initmem(void)
 {
 	free_initmem_default(-1);
-- 
2.16.2


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

* [PATCH 13/16] parisc: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (11 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 12/16] openrisc: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 14/16] powerpc: " Shea Levy
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/parisc/Kconfig   | 1 +
 arch/parisc/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 9792d8cf4f56..7410c2094987 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -51,6 +51,7 @@ config PARISC
 	select GENERIC_CLOCKEVENTS
 	select ARCH_NO_COHERENT_DMA_MMAP
 	select CPU_NO_EFFICIENT_FFS
+	select INITRAMFS_GENERIC_UNLOAD
 
 	help
 	  The PA-RISC microprocessor is designed by Hewlett-Packard and used
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index cab32ee824d2..3643399230f3 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -932,10 +932,3 @@ void flush_tlb_all(void)
 	spin_unlock(&sid_lock);
 }
 #endif
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH 14/16] powerpc: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (12 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 13/16] parisc: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 15/16] sh: " Shea Levy
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/powerpc/Kconfig  | 1 +
 arch/powerpc/mm/mem.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 73ce5dd07642..8cf384068e79 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -223,6 +223,7 @@ config PPC
 	select HAVE_SYSCALL_TRACEPOINTS
 	select HAVE_VIRT_CPU_ACCOUNTING
 	select HAVE_IRQ_TIME_ACCOUNTING
+	select INITRAMFS_GENERIC_UNLOAD
 	select IRQ_DOMAIN
 	select IRQ_FORCED_THREADING
 	select MODULES_USE_ELF_RELA
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index fe8c61149fb8..e85b2a3cd264 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -404,13 +404,6 @@ void free_initmem(void)
 	free_initmem_default(POISON_FREE_INITMEM);
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 /*
  * This is called when a page has been modified by the kernel.
  * It just marks the page as not i-cache clean.  We do the i-cache
-- 
2.16.2


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

* [PATCH 15/16] sh: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (13 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 14/16] powerpc: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-24 17:44 ` [PATCH 16/16] um: " Shea Levy
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/sh/Kconfig   | 1 +
 arch/sh/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 97fe29316476..b6f80dad2152 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -50,6 +50,7 @@ config SUPERH
 	select HAVE_ARCH_AUDITSYSCALL
 	select HAVE_FUTEX_CMPXCHG if FUTEX
 	select HAVE_NMI
+	select INITRAMFS_GENERIC_UNLOAD
 	help
 	  The SuperH is a RISC processor targeted for use in embedded systems
 	  and consumer electronics; it was also used in the Sega Dreamcast
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index ce0bbaa7e404..7451459d0725 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -477,13 +477,6 @@ void free_initmem(void)
 	free_initmem_default(-1);
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 #ifdef CONFIG_MEMORY_HOTPLUG
 int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
 		bool want_memblock)
-- 
2.16.2


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

* [PATCH 16/16] um: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (14 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 15/16] sh: " Shea Levy
@ 2018-03-24 17:44 ` Shea Levy
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
  16 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-24 17:44 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/um/Kconfig.common | 1 +
 arch/um/kernel/mem.c   | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index c68add8df3ae..1cb8a023938b 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -13,6 +13,7 @@ config UML
 	select GENERIC_CLOCKEVENTS
 	select HAVE_GCC_PLUGINS
 	select TTY # Needed for line.c
+	select INITRAMFS_GENERIC_UNLOAD
 
 config MMU
 	bool
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 3c0e470ea646..2d26eec92126 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -170,13 +170,6 @@ void free_initmem(void)
 {
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 /* Allocate and free page tables. */
 
 pgd_t *pgd_alloc(struct mm_struct *mm)
-- 
2.16.2


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

* Re: [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic.
  2018-03-24 17:44 ` [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
@ 2018-03-25 17:17   ` LEROY Christophe
  2018-03-25 22:20     ` Shea Levy
  2018-03-28 12:04   ` Christoph Hellwig
  1 sibling, 1 reply; 40+ messages in thread
From: LEROY Christophe @ 2018-03-25 17:17 UTC (permalink / raw)
  To: Shea Levy
  Cc: user-mode-linux-devel, linux-sh, linux-riscv, linuxppc-dev,
	linux-parisc, openrisc, nios2-dev, linux-m68k, uclinux-h8-devel,
	linux-c6x-dev, linux-snps-arc, linux-kernel, linux-alpha

Shea Levy <shea@shealevy.com> a écrit :

> Signed-off-by: Shea Levy <shea@shealevy.com>
> ---
>  init/initramfs.c | 7 +++++++
>  usr/Kconfig      | 4 ++++
>  2 files changed, 11 insertions(+)
>
> diff --git a/init/initramfs.c b/init/initramfs.c
> index 7e99a0038942..de5ce873eb5a 100644
> --- a/init/initramfs.c
> +++ b/init/initramfs.c
> @@ -526,6 +526,13 @@ extern unsigned long __initramfs_size;
>  #include <linux/initrd.h>
>  #include <linux/kexec.h>
>
> +#ifdef CONFIG_INITRAMFS_GENERIC_UNLOAD
> +void free_initrd_mem(unsigned long start, unsigned long end)
> +{
> +       free_reserved_area((void *)start, (void *)end, -1, "initrd");
> +}
> +#endif

In powerpc this was an __init function. Why not also put the generic  
one in __init section ?

Christophe


> +
>  static void __init free_initrd(void)
>  {
>  #ifdef CONFIG_KEXEC_CORE
> diff --git a/usr/Kconfig b/usr/Kconfig
> index 43658b8a975e..fd79d4d6fa26 100644
> --- a/usr/Kconfig
> +++ b/usr/Kconfig
> @@ -233,3 +233,7 @@ config INITRAMFS_COMPRESSION
>  	default ".lzma" if RD_LZMA
>  	default ".bz2"  if RD_BZIP2
>  	default ""
> +
> +# Arches can select this for a generic initrd unloading codepath
> +config INITRAMFS_GENERIC_UNLOAD
> +	bool
> --
> 2.16.2



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

* [PATCH v2 00/16] Generic infrastructure for unloading initramfs
  2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
                   ` (15 preceding siblings ...)
  2018-03-24 17:44 ` [PATCH 16/16] um: " Shea Levy
@ 2018-03-25 22:18 ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
                     ` (15 more replies)
  16 siblings, 16 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel

This patch series extracts out code for unloading the initramfs that
was identical across 14 architectures, and moves those architectures
to the common code path. Additionally, RISC-V is newly moved to the
common code path.

In addition to reducing duplication, this allows us to bring future
improvements (such as generalizing existing "keep initrd" command line
options) to multiple architectures at once.

v2: Mark generic free_initrd_mem __init.


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

* [PATCH v2 01/16] initrd: Add generic code path for common initrd unloading logic.
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD Shea Levy
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 init/initramfs.c | 7 +++++++
 usr/Kconfig      | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..5f2e3dba4822 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,13 @@ extern unsigned long __initramfs_size;
 #include <linux/initrd.h>
 #include <linux/kexec.h>
 
+#ifdef CONFIG_INITRAMFS_GENERIC_UNLOAD
+void __init free_initrd_mem(unsigned long start, unsigned long end)
+{
+       free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+#endif
+
 static void __init free_initrd(void)
 {
 #ifdef CONFIG_KEXEC_CORE
diff --git a/usr/Kconfig b/usr/Kconfig
index 43658b8a975e..fd79d4d6fa26 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -233,3 +233,7 @@ config INITRAMFS_COMPRESSION
 	default ".lzma" if RD_LZMA
 	default ".bz2"  if RD_BZIP2
 	default ""
+
+# Arches can select this for a generic initrd unloading codepath
+config INITRAMFS_GENERIC_UNLOAD
+	bool
-- 
2.16.2


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

* [PATCH v2 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD.
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
  2018-03-25 22:18   ` [PATCH v2 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-26  0:41     ` Palmer Dabbelt
  2018-03-25 22:18   ` [PATCH v2 03/16] alpha: " Shea Levy
                     ` (13 subsequent siblings)
  15 siblings, 1 reply; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/riscv/Kconfig   | 1 +
 arch/riscv/mm/init.c | 6 ------
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c22ebe08e902..ab1b4cee84fc 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -37,6 +37,7 @@ config RISCV
 	select THREAD_INFO_IN_TASK
 	select RISCV_TIMER
 	select GENERIC_IRQ_MULTI_HANDLER
+	select INITRAMFS_GENERIC_UNLOAD
 
 config MMU
 	def_bool y
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index c77df8142be2..36f83fe8a726 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -62,9 +62,3 @@ void free_initmem(void)
 {
 	free_initmem_default(0);
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-}
-#endif /* CONFIG_BLK_DEV_INITRD */
-- 
2.16.2


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

* [PATCH v2 03/16] alpha: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
  2018-03-25 22:18   ` [PATCH v2 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
  2018-03-25 22:18   ` [PATCH v2 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 04/16] arc: " Shea Levy
                     ` (12 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/alpha/Kconfig   | 1 +
 arch/alpha/mm/init.c | 8 --------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index e96adcbcab41..238d743ae8f2 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -27,6 +27,7 @@ config ALPHA
 	select ODD_RT_SIGACTION
 	select OLD_SIGSUSPEND
 	select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67
+	select INITRAMFS_GENERIC_UNLOAD
 	help
 	  The Alpha is a 64-bit general-purpose processor designed and
 	  marketed by the Digital Equipment Corporation of blessed memory,
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 9d74520298ab..55f7c8efa962 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -291,11 +291,3 @@ free_initmem(void)
 {
 	free_initmem_default(-1);
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void
-free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH v2 04/16] arc: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (2 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 03/16] alpha: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 05/16] c6x: " Shea Levy
                     ` (11 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/arc/Kconfig   | 1 +
 arch/arc/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index d76bf4a83740..2844ce5b910c 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -44,6 +44,7 @@ config ARC
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_LZMA
+	select INITRAMFS_GENERIC_UNLOAD
 
 config MIGHT_HAVE_PCI
 	bool
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index ba145065c579..7bcf23ab1756 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -229,10 +229,3 @@ void __ref free_initmem(void)
 {
 	free_initmem_default(-1);
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH v2 05/16] c6x: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (3 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 04/16] arc: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 06/16] frv: " Shea Levy
                     ` (10 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/c6x/Kconfig   | 1 +
 arch/c6x/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig
index c6b4dd1418b4..857f95f9a6a4 100644
--- a/arch/c6x/Kconfig
+++ b/arch/c6x/Kconfig
@@ -19,6 +19,7 @@ config C6X
 	select GENERIC_CLOCKEVENTS
 	select MODULES_USE_ELF_RELA
 	select ARCH_NO_COHERENT_DMA_MMAP
+	select INITRAMFS_GENERIC_UNLOAD
 
 config MMU
 	def_bool n
diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c
index 4cc72b0d1c1d..a11cb657182a 100644
--- a/arch/c6x/mm/init.c
+++ b/arch/c6x/mm/init.c
@@ -66,13 +66,6 @@ void __init mem_init(void)
 	mem_init_print_info(NULL);
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void __init free_initmem(void)
 {
 	free_initmem_default(-1);
-- 
2.16.2


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

* [PATCH v2 06/16] frv: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (4 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 05/16] c6x: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 07/16] h8300: " Shea Levy
                     ` (9 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/frv/Kconfig   |  1 +
 arch/frv/mm/init.c | 11 -----------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index af369b05fed5..5c104b800cb1 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -17,6 +17,7 @@ config FRV
 	select OLD_SIGACTION
 	select HAVE_DEBUG_STACKOVERFLOW
 	select ARCH_NO_COHERENT_DMA_MMAP
+	select INITRAMFS_GENERIC_UNLOAD
 
 config CPU_BIG_ENDIAN
 	def_bool y
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index cf464100e838..345edc4dc462 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -131,14 +131,3 @@ void free_initmem(void)
 	free_initmem_default(-1);
 #endif
 } /* end free_initmem() */
-
-/*****************************************************************************/
-/*
- * free the initial ramdisk memory
- */
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-} /* end free_initrd_mem() */
-#endif
-- 
2.16.2


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

* [PATCH v2 07/16] h8300: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (5 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 06/16] frv: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 08/16] m32r: " Shea Levy
                     ` (8 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/h8300/Kconfig   | 1 +
 arch/h8300/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 091d6d04b5e5..58c9b6b1df16 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -24,6 +24,7 @@ config H8300
 	select HAVE_ARCH_HASH
 	select CPU_NO_EFFICIENT_FFS
 	select DMA_DIRECT_OPS
+	select INITRAMFS_GENERIC_UNLOAD
 
 config CPU_BIG_ENDIAN
 	def_bool y
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 015287ac8ce8..37574332b202 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -102,13 +102,6 @@ void __init mem_init(void)
 }
 
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void
 free_initmem(void)
 {
-- 
2.16.2


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

* [PATCH v2 08/16] m32r: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (6 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 07/16] h8300: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 09/16] m68k: " Shea Levy
                     ` (7 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/m32r/Kconfig   |  1 +
 arch/m32r/mm/init.c | 11 -----------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index dd84ee194579..010a2b999181 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -21,6 +21,7 @@ config M32R
 	select CPU_NO_EFFICIENT_FFS
 	select DMA_DIRECT_OPS
 	select ARCH_NO_COHERENT_DMA_MMAP if !MMU
+	select INITRAMFS_GENERIC_UNLOAD
 
 config SBUS
 	bool
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 93abc8c3a46e..e2b5f09209ee 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -139,14 +139,3 @@ void free_initmem(void)
 {
 	free_initmem_default(-1);
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-/*===================================*
- * free_initrd_mem() :
- * orig : arch/sh/mm/init.c
- *===================================*/
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH v2 09/16] m68k: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (7 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 08/16] m32r: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 10/16] microblaze: " Shea Levy
                     ` (6 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/m68k/Kconfig   | 1 +
 arch/m68k/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 785612b576f7..47913a68529e 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -24,6 +24,7 @@ config M68K
 	select MODULES_USE_ELF_RELA
 	select OLD_SIGSUSPEND3
 	select OLD_SIGACTION
+	select INITRAMFS_GENERIC_UNLOAD
 
 config CPU_BIG_ENDIAN
 	def_bool y
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index e85acd131fa8..e20bef09258c 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -172,10 +172,3 @@ void __init mem_init(void)
 	mem_init_print_info(NULL);
 	print_memmap();
 }
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH v2 10/16] microblaze: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (8 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 09/16] m68k: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 11/16] nios2: " Shea Levy
                     ` (5 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/microblaze/Kconfig   | 1 +
 arch/microblaze/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 3817a3e2146c..ef23e8410b4b 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -36,6 +36,7 @@ config MICROBLAZE
 	select TRACING_SUPPORT
 	select VIRT_TO_BUS
 	select CPU_NO_EFFICIENT_FFS
+	select INITRAMFS_GENERIC_UNLOAD
 
 # Endianness selection
 choice
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index df6de7ccdc2e..ea058dfda222 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -187,13 +187,6 @@ void __init setup_memory(void)
 	paging_init();
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void free_initmem(void)
 {
 	free_initmem_default(-1);
-- 
2.16.2


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

* [PATCH v2 11/16] nios2: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (9 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 10/16] microblaze: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 12/16] openrisc: " Shea Levy
                     ` (4 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/nios2/Kconfig   | 1 +
 arch/nios2/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig
index 3d4ec88f1db1..d3b72d5c8967 100644
--- a/arch/nios2/Kconfig
+++ b/arch/nios2/Kconfig
@@ -19,6 +19,7 @@ config NIOS2
 	select SPARSE_IRQ
 	select USB_ARCH_HAS_HCD if USB_SUPPORT
 	select CPU_NO_EFFICIENT_FFS
+	select INITRAMFS_GENERIC_UNLOAD
 
 config GENERIC_CSUM
 	def_bool y
diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c
index c92fe4234009..3df75ff8c768 100644
--- a/arch/nios2/mm/init.c
+++ b/arch/nios2/mm/init.c
@@ -82,13 +82,6 @@ void __init mmu_init(void)
 	flush_tlb_all();
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void __ref free_initmem(void)
 {
 	free_initmem_default(-1);
-- 
2.16.2


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

* [PATCH v2 12/16] openrisc: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (10 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 11/16] nios2: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 13/16] parisc: " Shea Levy
                     ` (3 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/openrisc/Kconfig   | 1 +
 arch/openrisc/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index dfb6a79ba7ff..0f8d2132baa5 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -36,6 +36,7 @@ config OPENRISC
 	select OMPIC if SMP
 	select ARCH_WANT_FRAME_POINTERS
 	select GENERIC_IRQ_MULTI_HANDLER
+	select INITRAMFS_GENERIC_UNLOAD
 
 config CPU_BIG_ENDIAN
 	def_bool y
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
index 6972d5d6f23f..c1a3dcf9ad40 100644
--- a/arch/openrisc/mm/init.c
+++ b/arch/openrisc/mm/init.c
@@ -222,13 +222,6 @@ void __init mem_init(void)
 	return;
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 void free_initmem(void)
 {
 	free_initmem_default(-1);
-- 
2.16.2


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

* [PATCH v2 13/16] parisc: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (11 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 12/16] openrisc: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 14/16] powerpc: " Shea Levy
                     ` (2 subsequent siblings)
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/parisc/Kconfig   | 1 +
 arch/parisc/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 9792d8cf4f56..7410c2094987 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -51,6 +51,7 @@ config PARISC
 	select GENERIC_CLOCKEVENTS
 	select ARCH_NO_COHERENT_DMA_MMAP
 	select CPU_NO_EFFICIENT_FFS
+	select INITRAMFS_GENERIC_UNLOAD
 
 	help
 	  The PA-RISC microprocessor is designed by Hewlett-Packard and used
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index cab32ee824d2..3643399230f3 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -932,10 +932,3 @@ void flush_tlb_all(void)
 	spin_unlock(&sid_lock);
 }
 #endif
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-- 
2.16.2


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

* [PATCH v2 14/16] powerpc: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (12 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 13/16] parisc: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 15/16] sh: " Shea Levy
  2018-03-25 22:18   ` [PATCH v2 16/16] um: " Shea Levy
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/powerpc/Kconfig  | 1 +
 arch/powerpc/mm/mem.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 73ce5dd07642..8cf384068e79 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -223,6 +223,7 @@ config PPC
 	select HAVE_SYSCALL_TRACEPOINTS
 	select HAVE_VIRT_CPU_ACCOUNTING
 	select HAVE_IRQ_TIME_ACCOUNTING
+	select INITRAMFS_GENERIC_UNLOAD
 	select IRQ_DOMAIN
 	select IRQ_FORCED_THREADING
 	select MODULES_USE_ELF_RELA
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index fe8c61149fb8..e85b2a3cd264 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -404,13 +404,6 @@ void free_initmem(void)
 	free_initmem_default(POISON_FREE_INITMEM);
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 /*
  * This is called when a page has been modified by the kernel.
  * It just marks the page as not i-cache clean.  We do the i-cache
-- 
2.16.2


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

* [PATCH v2 15/16] sh: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (13 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 14/16] powerpc: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  2018-03-25 22:18   ` [PATCH v2 16/16] um: " Shea Levy
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/sh/Kconfig   | 1 +
 arch/sh/mm/init.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 97fe29316476..b6f80dad2152 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -50,6 +50,7 @@ config SUPERH
 	select HAVE_ARCH_AUDITSYSCALL
 	select HAVE_FUTEX_CMPXCHG if FUTEX
 	select HAVE_NMI
+	select INITRAMFS_GENERIC_UNLOAD
 	help
 	  The SuperH is a RISC processor targeted for use in embedded systems
 	  and consumer electronics; it was also used in the Sega Dreamcast
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index ce0bbaa7e404..7451459d0725 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -477,13 +477,6 @@ void free_initmem(void)
 	free_initmem_default(-1);
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 #ifdef CONFIG_MEMORY_HOTPLUG
 int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
 		bool want_memblock)
-- 
2.16.2


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

* [PATCH v2 16/16] um: Use INITRAMFS_GENERIC_UNLOAD
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (14 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 15/16] sh: " Shea Levy
@ 2018-03-25 22:18   ` Shea Levy
  15 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
  To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
  Cc: Shea Levy

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/um/Kconfig.common | 1 +
 arch/um/kernel/mem.c   | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index c68add8df3ae..1cb8a023938b 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -13,6 +13,7 @@ config UML
 	select GENERIC_CLOCKEVENTS
 	select HAVE_GCC_PLUGINS
 	select TTY # Needed for line.c
+	select INITRAMFS_GENERIC_UNLOAD
 
 config MMU
 	bool
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 3c0e470ea646..2d26eec92126 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -170,13 +170,6 @@ void free_initmem(void)
 {
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
 /* Allocate and free page tables. */
 
 pgd_t *pgd_alloc(struct mm_struct *mm)
-- 
2.16.2


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

* Re: [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic.
  2018-03-25 17:17   ` LEROY Christophe
@ 2018-03-25 22:20     ` Shea Levy
  0 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-25 22:20 UTC (permalink / raw)
  To: LEROY Christophe
  Cc: user-mode-linux-devel, linux-sh, linux-riscv, linuxppc-dev,
	linux-parisc, openrisc, nios2-dev, linux-m68k, uclinux-h8-devel,
	linux-c6x-dev, linux-snps-arc, linux-kernel, linux-alpha

[-- Attachment #1: Type: text/plain, Size: 1429 bytes --]

Hi Christophe,

LEROY Christophe <christophe.leroy@c-s.fr> writes:

> Shea Levy <shea@shealevy.com> a écrit :
>
>> Signed-off-by: Shea Levy <shea@shealevy.com>
>> ---
>>  init/initramfs.c | 7 +++++++
>>  usr/Kconfig      | 4 ++++
>>  2 files changed, 11 insertions(+)
>>
>> diff --git a/init/initramfs.c b/init/initramfs.c
>> index 7e99a0038942..de5ce873eb5a 100644
>> --- a/init/initramfs.c
>> +++ b/init/initramfs.c
>> @@ -526,6 +526,13 @@ extern unsigned long __initramfs_size;
>>  #include <linux/initrd.h>
>>  #include <linux/kexec.h>
>>
>> +#ifdef CONFIG_INITRAMFS_GENERIC_UNLOAD
>> +void free_initrd_mem(unsigned long start, unsigned long end)
>> +{
>> +       free_reserved_area((void *)start, (void *)end, -1, "initrd");
>> +}
>> +#endif
>
> In powerpc this was an __init function. Why not also put the generic  
> one in __init section ?
>

v2 series sent, thanks!

>
> Christophe
>
>
>> +
>>  static void __init free_initrd(void)
>>  {
>>  #ifdef CONFIG_KEXEC_CORE
>> diff --git a/usr/Kconfig b/usr/Kconfig
>> index 43658b8a975e..fd79d4d6fa26 100644
>> --- a/usr/Kconfig
>> +++ b/usr/Kconfig
>> @@ -233,3 +233,7 @@ config INITRAMFS_COMPRESSION
>>  	default ".lzma" if RD_LZMA
>>  	default ".bz2"  if RD_BZIP2
>>  	default ""
>> +
>> +# Arches can select this for a generic initrd unloading codepath
>> +config INITRAMFS_GENERIC_UNLOAD
>> +	bool
>> --
>> 2.16.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH v2 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD.
  2018-03-25 22:18   ` [PATCH v2 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD Shea Levy
@ 2018-03-26  0:41     ` Palmer Dabbelt
  2018-03-26  0:55       ` Shea Levy
  0 siblings, 1 reply; 40+ messages in thread
From: Palmer Dabbelt @ 2018-03-26  0:41 UTC (permalink / raw)
  To: shea
  Cc: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel

On Sun, 25 Mar 2018 15:18:39 PDT (-0700), shea@shealevy.com wrote:
> Signed-off-by: Shea Levy <shea@shealevy.com>
> ---
>  arch/riscv/Kconfig   | 1 +
>  arch/riscv/mm/init.c | 6 ------
>  2 files changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index c22ebe08e902..ab1b4cee84fc 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -37,6 +37,7 @@ config RISCV
>  	select THREAD_INFO_IN_TASK
>  	select RISCV_TIMER
>  	select GENERIC_IRQ_MULTI_HANDLER
> +	select INITRAMFS_GENERIC_UNLOAD
>
>  config MMU
>  	def_bool y
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index c77df8142be2..36f83fe8a726 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -62,9 +62,3 @@ void free_initmem(void)
>  {
>  	free_initmem_default(0);
>  }
> -
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void free_initrd_mem(unsigned long start, unsigned long end)
> -{
> -}
> -#endif /* CONFIG_BLK_DEV_INITRD */

I haven't looked through the rest of the patch set, but this is a pretty 
trivial change so feel free to add a 

Reviewed-By: Palmer Dabbelt <palmer@sifive.com>

if you'd like.  If you'd like it merged through my tree then just say 
something!

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

* Re: [PATCH v2 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD.
  2018-03-26  0:41     ` Palmer Dabbelt
@ 2018-03-26  0:55       ` Shea Levy
  0 siblings, 0 replies; 40+ messages in thread
From: Shea Levy @ 2018-03-26  0:55 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
	uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
	linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel

[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]

Hi Palmer,

Palmer Dabbelt <palmer@sifive.com> writes:

> On Sun, 25 Mar 2018 15:18:39 PDT (-0700), shea@shealevy.com wrote:
>> Signed-off-by: Shea Levy <shea@shealevy.com>
>> ---
>>  arch/riscv/Kconfig   | 1 +
>>  arch/riscv/mm/init.c | 6 ------
>>  2 files changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>> index c22ebe08e902..ab1b4cee84fc 100644
>> --- a/arch/riscv/Kconfig
>> +++ b/arch/riscv/Kconfig
>> @@ -37,6 +37,7 @@ config RISCV
>>  	select THREAD_INFO_IN_TASK
>>  	select RISCV_TIMER
>>  	select GENERIC_IRQ_MULTI_HANDLER
>> +	select INITRAMFS_GENERIC_UNLOAD
>>
>>  config MMU
>>  	def_bool y
>> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
>> index c77df8142be2..36f83fe8a726 100644
>> --- a/arch/riscv/mm/init.c
>> +++ b/arch/riscv/mm/init.c
>> @@ -62,9 +62,3 @@ void free_initmem(void)
>>  {
>>  	free_initmem_default(0);
>>  }
>> -
>> -#ifdef CONFIG_BLK_DEV_INITRD
>> -void free_initrd_mem(unsigned long start, unsigned long end)
>> -{
>> -}
>> -#endif /* CONFIG_BLK_DEV_INITRD */
>
> I haven't looked through the rest of the patch set, but this is a pretty 
> trivial change so feel free to add a 
>
> Reviewed-By: Palmer Dabbelt <palmer@sifive.com>
>
> if you'd like.  If you'd like it merged through my tree then just say 
> something!

I'm not sure how these cross-cutting changes go, if you can take the
series through your tree that'd be great!

Thanks,
Shea

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic.
  2018-03-24 17:44 ` [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
  2018-03-25 17:17   ` LEROY Christophe
@ 2018-03-28 12:04   ` Christoph Hellwig
  2018-03-28 12:23     ` Geert Uytterhoeven
  1 sibling, 1 reply; 40+ messages in thread
From: Christoph Hellwig @ 2018-03-28 12:04 UTC (permalink / raw)
  To: Shea Levy
  Cc: uclinux-h8-devel, linux-c6x-dev, linux-parisc, linux-sh,
	linux-kernel, linux-m68k, openrisc, linux-alpha,
	user-mode-linux-devel, nios2-dev, linux-riscv, linux-snps-arc,
	linuxppc-dev

> +#ifdef CONFIG_INITRAMFS_GENERIC_UNLOAD
> +void free_initrd_mem(unsigned long start, unsigned long end)
> +{
> +       free_reserved_area((void *)start, (void *)end, -1, "initrd");
> +}
> +#endif

Given how trivial this is and how many architectures can use it I'd
reverse the polarity and add a CONFIG_HAVE_ARCH_FREE_INITRD_MEM
instead.

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

* Re: [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic.
  2018-03-28 12:04   ` Christoph Hellwig
@ 2018-03-28 12:23     ` Geert Uytterhoeven
  0 siblings, 0 replies; 40+ messages in thread
From: Geert Uytterhoeven @ 2018-03-28 12:23 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Shea Levy, alpha, Linux Kernel Mailing List, arcml, linux-c6x-dev,
	moderated list:H8/300 ARCHITECTURE, linux-m68k, nios2-dev,
	Openrisc, Parisc List, linuxppc-dev, linux-riscv, Linux-sh list,
	uml-devel

On Wed, Mar 28, 2018 at 2:04 PM, Christoph Hellwig <hch@infradead.org> wrote:
>> +#ifdef CONFIG_INITRAMFS_GENERIC_UNLOAD
>> +void free_initrd_mem(unsigned long start, unsigned long end)
>> +{
>> +       free_reserved_area((void *)start, (void *)end, -1, "initrd");
>> +}
>> +#endif
>
> Given how trivial this is and how many architectures can use it I'd
> reverse the polarity and add a CONFIG_HAVE_ARCH_FREE_INITRD_MEM
> instead.

And while adding "special" functionality to the generic version, more and more
users of CONFIG_HAVE_ARCH_FREE_INITRD_MEM will be removed.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2018-03-28 12:23 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-24 17:44 [PATCH 00/16] Generic infrastructure for unloading initramfs Shea Levy
2018-03-24 17:44 ` [PATCH 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
2018-03-25 17:17   ` LEROY Christophe
2018-03-25 22:20     ` Shea Levy
2018-03-28 12:04   ` Christoph Hellwig
2018-03-28 12:23     ` Geert Uytterhoeven
2018-03-24 17:44 ` [PATCH 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD Shea Levy
2018-03-24 17:44 ` [PATCH 03/16] alpha: " Shea Levy
2018-03-24 17:44 ` [PATCH 04/16] arc: " Shea Levy
2018-03-24 17:44 ` [PATCH 05/16] c6x: " Shea Levy
2018-03-24 17:44 ` [PATCH 06/16] frv: " Shea Levy
2018-03-24 17:44 ` [PATCH 07/16] h8300: " Shea Levy
2018-03-24 17:44 ` [PATCH 08/16] m32r: " Shea Levy
2018-03-24 17:44 ` [PATCH 09/16] m68k: " Shea Levy
2018-03-24 17:44 ` [PATCH 10/16] microblaze: " Shea Levy
2018-03-24 17:44 ` [PATCH 11/16] nios2: " Shea Levy
2018-03-24 17:44 ` [PATCH 12/16] openrisc: " Shea Levy
2018-03-24 17:44 ` [PATCH 13/16] parisc: " Shea Levy
2018-03-24 17:44 ` [PATCH 14/16] powerpc: " Shea Levy
2018-03-24 17:44 ` [PATCH 15/16] sh: " Shea Levy
2018-03-24 17:44 ` [PATCH 16/16] um: " Shea Levy
2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
2018-03-25 22:18   ` [PATCH v2 01/16] initrd: Add generic code path for common initrd unloading logic Shea Levy
2018-03-25 22:18   ` [PATCH v2 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD Shea Levy
2018-03-26  0:41     ` Palmer Dabbelt
2018-03-26  0:55       ` Shea Levy
2018-03-25 22:18   ` [PATCH v2 03/16] alpha: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 04/16] arc: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 05/16] c6x: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 06/16] frv: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 07/16] h8300: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 08/16] m32r: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 09/16] m68k: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 10/16] microblaze: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 11/16] nios2: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 12/16] openrisc: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 13/16] parisc: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 14/16] powerpc: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 15/16] sh: " Shea Levy
2018-03-25 22:18   ` [PATCH v2 16/16] um: " Shea Levy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox