lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mhng-be5cef72-ac95-4f24-8b45-4c884085d2cb@palmer-si-x1c4>
Date:   Tue, 12 Feb 2019 13:59:29 -0800 (PST)
From:   Palmer Dabbelt <palmer@...ive.com>
To:     Anup.Patel@....com
CC:     aou@...s.berkeley.edu, Atish Patra <Atish.Patra@....com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Christoph Hellwig <hch@...radead.org>,
        linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Anup.Patel@....com
Subject:     Re: [PATCH v2 6/6] RISC-V: Implement keepinitrd kernel parameter

On Sat, 19 Jan 2019 05:28:59 PST (-0800), Anup.Patel@....com wrote:
> This patch implements keepinitrd kernel parameter. By default,
> keepinitrd=1 but users can pass "keepinitrd=0" to free-up
> initrd memory at boot-time in free_initrd_mem() function.
>
> The keepinitrd kernel parameter is already implemented by
> unicore32, arm, and arm64 architectures and it is documented
> at: Documentation/admin-guide/kernel-parameters.txt

All I see is

"

        keepinitrd      [HW,ARM]

"

which is pretty lacking for documentation and should be improved...

I'm happy to take this as it stands for the next merge window, as if you hadn't 
mentioned documentation then I wouldn't have looked :)

> Signed-off-by: Anup Patel <anup.patel@....com>
> ---
>  arch/riscv/kernel/setup.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> index 9cd583b6d1cd..46e547dd8245 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -97,8 +97,20 @@ static void __init setup_initrd(void)
>  	initrd_end = 0;
>  }
>  
> -void free_initrd_mem(unsigned long start, unsigned long end)
> +static int keep_initrd __initdata;
> +
> +static int __init keepinitrd_setup(char *__unused)
> +{
> +	keep_initrd = 1;
> +	return 1;
> +}
> +
> +__setup("keepinitrd", keepinitrd_setup);
> +
> +void __init free_initrd_mem(unsigned long start, unsigned long end)
>  {
> +	if (!keep_initrd)
> +		memblock_free(__pa(start), end - start);
>  }
>  #endif /* CONFIG_BLK_DEV_INITRD */
>  
> -- 
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