linux-kernel.vger.kernel.org archive mirror
 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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] 128+ 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
                     ` (16 more replies)
  16 siblings, 17 replies; 128+ 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] 128+ 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
                     ` (15 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (14 subsequent siblings)
  16 siblings, 1 reply; 128+ 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] 128+ 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
                     ` (13 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (12 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (11 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (10 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (9 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (8 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (7 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (6 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (5 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (4 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (3 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
                     ` (2 subsequent siblings)
  16 siblings, 0 replies; 128+ 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] 128+ 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
  2018-03-28 15:26   ` [PATCH] Extract initrd free logic from arch-specific code Shea Levy
  16 siblings, 0 replies; 128+ 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] 128+ 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
  2018-03-28 15:26   ` [PATCH] Extract initrd free logic from arch-specific code Shea Levy
  16 siblings, 0 replies; 128+ 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] 128+ 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; 128+ 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] 128+ 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; 128+ 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, shea

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] 128+ 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; 128+ 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] 128+ 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; 128+ messages in thread
From: Christoph Hellwig @ 2018-03-28 12:04 UTC (permalink / raw)
  To: Shea Levy
  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

> +#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] 128+ 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; 128+ 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] 128+ messages in thread

* [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-25 22:18 ` [PATCH v2 00/16] Generic infrastructure for unloading initramfs Shea Levy
                     ` (15 preceding siblings ...)
  2018-03-25 22:18   ` [PATCH v2 16/16] um: " Shea Levy
@ 2018-03-28 15:26   ` Shea Levy
  2018-03-28 15:58     ` Rob Landley
                       ` (3 more replies)
  16 siblings, 4 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 15:26 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Christoph Hellwig, Shea Levy, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Vineet Gupta, Russell King, Catalin Marinas,
	Will Deacon, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
	Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck,
	Fenghua Yu, Geert Uytterhoeven, James Hogan, Michal Simek,
	Ralf Baechle, David Howells, Ley Foon Tan, Jonas Bonn,
	Stefan Kristiansson, Stafford Horne, James E.J. Bottomley,
	Helge Deller, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Palmer Dabbelt, Albert Ou, Martin Schwidefsky,
	Heiko Carstens, Chen Liqin, Lennox Wu, Rich Felker,
	David S. Miller, Jeff Dike, Richard Weinberger, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Rob Landley, Florian Fainelli, linux-alpha,
	linux-snps-arc, linux-arm-kernel, adi-buildroot-devel,
	linux-c6x-dev, linux-cris-kernel, uclinux-h8-devel,
	linux-hexagon, linux-ia64, linux-m68k, linux-metag, linux-mips,
	linux-am33-list, nios2-dev, openrisc, linux-parisc, linuxppc-dev,
	linux-s390, linux-sh, sparclinux, user-mode-linux-devel,
	user-mode-linux-user, linux-xtensa

Now only those architectures that have custom initrd free requirements
need to define free_initrd_mem.

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/alpha/mm/init.c      |  8 --------
 arch/arc/mm/init.c        |  7 -------
 arch/arm/Kconfig          |  1 +
 arch/arm64/Kconfig        |  1 +
 arch/blackfin/Kconfig     |  1 +
 arch/c6x/mm/init.c        |  7 -------
 arch/cris/Kconfig         |  1 +
 arch/frv/mm/init.c        | 11 -----------
 arch/h8300/mm/init.c      |  7 -------
 arch/hexagon/Kconfig      |  1 +
 arch/ia64/Kconfig         |  1 +
 arch/m32r/Kconfig         |  1 +
 arch/m32r/mm/init.c       | 11 -----------
 arch/m68k/mm/init.c       |  7 -------
 arch/metag/Kconfig        |  1 +
 arch/microblaze/mm/init.c |  7 -------
 arch/mips/Kconfig         |  1 +
 arch/mn10300/Kconfig      |  1 +
 arch/nios2/mm/init.c      |  7 -------
 arch/openrisc/mm/init.c   |  7 -------
 arch/parisc/mm/init.c     |  7 -------
 arch/powerpc/mm/mem.c     |  7 -------
 arch/riscv/mm/init.c      |  6 ------
 arch/s390/Kconfig         |  1 +
 arch/score/Kconfig        |  1 +
 arch/sh/mm/init.c         |  7 -------
 arch/sparc/Kconfig        |  1 +
 arch/tile/Kconfig         |  1 +
 arch/um/kernel/mem.c      |  7 -------
 arch/unicore32/Kconfig    |  1 +
 arch/x86/Kconfig          |  1 +
 arch/xtensa/Kconfig       |  1 +
 init/initramfs.c          |  7 +++++++
 usr/Kconfig               |  4 ++++
 34 files changed, 28 insertions(+), 113 deletions(-)

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
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
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3f972e83909b..19d1c5594e2d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -47,6 +47,7 @@ config ARM
 	select HARDIRQS_SW_RESEND
 	select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
 	select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
 	select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
 	select HAVE_ARCH_MMAP_RND_BITS if MMU
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index cb03e93f03cf..de93620870af 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -85,6 +85,7 @@ config ARM64
 	select HAVE_ALIGNED_STRUCT_PAGE if SLUB
 	select HAVE_ARCH_AUDITSYSCALL
 	select HAVE_ARCH_BITREVERSE
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_HUGE_VMAP
 	select HAVE_ARCH_JUMP_LABEL
 	select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index d9c2866ba618..6c6dae9fe894 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -15,6 +15,7 @@ config BLACKFIN
 	def_bool y
 	select HAVE_ARCH_KGDB
 	select HAVE_ARCH_TRACEHOOK
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_DYNAMIC_FTRACE
 	select HAVE_FTRACE_MCOUNT_RECORD
 	select HAVE_FUNCTION_GRAPH_TRACER
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);
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index cd5a0865c97f..5425f77e5664 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -76,6 +76,7 @@ config CRIS
 	select HAVE_DEBUG_BUGVERBOSE if ETRAX_ARCH_V32
 	select HAVE_NMI
 	select DMA_DIRECT_OPS if PCI
+	select HAVE_ARCH_FREE_INITRD_MEM
 
 config HZ
 	int
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
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)
 {
diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
index 76d2f20d525e..69a16cd2e253 100644
--- a/arch/hexagon/Kconfig
+++ b/arch/hexagon/Kconfig
@@ -17,6 +17,7 @@ config HEXAGON
 	# GENERIC_ALLOCATOR is used by dma_alloc_coherent()
 	select GENERIC_ALLOCATOR
 	select GENERIC_IRQ_SHOW
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_KGDB
 	select HAVE_ARCH_TRACEHOOK
 	select NO_IOPORT_MAP
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index bbe12a038d21..366ef1dd3cd4 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -28,6 +28,7 @@ config IA64
 	select HAVE_DYNAMIC_FTRACE if (!ITANIUM)
 	select HAVE_FUNCTION_TRACER
 	select TTY
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_DMA_API_DEBUG
 	select HAVE_MEMBLOCK
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index dd84ee194579..9e41bdff45c3 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 HAVE_ARCH_FREE_INITRD_MEM
 
 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
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
diff --git a/arch/metag/Kconfig b/arch/metag/Kconfig
index c7b62a339539..5be7f1693b1b 100644
--- a/arch/metag/Kconfig
+++ b/arch/metag/Kconfig
@@ -7,6 +7,7 @@ config METAG
 	select GENERIC_IRQ_SHOW
 	select GENERIC_SMP_IDLE_THREAD
 	select HAVE_64BIT_ALIGNED_ACCESS
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_C_RECORDMCOUNT
 	select HAVE_DEBUG_KMEMLEAK
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);
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8128c3b68d6b..c033cd1e0c52 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -27,6 +27,7 @@ config MIPS
 	select GENERIC_SMP_IDLE_THREAD
 	select GENERIC_TIME_VSYSCALL
 	select HANDLE_DOMAIN_IRQ
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_JUMP_LABEL
 	select HAVE_ARCH_KGDB
 	select HAVE_ARCH_MMAP_RND_BITS if MMU
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index e9d8d60bd28b..5aa4f1aa309f 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -6,6 +6,7 @@ config MN10300
 	select HAVE_UID16
 	select GENERIC_IRQ_SHOW
 	select ARCH_WANT_IPC_PARSE_VERSION
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_ARCH_KGDB
 	select GENERIC_ATOMIC64
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);
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);
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
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
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 */
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index eaee7087886f..94a9879f1ea8 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -125,6 +125,7 @@ config S390
 	select GENERIC_TIME_VSYSCALL
 	select HAVE_ALIGNED_STRUCT_PAGE if SLUB
 	select HAVE_ARCH_AUDITSYSCALL
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_JUMP_LABEL
 	select CPU_NO_EFFICIENT_FFS if !HAVE_MARCH_Z9_109_FEATURES
 	select HAVE_ARCH_SECCOMP_FILTER
diff --git a/arch/score/Kconfig b/arch/score/Kconfig
index d881f99c9ddd..2beff03b2429 100644
--- a/arch/score/Kconfig
+++ b/arch/score/Kconfig
@@ -16,6 +16,7 @@ config SCORE
 	select MODULES_USE_ELF_REL
 	select CLONE_BACKWARDS
 	select CPU_NO_EFFICIENT_FFS
+	select HAVE_ARCH_FREE_INITRD_MEM
 
 choice
 	prompt "System type"
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)
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 8767e45f1b2b..06d543e35caf 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -18,6 +18,7 @@ config SPARC
 	select OF_PROMTREE
 	select HAVE_IDE
 	select HAVE_OPROFILE
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_KGDB if !SMP || SPARC64
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_EXIT_THREAD
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index ef9d403cbbe4..7fb36c15762c 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -16,6 +16,7 @@ config TILE
 	select GENERIC_PENDING_IRQ if SMP
 	select GENERIC_STRNCPY_FROM_USER
 	select GENERIC_STRNLEN_USER
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_SECCOMP_FILTER
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_CONTEXT_TRACKING
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)
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 462e59a7ae78..4da24cf467de 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -4,6 +4,7 @@ config UNICORE32
 	select ARCH_HAS_DEVMEM_IS_ALLOWED
 	select ARCH_MIGHT_HAVE_PC_PARPORT
 	select ARCH_MIGHT_HAVE_PC_SERIO
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_MEMBLOCK
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_KERNEL_GZIP
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0fa71a78ec99..51ce64e6d848 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -111,6 +111,7 @@ config X86
 	select HAVE_ALIGNED_STRUCT_PAGE		if SLUB
 	select HAVE_ARCH_AUDITSYSCALL
 	select HAVE_ARCH_HUGE_VMAP		if X86_64 || X86_PAE
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_JUMP_LABEL
 	select HAVE_ARCH_KASAN			if X86_64
 	select HAVE_ARCH_KGDB
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index c921e8bccdc8..01a4a0e42118 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -16,6 +16,7 @@ config XTENSA
 	select GENERIC_PCI_IOMAP
 	select GENERIC_SCHED_CLOCK
 	select GENERIC_STRNCPY_FROM_USER if KASAN
+	select HAVE_ARCH_FREE_INITRD_MEM
 	select HAVE_ARCH_KASAN if MMU
 	select HAVE_CC_STACKPROTECTOR
 	select HAVE_DEBUG_KMEMLEAK
diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..d319058eb464 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>
 
+#ifndef CONFIG_HAVE_ARCH_FREE_INITRD_MEM
+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..7a94f6df39bf 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 ""
+
+config HAVE_ARCH_FREE_INITRD_MEM
+	bool
+	default n
-- 
2.16.2

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 15:26   ` [PATCH] Extract initrd free logic from arch-specific code Shea Levy
@ 2018-03-28 15:58     ` Rob Landley
  2018-03-28 16:04       ` Shea Levy
  2018-03-28 16:48       ` Russell King - ARM Linux
  2018-03-28 16:55     ` Kees Cook
                       ` (2 subsequent siblings)
  3 siblings, 2 replies; 128+ messages in thread
From: Rob Landley @ 2018-03-28 15:58 UTC (permalink / raw)
  To: Shea Levy, linux-riscv, linux-kernel
  Cc: Christoph Hellwig, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Vineet Gupta, Russell King, Catalin Marinas,
	Will Deacon, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
	Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck,
	Fenghua Yu, Geert Uytterhoeven, James Hogan, Michal Simek,
	Ralf Baechle, David Howells, Ley Foon Tan, Jonas Bonn,
	Stefan Kristiansson, Stafford Horne, James E.J. Bottomley,
	Helge Deller, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Palmer Dabbelt, Albert Ou, Martin Schwidefsky,
	Heiko Carstens, Chen Liqin, Lennox Wu, Rich Felker,
	David S. Miller, Jeff Dike, Richard Weinberger, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, linux-alpha, linux-snps-arc,
	linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev,
	linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64,
	linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev,
	openrisc, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, user-mode-linux-devel, user-mode-linux-user,
	linux-xtensa

On 03/28/2018 10:26 AM, Shea Levy wrote:
> Now only those architectures that have custom initrd free requirements
> need to define free_initrd_mem.
...
> --- 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
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 3f972e83909b..19d1c5594e2d 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -47,6 +47,7 @@ config ARM
>  	select HARDIRQS_SW_RESEND
>  	select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
>  	select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
> +	select HAVE_ARCH_FREE_INITRD_MEM
>  	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
>  	select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
>  	select HAVE_ARCH_MMAP_RND_BITS if MMU

Isn't this why weak symbols were invented?

Confused,

Rob

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 15:58     ` Rob Landley
@ 2018-03-28 16:04       ` Shea Levy
  2018-03-28 16:48       ` Russell King - ARM Linux
  1 sibling, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 16:04 UTC (permalink / raw)
  To: Rob Landley, linux-riscv, linux-kernel
  Cc: Christoph Hellwig, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Vineet Gupta, Russell King, Catalin Marinas,
	Will Deacon, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
	Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck,
	Fenghua Yu, Geert Uytterhoeven, James Hogan, Michal Simek,
	Ralf Baechle, David Howells, Ley Foon Tan, Jonas Bonn,
	Stefan Kristiansson, Stafford Horne, James E.J. Bottomley,
	Helge Deller, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Palmer Dabbelt, Albert Ou, Martin Schwidefsky,
	Heiko Carstens, Chen Liqin, Lennox Wu, Rich Felker,
	David S. Miller, Jeff Dike, Richard Weinberger, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, linux-alpha, linux-snps-arc,
	linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev,
	linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64,
	linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev,
	openrisc, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, user-mode-linux-devel, user-mode-linux-user,
	linux-xtensa

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

Hi Rob,

Rob Landley <rob@landley.net> writes:

> On 03/28/2018 10:26 AM, Shea Levy wrote:
>> Now only those architectures that have custom initrd free requirements
>> need to define free_initrd_mem.
> ...
>> --- 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
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index 3f972e83909b..19d1c5594e2d 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -47,6 +47,7 @@ config ARM
>>  	select HARDIRQS_SW_RESEND
>>  	select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
>>  	select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
>> +	select HAVE_ARCH_FREE_INITRD_MEM
>>  	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
>>  	select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
>>  	select HAVE_ARCH_MMAP_RND_BITS if MMU
>
> Isn't this why weak symbols were invented?
>

This approach was suggested by Christoph Hellwig upthread, and seems to
have some precedent elsewhere (e.g. strncasecmp), but I agree weak
symbols seem appropriate here. I'm happy to implement either approach!

>
> Confused,
>
> Rob

Thanks,
Shea

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

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 15:58     ` Rob Landley
  2018-03-28 16:04       ` Shea Levy
@ 2018-03-28 16:48       ` Russell King - ARM Linux
  2018-03-28 19:04         ` Rob Landley
  1 sibling, 1 reply; 128+ messages in thread
From: Russell King - ARM Linux @ 2018-03-28 16:48 UTC (permalink / raw)
  To: Rob Landley
  Cc: Shea Levy, linux-riscv, linux-kernel, Christoph Hellwig,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
	Catalin Marinas, Will Deacon, Mark Salter, Aurelien Jacquiot,
	Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan,
	Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan,
	Jonas Bonn, Stefan Kristiansson, Stafford Horne,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
	Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu,
	Rich Felker, David S. Miller, Jeff Dike, Richard Weinberger,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, linux-alpha, linux-snps-arc,
	linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev,
	linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64,
	linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev,
	openrisc, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, user-mode-linux-devel, user-mode-linux-user,
	linux-xtensa

On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
> On 03/28/2018 10:26 AM, Shea Levy wrote:
> > Now only those architectures that have custom initrd free requirements
> > need to define free_initrd_mem.
> ...
> > --- 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
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 3f972e83909b..19d1c5594e2d 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -47,6 +47,7 @@ config ARM
> >  	select HARDIRQS_SW_RESEND
> >  	select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
> >  	select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
> > +	select HAVE_ARCH_FREE_INITRD_MEM
> >  	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
> >  	select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
> >  	select HAVE_ARCH_MMAP_RND_BITS if MMU
> 
> Isn't this why weak symbols were invented?

Weak symbols means that we end up with both the weakly-referenced code
and the arch code in the kernel image.  That's fine if the weak code
is small.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 15:26   ` [PATCH] Extract initrd free logic from arch-specific code Shea Levy
  2018-03-28 15:58     ` Rob Landley
@ 2018-03-28 16:55     ` Kees Cook
  2018-03-29  1:12       ` Wei Yang
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
  2018-03-30 11:15     ` [PATCH] Extract initrd free logic from arch-specific code Ingo Molnar
  3 siblings, 1 reply; 128+ messages in thread
