Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753421AbeAQODH (ORCPT + 1 other); Wed, 17 Jan 2018 09:03:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53764 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753388AbeAQODF (ORCPT ); Wed, 17 Jan 2018 09:03:05 -0500 Date: Wed, 17 Jan 2018 22:02:48 +0800 From: Baoquan He To: Chao Fan Cc: linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, keescook@chromium.org, yasu.isimatu@gmail.com, indou.takao@jp.fujitsu.com, lcapitulino@redhat.com Subject: Re: [PATCH v7 3/5] x86/KASLR: Give a warning if movable_node specified without kaslr_mem= Message-ID: <20180117140248.GG2321@localhost.localdomain> References: <20180117105351.12226-1-fanc.fnst@cn.fujitsu.com> <20180117105351.12226-4-fanc.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180117105351.12226-4-fanc.fnst@cn.fujitsu.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 17 Jan 2018 14:03:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/17/18 at 06:53pm, 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 > --- > 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..dca846b522fc 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; > > +#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 put on movable memory regions. > + */ > + if (strstr(args, "movable_node") && !strstr(args, "kaslr_mem=")) > + warn("kaslr_mem= should specified when using movable_node.\n"); 'kaslr_mem=' ^be > +#endif > + > tmp_cmdline = malloc(len + 1); > if (!tmp_cmdline) > error("Failed to allocate space for tmp_cmdline"); > -- > 2.14.3 > > >