Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966086AbeAOOJ1 (ORCPT + 1 other); Mon, 15 Jan 2018 09:09:27 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:2658 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965890AbeAOMlT (ORCPT ); Mon, 15 Jan 2018 07:41:19 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="35325136" From: Chao Fan To: , , , , , , , CC: , , Chao Fan Subject: [PATCH v6 3/5] kaslr: disable memory mirror feature when movable_node Date: Mon, 15 Jan 2018 20:40:14 +0800 Message-ID: <20180115124016.17683-4-fanc.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180115124016.17683-1-fanc.fnst@cn.fujitsu.com> References: <20180115124016.17683-1-fanc.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain X-yoursite-MailScanner-ID: 5E92848AEA0B.A9125 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: fanc.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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(+) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index 38816d3f8865..5615f26364f9 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -646,6 +646,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; @@ -679,6 +680,12 @@ process_efi_entries(unsigned long minimum, unsigned long image_size) } } +#ifdef CONFIG_MEMORY_HOTPLUG + /* Skip memory mirror if movabale_node or immovable_mem 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