From: Kees Cook @ 2018-03-28 16:55 UTC (permalink / raw)
  To: Shea Levy
  Cc: linux-riscv, LKML, Christoph Hellwig, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, Vineet Gupta, Russell King,
	Catalin Marinas, Will Deacon, Mark Salter, Aurelien Jacquiot,
	Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan,
	Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan,
	Jonas Bonn, Stefan Kristiansson, Stafford Horne,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
	Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu,
	Rich Felker, David S. Miller, Jeff Dike, Richard Weinberger,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	X86 ML, Chris Zankel, Max Filippov, Kate Stewart,
	Greg Kroah-Hartman, Philippe Ombredanne, Eugeniy Paltsev,
	Al Viro, Vladimir Murzin, Linus Walleij, Michal Hocko,
	Andrew Morton, Sudip Mukherjee, Marc Zyngier, Rob Herring,
	Vlastimil Babka, Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Rob Landley, Florian Fainelli, linux-alpha,
	linux-snps-arc, linux-arm-kernel, adi-buildroot-devel,
	linux-c6x-dev, linux-cris-kernel, uclinux-h8-devel,
	linux-hexagon, linux-ia64, linux-m68k, linux-metag,
	Linux MIPS Mailing List, linux-am33-list, nios2-dev, openrisc,
	linux-parisc, PowerPC, linux-s390, linux-sh, sparclinux,
	user-mode-linux-devel, user-mode-linux-user, linux-xtensa

On Wed, Mar 28, 2018 at 8:26 AM, Shea Levy <shea@shealevy.com> wrote:
> Now only those architectures that have custom initrd free requirements
> need to define free_initrd_mem.
>
> Signed-off-by: Shea Levy <shea@shealevy.com>

Yay consolidation! :)

> --- a/usr/Kconfig
> +++ b/usr/Kconfig
> @@ -233,3 +233,7 @@ config INITRAMFS_COMPRESSION
>         default ".lzma" if RD_LZMA
>         default ".bz2"  if RD_BZIP2
>         default ""
> +
> +config HAVE_ARCH_FREE_INITRD_MEM
> +       bool
> +       default n

If you keep the Kconfig, you can leave off "default n", and I'd
suggest adding a help section just to describe what the per-arch
responsibilities are when select-ing the config. (See
HAVE_ARCH_SECCOMP_FILTER for an example.)

-Kees

-- 
Kees Cook
Pixel Security

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 16:48       ` Russell King - ARM Linux
@ 2018-03-28 19:04         ` Rob Landley
  2018-03-28 22:14           ` Russell King - ARM Linux
  0 siblings, 1 reply; 128+ messages in thread
From: Rob Landley @ 2018-03-28 19:04 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Shea Levy, linux-riscv, linux-kernel, Christoph Hellwig,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
	Catalin Marinas, Will Deacon, Mark Salter, Aurelien Jacquiot,
	Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan,
	Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan,
	Jonas Bonn, Stefan Kristiansson, Stafford Horne,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
	Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu,
	Rich Felker, David S. Miller, Jeff Dike, Richard Weinberger,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, linux-alpha, linux-snps-arc,
	linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev,
	linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64,
	linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev,
	openrisc, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, user-mode-linux-devel, user-mode-linux-user,
	linux-xtensa



On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
> On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
>> On 03/28/2018 10:26 AM, Shea Levy wrote:
>>> Now only those architectures that have custom initrd free requirements
>>> need to define free_initrd_mem.
>> ...
>>> --- 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
>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>> index 3f972e83909b..19d1c5594e2d 100644
>>> --- a/arch/arm/Kconfig
>>> +++ b/arch/arm/Kconfig
>>> @@ -47,6 +47,7 @@ config ARM
>>>  	select HARDIRQS_SW_RESEND
>>>  	select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
>>>  	select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
>>> +	select HAVE_ARCH_FREE_INITRD_MEM
>>>  	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
>>>  	select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
>>>  	select HAVE_ARCH_MMAP_RND_BITS if MMU
>>
>> Isn't this why weak symbols were invented?
> 
> Weak symbols means that we end up with both the weakly-referenced code
> and the arch code in the kernel image.  That's fine if the weak code
> is small.

The kernel's been able to build with link time garbage collection since 2016:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d

Wouldn't that remove the unused one?

Rob

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

* [PATCH v4 0/16] Generic initrd_free_mem
  2018-03-28 15:26   ` [PATCH] Extract initrd free logic from arch-specific code Shea Levy
  2018-03-28 15:58     ` Rob Landley
  2018-03-28 16:55     ` Kees Cook
@ 2018-03-28 20:36     ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 01/16] initrd: Add weakly-linked generic free_initrd_mem Shea Levy
                         ` (16 more replies)
  2018-03-30 11:15     ` [PATCH] Extract initrd free logic from arch-specific code Ingo Molnar
  3 siblings, 17 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel

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.

v4: Use weak symbols instead of Kconfig.
v3: Make the generic path opt-out instead of opt-in.
v2: Mark generic free_initrd_mem __init.

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

* [PATCH v4 01/16] initrd: Add weakly-linked generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 02/16] riscv: Use " Shea Levy
                         ` (15 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Andrew Morton, Arnd Bergmann, Al Viro,
	Greg Kroah-Hartman, Daniel Thompson, Deepa Dinamani,
	Stafford Horne

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 init/initramfs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..c8fe150f958a 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
 #include <linux/initrd.h>
 #include <linux/kexec.h>
 
+void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
+{
+       free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+
 static void __init free_initrd(void)
 {
 #ifdef CONFIG_KEXEC_CORE
-- 
2.16.2

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

* [PATCH v4 02/16] riscv: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
  2018-03-28 20:36       ` [PATCH v4 01/16] initrd: Add weakly-linked generic free_initrd_mem Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-29  9:52         ` Daniel Thompson
  2018-03-28 20:36       ` [PATCH v4 03/16] alpha: " Shea Levy
                         ` (14 subsequent siblings)
  16 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Palmer Dabbelt, Albert Ou

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

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] 128+ messages in thread

* [PATCH v4 03/16] alpha: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
  2018-03-28 20:36       ` [PATCH v4 01/16] initrd: Add weakly-linked generic free_initrd_mem Shea Levy
  2018-03-28 20:36       ` [PATCH v4 02/16] riscv: Use " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 04/16] arc: " Shea Levy
                         ` (13 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Richard Henderson, Ivan Kokshaysky, Matt Turner,
	Philippe Ombredanne, Thomas Gleixner, Greg Kroah-Hartman,
	Kate Stewart, linux-alpha

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

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] 128+ messages in thread

* [PATCH v4 04/16] arc: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (2 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 03/16] alpha: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 05/16] c6x: " Shea Levy
                         ` (12 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Vineet Gupta, Eugeniy Paltsev, linux-snps-arc

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

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] 128+ messages in thread

* [PATCH v4 05/16] c6x: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (3 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 04/16] arc: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 06/16] frv: " Shea Levy
                         ` (11 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Mark Salter, Aurelien Jacquiot, linux-c6x-dev

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

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] 128+ messages in thread

* [PATCH v4 06/16] frv: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (4 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 05/16] c6x: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 07/16] h8300: " Shea Levy
                         ` (10 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Ingo Molnar, Michal Hocko, Andrew Morton, Ralf Baechle

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

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] 128+ messages in thread

* [PATCH v4 07/16] h8300: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (5 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 06/16] frv: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 08/16] m32r: " Shea Levy
                         ` (9 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Yoshinori Sato, Michal Hocko, Ingo Molnar,
	Kate Stewart, Greg Kroah-Hartman, Thomas Gleixner,
	uclinux-h8-devel

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

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] 128+ messages in thread

* [PATCH v4 08/16] m32r: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (6 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 07/16] h8300: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 09/16] m68k: " Shea Levy
                         ` (8 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Philippe Ombredanne, Thomas Gleixner,
	Greg Kroah-Hartman, Kate Stewart

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

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] 128+ messages in thread

* [PATCH v4 09/16] m68k: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (7 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 08/16] m32r: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-29  6:55         ` Geert Uytterhoeven
  2018-03-28 20:36       ` [PATCH v4 10/16] microblaze: " Shea Levy
                         ` (7 subsequent siblings)
  16 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Geert Uytterhoeven, Greg Kroah-Hartman,
	Thomas Gleixner, Kate Stewart, Philippe Ombredanne, linux-m68k

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

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] 128+ messages in thread

* [PATCH v4 10/16] microblaze: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (8 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 09/16] m68k: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 11/16] nios2: " Shea Levy
                         ` (6 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Michal Simek, Rob Herring

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

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] 128+ messages in thread

* [PATCH v4 11/16] nios2: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (9 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 10/16] microblaze: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 12/16] openrisc: " Shea Levy
                         ` (5 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Ley Foon Tan, nios2-dev

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

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] 128+ messages in thread

* [PATCH v4 12/16] openrisc: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (10 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 11/16] nios2: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 13/16] parisc: " Shea Levy
                         ` (4 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Jonas Bonn, Stefan Kristiansson, Stafford Horne, openrisc

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

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] 128+ messages in thread

* [PATCH v4 13/16] parisc: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (11 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 12/16] openrisc: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 14/16] powerpc: " Shea Levy
                         ` (3 subsequent siblings)
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, James E.J. Bottomley, Helge Deller, Thomas Gleixner,
	Philippe Ombredanne, Kate Stewart, Greg Kroah-Hartman,
	linux-parisc

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

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] 128+ messages in thread

* [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (12 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 13/16] parisc: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:44         ` Joe Perches
  2018-03-28 20:36       ` [PATCH v4 15/16] sh: " Shea Levy
                         ` (2 subsequent siblings)
  16 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Michal Hocko, Vlastimil Babka, Andrew Morton,
	Dan Williams, Christophe Leroy, Oliver O'Halloran,
	Joe Perches, linuxppc-dev

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

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] 128+ messages in thread

* [PATCH v4 15/16] sh: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (13 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 14/16] powerpc: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-28 20:36       ` [PATCH v4 16/16] um: " Shea Levy
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Yoshinori Sato, Rich Felker, Vlastimil Babka,
	Andrew Morton, Michal Hocko, Dan Williams, linux-sh

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

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] 128+ messages in thread

* [PATCH v4 16/16] um: Use generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (14 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 15/16] sh: " Shea Levy
@ 2018-03-28 20:36       ` Shea Levy
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
  16 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:36 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Jeff Dike, Richard Weinberger, Andrew Morton,
	Ingo Molnar, Michal Hocko, Ralf Baechle, user-mode-linux-devel,
	user-mode-linux-user

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

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] 128+ messages in thread

* Re: [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.
  2018-03-28 20:36       ` [PATCH v4 14/16] powerpc: " Shea Levy
@ 2018-03-28 20:44         ` Joe Perches
  2018-03-28 20:53           ` Shea Levy
  0 siblings, 1 reply; 128+ messages in thread
From: Joe Perches @ 2018-03-28 20:44 UTC (permalink / raw)
  To: Shea Levy, linux-riscv, linux-kernel
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Michal Hocko, Vlastimil Babka, Andrew Morton, Dan Williams,
	Christophe Leroy, Oliver O'Halloran, linuxppc-dev

On Wed, 2018-03-28 at 16:36 -0400, Shea Levy wrote:
> Signed-off-by: Shea Levy <shea@shealevy.com>

Most people seem to want some form of commit message
and not just your sign-off.

And btw:

It seems you used get_maintainer to determine who to
send these patches to.

I suggest you add --nogit and --nogit-fallback to the
get_maintainer command line you use to avoid sending
these patches to people like me that have done drive-by
cleanup work on these files.

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

