linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] provide a generic free_initmem implementation
@ 2019-02-14 15:59 Mike Rapoport
  2019-02-14 15:59 ` [PATCH 1/4] init: " Mike Rapoport
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Mike Rapoport @ 2019-02-14 15:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christoph Hellwig, Palmer Dabbelt, Richard Kuo, linux-arch,
	linux-hexagon, linux-kernel, linux-mm, linux-riscv,
	Mike Rapoport

Hi,

Many architectures implement free_initmem() in exactly the same or very
similar way: they wrap the call to free_initmem_default() with sometimes
different 'poison' parameter.

These patches switch those architectures to use a generic implementation
that does free_initmem_default(POISON_FREE_INITMEM).

This was inspired by Christoph's patches for free_initrd_mem [1] and I
shamelessly copied changlog entries from his patches :)

[1] https://lore.kernel.org/lkml/20190213174621.29297-1-hch@lst.de/

Mike Rapoport (4):
  init: provide a generic free_initmem implementation
  hexagon: switch over to generic free_initmem()
  init: free_initmem: poison freed init memory
  riscv: switch over to generic free_initmem()

 arch/alpha/mm/init.c      |  6 ------
 arch/arc/mm/init.c        |  8 --------
 arch/c6x/mm/init.c        |  5 -----
 arch/h8300/mm/init.c      |  6 ------
 arch/hexagon/mm/init.c    | 10 ----------
 arch/microblaze/mm/init.c |  5 -----
 arch/nds32/mm/init.c      |  5 -----
 arch/nios2/mm/init.c      |  5 -----
 arch/openrisc/mm/init.c   |  5 -----
 arch/riscv/mm/init.c      |  5 -----
 arch/sh/mm/init.c         |  5 -----
 arch/sparc/mm/init_32.c   |  5 -----
 arch/unicore32/mm/init.c  |  5 -----
 arch/xtensa/mm/init.c     |  5 -----
 init/main.c               |  5 +++++
 15 files changed, 5 insertions(+), 80 deletions(-)

-- 
2.7.4


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

* [PATCH 1/4] init: provide a generic free_initmem implementation
  2019-02-14 15:59 [PATCH 0/4] provide a generic free_initmem implementation Mike Rapoport
@ 2019-02-14 15:59 ` Mike Rapoport
  2019-02-14 15:59 ` [PATCH 2/4] hexagon: switch over to generic free_initmem() Mike Rapoport
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Mike Rapoport @ 2019-02-14 15:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christoph Hellwig, Palmer Dabbelt, Richard Kuo, linux-arch,
	linux-hexagon, linux-kernel, linux-mm, linux-riscv,
	Mike Rapoport

For most architectures free_initmem just a wrapper for the same
free_initmem_default(-1) call.
Provide that as a generic implementation marked __weak.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
 arch/alpha/mm/init.c      | 6 ------
 arch/arc/mm/init.c        | 8 --------
 arch/c6x/mm/init.c        | 5 -----
 arch/h8300/mm/init.c      | 6 ------
 arch/microblaze/mm/init.c | 5 -----
 arch/nds32/mm/init.c      | 5 -----
 arch/nios2/mm/init.c      | 5 -----
 arch/openrisc/mm/init.c   | 5 -----
 arch/sh/mm/init.c         | 5 -----
 arch/unicore32/mm/init.c  | 5 -----
 arch/xtensa/mm/init.c     | 5 -----
 init/main.c               | 5 +++++
 12 files changed, 5 insertions(+), 60 deletions(-)

diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index a42fc5c..8a8ac09 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -286,12 +286,6 @@ mem_init(void)
 	mem_init_print_info(NULL);
 }
 
-void
-free_initmem(void)
-{
-	free_initmem_default(-1);
-}
-
 #ifdef CONFIG_BLK_DEV_INITRD
 void
 free_initrd_mem(unsigned long start, unsigned long end)
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index e1ab2d7..1d08736 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -207,14 +207,6 @@ void __init mem_init(void)
 	mem_init_print_info(NULL);
 }
 
-/*
- * free_initmem: Free all the __init memory.
- */
-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)
 {
diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c
index af5ada0..ca1c182 100644
--- a/arch/c6x/mm/init.c
+++ b/arch/c6x/mm/init.c
@@ -73,8 +73,3 @@ 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/h8300/mm/init.c b/arch/h8300/mm/init.c
index 6519252..fabf9e3 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -108,9 +108,3 @@ 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/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index b17fd8a..4d6fa630 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -193,11 +193,6 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 }
 #endif
 
-void free_initmem(void)
-{
-	free_initmem_default(-1);
-}
-
 void __init mem_init(void)
 {
 	high_memory = (void *)__va(memory_start + lowmem_size - 1);
diff --git a/arch/nds32/mm/init.c b/arch/nds32/mm/init.c
index 253f79f..8a1563e 100644
--- a/arch/nds32/mm/init.c
+++ b/arch/nds32/mm/init.c
@@ -244,11 +244,6 @@ void __init mem_init(void)
 	return;
 }
 
-void free_initmem(void)
-{
-	free_initmem_default(-1);
-}
-
 #ifdef CONFIG_BLK_DEV_INITRD
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c
index 16cea57..362a7a7 100644
--- a/arch/nios2/mm/init.c
+++ b/arch/nios2/mm/init.c
@@ -89,11 +89,6 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
 }
 #endif
 
-void __ref free_initmem(void)
-{
-	free_initmem_default(-1);
-}
-
 #define __page_aligned(order) __aligned(PAGE_SIZE << (order))
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER);
 pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER);
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
index d157310..bf3a160 100644
--- a/arch/openrisc/mm/init.c
+++ b/arch/openrisc/mm/init.c
@@ -227,8 +227,3 @@ 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/sh/mm/init.c b/arch/sh/mm/init.c
index a8e5c0e..bc59332 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -405,11 +405,6 @@ void __init mem_init(void)
 	mem_init_done = 1;
 }
 
-void free_initmem(void)
-{
-	free_initmem_default(-1);
-}
-
 #ifdef CONFIG_BLK_DEV_INITRD
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c
index 85ef2c6..3aed4d5 100644
--- a/arch/unicore32/mm/init.c
+++ b/arch/unicore32/mm/init.c
@@ -312,11 +312,6 @@ void __init mem_init(void)
 	}
 }
 
-void free_initmem(void)
-{
-	free_initmem_default(-1);
-}
-
 #ifdef CONFIG_BLK_DEV_INITRD
 
 static int keep_initrd;
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index d498610..b51746f 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -216,11 +216,6 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 }
 #endif
 
-void free_initmem(void)
-{
-	free_initmem_default(-1);
-}
-
 static void __init parse_memmap_one(char *p)
 {
 	char *oldp;
diff --git a/init/main.c b/init/main.c
index c86a1c8..38d69e0 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1047,6 +1047,11 @@ static inline void mark_readonly(void)
 }
 #endif
 
+void __weak free_initmem(void)
+{
+	free_initmem_default(-1);
+}
+
 static int __ref kernel_init(void *unused)
 {
 	int ret;
-- 
2.7.4


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

* [PATCH 2/4] hexagon: switch over to generic free_initmem()
  2019-02-14 15:59 [PATCH 0/4] provide a generic free_initmem implementation Mike Rapoport
  2019-02-14 15:59 ` [PATCH 1/4] init: " Mike Rapoport
