Received: by 10.223.185.116 with SMTP id b49csp6033640wrg; Wed, 28 Feb 2018 02:53:06 -0800 (PST) X-Google-Smtp-Source: AH8x227j4PTXp8X7kwT9moEdZXJhqMuUtZXvY5XYDcE/8oEKsiVmc0BgrnJzTcFbf2JFyheMF/xN X-Received: by 10.99.66.135 with SMTP id p129mr14132176pga.220.1519815186641; Wed, 28 Feb 2018 02:53:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519815186; cv=none; d=google.com; s=arc-20160816; b=JW1nLegc8XvmGe6hneGb8INcJjG+HKtiRpIPDBi06+RvuhMgGzyFF+MlCBMWf9K3Uw I/IN1pp0/FMjYXOOlj05P2nQCdhtGTy1d/4LTSFq29DWoQNu5/O0lj4fvYi7Y3TZf4hp tzaZWwlnozl/U4gkOuxeYWjeuypiBmuROXYhHsFbIiQ2WHQT9//m8SdSDtelVhDInHB1 teM2txfADPPMmCn3T8kXrFeDm/JKzMTi5fk3sbF6l2UfdXMCNWR4pD9POgtmFuR+7J2M Z9/A7rIMOM9EOQLjrk3GmtJNQqgwb2mgcMZtdXm2cl6QFJ76rFf/e0YVQIkS0HXPZ10/ ivYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=W1e5Q9bKp8HhyIX2GItgbBfYpWEPV1e7+UEyZbBBFLM=; b=G6TbPuGP1hO3zFnz73vNMuf31ihTnDqkRNGumt8l8Bj+Lv7Higcsh+hTPCjMwC6wPm 5j44z+tVjJFWmkWngFHp2FoGF1zmVFXHfHcPQolcKm96ytIcrI0SOSpOKh5uEfHGjF3t 6TPlaQ1CuQQnhAuMH5CMzg9ya3prSItJObG2GO8YL/LtgRhW/0Dw8jGHCJVMBI8zhfY3 1rGFyJyU+ypZaNW0VuVBdowGEdDa5LY/ULDMKDjbG7P+EFoeI2JgtOs+y8HgMWgYIsJU dOPxbbC6Utj24eK0bmVDVl8QtYVvA25o8PymQihgHpEPI9wa6wcZsKEyk2KcvkURjx+P 1J7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t199si862361pgb.105.2018.02.28.02.52.51; Wed, 28 Feb 2018 02:53:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752578AbeB1Kvq (ORCPT + 99 others); Wed, 28 Feb 2018 05:51:46 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:39831 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752542AbeB1Kvo (ORCPT ); Wed, 28 Feb 2018 05:51:44 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="37332013" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 28 Feb 2018 18:51:43 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 51C0A486A78A; Wed, 28 Feb 2018 18:51:41 +0800 (CST) Received: from localhost (10.167.225.56) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.361.1; Wed, 28 Feb 2018 18:51:45 +0800 From: Chao Fan To: , , , , , , , CC: , , Chao Fan Subject: [PATCH v9 3/5] x86/KASLR: Give a warning if movable_node specified without kaslr_boot_mem= Date: Wed, 28 Feb 2018 18:51:03 +0800 Message-ID: <20180228105105.11487-4-fanc.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180228105105.11487-1-fanc.fnst@cn.fujitsu.com> References: <20180228105105.11487-1-fanc.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain X-yoursite-MailScanner-ID: 51C0A486A78A.A8FBC X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: fanc.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since only 'movable_node' specified without 'kaslr_boot_mem=' may break memory hotplug, so reconmmend users using 'kaslr_boot_mem=' when 'movable_node' specified. Signed-off-by: Chao Fan Acked-by: Baoquan He --- 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 eb47502fbe54..9fb86248d5c5 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -288,6 +288,16 @@ static int handle_mem_filter(void) !strstr(args, "kaslr_boot_mem=")) return 0; +#ifdef CONFIG_MEMORY_HOTPLUG + /* + * Check if 'kaslr_boot_mem=' specified when 'movable_node' found. + * If not, just give a warrning. Otherwise memory hotplug could be + * affected if kernel is put on movable memory regions. + */ + if (strstr(args, "movable_node") && !strstr(args, "kaslr_boot_mem=")) + warn("'kaslr_boot_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