* Re: [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.
  2018-03-28 20:44         ` Joe Perches
@ 2018-03-28 20:53           ` Shea Levy
  2018-03-29 13:19             ` Michael Ellerman
  0 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-03-28 20:53 UTC (permalink / raw)
  To: Joe Perches, linux-riscv, linux-kernel
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Michal Hocko, Vlastimil Babka, Andrew Morton, Dan Williams,
	Christophe Leroy, Oliver O'Halloran, linuxppc-dev

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

Joe Perches <joe@perches.com> writes:

> On Wed, 2018-03-28 at 16:36 -0400, Shea Levy wrote:
>> Signed-off-by: Shea Levy <shea@shealevy.com>
>
> Most people seem to want some form of commit message
> and not just your sign-off.
>

Ah, if the subject is insufficient I can add some more detail.

>
> And btw:
>
> It seems you used get_maintainer to determine who to
> send these patches to.
>
> I suggest you add --nogit and --nogit-fallback to the
> get_maintainer command line you use to avoid sending
> these patches to people like me that have done drive-by
> cleanup work on these files.

Whoops, thanks for the tip and sorry for the noise!

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

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 19:04         ` Rob Landley
@ 2018-03-28 22:14           ` Russell King - ARM Linux
  2018-03-28 22:37             ` Oliver
  2018-03-29 16:39             ` Rob Landley
  0 siblings, 2 replies; 128+ messages in thread
From: Russell King - ARM Linux @ 2018-03-28 22:14 UTC (permalink / raw)
  To: Rob Landley
  Cc: Shea Levy, linux-riscv, linux-kernel, Christoph Hellwig,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
	Catalin Marinas, Will Deacon, Mark Salter, Aurelien Jacquiot,
	Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan,
	Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan,
	Jonas Bonn, Stefan Kristiansson, Stafford Horne,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
	Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu,
	Rich Felker, David S. Miller, Jeff Dike, Richard Weinberger,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, linux-alpha, linux-snps-arc,
	linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev,
	linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64,
	linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev,
	openrisc, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, user-mode-linux-devel, user-mode-linux-user,
	linux-xtensa

On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:
> 
> 
> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
> > On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
> >> On 03/28/2018 10:26 AM, Shea Levy wrote:
> >>> Now only those architectures that have custom initrd free requirements
> >>> need to define free_initrd_mem.
> >> ...
> >>> --- 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
> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >>> index 3f972e83909b..19d1c5594e2d 100644
> >>> --- a/arch/arm/Kconfig
> >>> +++ b/arch/arm/Kconfig
> >>> @@ -47,6 +47,7 @@ config ARM
> >>>  	select HARDIRQS_SW_RESEND
> >>>  	select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
> >>>  	select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
> >>> +	select HAVE_ARCH_FREE_INITRD_MEM
> >>>  	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
> >>>  	select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
> >>>  	select HAVE_ARCH_MMAP_RND_BITS if MMU
> >>
> >> Isn't this why weak symbols were invented?
> > 
> > Weak symbols means that we end up with both the weakly-referenced code
> > and the arch code in the kernel image.  That's fine if the weak code
> > is small.
> 
> The kernel's been able to build with link time garbage collection since 2016:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
> 
> Wouldn't that remove the unused one?

Probably, if anyone bothered to use that, which they don't.

LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
what I can see, nothing selects it.  Therefore, the symbol is always
disabled, and so the feature never gets used in mainline kernels.

Brings up the obvious question - why is it there if it's completely
unused?  (Maybe to cause confusion, and allowing a justification
for __weak ?)

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 22:14           ` Russell King - ARM Linux
@ 2018-03-28 22:37             ` Oliver
  2018-03-29  0:23               ` Nicholas Piggin
  2018-03-29 15:27               ` Russell King - ARM Linux
  2018-03-29 16:39             ` Rob Landley
  1 sibling, 2 replies; 128+ messages in thread
From: Oliver @ 2018-03-28 22:37 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Rob Landley, Shea Levy, linux-riscv, linux-kernel,
	Christoph Hellwig, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Vineet Gupta, Catalin Marinas, Will Deacon,
	Mark Salter, Aurelien Jacquiot, Mikael Starvik, Jesper Nilsson,
	Yoshinori Sato, Richard Kuo, Tony Luck, Fenghua Yu,
	Geert Uytterhoeven, James Hogan, Michal Simek, Ralf Baechle,
	David Howells, Ley Foon Tan, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, James E.J. Bottomley, Helge Deller,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Palmer Dabbelt, Albert Ou, Martin Schwidefsky, Heiko Carstens,
	Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Jeff Dike,
	Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, Chris Zankel, Max Filippov, Kate Stewart,
	Greg Kroah-Hartman, Philippe Ombredanne, Eugeniy Paltsev,
	Al Viro, Vladimir Murzin, Linus Walleij, Michal Hocko,
	Andrew Morton, Sudip Mukherjee, Marc Zyngier, Rob Herring,
	Kees Cook, Vlastimil Babka, Balbir Singh, Christophe Leroy,
	Joe Perches, Dan Williams, Wei Yang, Christian König,
	Arnd Bergmann, Deepa Dinamani, Daniel Thompson, Florian Fainelli,
	linux-alpha, linux-snps-arc, linux-arm-kernel,
	adi-buildroot-devel, linux-c6x-dev, linux-cris-kernel,
	uclinux-h8-devel, linux-hexagon, linux-ia64, linux-m68k,
	linux-metag, linux-mips, linux-am33-list, nios2-dev, openrisc,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh, sparclinux,
	user-mode-linux-devel, user-mode-linux-user, linux-xtensa,
	Nicholas Piggin

On Thu, Mar 29, 2018 at 9:14 AM, Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:
> On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:
>>
>>
>> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
>> > On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
>> >> On 03/28/2018 10:26 AM, Shea Levy wrote:
>> >>> Now only those architectures that have custom initrd free requirements
>> >>> need to define free_initrd_mem.
>> >> ...
>> >>> --- 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
>> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> >>> index 3f972e83909b..19d1c5594e2d 100644
>> >>> --- a/arch/arm/Kconfig
>> >>> +++ b/arch/arm/Kconfig
>> >>> @@ -47,6 +47,7 @@ config ARM
>> >>>   select HARDIRQS_SW_RESEND
>> >>>   select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
>> >>>   select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
>> >>> + select HAVE_ARCH_FREE_INITRD_MEM
>> >>>   select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
>> >>>   select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
>> >>>   select HAVE_ARCH_MMAP_RND_BITS if MMU
>> >>
>> >> Isn't this why weak symbols were invented?
>> >
>> > Weak symbols means that we end up with both the weakly-referenced code
>> > and the arch code in the kernel image.  That's fine if the weak code
>> > is small.
>>
>> The kernel's been able to build with link time garbage collection since 2016:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
>>
>> Wouldn't that remove the unused one?
>
> Probably, if anyone bothered to use that, which they don't.
>
> LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
> what I can see, nothing selects it.  Therefore, the symbol is always
> disabled, and so the feature never gets used in mainline kernels.
>
> Brings up the obvious question - why is it there if it's completely
> unused?  (Maybe to cause confusion, and allowing a justification
> for __weak ?)

IIRC Nick had some patches to do the arch enablement for powerpc, but
I'm not sure what happened to them though. I suspect it just fell down
Nick's ever growing TODO list.

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 22:37             ` Oliver
@ 2018-03-29  0:23               ` Nicholas Piggin
  2018-03-29 15:27               ` Russell King - ARM Linux
  1 sibling, 0 replies; 128+ messages in thread
From: Nicholas Piggin @ 2018-03-29  0:23 UTC (permalink / raw)
  To: Oliver
  Cc: Russell King - ARM Linux, Rob Landley, Shea Levy, linux-riscv,
	linux-kernel, Christoph Hellwig, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, Vineet Gupta, Catalin Marinas,
	Will Deacon, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
	Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck,
	Fenghua Yu, Geert Uytterhoeven, James Hogan, Michal Simek,
	Ralf Baechle, David Howells, Ley Foon Tan, Jonas Bonn,
	Stefan Kristiansson, Stafford Horne, James E.J. Bottomley,
	Helge Deller, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Palmer Dabbelt, Albert Ou, Martin Schwidefsky,
	Heiko Carstens, Chen Liqin, Lennox Wu, Rich Felker,
	David S. Miller, Jeff Dike, Richard Weinberger, Guan Xuetao,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Chris Zankel,
	Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches, Dan Williams,
	Wei Yang, Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, linux-alpha, linux-snps-arc,
	linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev,
	linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64,
	linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev,
	openrisc, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, user-mode-linux-devel, user-mode-linux-user,
	linux-xtensa

On Thu, 29 Mar 2018 09:37:52 +1100
Oliver <oohall@gmail.com> wrote:

> On Thu, Mar 29, 2018 at 9:14 AM, Russell King - ARM Linux
> <linux@armlinux.org.uk> wrote:
> > On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:  
> >>
> >>
> >> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:  
> >> > On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:  
> >> >> On 03/28/2018 10:26 AM, Shea Levy wrote:  
> >> >>> Now only those architectures that have custom initrd free requirements
> >> >>> need to define free_initrd_mem.  
> >> >> ...  
> >> >>> --- 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
> >> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >> >>> index 3f972e83909b..19d1c5594e2d 100644
> >> >>> --- a/arch/arm/Kconfig
> >> >>> +++ b/arch/arm/Kconfig
> >> >>> @@ -47,6 +47,7 @@ config ARM
> >> >>>   select HARDIRQS_SW_RESEND
> >> >>>   select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
> >> >>>   select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
> >> >>> + select HAVE_ARCH_FREE_INITRD_MEM
> >> >>>   select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
> >> >>>   select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
> >> >>>   select HAVE_ARCH_MMAP_RND_BITS if MMU  
> >> >>
> >> >> Isn't this why weak symbols were invented?  
> >> >
> >> > Weak symbols means that we end up with both the weakly-referenced code
> >> > and the arch code in the kernel image.  That's fine if the weak code
> >> > is small.  
> >>
> >> The kernel's been able to build with link time garbage collection since 2016:
> >>
> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
> >>
> >> Wouldn't that remove the unused one?  
> >
> > Probably, if anyone bothered to use that, which they don't.
> >
> > LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
> > what I can see, nothing selects it.  Therefore, the symbol is always
> > disabled, and so the feature never gets used in mainline kernels.
> >
> > Brings up the obvious question - why is it there if it's completely
> > unused?  (Maybe to cause confusion, and allowing a justification
> > for __weak ?)  

Well weak symbols have been used long before it was added.

> IIRC Nick had some patches to do the arch enablement for powerpc, but
> I'm not sure what happened to them though. I suspect it just fell down
> Nick's ever growing TODO list.

Yeah I had started some patches for powerpc and x86 that have ended up
on the back burner. There's been some MIPS people playing with it too.

For the kernel, LD_DEAD_CODE_DATA_ELIMINATION is not great. It can save
a little, but you get issues like any exception table entry or bug table
entry in a function will create a reference back to the function, so the
linker can't trim it away even if nothing else references it.

I'll try to take another look at it within the next few months and
remove it if I can't make progress.

Nicolas Pitre has been doing some much better work on dead code using
real LTO.

Thanks,
Nick

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 16:55     ` Kees Cook
@ 2018-03-29  1:12       ` Wei Yang
  0 siblings, 0 replies; 128+ messages in thread
From: Wei Yang @ 2018-03-29  1:12 UTC (permalink / raw)
  To: Kees Cook
  Cc: Shea Levy, linux-riscv, LKML, Christoph Hellwig,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
	Russell King, Catalin Marinas, Will Deacon, Mark Salter,
	Aurelien Jacquiot, Mikael Starvik, Jesper Nilsson,
	Yoshinori Sato, Richard Kuo, Tony Luck, Fenghua Yu,
	Geert Uytterhoeven, James Hogan, Michal Simek, Ralf Baechle,
	David Howells, Ley Foon Tan, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, James E.J. Bottomley, Helge Deller,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Palmer Dabbelt, Albert Ou, Martin Schwidefsky, Heiko Carstens,
	Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Jeff Dike,
	Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, X86 ML, Chris Zankel, Max Filippov, Kate Stewart,
	Greg Kroah-Hartman, Philippe Ombredanne, Eugeniy Paltsev,
	Al Viro, Vladimir Murzin, Linus Walleij, Michal Hocko,
	Andrew Morton, Sudip Mukherjee, Marc Zyngier, Rob Herring,
	Vlastimil Babka, Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Rob Landley, Florian Fainelli, linux-alpha,
	linux-snps-arc, linux-arm-kernel, adi-buildroot-devel,
	linux-c6x-dev, linux-cris-kernel, uclinux-h8-devel,
	linux-hexagon, linux-ia64, linux-m68k, linux-metag,
	Linux MIPS Mailing List, linux-am33-list, nios2-dev, openrisc,
	linux-parisc, PowerPC, linux-s390, linux-sh, sparclinux,
	user-mode-linux-devel, user-mode-linux-user, linux-xtensa

On Wed, Mar 28, 2018 at 09:55:07AM -0700, Kees Cook wrote:
>On Wed, Mar 28, 2018 at 8:26 AM, Shea Levy <shea@shealevy.com> wrote:
>> Now only those architectures that have custom initrd free requirements
>> need to define free_initrd_mem.
>>
>> Signed-off-by: Shea Levy <shea@shealevy.com>
>
>Yay consolidation! :)
>
>> --- a/usr/Kconfig
>> +++ b/usr/Kconfig
>> @@ -233,3 +233,7 @@ config INITRAMFS_COMPRESSION
>>         default ".lzma" if RD_LZMA
>>         default ".bz2"  if RD_BZIP2
>>         default ""
>> +
>> +config HAVE_ARCH_FREE_INITRD_MEM
>> +       bool
>> +       default n
>
>If you keep the Kconfig, you can leave off "default n", and I'd
>suggest adding a help section just to describe what the per-arch
>responsibilities are when select-ing the config. (See
>HAVE_ARCH_SECCOMP_FILTER for an example.)
>

One question about this change.

The original code would "select" HAVE_ARCH_FREE_INITRD_MEM on those arch.
After this change, we need to manually "select" this?

>-Kees
>
>-- 
>Kees Cook
>Pixel Security

-- 
Wei Yang
Help you, Help me

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

* Re: [PATCH v4 09/16] m68k: Use generic free_initrd_mem.
  2018-03-28 20:36       ` [PATCH v4 09/16] m68k: " Shea Levy
@ 2018-03-29  6:55         ` Geert Uytterhoeven
  0 siblings, 0 replies; 128+ messages in thread
From: Geert Uytterhoeven @ 2018-03-29  6:55 UTC (permalink / raw)
  To: Shea Levy
  Cc: linux-riscv, Linux Kernel Mailing List, Greg Kroah-Hartman,
	Thomas Gleixner, Kate Stewart, Philippe Ombredanne, linux-m68k

On Wed, Mar 28, 2018 at 10:36 PM, Shea Levy <shea@shealevy.com> wrote:
> Signed-off-by: Shea Levy <shea@shealevy.com>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

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] 128+ messages in thread

* Re: [PATCH v4 02/16] riscv: Use generic free_initrd_mem.
  2018-03-28 20:36       ` [PATCH v4 02/16] riscv: Use " Shea Levy
@ 2018-03-29  9:52         ` Daniel Thompson
  2018-03-29 11:12           ` Shea Levy
  0 siblings, 1 reply; 128+ messages in thread
From: Daniel Thompson @ 2018-03-29  9:52 UTC (permalink / raw)
  To: Shea Levy, linux-riscv, linux-kernel; +Cc: Palmer Dabbelt, Albert Ou

On 28/03/18 21:36, Shea Levy wrote:
> Signed-off-by: Shea Levy <shea@shealevy.com>
> ---
>   arch/riscv/mm/init.c | 6 ------
>   1 file changed, 6 deletions(-)
> 
> 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 */

This looks like a change of behavior since the weakly defined code does 
not implement a nop.

I'm not saying the change is wrong, but if this is a deliberate bug fix 
then we need more than an empty commit message to explain what is 
happening here.


Daniel.

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

* Re: [PATCH v4 02/16] riscv: Use generic free_initrd_mem.
  2018-03-29  9:52         ` Daniel Thompson
@ 2018-03-29 11:12           ` Shea Levy
  0 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:12 UTC (permalink / raw)
  To: Daniel Thompson, linux-riscv, linux-kernel; +Cc: Palmer Dabbelt, Albert Ou

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

Daniel Thompson <daniel.thompson@linaro.org> writes:

> On 28/03/18 21:36, Shea Levy wrote:
>> Signed-off-by: Shea Levy <shea@shealevy.com>
>> ---
>>   arch/riscv/mm/init.c | 6 ------
>>   1 file changed, 6 deletions(-)
>> 
>> 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 */
>
> This looks like a change of behavior since the weakly defined code does 
> not implement a nop.
>
> I'm not saying the change is wrong, but if this is a deliberate bug fix 
> then we need more than an empty commit message to explain what is 
> happening here.
>

Right, sorry, will re-send with a proper commit message here.

>
>
> Daniel.

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

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

* [PATCH v5 01/16] initrd: Add weakly-linked generic free_initrd_mem.
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
                         ` (15 preceding siblings ...)
  2018-03-28 20:36       ` [PATCH v4 16/16] um: " Shea Levy
@ 2018-03-29 11:31       ` Shea Levy
  2018-03-29 11:31         ` [PATCH v5 02/16] riscv: Free initrds with " Shea Levy
                           ` (15 more replies)
  16 siblings, 16 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:31 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy

This function is effectively identical across 14 architectures, and
the generic implementation is small enough to be negligible in the
architectures that do override it. Many of the remaining divergent
implementations can be included in the common code path in future,
further reducing code duplication and sharing improvements between
architectures.

v5: Add more complete commit messages.
v4: Use weak symbols instead of Kconfig.
v3: Make the generic path opt-out instead of opt-in.
v2: Mark generic free_initrd_mem __init.

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 init/initramfs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..c8fe150f958a 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
 #include <linux/initrd.h>
 #include <linux/kexec.h>
 
+void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
+{
+       free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+
 static void __init free_initrd(void)
 {
 #ifdef CONFIG_KEXEC_CORE
-- 
2.16.2

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

* [PATCH v5 02/16] riscv: Free initrds with generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
@ 2018-03-29 11:31         ` Shea Levy
  2018-03-29 11:31         ` [PATCH v5 03/16] alpha: Switch to " Shea Levy
                           ` (14 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:31 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Palmer Dabbelt, Albert Ou

Now that there is a generic implementation, riscv's noop stub can be
removed.

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

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] 128+ messages in thread

* [PATCH v5 03/16] alpha: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
  2018-03-29 11:31         ` [PATCH v5 02/16] riscv: Free initrds with " Shea Levy
@ 2018-03-29 11:31         ` Shea Levy
  2018-03-29 11:31         ` [PATCH v5 04/16] arc: " Shea Levy
                           ` (13 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:31 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 04/16] arc: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
  2018-03-29 11:31         ` [PATCH v5 02/16] riscv: Free initrds with " Shea Levy
  2018-03-29 11:31         ` [PATCH v5 03/16] alpha: Switch to " Shea Levy
@ 2018-03-29 11:31         ` Shea Levy
  2018-03-29 11:31         ` [PATCH v5 05/16] c6x: " Shea Levy
                           ` (12 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:31 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Vineet Gupta, linux-snps-arc

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 05/16] c6x: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (2 preceding siblings ...)
  2018-03-29 11:31         ` [PATCH v5 04/16] arc: " Shea Levy
@ 2018-03-29 11:31         ` Shea Levy
  2018-03-29 11:31         ` [PATCH v5 06/16] frv: " Shea Levy
                           ` (11 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:31 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Mark Salter, Aurelien Jacquiot, linux-c6x-dev

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 06/16] frv: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (3 preceding siblings ...)
  2018-03-29 11:31         ` [PATCH v5 05/16] c6x: " Shea Levy
@ 2018-03-29 11:31         ` Shea Levy
  2018-03-29 11:31         ` [PATCH v5 07/16] h8300: " Shea Levy
                           ` (10 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:31 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 07/16] h8300: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (4 preceding siblings ...)
  2018-03-29 11:31         ` [PATCH v5 06/16] frv: " Shea Levy
@ 2018-03-29 11:31         ` Shea Levy
  2018-03-29 11:31         ` [PATCH v5 08/16] m32r: " Shea Levy
                           ` (9 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:31 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Yoshinori Sato, uclinux-h8-devel

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 08/16] m32r: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (5 preceding siblings ...)
  2018-03-29 11:31         ` [PATCH v5 07/16] h8300: " Shea Levy
@ 2018-03-29 11:31         ` Shea Levy
  2018-03-29 11:32         ` [PATCH v5 09/16] m68k: " Shea Levy
                           ` (8 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:31 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 09/16] m68k: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (6 preceding siblings ...)
  2018-03-29 11:31         ` [PATCH v5 08/16] m32r: " Shea Levy
@ 2018-03-29 11:32         ` Shea Levy
  2018-03-29 11:32         ` [PATCH v5 10/16] microblaze: " Shea Levy
                           ` (7 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:32 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Geert Uytterhoeven, linux-m68k

The generic implementation is functionally identical.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/m68k/mm/init.c | 7 -------
 1 file changed, 7 deletions(-)

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] 128+ messages in thread

* [PATCH v5 10/16] microblaze: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (7 preceding siblings ...)
  2018-03-29 11:32         ` [PATCH v5 09/16] m68k: " Shea Levy
@ 2018-03-29 11:32         ` Shea Levy
  2018-03-29 11:32         ` [PATCH v5 11/16] nios2: " Shea Levy
                           ` (6 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:32 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Michal Simek

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 11/16] nios2: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (8 preceding siblings ...)
  2018-03-29 11:32         ` [PATCH v5 10/16] microblaze: " Shea Levy
@ 2018-03-29 11:32         ` Shea Levy
  2018-03-29 11:32         ` [PATCH v5 12/16] openrisc: " Shea Levy
                           ` (5 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:32 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Ley Foon Tan, nios2-dev

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 12/16] openrisc: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (9 preceding siblings ...)
  2018-03-29 11:32         ` [PATCH v5 11/16] nios2: " Shea Levy
@ 2018-03-29 11:32         ` Shea Levy
  2018-03-29 11:50           ` Stafford Horne
  2018-03-29 11:32         ` [PATCH v5 13/16] parisc: " Shea Levy
                           ` (4 subsequent siblings)
  15 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:32 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Jonas Bonn, Stefan Kristiansson, Stafford Horne, openrisc

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 13/16] parisc: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (10 preceding siblings ...)
  2018-03-29 11:32         ` [PATCH v5 12/16] openrisc: " Shea Levy
@ 2018-03-29 11:32         ` Shea Levy
  2018-03-29 11:32         ` [PATCH v5 14/16] powerpc: " Shea Levy
                           ` (3 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:32 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, James E.J. Bottomley, Helge Deller, linux-parisc

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 14/16] powerpc: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (11 preceding siblings ...)
  2018-03-29 11:32         ` [PATCH v5 13/16] parisc: " Shea Levy
@ 2018-03-29 11:32         ` Shea Levy
  2018-03-29 11:32         ` [PATCH v5 15/16] sh: " Shea Levy
                           ` (2 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:32 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 15/16] sh: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (12 preceding siblings ...)
  2018-03-29 11:32         ` [PATCH v5 14/16] powerpc: " Shea Levy
@ 2018-03-29 11:32         ` Shea Levy
  2018-03-29 16:26           ` Rich Felker
  2018-03-29 11:32         ` [PATCH v5 16/16] um: " Shea Levy
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
  15 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:32 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Yoshinori Sato, Rich Felker, linux-sh

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* [PATCH v5 16/16] um: Switch to generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (13 preceding siblings ...)
  2018-03-29 11:32         ` [PATCH v5 15/16] sh: " Shea Levy
@ 2018-03-29 11:32         ` Shea Levy
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-03-29 11:32 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Jeff Dike, Richard Weinberger, user-mode-linux-devel,
	user-mode-linux-user