@ 2019-02-14 15:59 ` Mike Rapoport
  2019-02-14 15:59 ` [PATCH 3/4] init: free_initmem: poison freed init memory Mike Rapoport
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Mike Rapoport @ 2019-02-14 15:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christoph Hellwig, Palmer Dabbelt, Richard Kuo, linux-arch,
	linux-hexagon, linux-kernel, linux-mm, linux-riscv,
	Mike Rapoport

hexagon implementation of free_initmem() is currently empty and marked with
comment

 * Todo:  free pages between __init_begin and __init_end; possibly
 * some devtree related stuff as well.

Switch it to the generic implementation.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
 arch/hexagon/mm/init.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/arch/hexagon/mm/init.c b/arch/hexagon/mm/init.c
index 1719ede..41cf342 100644
--- a/arch/hexagon/mm/init.c
+++ b/arch/hexagon/mm/init.c
@@ -85,16 +85,6 @@ void __init mem_init(void)
 }
 
 /*
- * free_initmem - frees memory used by stuff declared with __init
- *
- * Todo:  free pages between __init_begin and __init_end; possibly
- * some devtree related stuff as well.
- */
-void __ref free_initmem(void)
-{
-}
-
-/*
  * free_initrd_mem - frees...  initrd memory.
  * @start - start of init memory
  * @end - end of init memory
-- 
2.7.4


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

* [PATCH 3/4] init: free_initmem: poison freed init memory
  2019-02-14 15:59 [PATCH 0/4] provide a generic free_initmem implementation Mike Rapoport
  2019-02-14 15:59 ` [PATCH 1/4] init: " Mike Rapoport
  2019-02-14 15:59 ` [PATCH 2/4] hexagon: switch over to generic free_initmem() Mike Rapoport
@ 2019-02-14 15:59 ` Mike Rapoport
  2019-02-14 15:59 ` [PATCH 4/4] riscv: switch over to generic free_initmem() Mike Rapoport
  2019-02-14 17:04 ` [PATCH 0/4] provide a generic free_initmem implementation Christoph Hellwig
  4 siblings, 0 replies; 11+ messages in thread
From: Mike Rapoport @ 2019-02-14 15:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christoph Hellwig, Palmer Dabbelt, Richard Kuo, linux-arch,
	linux-hexagon, linux-kernel, linux-mm, linux-riscv,
	Mike Rapoport

Various architectures including x86 poison the freed init memory.
Do the same in the generic free_initmem implementation and switch sparc32
architecture that is identical to the generic code over to it now.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
 arch/sparc/mm/init_32.c | 5 -----
 init/main.c             | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index d900952..77e8341 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -294,11 +294,6 @@ void __init mem_init(void)
 	mem_init_print_info(NULL);
 }
 
-void free_initmem (void)
-{
-	free_initmem_default(POISON_FREE_INITMEM);
-}
-
 #ifdef CONFIG_BLK_DEV_INITRD
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
diff --git a/init/main.c b/init/main.c
index 38d69e0..9a61e9c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1049,7 +1049,7 @@ static inline void mark_readonly(void)
 
 void __weak free_initmem(void)
 {
-	free_initmem_default(-1);
+	free_initmem_default(POISON_FREE_INITMEM);
 }
 
 static int __ref kernel_init(void *unused)
-- 
2.7.4


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

* [PATCH 4/4] riscv: switch over to generic free_initmem()
  2019-02-14 15:59 [PATCH 0/4] provide a generic free_initmem implementation Mike Rapoport
                   ` (2 preceding siblings ...)
  2019-02-14 15:59 ` [PATCH 3/4] init: free_initmem: poison freed init memory Mike Rapoport
@ 2019-02-14 15:59 ` Mike Rapoport
  2019-02-14 20:49   ` Palmer Dabbelt
  2019-02-14 17:04 ` [PATCH 0/4] provide a generic free_initmem implementation Christoph Hellwig
  4 siblings, 1 reply; 11+ messages in thread
From: Mike Rapoport @ 2019-02-14 15:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christoph Hellwig, Palmer Dabbelt, Richard Kuo, linux-arch,
	linux-hexagon, linux-kernel, linux-mm, linux-riscv,
	Mike Rapoport

The riscv version of free_initmem() differs from the generic one only in
that it sets the freed memory to zero.

Make ricsv use the generic version and poison the freed memory.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
 arch/riscv/mm/init.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 658ebf6..2af0010 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -60,11 +60,6 @@ void __init mem_init(void)
 	mem_init_print_info(NULL);
 }
 
-void free_initmem(void)
-{
-	free_initmem_default(0);
-}
-
 #ifdef CONFIG_BLK_DEV_INITRD
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
-- 
2.7.4


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

* Re: [PATCH 0/4] provide a generic free_initmem implementation
  2019-02-14 15:59 [PATCH 0/4] provide a generic free_initmem implementation Mike Rapoport
                   ` (3 preceding siblings ...)
  2019-02-14 15:59 ` [PATCH 4/4] riscv: switch over to generic free_initmem() Mike Rapoport
@ 2019-02-14 17:04 ` Christoph Hellwig
  2019-02-14 18:38   ` Mike Rapoport
  4 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2019-02-14 17:04 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Andrew Morton, Christoph Hellwig, Palmer Dabbelt, Richard Kuo,
	linux-arch, linux-hexagon, linux-kernel, linux-mm, linux-riscv

This look fine to me, but I'm a little worried that as-is this will
just create conflicts with my series..

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

* Re: [PATCH 0/4] provide a generic free_initmem implementation
  2019-02-14 17:04 ` [PATCH 0/4] provide a generic free_initmem implementation Christoph Hellwig
@ 2019-02-14 18:38   ` Mike Rapoport
  2019-02-18  9:49     ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Rapoport @ 2019-02-14 18:38 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Andrew Morton, Palmer Dabbelt, Richard Kuo, linux-arch,
	linux-hexagon, linux-kernel, linux-mm, linux-riscv

On Thu, Feb 14, 2019 at 06:04:16PM +0100, Christoph Hellwig wrote:
> This look fine to me, but I'm a little worried that as-is this will
> just create conflicts with my series..

I'll rebase on top of your patches once they are in. Or I can send both
series as a single set.
Preferences? 

-- 
Sincerely yours,
Mike.


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

* Re: [PATCH 4/4] riscv: switch over to generic free_initmem()
  2019-02-14 15:59 ` [PATCH 4/4] riscv: switch over to generic free_initmem() Mike Rapoport
@ 2019-02-14 20:49   ` Palmer Dabbelt
  2019-02-18 12:46     ` Souptick Joarder
  0 siblings, 1 reply; 11+ messages in thread
From: Palmer Dabbelt @ 2019-02-14 20:49 UTC (permalink / raw)
  To: rppt
  Cc: akpm, Christoph Hellwig, rkuo, linux-arch, linux-hexagon,
	linux-kernel, linux-mm, linux-riscv, rppt

On Thu, 14 Feb 2019 07:59:37 PST (-0800), rppt@linux.ibm.com wrote:
> The riscv version of free_initmem() differs from the generic one only in
> that it sets the freed memory to zero.
>
> Make ricsv use the generic version and poison the freed memory.
>
> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
>  arch/riscv/mm/init.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 658ebf6..2af0010 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -60,11 +60,6 @@ void __init mem_init(void)
>  	mem_init_print_info(NULL);
>  }
>
> -void free_initmem(void)
> -{
> -	free_initmem_default(0);
> -}
> -
>  #ifdef CONFIG_BLK_DEV_INITRD
>  void free_initrd_mem(unsigned long start, unsigned long end)
>  {

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

I'm going to assume this goes in with the rest of the patch set, thanks!

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

* Re: [PATCH 0/4] provide a generic free_initmem implementation
  2019-02-14 18:38   ` Mike Rapoport
@ 2019-02-18  9:49     ` Christoph Hellwig
  0 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2019-02-18  9:49 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Christoph Hellwig, Andrew Morton, Palmer Dabbelt, Richard Kuo,
	linux-arch, linux-hexagon, linux-kernel, linux-mm, linux-riscv

On Thu, Feb 14, 2019 at 08:38:55PM +0200, Mike Rapoport wrote:
> On Thu, Feb 14, 2019 at 06:04:16PM +0100, Christoph Hellwig wrote:
> > This look fine to me, but I'm a little worried that as-is this will
> > just create conflicts with my series..
> 
> I'll rebase on top of your patches once they are in. Or I can send both
> series as a single set.
> Preferences? 

So far there wasn't really much a reason to rebase my series, hope
this gets picked up either by Andrew or Al (not sure what the right
place is).  I think for now just rebase your series on top, we can
then figure out how to proceed.

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

* Re: [PATCH 4/4] riscv: switch over to generic free_initmem()
  2019-02-14 20:49   ` Palmer Dabbelt
@ 2019-02-18 12:46     ` Souptick Joarder
  2019-02-18 12:50       ` Souptick Joarder
  0 siblings, 1 reply; 11+ messages in thread
From: Souptick Joarder @ 2019-02-18 12:46 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Andrew Morton, Palmer Dabbelt, Christoph Hellwig, rkuo,
	linux-arch, linux-hexagon, linux-kernel, Linux-MM, linux-riscv

Hi Mike,

On Fri, Feb 15, 2019 at 2:19 AM Palmer Dabbelt <palmer@sifive.com> wrote:
>
> On Thu, 14 Feb 2019 07:59:37 PST (-0800), rppt@linux.ibm.com wrote:
> > The riscv version of free_initmem() differs from the generic one only in
> > that it sets the freed memory to zero.
> >
> > Make ricsv use the generic version and poison the freed memory.
> >
> > Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>

Just for clarity, does same change applicable in below places -

arch/openrisc/mm/init.c#L231
arch/alpha/mm/init.c#L290
arch/arc/mm/init.c#L213
arch/m68k/mm/init.c#L109
arch/nds32/mm/init.c#L247
arch/nios2/mm/init.c#L92
arch/openrisc/mm/init.c#L231


> > ---
> >  arch/riscv/mm/init.c | 5 -----
> >  1 file changed, 5 deletions(-)
> >
> > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> > index 658ebf6..2af0010 100644
> > --- a/arch/riscv/mm/init.c
> > +++ b/arch/riscv/mm/init.c
> > @@ -60,11 +60,6 @@ void __init mem_init(void)
> >       mem_init_print_info(NULL);
> >  }
> >
> > -void free_initmem(void)
> > -{
> > -     free_initmem_default(0);
> > -}
> > -
> >  #ifdef CONFIG_BLK_DEV_INITRD
> >  void free_initrd_mem(unsigned long start, unsigned long end)
> >  {
>
> Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
>
> I'm going to assume this goes in with the rest of the patch set, thanks!
>

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

* Re: [PATCH 4/4] riscv: switch over to generic free_initmem()
  2019-02-18 12:46     ` Souptick Joarder
@ 2019-02-18 12:50       ` Souptick Joarder
  0 siblings, 0 replies; 11+ messages in thread
From: Souptick Joarder @ 2019-02-18 12:50 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Andrew Morton, Palmer Dabbelt, Christoph Hellwig, rkuo,
	linux-arch, linux-hexagon, linux-kernel, Linux-MM, linux-riscv

On Mon, Feb 18, 2019 at 6:16 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> Hi Mike,
>
> On Fri, Feb 15, 2019 at 2:19 AM Palmer Dabbelt <palmer@sifive.com> wrote:
> >
> > On Thu, 14 Feb 2019 07:59:37 PST (-0800), rppt@linux.ibm.com wrote:
> > > The riscv version of free_initmem() differs from the generic one only in
> > > that it sets the freed memory to zero.
> > >
> > > Make ricsv use the generic version and poison the freed memory.
> > >
> > > Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
>
> Just for clarity, does same change applicable in below places -
>
> arch/openrisc/mm/init.c#L231
> arch/alpha/mm/init.c#L290
> arch/arc/mm/init.c#L213
> arch/m68k/mm/init.c#L109
> arch/nds32/mm/init.c#L247
> arch/nios2/mm/init.c#L92
> arch/openrisc/mm/init.c#L231

Please ignore this query. just saw the other patches.
Sorry for the noise.
>
>
> > > ---
> > >  arch/riscv/mm/init.c | 5 -----
> > >  1 file changed, 5 deletions(-)
> > >
> > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> > > index 658ebf6..2af0010 100644
> > > --- a/arch/riscv/mm/init.c
> > > +++ b/arch/riscv/mm/init.c
> > > @@ -60,11 +60,6 @@ void __init mem_init(void)
> > >       mem_init_print_info(NULL);
> > >  }
> > >
> > > -void free_initmem(void)
> > > -{
> > > -     free_initmem_default(0);
> > > -}
> > > -
> > >  #ifdef CONFIG_BLK_DEV_INITRD
> > >  void free_initrd_mem(unsigned long start, unsigned long end)
> > >  {
> >
> > Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
> >
> > I'm going to assume this goes in with the rest of the patch set, thanks!
> >

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

end of thread, other threads:[~2019-02-18 12:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-14 15:59 [PATCH 0/4] provide a generic free_initmem implementation Mike Rapoport
2019-02-14 15:59 ` [PATCH 1/4] init: " Mike Rapoport
2019-02-14 15:59 ` [PATCH 2/4] hexagon: switch over to generic free_initmem() Mike Rapoport
2019-02-14 15:59 ` [PATCH 3/4] init: free_initmem: poison freed init memory Mike Rapoport
2019-02-14 15:59 ` [PATCH 4/4] riscv: switch over to generic free_initmem() Mike Rapoport
2019-02-14 20:49   ` Palmer Dabbelt
2019-02-18 12:46     ` Souptick Joarder
2019-02-18 12:50       ` Souptick Joarder
2019-02-14 17:04 ` [PATCH 0/4] provide a generic free_initmem implementation Christoph Hellwig
2019-02-14 18:38   ` Mike Rapoport
2019-02-18  9:49     ` Christoph Hellwig

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).