From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755438AbeASDrn (ORCPT ); Thu, 18 Jan 2018 22:47:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43050 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755202AbeASDrj (ORCPT ); Thu, 18 Jan 2018 22:47:39 -0500 Date: Fri, 19 Jan 2018 11:47:34 +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 v8 4/5] x86/KASLR: Skip memory mirror handling if movable_node specified Message-ID: <20180119034734.GD1753@localhost.localdomain> References: <20180117105351.12226-5-fanc.fnst@cn.fujitsu.com> <20180119033352.22112-1-fanc.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180119033352.22112-1-fanc.fnst@cn.fujitsu.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/19/18 at 11:33am, Chao Fan wrote: > In kernel code, if movable_node specified, it will skip the mirror > feature. So we should also skip mirror feature in KASLR. > > Signed-off-by: Chao Fan > --- > arch/x86/boot/compressed/kaslr.c | 7 +++++++ > 1 file changed, 7 insertions(+) Ack. Acked-by: Baoquan He > > diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c > index 8703cc764306..e4b487f0b7af 100644 > --- a/arch/x86/boot/compressed/kaslr.c > +++ b/arch/x86/boot/compressed/kaslr.c > @@ -692,6 +692,7 @@ static bool > process_efi_entries(unsigned long minimum, unsigned long image_size) > { > struct efi_info *e = &boot_params->efi_info; > + char *args = (char *)get_cmd_line_ptr(); > bool efi_mirror_found = false; > struct mem_vector region; > efi_memory_desc_t *md; > @@ -725,6 +726,12 @@ process_efi_entries(unsigned long minimum, unsigned long image_size) > } > } > > +#ifdef CONFIG_MEMORY_HOTPLUG > + /* Skip memory mirror if 'movabale_node' specified */ > + if (strstr(args, "movable_node")) > + efi_mirror_found = false; > +#endif > + > for (i = 0; i < nr_desc; i++) { > md = efi_early_memdesc_ptr(pmap, e->efi_memdesc_size, i); > > -- > 2.14.3 > > >