lkml.org 
[lkml]   [2019]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] arm64/mm: Poison initmem while freeing with free_reserved_area()
From
Date
On 04/10/2019 05:23, Anshuman Khandual wrote:
> Platform implementation for free_initmem() should poison the memory while
> freeing it up. Hence pass across POISON_FREE_INITMEM while calling into
> free_reserved_area(). The same is being followed in the generic fallback
> for free_initmem() and some other platforms overriding it.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>

Is there a good reason you haven't made a similar change to
free_initrd_mem() - the same logic seems to apply. However this change
looks fine to me.

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
> arch/arm64/mm/init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index 45c00a54909c..ea7d38011e83 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -571,7 +571,7 @@ void free_initmem(void)
> {
> free_reserved_area(lm_alias(__init_begin),
> lm_alias(__init_end),
> - 0, "unused kernel");
> + POISON_FREE_INITMEM, "unused kernel");
> /*
> * Unmap the __init region but leave the VM area in place. This
> * prevents the region from being reused for kernel modules, which
>

\
 
 \ /
  Last update: 2019-10-04 12:19    [W:0.077 / U:2.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site