The generic implementation is functionally identical.

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

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] 128+ messages in thread

* Re: [PATCH v5 12/16] openrisc: Switch to generic free_initrd_mem.
  2018-03-29 11:32         ` [PATCH v5 12/16] openrisc: " Shea Levy
@ 2018-03-29 11:50           ` Stafford Horne
  0 siblings, 0 replies; 128+ messages in thread
From: Stafford Horne @ 2018-03-29 11:50 UTC (permalink / raw)
  To: Shea Levy
  Cc: linux-riscv, linux-kernel, Jonas Bonn, Stefan Kristiansson, openrisc

On Thu, Mar 29, 2018 at 07:32:03AM -0400, Shea Levy wrote:
> The generic implementation is functionally identical.
> 
> Signed-off-by: Shea Levy <shea@shealevy.com>

Acked-by: Stafford Horne <shorne@gmail.com>

> ---
>  arch/openrisc/mm/init.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> 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	[flat|nested] 128+ messages in thread

* Re: [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.
  2018-03-28 20:53           ` Shea Levy
@ 2018-03-29 13:19             ` Michael Ellerman
  2018-04-01 15:01               ` Shea Levy
  0 siblings, 1 reply; 128+ messages in thread
From: Michael Ellerman @ 2018-03-29 13:19 UTC (permalink / raw)
  To: Shea Levy, Joe Perches, linux-riscv, linux-kernel
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michal Hocko,
	Vlastimil Babka, Andrew Morton, Dan Williams, Christophe Leroy,
	Oliver O'Halloran, linuxppc-dev

Shea Levy <shea@shealevy.com> writes:

> Joe Perches <joe@perches.com> writes:
>
>> On Wed, 2018-03-28 at 16:36 -0400, Shea Levy wrote:
>>> Signed-off-by: Shea Levy <shea@shealevy.com>
>>
>> Most people seem to want some form of commit message
>> and not just your sign-off.
>>
>
> Ah, if the subject is insufficient I can add some more detail.

Yeah please do.

Seeing this patch in isolation, with no change log, I might think it's
safe for me to just apply it.

But that would break the build because I don't have patch 1.

So for starters you need to explain that part, eg something like:

  A previous patch in the series added a weak definition of
  free_initrd_mem() in init/initramfs.c.

  The powerpc implementation is identical, so it can be removed allowing
  the generic version to be used.


Then you could also tell me if you did/didn't build/boot test it.

cheers

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 22:37             ` Oliver
  2018-03-29  0:23               ` Nicholas Piggin
@ 2018-03-29 15:27               ` Russell King - ARM Linux
  2018-03-29 15:43                 ` Geert Uytterhoeven
  2018-03-29 17:43                 ` Rob Landley
  1 sibling, 2 replies; 128+ messages in thread
From: Russell King - ARM Linux @ 2018-03-29 15:27 UTC (permalink / raw)
  To: Oliver
  Cc: Rob Landley, Shea Levy, linux-riscv, linux-kernel,
	Christoph Hellwig, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Vineet Gupta, Catalin Marinas, Will Deacon,
	Mark Salter, Aurelien Jacquiot, Mikael Starvik, Jesper Nilsson,
	Yoshinori Sato, Richard Kuo, Tony Luck, Fenghua Yu,
	Geert Uytterhoeven, James Hogan, Michal Simek, Ralf Baechle,
	David Howells, Ley Foon Tan, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, James E.J. Bottomley, Helge Deller,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Palmer Dabbelt, Albert Ou, Martin Schwidefsky, Heiko Carstens,
	Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Jeff Dike,
	Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, Chris Zankel, Max Filippov, Kate Stewart,
	Greg Kroah-Hartman, Philippe Ombredanne, Eugeniy Paltsev,
	Al Viro, Vladimir Murzin, Linus Walleij, Michal Hocko,
	Andrew Morton, Sudip Mukherjee, Marc Zyngier, Rob Herring,
	Kees Cook, Vlastimil Babka, Balbir Singh, Christophe Leroy,
	Joe Perches, Dan Williams, Wei Yang, Christian König,
	Arnd Bergmann, Deepa Dinamani, Daniel Thompson, Florian Fainelli,
	linux-alpha, linux-snps-arc, linux-arm-kernel,
	adi-buildroot-devel, linux-c6x-dev, linux-cris-kernel,
	uclinux-h8-devel, linux-hexagon, linux-ia64, linux-m68k,
	linux-metag, linux-mips, linux-am33-list, nios2-dev, openrisc,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh, sparclinux,
	user-mode-linux-devel, user-mode-linux-user, linux-xtensa,
	Nicholas Piggin

On Thu, Mar 29, 2018 at 09:37:52AM +1100, Oliver wrote:
> On Thu, Mar 29, 2018 at 9:14 AM, Russell King - ARM Linux
> <linux@armlinux.org.uk> wrote:
> > On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:
> >>
> >>
> >> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
> >> > On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
> >> >> On 03/28/2018 10:26 AM, Shea Levy wrote:
> >> >>> Now only those architectures that have custom initrd free requirements
> >> >>> need to define free_initrd_mem.
> >> >> ...
> >> >>> --- 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
> >> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >> >>> index 3f972e83909b..19d1c5594e2d 100644
> >> >>> --- a/arch/arm/Kconfig
> >> >>> +++ b/arch/arm/Kconfig
> >> >>> @@ -47,6 +47,7 @@ config ARM
> >> >>>   select HARDIRQS_SW_RESEND
> >> >>>   select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
> >> >>>   select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
> >> >>> + select HAVE_ARCH_FREE_INITRD_MEM
> >> >>>   select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
> >> >>>   select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
> >> >>>   select HAVE_ARCH_MMAP_RND_BITS if MMU
> >> >>
> >> >> Isn't this why weak symbols were invented?
> >> >
> >> > Weak symbols means that we end up with both the weakly-referenced code
> >> > and the arch code in the kernel image.  That's fine if the weak code
> >> > is small.
> >>
> >> The kernel's been able to build with link time garbage collection since 2016:
> >>
> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
> >>
> >> Wouldn't that remove the unused one?
> >
> > Probably, if anyone bothered to use that, which they don't.
> >
> > LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
> > what I can see, nothing selects it.  Therefore, the symbol is always
> > disabled, and so the feature never gets used in mainline kernels.
> >
> > Brings up the obvious question - why is it there if it's completely
> > unused?  (Maybe to cause confusion, and allowing a justification
> > for __weak ?)
> 
> IIRC Nick had some patches to do the arch enablement for powerpc, but
> I'm not sure what happened to them though. I suspect it just fell down
> Nick's ever growing TODO list.

I've given it a go on ARM, marking every linker-built table with KEEP()
and comparing the System.map files.  The resulting kernel is around
150k smaller, which seems good.

However, it doesn't boot - and I don't know why.  Booting the kernel
under kvmtool in a VM using virtio-console, I can find no way to get
any kernel messages out of it.  Using lkvm debug, I can see that the
PC is stuck inside die(), and that's the only information I have.
It dies before bringing up the other CPUs, so it's a very early death.

I don't think other console types are available under ARM64.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-29 15:27               ` Russell King - ARM Linux
@ 2018-03-29 15:43                 ` Geert Uytterhoeven
  2018-03-29 15:58                   ` Russell King - ARM Linux
  2018-03-29 17:43                 ` Rob Landley
  1 sibling, 1 reply; 128+ messages in thread
From: Geert Uytterhoeven @ 2018-03-29 15:43 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Oliver, Rob Landley, Shea Levy, linux-riscv,
	Linux Kernel Mailing List, Christoph Hellwig, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, Vineet Gupta, Catalin Marinas,
	Will Deacon, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
	Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck,
	Fenghua Yu, James Hogan, Michal Simek, Ralf Baechle,
	David Howells, Ley Foon Tan, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, James E.J. Bottomley, Helge Deller,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Palmer Dabbelt, Albert Ou, Martin Schwidefsky, Heiko Carstens,
	Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Jeff Dike,
	Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, the arch/x86 maintainers, Chris Zankel,
	Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches, Dan Williams,
	Wei Yang, Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, alpha, arcml, Linux ARM,
	adi-buildroot-devel, linux-c6x-dev, Cris,
	moderated list:H8/300 ARCHITECTURE, open list:QUALCOMM HEXAGON...,
	linux-ia64, linux-m68k, open list:METAG ARCHITECTURE,
	Linux MIPS Mailing List, moderated list:PANASONIC MN10300...,
	nios2-dev, Openrisc, Parisc List, linuxppc-dev, linux-s390,
	Linux-sh list, sparclinux, uml-devel, uml-user, linux-xtensa,
	Nicholas Piggin

On Thu, Mar 29, 2018 at 5:27 PM, Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:
> On Thu, Mar 29, 2018 at 09:37:52AM +1100, Oliver wrote:
>> On Thu, Mar 29, 2018 at 9:14 AM, Russell King - ARM Linux
>> <linux@armlinux.org.uk> wrote:
>> > On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:
>> >> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
>> >> > On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
>> >> >> On 03/28/2018 10:26 AM, Shea Levy wrote:
>> >> >>> Now only those architectures that have custom initrd free requirements
>> >> >>> need to define free_initrd_mem.
>> >> >> ...
>> >> >>> --- 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
>> >> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> >> >>> index 3f972e83909b..19d1c5594e2d 100644
>> >> >>> --- a/arch/arm/Kconfig
>> >> >>> +++ b/arch/arm/Kconfig
>> >> >>> @@ -47,6 +47,7 @@ config ARM
>> >> >>>   select HARDIRQS_SW_RESEND
>> >> >>>   select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
>> >> >>>   select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
>> >> >>> + select HAVE_ARCH_FREE_INITRD_MEM
>> >> >>>   select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
>> >> >>>   select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
>> >> >>>   select HAVE_ARCH_MMAP_RND_BITS if MMU
>> >> >>
>> >> >> Isn't this why weak symbols were invented?
>> >> >
>> >> > Weak symbols means that we end up with both the weakly-referenced code
>> >> > and the arch code in the kernel image.  That's fine if the weak code
>> >> > is small.
>> >>
>> >> The kernel's been able to build with link time garbage collection since 2016:
>> >>
>> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
>> >>
>> >> Wouldn't that remove the unused one?
>> >
>> > Probably, if anyone bothered to use that, which they don't.
>> >
>> > LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
>> > what I can see, nothing selects it.  Therefore, the symbol is always
>> > disabled, and so the feature never gets used in mainline kernels.
>> >
>> > Brings up the obvious question - why is it there if it's completely
>> > unused?  (Maybe to cause confusion, and allowing a justification
>> > for __weak ?)
>>
>> IIRC Nick had some patches to do the arch enablement for powerpc, but
>> I'm not sure what happened to them though. I suspect it just fell down
>> Nick's ever growing TODO list.
>
> I've given it a go on ARM, marking every linker-built table with KEEP()
> and comparing the System.map files.  The resulting kernel is around
> 150k smaller, which seems good.
>
> However, it doesn't boot - and I don't know why.  Booting the kernel
> under kvmtool in a VM using virtio-console, I can find no way to get
> any kernel messages out of it.  Using lkvm debug, I can see that the
> PC is stuck inside die(), and that's the only information I have.
> It dies before bringing up the other CPUs, so it's a very early death.
>
> I don't think other console types are available under ARM64.

earlycon?

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] 128+ messages in thread

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-29 15:43                 ` Geert Uytterhoeven
@ 2018-03-29 15:58                   ` Russell King - ARM Linux
  2018-03-29 16:53                     ` Marc Zyngier
  0 siblings, 1 reply; 128+ messages in thread
From: Russell King - ARM Linux @ 2018-03-29 15:58 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Oliver, Rob Landley, Shea Levy, linux-riscv,
	Linux Kernel Mailing List, Christoph Hellwig, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, Vineet Gupta, Catalin Marinas,
	Will Deacon, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
	Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck,
	Fenghua Yu, James Hogan, Michal Simek, Ralf Baechle,
	David Howells, Ley Foon Tan, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, James E.J. Bottomley, Helge Deller,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Palmer Dabbelt, Albert Ou, Martin Schwidefsky, Heiko Carstens,
	Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Jeff Dike,
	Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, the arch/x86 maintainers, Chris Zankel,
	Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches, Dan Williams,
	Wei Yang, Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, alpha, arcml, Linux ARM,
	adi-buildroot-devel, linux-c6x-dev, Cris,
	moderated list:H8/300 ARCHITECTURE, open list:QUALCOMM HEXAGON...,
	linux-ia64, linux-m68k, open list:METAG ARCHITECTURE,
	Linux MIPS Mailing List, moderated list:PANASONIC MN10300...,
	nios2-dev, Openrisc, Parisc List, linuxppc-dev, linux-s390,
	Linux-sh list, sparclinux, uml-devel, uml-user, linux-xtensa,
	Nicholas Piggin

On Thu, Mar 29, 2018 at 05:43:47PM +0200, Geert Uytterhoeven wrote:
> On Thu, Mar 29, 2018 at 5:27 PM, Russell King - ARM Linux
> <linux@armlinux.org.uk> wrote:
> > On Thu, Mar 29, 2018 at 09:37:52AM +1100, Oliver wrote:
> >> On Thu, Mar 29, 2018 at 9:14 AM, Russell King - ARM Linux
> >> <linux@armlinux.org.uk> wrote:
> >> > On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:
> >> >> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
> >> >> > On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
> >> >> >> On 03/28/2018 10:26 AM, Shea Levy wrote:
> >> >> >>> Now only those architectures that have custom initrd free requirements
> >> >> >>> need to define free_initrd_mem.
> >> >> >> ...
> >> >> >>> --- 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
> >> >> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >> >> >>> index 3f972e83909b..19d1c5594e2d 100644
> >> >> >>> --- a/arch/arm/Kconfig
> >> >> >>> +++ b/arch/arm/Kconfig
> >> >> >>> @@ -47,6 +47,7 @@ config ARM
> >> >> >>>   select HARDIRQS_SW_RESEND
> >> >> >>>   select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
> >> >> >>>   select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
> >> >> >>> + select HAVE_ARCH_FREE_INITRD_MEM
> >> >> >>>   select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
> >> >> >>>   select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
> >> >> >>>   select HAVE_ARCH_MMAP_RND_BITS if MMU
> >> >> >>
> >> >> >> Isn't this why weak symbols were invented?
> >> >> >
> >> >> > Weak symbols means that we end up with both the weakly-referenced code
> >> >> > and the arch code in the kernel image.  That's fine if the weak code
> >> >> > is small.
> >> >>
> >> >> The kernel's been able to build with link time garbage collection since 2016:
> >> >>
> >> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
> >> >>
> >> >> Wouldn't that remove the unused one?
> >> >
> >> > Probably, if anyone bothered to use that, which they don't.
> >> >
> >> > LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
> >> > what I can see, nothing selects it.  Therefore, the symbol is always
> >> > disabled, and so the feature never gets used in mainline kernels.
> >> >
> >> > Brings up the obvious question - why is it there if it's completely
> >> > unused?  (Maybe to cause confusion, and allowing a justification
> >> > for __weak ?)
> >>
> >> IIRC Nick had some patches to do the arch enablement for powerpc, but
> >> I'm not sure what happened to them though. I suspect it just fell down
> >> Nick's ever growing TODO list.
> >
> > I've given it a go on ARM, marking every linker-built table with KEEP()
> > and comparing the System.map files.  The resulting kernel is around
> > 150k smaller, which seems good.
> >
> > However, it doesn't boot - and I don't know why.  Booting the kernel
> > under kvmtool in a VM using virtio-console, I can find no way to get
> > any kernel messages out of it.  Using lkvm debug, I can see that the
> > PC is stuck inside die(), and that's the only information I have.
> > It dies before bringing up the other CPUs, so it's a very early death.
> >
> > I don't think other console types are available under ARM64.
> 
> earlycon?

Through what - as I say above, I think the only thing that's present is
virtio-console, and the virtio stack only get initialised much later in
boot.

Eg, there's the memory-based virtio driver which interfaces any virtio
driver to a memory-based ring structures for communication with the host
(drivers/virtio/virtio_mmio.c) which is initialised at module_init()
time, and so isn't available for earlycon.

I don't think merely changing the module_init() calls in the appropriate
virtio bits will suffice - it's why I pointed out that it dies before
SMP initialisation, which also means that it dies before we start
running the initcalls for subsystems and drivers.

I'm not aware of there being an emulated UART in the guest's address
space, so serial based stuff doesn't work.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

* Re: [PATCH v5 15/16] sh: Switch to generic free_initrd_mem.
  2018-03-29 11:32         ` [PATCH v5 15/16] sh: " Shea Levy
@ 2018-03-29 16:26           ` Rich Felker
  0 siblings, 0 replies; 128+ messages in thread
From: Rich Felker @ 2018-03-29 16:26 UTC (permalink / raw)
  To: Shea Levy; +Cc: linux-riscv, linux-kernel, Yoshinori Sato, linux-sh

On Thu, Mar 29, 2018 at 07:32:06AM -0400, Shea Levy wrote:
> The generic implementation is functionally identical.
> 
> Signed-off-by: Shea Levy <shea@shealevy.com>
> ---
>  arch/sh/mm/init.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> 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

LGTM.

Acked-by: Rich Felker <dalias@libc.org>

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 22:14           ` Russell King - ARM Linux
  2018-03-28 22:37             ` Oliver
@ 2018-03-29 16:39             ` Rob Landley
  2018-03-29 17:31               ` Russell King - ARM Linux
  1 sibling, 1 reply; 128+ messages in thread
From: Rob Landley @ 2018-03-29 16:39 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Shea Levy, linux-riscv, linux-kernel, Christoph Hellwig,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
	Catalin Marinas, Will Deacon, Mark Salter, Aurelien Jacquiot,
	Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan,
	Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan,
	Jonas Bonn, Stefan Kristiansson, Stafford Horne,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
	Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu,
	Rich Felker, David S. Miller, Jeff Dike, Richard Weinberger,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, linux-alpha, linux-snps-arc,
	linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev,
	linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64,
	linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev,
	openrisc, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, user-mode-linux-devel, user-mode-linux-user,
	linux-xtensa



On 03/28/2018 05:14 PM, Russell King - ARM Linux wrote:
> On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:
>>
>>
>> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
>>> On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
>>>> On 03/28/2018 10:26 AM, Shea Levy wrote:
>>>>> Now only those architectures that have custom initrd free requirements
>>>>> need to define free_initrd_mem.
>>>> ...
>>>>> --- 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
>>>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>>>> index 3f972e83909b..19d1c5594e2d 100644
>>>>> --- a/arch/arm/Kconfig
>>>>> +++ b/arch/arm/Kconfig
>>>>> @@ -47,6 +47,7 @@ config ARM
>>>>>  	select HARDIRQS_SW_RESEND
>>>>>  	select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
>>>>>  	select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
>>>>> +	select HAVE_ARCH_FREE_INITRD_MEM
>>>>>  	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
>>>>>  	select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
>>>>>  	select HAVE_ARCH_MMAP_RND_BITS if MMU
>>>>
>>>> Isn't this why weak symbols were invented?
>>>
>>> Weak symbols means that we end up with both the weakly-referenced code
>>> and the arch code in the kernel image.  That's fine if the weak code
>>> is small.
>>
>> The kernel's been able to build with link time garbage collection since 2016:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
>>
>> Wouldn't that remove the unused one?
> 
> Probably, if anyone bothered to use that, which they don't.
> 
> LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
> what I can see, nothing selects it.  Therefore, the symbol is always
> disabled, and so the feature never gets used in mainline kernels.

It looks like there are per-architecture linker scripts that need to be updated?
So if an architecture supports it, it's always done (well, it probes for the
toolchain supporting the flag). And if the architecture doesn't support it, the
linker script needs to be updated to mark sections with "I know nothing seems to
reference this at the ELF level but keep it anyway, we're pulling an assembly
trick".

