lkml.org 
[lkml]   [2018]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 3/5] x86/KASLR: Give a warning if movable_node specified without kaslr_mem=
On 01/19/18 at 11:31am, Chao Fan wrote:
> Since only 'movable_node' specified without 'kaslr_mem=' may break
> memory hotplug, so reconmmend users using 'kaslr_mem=' when
> 'movable_node' specified.
>
> Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
> ---
> arch/x86/boot/compressed/kaslr.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
> index b200a7ceafc1..8703cc764306 100644
> --- a/arch/x86/boot/compressed/kaslr.c
> +++ b/arch/x86/boot/compressed/kaslr.c
> @@ -282,6 +282,16 @@ static int handle_mem_filter(void)
> !strstr(args, "kaslr_mem="))
> return 0;

Looks good to me.

Acked-by: Baoquan He <bhe@redhat.com>

>
> +#ifdef CONFIG_MEMORY_HOTPLUG
> + /*
> + * Check if 'kaslr_mem=' specified when 'movable_node' found. If not,
> + * just give warrning. Otherwise memory hotplug could be
> + * affected if kernel is put on movable memory regions.
> + */
> + if (strstr(args, "movable_node") && !strstr(args, "kaslr_mem="))
> + warn("'kaslr_mem=' should be specified when using 'movable_node'.\n");
> +#endif
> +
> tmp_cmdline = malloc(len + 1);
> if (!tmp_cmdline)
> error("Failed to allocate space for tmp_cmdline");
> --
> 2.14.3
>
>
>

\
 
 \ /
  Last update: 2018-01-19 04:49    [W:0.050 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site