> Brings up the obvious question - why is it there if it's completely
> unused?  (Maybe to cause confusion, and allowing a justification
> for __weak ?)

Presumably it will become the default on architectures as their linker scripts
are converted. Once they're all converted the config symbol can go away. (Given
the move to requiring gcc 4.7 or whatever it is, there can't be an architecture
depending on a toolchain that _doesn't_ support it after that point. I doubt you
can pair gcc 4.7 with a >12 year old binutils and expect good things...)

Rob

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-29 15:58                   ` Russell King - ARM Linux
@ 2018-03-29 16:53                     ` Marc Zyngier
  2018-03-29 17:32                       ` Russell King - ARM Linux
  0 siblings, 1 reply; 128+ messages in thread
From: Marc Zyngier @ 2018-03-29 16:53 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Geert Uytterhoeven, Oliver, Rob Landley, Shea Levy, linux-riscv,
	Linux Kernel Mailing List, Christoph Hellwig, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, Vineet Gupta, Catalin Marinas,
	Will Deacon, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
	Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck,
	Fenghua Yu, James Hogan, Michal Simek, Ralf Baechle,
	David Howells, Ley Foon Tan, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, James E.J. Bottomley, Helge Deller,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Palmer Dabbelt, Albert Ou, Martin Schwidefsky, Heiko Carstens,
	Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Jeff Dike,
	Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, the arch/x86 maintainers, Chris Zankel,
	Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Rob Herring, Kees Cook, Vlastimil Babka, Balbir Singh,
	Christophe Leroy, Joe Perches, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, alpha, arcml, Linux ARM,
	adi-buildroot-devel, linux-c6x-dev, Cris,
	moderated list:H8/300 ARCHITECTURE, open list:QUALCOMM HEXAGON...,
	linux-ia64, linux-m68k, open list:METAG ARCHITECTURE,
	Linux MIPS Mailing List, moderated list:PANASONIC MN10300...,
	nios2-dev, Openrisc, Parisc List, linuxppc-dev, linux-s390,
	Linux-sh list, sparclinux, uml-devel, uml-user, linux-xtensa,
	Nicholas Piggin

On Thu, 29 Mar 2018 16:58:27 +0100,
Russell King - ARM Linux wrote:
> 
> On Thu, Mar 29, 2018 at 05:43:47PM +0200, Geert Uytterhoeven wrote:
> > On Thu, Mar 29, 2018 at 5:27 PM, Russell King - ARM Linux
> > <linux@armlinux.org.uk> wrote:
> > > On Thu, Mar 29, 2018 at 09:37:52AM +1100, Oliver wrote:
> > >> On Thu, Mar 29, 2018 at 9:14 AM, Russell King - ARM Linux
> > >> <linux@armlinux.org.uk> wrote:
> > >> > On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:
> > >> >> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
> > >> >> > On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
> > >> >> >> On 03/28/2018 10:26 AM, Shea Levy wrote:
> > >> >> >>> Now only those architectures that have custom initrd free requirements
> > >> >> >>> need to define free_initrd_mem.
> > >> >> >> ...
> > >> >> >>> --- 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
> > >> >> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > >> >> >>> index 3f972e83909b..19d1c5594e2d 100644
> > >> >> >>> --- a/arch/arm/Kconfig
> > >> >> >>> +++ b/arch/arm/Kconfig
> > >> >> >>> @@ -47,6 +47,7 @@ config ARM
> > >> >> >>>   select HARDIRQS_SW_RESEND
> > >> >> >>>   select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
> > >> >> >>>   select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
> > >> >> >>> + select HAVE_ARCH_FREE_INITRD_MEM
> > >> >> >>>   select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
> > >> >> >>>   select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
> > >> >> >>>   select HAVE_ARCH_MMAP_RND_BITS if MMU
> > >> >> >>
> > >> >> >> Isn't this why weak symbols were invented?
> > >> >> >
> > >> >> > Weak symbols means that we end up with both the weakly-referenced code
> > >> >> > and the arch code in the kernel image.  That's fine if the weak code
> > >> >> > is small.
> > >> >>
> > >> >> The kernel's been able to build with link time garbage collection since 2016:
> > >> >>
> > >> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
> > >> >>
> > >> >> Wouldn't that remove the unused one?
> > >> >
> > >> > Probably, if anyone bothered to use that, which they don't.
> > >> >
> > >> > LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
> > >> > what I can see, nothing selects it.  Therefore, the symbol is always
> > >> > disabled, and so the feature never gets used in mainline kernels.
> > >> >
> > >> > Brings up the obvious question - why is it there if it's completely
> > >> > unused?  (Maybe to cause confusion, and allowing a justification
> > >> > for __weak ?)
> > >>
> > >> IIRC Nick had some patches to do the arch enablement for powerpc, but
> > >> I'm not sure what happened to them though. I suspect it just fell down
> > >> Nick's ever growing TODO list.
> > >
> > > I've given it a go on ARM, marking every linker-built table with KEEP()
> > > and comparing the System.map files.  The resulting kernel is around
> > > 150k smaller, which seems good.
> > >
> > > However, it doesn't boot - and I don't know why.  Booting the kernel
> > > under kvmtool in a VM using virtio-console, I can find no way to get
> > > any kernel messages out of it.  Using lkvm debug, I can see that the
> > > PC is stuck inside die(), and that's the only information I have.
> > > It dies before bringing up the other CPUs, so it's a very early death.
> > >
> > > I don't think other console types are available under ARM64.
> > 
> > earlycon?
> 
> Through what - as I say above, I think the only thing that's present is
> virtio-console, and the virtio stack only get initialised much later in
> boot.
> 
> Eg, there's the memory-based virtio driver which interfaces any virtio
> driver to a memory-based ring structures for communication with the host
> (drivers/virtio/virtio_mmio.c) which is initialised at module_init()
> time, and so isn't available for earlycon.
> 
> I don't think merely changing the module_init() calls in the appropriate
> virtio bits will suffice - it's why I pointed out that it dies before
> SMP initialisation, which also means that it dies before we start
> running the initcalls for subsystems and drivers.
> 
> I'm not aware of there being an emulated UART in the guest's address
> space, so serial based stuff doesn't work.

"earlycon=uart,mmio,0x3f8" is what you're looking for:

$ Work/kvmtool/lkvm run -c2 -k zImage -p "earlycon=uart,mmio,0x3f8" --console virtio --aarch32
  # lkvm run -k zImage -m 320 -c 2 --name guest-3856
  Info: Loaded kernel to 0x80008000 (6767104 bytes)
  Info: Placing fdt at 0x8fe00000 - 0x8fffffff
  Info: virtio-mmio.devices=0x200@0x10000:36

  Info: virtio-mmio.devices=0x200@0x10200:37

  Info: virtio-mmio.devices=0x200@0x10400:38

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.16.0-rc6+ (maz@approximate) (gcc version 6.3.0 20170516 (Debian 6.3.0-18)) #8407 SMP PREEMPT Tue Mar 20 15:01:43 GMT 2018
[    0.000000] CPU: ARMv7 Processor [410fd082] revision 2 (ARMv7), cr=30c5383d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[    0.000000] OF: fdt: Machine model: linux,dummy-virt
[    0.000000] earlycon: uart0 at MMIO 0x00000000000003f8 (options '')
[    0.000000] bootconsole [uart0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.

[...]

	M.

-- 
Jazz is not dead, it just smell funny.

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-29 16:39             ` Rob Landley
@ 2018-03-29 17:31               ` Russell King - ARM Linux
  0 siblings, 0 replies; 128+ messages in thread
From: Russell King - ARM Linux @ 2018-03-29 17:31 UTC (permalink / raw)
  To: Rob Landley
  Cc: Shea Levy, linux-riscv, linux-kernel, Christoph Hellwig,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
	Catalin Marinas, Will Deacon, Mark Salter, Aurelien Jacquiot,
	Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan,
	Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan,
	Jonas Bonn, Stefan Kristiansson, Stafford Horne,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
	Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu,
	Rich Felker, David S. Miller, Jeff Dike, Richard Weinberger,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, linux-alpha, linux-snps-arc,
	linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev,
	linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64,
	linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev,
	openrisc, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, user-mode-linux-devel, user-mode-linux-user,
	linux-xtensa

On Thu, Mar 29, 2018 at 11:39:24AM -0500, Rob Landley wrote:
> 
> 
> On 03/28/2018 05:14 PM, Russell King - ARM Linux wrote:
> > On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:
> >>
> >>
> >> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
> >>> On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
> >>>> On 03/28/2018 10:26 AM, Shea Levy wrote:
> >>>>> Now only those architectures that have custom initrd free requirements
> >>>>> need to define free_initrd_mem.
> >>>> ...
> >>>>> --- 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
> >>>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >>>>> index 3f972e83909b..19d1c5594e2d 100644
> >>>>> --- a/arch/arm/Kconfig
> >>>>> +++ b/arch/arm/Kconfig
> >>>>> @@ -47,6 +47,7 @@ config ARM
> >>>>>  	select HARDIRQS_SW_RESEND
> >>>>>  	select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
> >>>>>  	select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
> >>>>> +	select HAVE_ARCH_FREE_INITRD_MEM
> >>>>>  	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
> >>>>>  	select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
> >>>>>  	select HAVE_ARCH_MMAP_RND_BITS if MMU
> >>>>
> >>>> Isn't this why weak symbols were invented?
> >>>
> >>> Weak symbols means that we end up with both the weakly-referenced code
> >>> and the arch code in the kernel image.  That's fine if the weak code
> >>> is small.
> >>
> >> The kernel's been able to build with link time garbage collection since 2016:
> >>
> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
> >>
> >> Wouldn't that remove the unused one?
> > 
> > Probably, if anyone bothered to use that, which they don't.
> > 
> > LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
> > what I can see, nothing selects it.  Therefore, the symbol is always
> > disabled, and so the feature never gets used in mainline kernels.
> 
> It looks like there are per-architecture linker scripts that need to be updated?
> So if an architecture supports it, it's always done (well, it probes for the
> toolchain supporting the flag). And if the architecture doesn't support it, the
> linker script needs to be updated to mark sections with "I know nothing seems to
> reference this at the ELF level but keep it anyway, we're pulling an assembly
> trick".

It looks like it needs much more than just architecture changes as the
reason it fails on ARM is because the init thread structure is missing
due to missing KEEP()s in INIT_TASK_DATA().  Probably means it doesn't
work anywhere.

8<===
From: Russell King <rmk+kernel@armlinux.org.uk>
Subject: [PATCH] Fix LD_DEAD_CODE_DATA_ELIMINATION

LD_DEAD_CODE_DATA_ELIMINATION fails to boot on ARM because the linker
eliminates the init thread data from the bottom of the init threads
stack.  This causes recursive faults that end up overwriting parts
of the kernel before they can print any message.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 include/asm-generic/vmlinux.lds.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 1ab0e520d6fc..41af8a74aae4 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -279,8 +279,8 @@
 	VMLINUX_SYMBOL(__start_init_task) = .;				\
 	VMLINUX_SYMBOL(init_thread_union) = .;				\
 	VMLINUX_SYMBOL(init_stack) = .;					\
-	*(.data..init_task)						\
-	*(.data..init_thread_info)					\
+	KEEP(*(.data..init_task))					\
+	KEEP(*(.data..init_thread_info))				\
 	. = VMLINUX_SYMBOL(__start_init_task) + THREAD_SIZE;		\
 	VMLINUX_SYMBOL(__end_init_task) = .;
 

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-29 16:53                     ` Marc Zyngier
@ 2018-03-29 17:32                       ` Russell King - ARM Linux
  2018-03-29 17:53                         ` Marc Zyngier
  0 siblings, 1 reply; 128+ messages in thread
From: Russell King - ARM Linux @ 2018-03-29 17:32 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Geert Uytterhoeven, Oliver, Rob Landley, Shea Levy, linux-riscv,
	Linux Kernel Mailing List, Christoph Hellwig, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, Vineet Gupta, Catalin Marinas,
	Will Deacon, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
	Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck,
	Fenghua Yu, James Hogan, Michal Simek, Ralf Baechle,
	David Howells, Ley Foon Tan, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, James E.J. Bottomley, Helge Deller,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Palmer Dabbelt, Albert Ou, Martin Schwidefsky, Heiko Carstens,
	Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Jeff Dike,
	Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, the arch/x86 maintainers, Chris Zankel,
	Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Rob Herring, Kees Cook, Vlastimil Babka, Balbir Singh,
	Christophe Leroy, Joe Perches, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, alpha, arcml, Linux ARM,
	adi-buildroot-devel, linux-c6x-dev, Cris,
	moderated list:H8/300 ARCHITECTURE, open list:QUALCOMM HEXAGON...,
	linux-ia64, linux-m68k, open list:METAG ARCHITECTURE,
	Linux MIPS Mailing List, moderated list:PANASONIC MN10300...,
	nios2-dev, Openrisc, Parisc List, linuxppc-dev, linux-s390,
	Linux-sh list, sparclinux, uml-devel, uml-user, linux-xtensa,
	Nicholas Piggin

On Thu, Mar 29, 2018 at 05:53:14PM +0100, Marc Zyngier wrote:
> On Thu, 29 Mar 2018 16:58:27 +0100,
> Russell King - ARM Linux wrote:
> > 
> > On Thu, Mar 29, 2018 at 05:43:47PM +0200, Geert Uytterhoeven wrote:
> > > On Thu, Mar 29, 2018 at 5:27 PM, Russell King - ARM Linux
> > > <linux@armlinux.org.uk> wrote:
> > > > On Thu, Mar 29, 2018 at 09:37:52AM +1100, Oliver wrote:
> > > >> On Thu, Mar 29, 2018 at 9:14 AM, Russell King - ARM Linux
> > > >> <linux@armlinux.org.uk> wrote:
> > > >> > On Wed, Mar 28, 2018 at 02:04:22PM -0500, Rob Landley wrote:
> > > >> >> On 03/28/2018 11:48 AM, Russell King - ARM Linux wrote:
> > > >> >> > On Wed, Mar 28, 2018 at 10:58:51AM -0500, Rob Landley wrote:
> > > >> >> >> On 03/28/2018 10:26 AM, Shea Levy wrote:
> > > >> >> >>> Now only those architectures that have custom initrd free requirements
> > > >> >> >>> need to define free_initrd_mem.
> > > >> >> >> ...
> > > >> >> >>> --- 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
> > > >> >> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > > >> >> >>> index 3f972e83909b..19d1c5594e2d 100644
> > > >> >> >>> --- a/arch/arm/Kconfig
> > > >> >> >>> +++ b/arch/arm/Kconfig
> > > >> >> >>> @@ -47,6 +47,7 @@ config ARM
> > > >> >> >>>   select HARDIRQS_SW_RESEND
> > > >> >> >>>   select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
> > > >> >> >>>   select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
> > > >> >> >>> + select HAVE_ARCH_FREE_INITRD_MEM
> > > >> >> >>>   select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
> > > >> >> >>>   select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
> > > >> >> >>>   select HAVE_ARCH_MMAP_RND_BITS if MMU
> > > >> >> >>
> > > >> >> >> Isn't this why weak symbols were invented?
> > > >> >> >
> > > >> >> > Weak symbols means that we end up with both the weakly-referenced code
> > > >> >> > and the arch code in the kernel image.  That's fine if the weak code
> > > >> >> > is small.
> > > >> >>
> > > >> >> The kernel's been able to build with link time garbage collection since 2016:
> > > >> >>
> > > >> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b67067f1176d
> > > >> >>
> > > >> >> Wouldn't that remove the unused one?
> > > >> >
> > > >> > Probably, if anyone bothered to use that, which they don't.
> > > >> >
> > > >> > LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
> > > >> > what I can see, nothing selects it.  Therefore, the symbol is always
> > > >> > disabled, and so the feature never gets used in mainline kernels.
> > > >> >
> > > >> > Brings up the obvious question - why is it there if it's completely
> > > >> > unused?  (Maybe to cause confusion, and allowing a justification
> > > >> > for __weak ?)
> > > >>
> > > >> IIRC Nick had some patches to do the arch enablement for powerpc, but
> > > >> I'm not sure what happened to them though. I suspect it just fell down
> > > >> Nick's ever growing TODO list.
> > > >
> > > > I've given it a go on ARM, marking every linker-built table with KEEP()
> > > > and comparing the System.map files.  The resulting kernel is around
> > > > 150k smaller, which seems good.
> > > >
> > > > However, it doesn't boot - and I don't know why.  Booting the kernel
> > > > under kvmtool in a VM using virtio-console, I can find no way to get
> > > > any kernel messages out of it.  Using lkvm debug, I can see that the
> > > > PC is stuck inside die(), and that's the only information I have.
> > > > It dies before bringing up the other CPUs, so it's a very early death.
> > > >
> > > > I don't think other console types are available under ARM64.
> > > 
> > > earlycon?
> > 
> > Through what - as I say above, I think the only thing that's present is
> > virtio-console, and the virtio stack only get initialised much later in
> > boot.
> > 
> > Eg, there's the memory-based virtio driver which interfaces any virtio
> > driver to a memory-based ring structures for communication with the host
> > (drivers/virtio/virtio_mmio.c) which is initialised at module_init()
> > time, and so isn't available for earlycon.
> > 
> > I don't think merely changing the module_init() calls in the appropriate
> > virtio bits will suffice - it's why I pointed out that it dies before
> > SMP initialisation, which also means that it dies before we start
> > running the initcalls for subsystems and drivers.
> > 
> > I'm not aware of there being an emulated UART in the guest's address
> > space, so serial based stuff doesn't work.
> 
> "earlycon=uart,mmio,0x3f8" is what you're looking for:

Does that also mean that we have a RTC at the standard PC IO addresses
as well, but in mmio space?

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-29 15:27               ` Russell King - ARM Linux
  2018-03-29 15:43                 ` Geert Uytterhoeven
@ 2018-03-29 17:43                 ` Rob Landley
  1 sibling, 0 replies; 128+ messages in thread
From: Rob Landley @ 2018-03-29 17:43 UTC (permalink / raw)
  To: Russell King - ARM Linux, Oliver
  Cc: Shea Levy, linux-riscv, linux-kernel, Christoph Hellwig,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, Vineet Gupta,
	Catalin Marinas, Will Deacon, Mark Salter, Aurelien Jacquiot,
	Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan,
	Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan,
	Jonas Bonn, Stefan Kristiansson, Stafford Horne,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
	Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu,
	Rich Felker, David S. Miller, Jeff Dike, Richard Weinberger,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches, Dan Williams,
	Wei Yang, Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, linux-alpha, linux-snps-arc,
	linux-arm-kernel, adi-buildroot-devel, linux-c6x-dev,
	linux-cris-kernel, uclinux-h8-devel, linux-hexagon, linux-ia64,
	linux-m68k, linux-metag, linux-mips, linux-am33-list, nios2-dev,
	openrisc, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
	sparclinux, user-mode-linux-devel, user-mode-linux-user,
	linux-xtensa, Nicholas Piggin

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

On 03/29/2018 10:27 AM, Russell King - ARM Linux wrote:
> On Thu, Mar 29, 2018 at 09:37:52AM +1100, Oliver wrote:
>> On Thu, Mar 29, 2018 at 9:14 AM, Russell King - ARM Linux
>>> LD_DEAD_CODE_DATA_ELIMINATION is a symbol without a prompt, and from
>>> what I can see, nothing selects it.  Therefore, the symbol is always
>>> disabled, and so the feature never gets used in mainline kernels.
>>>
>>> Brings up the obvious question - why is it there if it's completely
>>> unused?  (Maybe to cause confusion, and allowing a justification
>>> for __weak ?)
>>
>> IIRC Nick had some patches to do the arch enablement for powerpc, but
>> I'm not sure what happened to them though. I suspect it just fell down
>> Nick's ever growing TODO list.
> 
> I've given it a go on ARM, marking every linker-built table with KEEP()
> and comparing the System.map files.  The resulting kernel is around
> 150k smaller, which seems good.
> 
> However, it doesn't boot - and I don't know why.  Booting the kernel
> under kvmtool in a VM using virtio-console, I can find no way to get
> any kernel messages out of it.  Using lkvm debug, I can see that the
> PC is stuck inside die(), and that's the only information I have.

qemu-system-arm's "-s" option lets you hook to the hardware with gdb, as if
using one of those jtags that speaks gdbserver protocol. It stops waiting for
you to attach with 'target remote' it, then 'file vmlinux' to load the symbols...

The miniconfig and qemu invocation I use for arm64 are attached, tested with
2.11.0 on a 4.14 kernel. You should be able to just "qemu-aarch64.sh -s" and
then probably "target remote 127.0.0.1:1234"? (Been a while since I've used it,
don't have a cross-gdb for arm64 lying around...)

Sigh, I just tried -s and qemu 2.11.0 is _not_ waiting for gdb to attach on
arm64, despite what the docs say:

$ qemu-system-aarch64 --help | grep gdb
-gdb dev        wait for gdb connection on 'dev'
-s              shorthand for -gdb tcp::1234

Another random regression in qemu, gee what a surprise.

> It dies before bringing up the other CPUs, so it's a very early death.
> 
> I don't think other console types are available under ARM64.

I've often found useful the two line version of:

https://balau82.wordpress.com/2010/02/28/hello-world-for-bare-metal-arm-using-qemu/

Which is generally some variant of:

{char *XX = "blah"; while (*XX) {while (*SERIAL_STATUS_REGISTER & OUT_READY);
*SERIAL_OUT = *XX++;}}

(I.E. balu cheated not spinning checking the ready-for-next-byte bit, because
qemu's always angry.)

That trick lets you cut and paste a print statement into all sorts of early
hardware nonsense, on most architectures. You just have to look up
SERIAL_STATUS_REGISTER, OUT_OK_BIT, and SERIAL_OUT values for the serial port du
jour.

That said I've mostly used it in things like u-boot. I dunno at what point the
kernel's done enough setup that direct banging on registers would stop working.
(Works in the decompresion code, anyway.) And it assumes the port's set to the
right speed (usually left there by the bootloader)...

Rob

[-- Attachment #2: aarch64.miniconf --]
[-- Type: text/plain, Size: 1387 bytes --]

# make ARCH=arm64 allnoconfig KCONFIG_ALLCONFIG=aarch64.miniconf
# make ARCH=arm64 -j $(nproc)
# boot arch/arm64/boot/Image


CONFIG_MMU=y
CONFIG_ARCH_MULTI_V7=y
CONFIG_ARCH_VIRT=y
CONFIG_SOC_DRA7XX=y
CONFIG_ARCH_OMAP2PLUS_TYPICAL=y
CONFIG_ARCH_ALPINE=y
CONFIG_ARM_THUMB=y
CONFIG_VDSO=y
CONFIG_CPU_IDLE=y
CONFIG_ARM_CPUIDLE=y
CONFIG_KERNEL_MODE_NEON=y

CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y

CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_DRV_PL031=y

CONFIG_NET_CORE=y
CONFIG_VIRTIO_NET=y

CONFIG_PCI=y
CONFIG_PCI_HOST_GENERIC=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_MMIO=y

CONFIG_ATA=y
CONFIG_ATA_SFF=y
CONFIG_ATA_BMDMA=y
CONFIG_ATA_PIIX=y

CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y
CONFIG_ATA_GENERIC=y


# CONFIG_EMBEDDED is not set
CONFIG_EARLY_PRINTK=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_SCRIPT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y

CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_RD_GZIP=y

CONFIG_BLK_DEV_LOOP=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_UTF8=y
CONFIG_MISC_FILESYSTEMS=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_XATTR=y
CONFIG_SQUASHFS_ZLIB=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y

CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IPV6=y
CONFIG_NETDEVICES=y
#CONFIG_NET_CORE=y
#CONFIG_NETCONSOLE=y
CONFIG_ETHERNET=y


[-- Attachment #3: qemu-aarch64.sh --]
[-- Type: application/x-shellscript, Size: 186 bytes --]

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-29 17:32                       ` Russell King - ARM Linux
@ 2018-03-29 17:53                         ` Marc Zyngier
  0 siblings, 0 replies; 128+ messages in thread
From: Marc Zyngier @ 2018-03-29 17:53 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Geert Uytterhoeven, Oliver, Rob Landley, Shea Levy, linux-riscv,
	Linux Kernel Mailing List, Christoph Hellwig, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, Vineet Gupta, Catalin Marinas,
	Will Deacon, Mark Salter, Aurelien Jacquiot, Mikael Starvik,
	Jesper Nilsson, Yoshinori Sato, Richard Kuo, Tony Luck,
	Fenghua Yu, James Hogan, Michal Simek, Ralf Baechle,
	David Howells, Ley Foon Tan, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, James E.J. Bottomley, Helge Deller,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Palmer Dabbelt, Albert Ou, Martin Schwidefsky, Heiko Carstens,
	Chen Liqin, Lennox Wu, Rich Felker, David S. Miller, Jeff Dike,
	Richard Weinberger, Guan Xuetao, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, the arch/x86 maintainers, Chris Zankel,
	Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Rob Herring, Kees Cook, Vlastimil Babka, Balbir Singh,
	Christophe Leroy, Joe Perches, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Florian Fainelli, alpha, arcml, Linux ARM,
	adi-buildroot-devel, linux-c6x-dev, Cris,
	moderated list:H8/300 ARCHITECTURE, open list:QUALCOMM HEXAGON...,
	linux-ia64, linux-m68k, open list:METAG ARCHITECTURE,
	Linux MIPS Mailing List, moderated list:PANASONIC MN10300...,
	nios2-dev, Openrisc, Parisc List, linuxppc-dev, linux-s390,
	Linux-sh list, sparclinux, uml-devel, uml-user, linux-xtensa,
	Nicholas Piggin

On Thu, 29 Mar 2018 18:32:47 +0100,
Russell King - ARM Linux wrote:
> 
> On Thu, Mar 29, 2018 at 05:53:14PM +0100, Marc Zyngier wrote:
> > On Thu, 29 Mar 2018 16:58:27 +0100,
> > Russell King - ARM Linux wrote:

[...]

> > > I'm not aware of there being an emulated UART in the guest's address
> > > space, so serial based stuff doesn't work.
> > 
> > "earlycon=uart,mmio,0x3f8" is what you're looking for:
> 
> Does that also mean that we have a RTC at the standard PC IO addresses
> as well, but in mmio space?

There is one, together with an i8042. Not exposed in the DT though.

	M.

-- 
Jazz is not dead, it just smell funny.

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-28 15:26   ` [PATCH] Extract initrd free logic from arch-specific code Shea Levy
                       ` (2 preceding siblings ...)
  2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
@ 2018-03-30 11:15     ` Ingo Molnar
  2018-04-01 15:05       ` Shea Levy
  3 siblings, 1 reply; 128+ messages in thread
From: Ingo Molnar @ 2018-03-30 11:15 UTC (permalink / raw)
  To: Shea Levy
  Cc: linux-riscv, linux-kernel, Christoph Hellwig, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, Vineet Gupta, Russell King,
	Catalin Marinas, Will Deacon, Mark Salter, Aurelien Jacquiot,
	Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan,
	Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan,
	Jonas Bonn, Stefan Kristiansson, Stafford Horne,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
	Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu,
	Rich Felker, David S. Miller, Jeff Dike, Richard Weinberger,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Rob Landley, Florian Fainelli, linux-alpha,
	linux-snps-arc, linux-arm-kernel, adi-buildroot-devel,
	linux-c6x-dev, linux-cris-kernel, uclinux-h8-devel,
	linux-hexagon, linux-ia64, linux-m68k, linux-metag, linux-mips,
	linux-am33-list, nios2-dev, openrisc, linux-parisc, linuxppc-dev,
	linux-s390, linux-sh, sparclinux, user-mode-linux-devel,
	user-mode-linux-user, linux-xtensa


* Shea Levy <shea@shealevy.com> wrote:

> Now only those architectures that have custom initrd free requirements
> need to define free_initrd_mem.
> 
> Signed-off-by: Shea Levy <shea@shealevy.com>

Please put the Kconfig symbol name this patch introduces both into the title, so 
that people know what to grep for.

> ---
>  arch/alpha/mm/init.c      |  8 --------
>  arch/arc/mm/init.c        |  7 -------
>  arch/arm/Kconfig          |  1 +
>  arch/arm64/Kconfig        |  1 +
>  arch/blackfin/Kconfig     |  1 +
>  arch/c6x/mm/init.c        |  7 -------
>  arch/cris/Kconfig         |  1 +
>  arch/frv/mm/init.c        | 11 -----------
>  arch/h8300/mm/init.c      |  7 -------
>  arch/hexagon/Kconfig      |  1 +
>  arch/ia64/Kconfig         |  1 +
>  arch/m32r/Kconfig         |  1 +
>  arch/m32r/mm/init.c       | 11 -----------
>  arch/m68k/mm/init.c       |  7 -------
>  arch/metag/Kconfig        |  1 +
>  arch/microblaze/mm/init.c |  7 -------
>  arch/mips/Kconfig         |  1 +
>  arch/mn10300/Kconfig      |  1 +
>  arch/nios2/mm/init.c      |  7 -------
>  arch/openrisc/mm/init.c   |  7 -------
>  arch/parisc/mm/init.c     |  7 -------
>  arch/powerpc/mm/mem.c     |  7 -------
>  arch/riscv/mm/init.c      |  6 ------
>  arch/s390/Kconfig         |  1 +
>  arch/score/Kconfig        |  1 +
>  arch/sh/mm/init.c         |  7 -------
>  arch/sparc/Kconfig        |  1 +
>  arch/tile/Kconfig         |  1 +
>  arch/um/kernel/mem.c      |  7 -------
>  arch/unicore32/Kconfig    |  1 +
>  arch/x86/Kconfig          |  1 +
>  arch/xtensa/Kconfig       |  1 +
>  init/initramfs.c          |  7 +++++++
>  usr/Kconfig               |  4 ++++
>  34 files changed, 28 insertions(+), 113 deletions(-)

Please also put it into Documentation/features/.

> diff --git a/usr/Kconfig b/usr/Kconfig
> index 43658b8a975e..7a94f6df39bf 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 ""
> +
> +config HAVE_ARCH_FREE_INITRD_MEM
> +	bool
> +	default n

Help text would be nice, to tell arch maintainers what the purpose of this switch 
is.

Also, a nit, I think this should be named "ARCH_HAS_FREE_INITRD_MEM", which is the 
dominant pattern:

triton:~/tip> git grep 'select.*ARCH' arch/x86/Kconfig* | cut -f2 | cut -d_ -f1-2 | sort | uniq -c | sort -n
    ...
      2 select ARCH_USES
      2 select ARCH_WANTS
      3 select ARCH_MIGHT
      3 select ARCH_WANT
      4 select ARCH_SUPPORTS
      4 select ARCH_USE
     16 select HAVE_ARCH
     23 select ARCH_HAS

It also reads nicely in English:

  "arch has free_initrd_mem()"

While the other makes little sense:

  "have arch free_initrd_mem()"

?

Thanks,

	Ingo

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

* [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.
  2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
                           ` (14 preceding siblings ...)
  2018-03-29 11:32         ` [PATCH v5 16/16] um: " Shea Levy
@ 2018-04-01 14:59         ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 02/16] riscv: Free initrds with " Shea Levy
                             ` (15 more replies)
  15 siblings, 16 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy

This function is effectively identical across 14 architectures, and
the generic implementation is small enough to be negligible in the
architectures that do override it. Many of the remaining divergent
implementations can be included in the common code path in future,
further reducing code duplication and sharing improvements between
architectures.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

v6: Add information about build/run testing.
v5: Add more complete commit messages.
v4: Use weak symbols instead of Kconfig.
v3: Make the generic path opt-out instead of opt-in.
v2: Mark generic free_initrd_mem __init.

Signed-off-by: Shea Levy <shea@shealevy.com>
---
 init/initramfs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..c8fe150f958a 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
 #include <linux/initrd.h>
 #include <linux/kexec.h>
 
+void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
+{
+       free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+
 static void __init free_initrd(void)
 {
 #ifdef CONFIG_KEXEC_CORE
-- 
2.16.2

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

* [PATCH v6 02/16] riscv: Free initrds with generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 03/16] alpha: Switch to " Shea Levy
                             ` (14 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Palmer Dabbelt, Albert Ou

The first patch in this series added a weakly-defined generic
implementation, which works on RISC-V.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 03/16] alpha: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
  2018-04-01 14:59           ` [PATCH v6 02/16] riscv: Free initrds with " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 04/16] arc: " Shea Levy
                             ` (13 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 04/16] arc: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
  2018-04-01 14:59           ` [PATCH v6 02/16] riscv: Free initrds with " Shea Levy
  2018-04-01 14:59           ` [PATCH v6 03/16] alpha: Switch to " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-04 15:21             ` Alexey Brodkin
  2018-04-09 16:40             ` Vineet Gupta
  2018-04-01 14:59           ` [PATCH v6 05/16] c6x: " Shea Levy
                             ` (12 subsequent siblings)
  15 siblings, 2 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Vineet Gupta, linux-snps-arc

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 05/16] c6x: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (2 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 04/16] arc: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-19 16:37             ` Mark Salter
  2018-04-01 14:59           ` [PATCH v6 06/16] frv: " Shea Levy
                             ` (11 subsequent siblings)
  15 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Mark Salter, Aurelien Jacquiot, linux-c6x-dev

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 06/16] frv: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (3 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 05/16] c6x: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 07/16] h8300: " Shea Levy
                             ` (10 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 07/16] h8300: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (4 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 06/16] frv: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 08/16] m32r: " Shea Levy
                             ` (9 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Yoshinori Sato, uclinux-h8-devel

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 08/16] m32r: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (5 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 07/16] h8300: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 09/16] m68k: " Shea Levy
                             ` (8 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 09/16] m68k: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (6 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 08/16] m32r: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 10/16] microblaze: " Shea Levy
                             ` (7 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Geert Uytterhoeven, linux-m68k

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/m68k/mm/init.c | 7 -------
 1 file changed, 7 deletions(-)

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] 128+ messages in thread

* [PATCH v6 10/16] microblaze: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (7 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 09/16] m68k: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 11/16] nios2: " Shea Levy
                             ` (6 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Michal Simek

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 11/16] nios2: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (8 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 10/16] microblaze: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-02 16:04             ` Ley Foon Tan
  2018-04-01 14:59           ` [PATCH v6 12/16] openrisc: " Shea Levy
                             ` (5 subsequent siblings)
  15 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: Shea Levy, Ley Foon Tan, nios2-dev

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 12/16] openrisc: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (9 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 11/16] nios2: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 13/16] parisc: " Shea Levy
                             ` (4 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Jonas Bonn, Stefan Kristiansson, Stafford Horne, openrisc

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 13/16] parisc: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (10 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 12/16] openrisc: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-02 20:07             ` Helge Deller
  2018-04-01 14:59           ` [PATCH v6 14/16] powerpc: " Shea Levy
                             ` (3 subsequent siblings)
  15 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, James E.J. Bottomley, Helge Deller, linux-parisc

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 14/16] powerpc: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (11 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 13/16] parisc: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 15/16] sh: " Shea Levy
                             ` (2 subsequent siblings)
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* [PATCH v6 15/16] sh: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (12 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 14/16] powerpc: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-01 14:59           ` [PATCH v6 16/16] um: " Shea Levy
  2018-04-18 11:10           ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Yoshinori Sato, Rich Felker, linux-sh

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

Acked-by: Rich Felker <dalias@libc.org>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
 arch/sh/mm/init.c | 7 -------
 1 file changed, 7 deletions(-)

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] 128+ messages in thread

* [PATCH v6 16/16] um: Switch to generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (13 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 15/16] sh: " Shea Levy
@ 2018-04-01 14:59           ` Shea Levy
  2018-04-18 11:10           ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
  15 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 14:59 UTC (permalink / raw)
  To: linux-riscv, linux-kernel
  Cc: Shea Levy, Jeff Dike, Richard Weinberger, user-mode-linux-devel,
	user-mode-linux-user

The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.

Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).

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

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] 128+ messages in thread

* Re: [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.
  2018-03-29 13:19             ` Michael Ellerman
@ 2018-04-01 15:01               ` Shea Levy
  0 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 15:01 UTC (permalink / raw)
  To: Michael Ellerman, Joe Perches, linux-riscv, linux-kernel
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michal Hocko,
	Vlastimil Babka, Andrew Morton, Dan Williams, Christophe Leroy,
	Oliver O'Halloran, linuxppc-dev

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

Hi Michael,

Michael Ellerman <mpe@ellerman.id.au> writes:

> Shea Levy <shea@shealevy.com> writes:
>
>> Joe Perches <joe@perches.com> writes:
>>
>>> On Wed, 2018-03-28 at 16:36 -0400, Shea Levy wrote:
>>>> Signed-off-by: Shea Levy <shea@shealevy.com>
>>>
>>> Most people seem to want some form of commit message
>>> and not just your sign-off.
>>>
>>
>> Ah, if the subject is insufficient I can add some more detail.
>
> Yeah please do.
>
> Seeing this patch in isolation, with no change log, I might think it's
> safe for me to just apply it.
>
> But that would break the build because I don't have patch 1.
>
> So for starters you need to explain that part, eg something like:
>
>   A previous patch in the series added a weak definition of
>   free_initrd_mem() in init/initramfs.c.
>
>   The powerpc implementation is identical, so it can be removed allowing
>   the generic version to be used.
>
>
> Then you could also tell me if you did/didn't build/boot test it.

Thanks for the feedback, can you let me know if the recently posted v6
fits the bill?

>
> cheers

Thanks,
Shea

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

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

* Re: [PATCH] Extract initrd free logic from arch-specific code.
  2018-03-30 11:15     ` [PATCH] Extract initrd free logic from arch-specific code Ingo Molnar
@ 2018-04-01 15:05       ` Shea Levy
  0 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-04-01 15:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-riscv, linux-kernel, Christoph Hellwig, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, Vineet Gupta, Russell King,
	Catalin Marinas, Will Deacon, Mark Salter, Aurelien Jacquiot,
	Mikael Starvik, Jesper Nilsson, Yoshinori Sato, Richard Kuo,
	Tony Luck, Fenghua Yu, Geert Uytterhoeven, James Hogan,
	Michal Simek, Ralf Baechle, David Howells, Ley Foon Tan,
	Jonas Bonn, Stefan Kristiansson, Stafford Horne,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Palmer Dabbelt, Albert Ou,
	Martin Schwidefsky, Heiko Carstens, Chen Liqin, Lennox Wu,
	Rich Felker, David S. Miller, Jeff Dike, Richard Weinberger,
	Guan Xuetao, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Chris Zankel, Max Filippov, Kate Stewart, Greg Kroah-Hartman,
	Philippe Ombredanne, Eugeniy Paltsev, Al Viro, Vladimir Murzin,
	Linus Walleij, Michal Hocko, Andrew Morton, Sudip Mukherjee,
	Marc Zyngier, Rob Herring, Kees Cook, Vlastimil Babka,
	Balbir Singh, Christophe Leroy, Joe Perches,
	Oliver O'Halloran, Dan Williams, Wei Yang,
	Christian König, Arnd Bergmann, Deepa Dinamani,
	Daniel Thompson, Rob Landley, Florian Fainelli, linux-alpha,
	linux-snps-arc, linux-arm-kernel, adi-buildroot-devel,
	linux-c6x-dev, linux-cris-kernel, uclinux-h8-devel,
	linux-hexagon, linux-ia64, linux-m68k, linux-metag, linux-mips,
	linux-am33-list, nios2-dev, openrisc, linux-parisc, linuxppc-dev,
	linux-s390, linux-sh, sparclinux, user-mode-linux-devel,
	user-mode-linux-user, linux-xtensa

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

Hi Ingo,

Ingo Molnar <mingo@kernel.org> writes:

> * Shea Levy <shea@shealevy.com> wrote:
>
>> Now only those architectures that have custom initrd free requirements
>> need to define free_initrd_mem.
>> 
>> Signed-off-by: Shea Levy <shea@shealevy.com>
>
> Please put the Kconfig symbol name this patch introduces both into the title, so 
> that people know what to grep for.
>
>> ---
>>  arch/alpha/mm/init.c      |  8 --------
>>  arch/arc/mm/init.c        |  7 -------
>>  arch/arm/Kconfig          |  1 +
>>  arch/arm64/Kconfig        |  1 +
>>  arch/blackfin/Kconfig     |  1 +
>>  arch/c6x/mm/init.c        |  7 -------
>>  arch/cris/Kconfig         |  1 +
>>  arch/frv/mm/init.c        | 11 -----------
>>  arch/h8300/mm/init.c      |  7 -------
>>  arch/hexagon/Kconfig      |  1 +
>>  arch/ia64/Kconfig         |  1 +
>>  arch/m32r/Kconfig         |  1 +
>>  arch/m32r/mm/init.c       | 11 -----------
>>  arch/m68k/mm/init.c       |  7 -------
>>  arch/metag/Kconfig        |  1 +
>>  arch/microblaze/mm/init.c |  7 -------
>>  arch/mips/Kconfig         |  1 +
>>  arch/mn10300/Kconfig      |  1 +
>>  arch/nios2/mm/init.c      |  7 -------
>>  arch/openrisc/mm/init.c   |  7 -------
>>  arch/parisc/mm/init.c     |  7 -------
>>  arch/powerpc/mm/mem.c     |  7 -------
>>  arch/riscv/mm/init.c      |  6 ------
>>  arch/s390/Kconfig         |  1 +
>>  arch/score/Kconfig        |  1 +
>>  arch/sh/mm/init.c         |  7 -------
>>  arch/sparc/Kconfig        |  1 +
>>  arch/tile/Kconfig         |  1 +
>>  arch/um/kernel/mem.c      |  7 -------
>>  arch/unicore32/Kconfig    |  1 +
>>  arch/x86/Kconfig          |  1 +
>>  arch/xtensa/Kconfig       |  1 +
>>  init/initramfs.c          |  7 +++++++
>>  usr/Kconfig               |  4 ++++
>>  34 files changed, 28 insertions(+), 113 deletions(-)
>
> Please also put it into Documentation/features/.
>

I switched this patch series (the latest revision v6 was just posted) to
using weak symbols instead of Kconfig. Does it still warrant documentation?

>
>> diff --git a/usr/Kconfig b/usr/Kconfig
>> index 43658b8a975e..7a94f6df39bf 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 ""
>> +
>> +config HAVE_ARCH_FREE_INITRD_MEM
>> +	bool
>> +	default n
>
> Help text would be nice, to tell arch maintainers what the purpose of this switch 
> is.
>
> Also, a nit, I think this should be named "ARCH_HAS_FREE_INITRD_MEM", which is the 
> dominant pattern:
>
> triton:~/tip> git grep 'select.*ARCH' arch/x86/Kconfig* | cut -f2 | cut -d_ -f1-2 | sort | uniq -c | sort -n
>     ...
>       2 select ARCH_USES
>       2 select ARCH_WANTS
>       3 select ARCH_MIGHT
>       3 select ARCH_WANT
>       4 select ARCH_SUPPORTS
>       4 select ARCH_USE
>      16 select HAVE_ARCH
>      23 select ARCH_HAS
>
> It also reads nicely in English:
>
>   "arch has free_initrd_mem()"
>
> While the other makes little sense:
>
>   "have arch free_initrd_mem()"
>
> ?
>
> Thanks,
>
> 	Ingo

Thanks,
Shea

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

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

* Re: [PATCH v6 11/16] nios2: Switch to generic free_initrd_mem.
  2018-04-01 14:59           ` [PATCH v6 11/16] nios2: " Shea Levy
@ 2018-04-02 16:04             ` Ley Foon Tan
  0 siblings, 0 replies; 128+ messages in thread
From: Ley Foon Tan @ 2018-04-02 16:04 UTC (permalink / raw)
  To: Shea Levy, linux-riscv, linux-kernel; +Cc: nios2-dev

On Sun, 2018-04-01 at 10:59 -0400, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
> 
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
> 
> Signed-off-by: Shea Levy <shea@shealevy.com>

Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>

> ---
>  arch/nios2/mm/init.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> 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	[flat|nested] 128+ messages in thread

* Re: [PATCH v6 13/16] parisc: Switch to generic free_initrd_mem.
  2018-04-01 14:59           ` [PATCH v6 13/16] parisc: " Shea Levy
@ 2018-04-02 20:07             ` Helge Deller
  0 siblings, 0 replies; 128+ messages in thread
From: Helge Deller @ 2018-04-02 20:07 UTC (permalink / raw)
  To: Shea Levy, linux-riscv, linux-kernel; +Cc: James E.J. Bottomley, linux-parisc

On 01.04.2018 16:59, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
> 
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
> 
> Signed-off-by: Shea Levy <shea@shealevy.com>

Acked-by: Helge Deller <deller@gmx.de> # parisc

> ---
>  arch/parisc/mm/init.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> 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
> 

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

* Re: [PATCH v6 04/16] arc: Switch to generic free_initrd_mem.
  2018-04-01 14:59           ` [PATCH v6 04/16] arc: " Shea Levy
@ 2018-04-04 15:21             ` Alexey Brodkin
  2018-04-09 16:40             ` Vineet Gupta
  1 sibling, 0 replies; 128+ messages in thread
From: Alexey Brodkin @ 2018-04-04 15:21 UTC (permalink / raw)
  To: shea; +Cc: Vineet.Gupta1, linux-riscv, linux-kernel, linux-snps-arc

Hi Shea,

On Sun, 2018-04-01 at 10:59 -0400, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
> 
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
> 
> Signed-off-by: Shea Levy <shea@shealevy.com>

Boot-tested on ARC, thus...

Tested-by: Alexey Brodkin <abrodkin@synopsys.com>

-Alexey

P.S. Note Vineet is out this week so please wait for him to return
next week to ack your patch.

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

* Re: [PATCH v6 04/16] arc: Switch to generic free_initrd_mem.
  2018-04-01 14:59           ` [PATCH v6 04/16] arc: " Shea Levy
  2018-04-04 15:21             ` Alexey Brodkin
@ 2018-04-09 16:40             ` Vineet Gupta
  1 sibling, 0 replies; 128+ messages in thread
From: Vineet Gupta @ 2018-04-09 16:40 UTC (permalink / raw)
  To: Shea Levy, linux-riscv, linux-kernel; +Cc: Vineet Gupta, linux-snps-arc

On 04/01/2018 08:00 AM, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
>
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
>
> Signed-off-by: Shea Levy <shea@shealevy.com>
> ---
>   arch/arc/mm/init.c | 7 -------
>   1 file changed, 7 deletions(-)
>
> 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

LGTM.

Acked-by: Vineet Gupta <vgupta@synopsys.com>

-Vineet

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

* Re: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.
  2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
                             ` (14 preceding siblings ...)
  2018-04-01 14:59           ` [PATCH v6 16/16] um: " Shea Levy
@ 2018-04-18 11:10           ` Shea Levy
  2018-04-20 20:22             ` Palmer Dabbelt
  15 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-04-18 11:10 UTC (permalink / raw)
  To: linux-riscv, linux-kernel

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

Hi all,

Shea Levy <shea@shealevy.com> writes:

> This function is effectively identical across 14 architectures, and
> the generic implementation is small enough to be negligible in the
> architectures that do override it. Many of the remaining divergent
> implementations can be included in the common code path in future,
> further reducing code duplication and sharing improvements between
> architectures.
>
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
>
> v6: Add information about build/run testing.
> v5: Add more complete commit messages.
> v4: Use weak symbols instead of Kconfig.
> v3: Make the generic path opt-out instead of opt-in.
> v2: Mark generic free_initrd_mem __init.
>
> Signed-off-by: Shea Levy <shea@shealevy.com>
> ---
>  init/initramfs.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/init/initramfs.c b/init/initramfs.c
> index 7e99a0038942..c8fe150f958a 100644
> --- a/init/initramfs.c
> +++ b/init/initramfs.c
> @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
>  #include <linux/initrd.h>
>  #include <linux/kexec.h>
>  
> +void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
> +{
> +       free_reserved_area((void *)start, (void *)end, -1, "initrd");
> +}
> +
>  static void __init free_initrd(void)
>  {
>  #ifdef CONFIG_KEXEC_CORE
> -- 
> 2.16.2

This series has been quiet for a few weeks other than picking up some
arch-specific acks. What is the next step here?

Thanks,
Shea

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

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

* Re: [PATCH v6 05/16] c6x: Switch to generic free_initrd_mem.
  2018-04-01 14:59           ` [PATCH v6 05/16] c6x: " Shea Levy
@ 2018-04-19 16:37             ` Mark Salter
  0 siblings, 0 replies; 128+ messages in thread
From: Mark Salter @ 2018-04-19 16:37 UTC (permalink / raw)
  To: Shea Levy, linux-riscv, linux-kernel; +Cc: Aurelien Jacquiot, linux-c6x-dev

On Sun, 2018-04-01 at 10:59 -0400, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
> 
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
> 
> Signed-off-by: Shea Levy <shea@shealevy.com>
> ---
>  arch/c6x/mm/init.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> 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);

Acked-by: Mark Salter <msalter@redhat.com>

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

* Re: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.
  2018-04-18 11:10           ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
@ 2018-04-20 20:22             ` Palmer Dabbelt
  2018-04-20 22:50               ` Shea Levy
  0 siblings, 1 reply; 128+ messages in thread
From: Palmer Dabbelt @ 2018-04-20 20:22 UTC (permalink / raw)
  To: shea, Arnd Bergmann, Olof Johansson; +Cc: linux-riscv, linux-kernel

On Wed, 18 Apr 2018 04:10:16 PDT (-0700), shea@shealevy.com wrote:
> Hi all,
>
> Shea Levy <shea@shealevy.com> writes:
>
>> This function is effectively identical across 14 architectures, and
>> the generic implementation is small enough to be negligible in the
>> architectures that do override it. Many of the remaining divergent
>> implementations can be included in the common code path in future,
>> further reducing code duplication and sharing improvements between
>> architectures.
>>
>> Series boot-tested on RISC-V (which now uses the generic
>> implementation) and x86_64 (which doesn't).
>>
>> v6: Add information about build/run testing.
>> v5: Add more complete commit messages.
>> v4: Use weak symbols instead of Kconfig.
>> v3: Make the generic path opt-out instead of opt-in.
>> v2: Mark generic free_initrd_mem __init.
>>
>> Signed-off-by: Shea Levy <shea@shealevy.com>
>> ---
>>  init/initramfs.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/init/initramfs.c b/init/initramfs.c
>> index 7e99a0038942..c8fe150f958a 100644
>> --- a/init/initramfs.c
>> +++ b/init/initramfs.c
>> @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
>>  #include <linux/initrd.h>
>>  #include <linux/kexec.h>
>>  
>> +void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
>> +{
>> +       free_reserved_area((void *)start, (void *)end, -1, "initrd");
>> +}
>> +
>>  static void __init free_initrd(void)
>>  {
>>  #ifdef CONFIG_KEXEC_CORE
>> -- 
>> 2.16.2
>
> This series has been quiet for a few weeks other than picking up some
> arch-specific acks. What is the next step here?

I'm not sure.  I don't really think it's sane for the RISC-V tree because it 
touches so many architectures -- I haven't looked closely, though.  IIRC 
there's a slight behavior change to the RISC-V port, which I'd be OK taking 
through my tree (and then obviously the RISC-V cleanup as well, unless it goes 
in as a whole patch set).

For the IRQ cleanup I currently have in flight

* Add the generic support
* Move every arch over (RISC-V is in, the rest aren't yet)
* Clean up a bit now that everyone is generic

That lets all the arch-specific patches go in parallel, but can be a bit of a 
headache to manage.

I'm adding Arnd and Olof, as they know a lot more about Linux than I do.  
Here's the top-level of the v4 patch set: https://lkml.org/lkml/2018/3/28/744

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

* Re: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.
  2018-04-20 20:22             ` Palmer Dabbelt
@ 2018-04-20 22:50               ` Shea Levy
  2018-05-09 11:15                 ` Shea Levy
  0 siblings, 1 reply; 128+ messages in thread
From: Shea Levy @ 2018-04-20 22:50 UTC (permalink / raw)
  To: Palmer Dabbelt, Arnd Bergmann, Olof Johansson; +Cc: linux-riscv, linux-kernel

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

Hi Palmer,

Palmer Dabbelt <palmer@sifive.com> writes:

> On Wed, 18 Apr 2018 04:10:16 PDT (-0700), shea@shealevy.com wrote:
>> Hi all,
>>
>> Shea Levy <shea@shealevy.com> writes:
>>
>>> This function is effectively identical across 14 architectures, and
>>> the generic implementation is small enough to be negligible in the
>>> architectures that do override it. Many of the remaining divergent
>>> implementations can be included in the common code path in future,
>>> further reducing code duplication and sharing improvements between
>>> architectures.
>>>
>>> Series boot-tested on RISC-V (which now uses the generic
>>> implementation) and x86_64 (which doesn't).
>>>
>>> v6: Add information about build/run testing.
>>> v5: Add more complete commit messages.
>>> v4: Use weak symbols instead of Kconfig.
>>> v3: Make the generic path opt-out instead of opt-in.
>>> v2: Mark generic free_initrd_mem __init.
>>>
>>> Signed-off-by: Shea Levy <shea@shealevy.com>
>>> ---
>>>  init/initramfs.c | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/init/initramfs.c b/init/initramfs.c
>>> index 7e99a0038942..c8fe150f958a 100644
>>> --- a/init/initramfs.c
>>> +++ b/init/initramfs.c
>>> @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
>>>  #include <linux/initrd.h>
>>>  #include <linux/kexec.h>
>>>  
>>> +void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
>>> +{
>>> +       free_reserved_area((void *)start, (void *)end, -1, "initrd");
>>> +}
>>> +
>>>  static void __init free_initrd(void)
>>>  {
>>>  #ifdef CONFIG_KEXEC_CORE
>>> -- 
>>> 2.16.2
>>
>> This series has been quiet for a few weeks other than picking up some
>> arch-specific acks. What is the next step here?
>
> I'm not sure.  I don't really think it's sane for the RISC-V tree because it 
> touches so many architectures -- I haven't looked closely, though.

Yeah, I think that makes sense.

> IIRC 
> there's a slight behavior change to the RISC-V port, which I'd be OK taking 
> through my tree (and then obviously the RISC-V cleanup as well, unless it goes 
> in as a whole patch set).
>

So currently the behavior for RISC-V is changed by simply deleting the
arch-specific free_initrd_mem, which was a noop. Would you like me to
first submit a patch to have the arch-specific free_initrd_mem and then
change that in this series?

>
> For the IRQ cleanup I currently have in flight
>
> * Add the generic support
> * Move every arch over (RISC-V is in, the rest aren't yet)
> * Clean up a bit now that everyone is generic
>
> That lets all the arch-specific patches go in parallel, but can be a bit of a 
> headache to manage.

With the current series, the first patch could go in on its own and all
of the arch-specific patches can go in in parallel if we wanted to, but
beyond the above-suggested implementation of the RISC-V free_initrd_mem
there's no real reordering meaningful here.

>
> I'm adding Arnd and Olof, as they know a lot more about Linux than I do.  
> Here's the top-level of the v4 patch set: https://lkml.org/lkml/2018/3/28/744

And here's the top-level of v6, the latest: https://lkml.org/lkml/2018/4/1/50

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

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

* Re: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.
  2018-04-20 22:50               ` Shea Levy
@ 2018-05-09 11:15                 ` Shea Levy
  0 siblings, 0 replies; 128+ messages in thread
From: Shea Levy @ 2018-05-09 11:15 UTC (permalink / raw)
  To: Palmer Dabbelt, Arnd Bergmann, Olof Johansson; +Cc: linux-riscv, linux-kernel

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

Hi all,

Shea Levy <shea@shealevy.com> writes:

> Hi Palmer,
>
> Palmer Dabbelt <palmer@sifive.com> writes:
>
>> On Wed, 18 Apr 2018 04:10:16 PDT (-0700), shea@shealevy.com wrote:
>>> Hi all,
>>>
>>> Shea Levy <shea@shealevy.com> writes:
>>>
>>>> This function is effectively identical across 14 architectures, and
>>>> the generic implementation is small enough to be negligible in the
>>>> architectures that do override it. Many of the remaining divergent
>>>> implementations can be included in the common code path in future,
>>>> further reducing code duplication and sharing improvements between
>>>> architectures.
>>>>
>>>> Series boot-tested on RISC-V (which now uses the generic
>>>> implementation) and x86_64 (which doesn't).
>>>>
>>>> v6: Add information about build/run testing.
>>>> v5: Add more complete commit messages.
>>>> v4: Use weak symbols instead of Kconfig.
>>>> v3: Make the generic path opt-out instead of opt-in.
>>>> v2: Mark generic free_initrd_mem __init.
>>>>
>>>> Signed-off-by: Shea Levy <shea@shealevy.com>
>>>> ---
>>>>  init/initramfs.c | 5 +++++
>>>>  1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/init/initramfs.c b/init/initramfs.c
>>>> index 7e99a0038942..c8fe150f958a 100644
>>>> --- a/init/initramfs.c
>>>> +++ b/init/initramfs.c
>>>> @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
>>>>  #include <linux/initrd.h>
>>>>  #include <linux/kexec.h>
>>>>  
>>>> +void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
>>>> +{
>>>> +       free_reserved_area((void *)start, (void *)end, -1, "initrd");
>>>> +}
>>>> +
>>>>  static void __init free_initrd(void)
>>>>  {
>>>>  #ifdef CONFIG_KEXEC_CORE
>>>> -- 
>>>> 2.16.2
>>>
>>> This series has been quiet for a few weeks other than picking up some
>>> arch-specific acks. What is the next step here?
>>
>> I'm not sure.  I don't really think it's sane for the RISC-V tree because it 
>> touches so many architectures -- I haven't looked closely, though.
>
> Yeah, I think that makes sense.
>
>> IIRC 
>> there's a slight behavior change to the RISC-V port, which I'd be OK taking 
>> through my tree (and then obviously the RISC-V cleanup as well, unless it goes 
>> in as a whole patch set).
>>
>
> So currently the behavior for RISC-V is changed by simply deleting the
> arch-specific free_initrd_mem, which was a noop. Would you like me to
> first submit a patch to have the arch-specific free_initrd_mem and then
> change that in this series?
>
>>
>> For the IRQ cleanup I currently have in flight
>>
>> * Add the generic support
>> * Move every arch over (RISC-V is in, the rest aren't yet)
>> * Clean up a bit now that everyone is generic
>>
>> That lets all the arch-specific patches go in parallel, but can be a bit of a 
>> headache to manage.
>
> With the current series, the first patch could go in on its own and all
> of the arch-specific patches can go in in parallel if we wanted to, but
> beyond the above-suggested implementation of the RISC-V free_initrd_mem
> there's no real reordering meaningful here.
>
>>
>> I'm adding Arnd and Olof, as they know a lot more about Linux than I do.  
>> Here's the top-level of the v4 patch set: https://lkml.org/lkml/2018/3/28/744
>
> And here's the top-level of v6, the latest: https://lkml.org/lkml/2018/4/1/50

What's the right next step here?

Thanks,
Shea

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

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

end of thread, other threads:[~2018-05-09 11:15 UTC | newest]

Thread overview: 128+ 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
2018-03-28 15:26   ` [PATCH] Extract initrd free logic from arch-specific code Shea Levy
2018-03-28 15:58     ` Rob Landley
2018-03-28 16:04       ` Shea Levy
2018-03-28 16:48       ` Russell King - ARM Linux
2018-03-28 19:04         ` Rob Landley
2018-03-28 22:14           ` Russell King - ARM Linux
2018-03-28 22:37             ` Oliver
2018-03-29  0:23               ` Nicholas Piggin
2018-03-29 15:27               ` Russell King - ARM Linux
2018-03-29 15:43                 ` Geert Uytterhoeven
2018-03-29 15:58                   ` Russell King - ARM Linux
2018-03-29 16:53                     ` Marc Zyngier
2018-03-29 17:32                       ` Russell King - ARM Linux
2018-03-29 17:53                         ` Marc Zyngier
2018-03-29 17:43                 ` Rob Landley
2018-03-29 16:39             ` Rob Landley
2018-03-29 17:31               ` Russell King - ARM Linux
2018-03-28 16:55     ` Kees Cook
2018-03-29  1:12       ` Wei Yang
2018-03-28 20:36     ` [PATCH v4 0/16] Generic initrd_free_mem Shea Levy
2018-03-28 20:36       ` [PATCH v4 01/16] initrd: Add weakly-linked generic free_initrd_mem Shea Levy
2018-03-28 20:36       ` [PATCH v4 02/16] riscv: Use " Shea Levy
2018-03-29  9:52         ` Daniel Thompson
2018-03-29 11:12           ` Shea Levy
2018-03-28 20:36       ` [PATCH v4 03/16] alpha: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 04/16] arc: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 05/16] c6x: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 06/16] frv: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 07/16] h8300: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 08/16] m32r: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 09/16] m68k: " Shea Levy
2018-03-29  6:55         ` Geert Uytterhoeven
2018-03-28 20:36       ` [PATCH v4 10/16] microblaze: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 11/16] nios2: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 12/16] openrisc: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 13/16] parisc: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 14/16] powerpc: " Shea Levy
2018-03-28 20:44         ` Joe Perches
2018-03-28 20:53           ` Shea Levy
2018-03-29 13:19             ` Michael Ellerman
2018-04-01 15:01               ` Shea Levy
2018-03-28 20:36       ` [PATCH v4 15/16] sh: " Shea Levy
2018-03-28 20:36       ` [PATCH v4 16/16] um: " Shea Levy
2018-03-29 11:31       ` [PATCH v5 01/16] initrd: Add weakly-linked " Shea Levy
2018-03-29 11:31         ` [PATCH v5 02/16] riscv: Free initrds with " Shea Levy
2018-03-29 11:31         ` [PATCH v5 03/16] alpha: Switch to " Shea Levy
2018-03-29 11:31         ` [PATCH v5 04/16] arc: " Shea Levy
2018-03-29 11:31         ` [PATCH v5 05/16] c6x: " Shea Levy
2018-03-29 11:31         ` [PATCH v5 06/16] frv: " Shea Levy
2018-03-29 11:31         ` [PATCH v5 07/16] h8300: " Shea Levy
2018-03-29 11:31         ` [PATCH v5 08/16] m32r: " Shea Levy
2018-03-29 11:32         ` [PATCH v5 09/16] m68k: " Shea Levy
2018-03-29 11:32         ` [PATCH v5 10/16] microblaze: " Shea Levy
2018-03-29 11:32         ` [PATCH v5 11/16] nios2: " Shea Levy
2018-03-29 11:32         ` [PATCH v5 12/16] openrisc: " Shea Levy
2018-03-29 11:50           ` Stafford Horne
2018-03-29 11:32         ` [PATCH v5 13/16] parisc: " Shea Levy
2018-03-29 11:32         ` [PATCH v5 14/16] powerpc: " Shea Levy
2018-03-29 11:32         ` [PATCH v5 15/16] sh: " Shea Levy
2018-03-29 16:26           ` Rich Felker
2018-03-29 11:32         ` [PATCH v5 16/16] um: " Shea Levy
2018-04-01 14:59         ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
2018-04-01 14:59           ` [PATCH v6 02/16] riscv: Free initrds with " Shea Levy
2018-04-01 14:59           ` [PATCH v6 03/16] alpha: Switch to " Shea Levy
2018-04-01 14:59           ` [PATCH v6 04/16] arc: " Shea Levy
2018-04-04 15:21             ` Alexey Brodkin
2018-04-09 16:40             ` Vineet Gupta
2018-04-01 14:59           ` [PATCH v6 05/16] c6x: " Shea Levy
2018-04-19 16:37             ` Mark Salter
2018-04-01 14:59           ` [PATCH v6 06/16] frv: " Shea Levy
2018-04-01 14:59           ` [PATCH v6 07/16] h8300: " Shea Levy
2018-04-01 14:59           ` [PATCH v6 08/16] m32r: " Shea Levy
2018-04-01 14:59           ` [PATCH v6 09/16] m68k: " Shea Levy
2018-04-01 14:59           ` [PATCH v6 10/16] microblaze: " Shea Levy
2018-04-01 14:59           ` [PATCH v6 11/16] nios2: " Shea Levy
2018-04-02 16:04             ` Ley Foon Tan
2018-04-01 14:59           ` [PATCH v6 12/16] openrisc: " Shea Levy
2018-04-01 14:59           ` [PATCH v6 13/16] parisc: " Shea Levy
2018-04-02 20:07             ` Helge Deller
2018-04-01 14:59           ` [PATCH v6 14/16] powerpc: " Shea Levy
2018-04-01 14:59           ` [PATCH v6 15/16] sh: " Shea Levy
2018-04-01 14:59           ` [PATCH v6 16/16] um: " Shea Levy
2018-04-18 11:10           ` [PATCH v6 01/16] initrd: Add weakly-linked " Shea Levy
2018-04-20 20:22             ` Palmer Dabbelt
2018-04-20 22:50               ` Shea Levy
2018-05-09 11:15                 ` Shea Levy
2018-03-30 11:15     ` [PATCH] Extract initrd free logic from arch-specific code Ingo Molnar
2018-04-01 15:05       ` Shea Levy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).