From patchwork Tue Jul 17 11:20:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 10529013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 30C46603ED for ; Tue, 17 Jul 2018 11:22:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DBC5205A8 for ; Tue, 17 Jul 2018 11:22:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 121BA28A8C; Tue, 17 Jul 2018 11:22:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5ACE205A8 for ; Tue, 17 Jul 2018 11:22:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA1C06B0010; Tue, 17 Jul 2018 07:21:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A82C16B0269; Tue, 17 Jul 2018 07:21:50 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 942A96B0272; Tue, 17 Jul 2018 07:21:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f70.google.com (mail-pl0-f70.google.com [209.85.160.70]) by kanga.kvack.org (Postfix) with ESMTP id 4B06F6B0269 for ; Tue, 17 Jul 2018 07:21:50 -0400 (EDT) Received: by mail-pl0-f70.google.com with SMTP id x2-v6so463526plv.0 for ; Tue, 17 Jul 2018 04:21:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=BcArfYur4mOGyms2+2Xbm7aeUYElC/KY0I/Puzg4HEg=; b=IAK0KJYLrJkIYC5Ha1fEaZDNexhJ98NpzvGcg8mTcU8NiPYlxfMbBbjkcYi4HaMgUv BC9+TbNbBj7JPvw7HMw04PziD9BcjWFSixAzPtJv5ehOe74kY6PC+jDUiGVYMvUavf3H 77dgqzz1DQksrIlcoicXS2S5Rk1DSnNlgCNkvjeL3a+3VKdEK476Kb6VTFF44y4sQJYu qcjXXOxK+OposM9hi9kk4cM74NDyOnVdDe92S4J3MhTUsEdjV6BlT5RuBWQciW10/Qfy swT+9AW4vRHk5cPYmDjSAYMggTR2Gxki38eBzAYyHinmRDgyd3K+AyAQwsz2Vfsi0zmW 2w0A== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 192.55.52.151 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: AOUpUlHtBmXdCZtlb449h62GoTGfcnoRA7wesf0b2QR1jzdLmpqygbIZ AuXrUXb7ntW3jb07HHCwMOh1blIHv4WNegWYl3GZB62odLX8ptK2gRTAthqbvGcXeVFMmrC/v2p M3pWvjW12IHgesRqVp6CsXWTEdKJaIDtmofaa8m8HFeWw0zYOgV3Y0rIcriD6DpBA+w== X-Received: by 2002:a17:902:5a83:: with SMTP id r3-v6mr1236898pli.78.1531826510001; Tue, 17 Jul 2018 04:21:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdu9Do8pJJT925Blld63CulbWI6me1/eQKXX8bwUebRz4EXPLuglOqnP7PS6i8vjFeEz8Yq X-Received: by 2002:a17:902:5a83:: with SMTP id r3-v6mr1236863pli.78.1531826509245; Tue, 17 Jul 2018 04:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531826509; cv=none; d=google.com; s=arc-20160816; b=Ph5U23ys7VPjQ53Z8L4j0rX6bbYRRKZ1jNUwGfjX0YIJYsx5MQecddrg7JyLQgbNM3 CZoLicXB6xmTHZ11uGbbUW5g/9HmHpWhJ2UoDVeaWL358hkELpaqu6+wbTx8VNoLUvjO 0uwV/aU0+K49JvBmVFc2Tg2cjpFMD0IWfmkcu5/ERoWugzxC5VSUQl3LbE0LwEbx2Uis U3fHZg0+E16Ud21KlSdyo1TZApKbOoSOHaYs3ZsJkqrc25G9ByKUrO4v2zVG0EK708tL n/UCQEoUoRtMdLUnd3lh7OsU6yZREloBbatmZpGXo2+8qrVaZVUTRtwUYqMT3Ar3C3GK pwAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BcArfYur4mOGyms2+2Xbm7aeUYElC/KY0I/Puzg4HEg=; b=cyhnkB1NA0bdQ3EinnCP2N/t/lf1EjDyMbEQ4FYh4uSULZ3MfLdrFF+6JDgYLjHvf9 xX/QRdymR88TRfx1ju1sGbxHcB9ltIMRKip+UxdRARtviHaCTL11MDJw9ePQZjTRJzsw r/1/wQp++NOhqZVObYQxUZKEjPO5vbdGcIrgL/Ey751LHtz2QiUiqhVezJ/qLaG0ZapW /4/mUXKDawUe1mwcTaW7oFGVVnyREsbGL4V1mrotbQI+d1FSf8ccPsi1+8bCxPaikdmk iWv08krKElj/xhHv2mWiKinY/YnpApbqnz6kJ7nV7DzUZlDznRGBuhJl2OhLPI8eJ9u6 1fUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 192.55.52.151 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga17.intel.com (mga17.intel.com. [192.55.52.151]) by mx.google.com with ESMTPS id f62-v6si697286pfg.165.2018.07.17.04.21.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jul 2018 04:21:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 192.55.52.151 as permitted sender) client-ip=192.55.52.151; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 192.55.52.151 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2018 04:21:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,365,1526367600"; d="scan'208";a="57138277" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 17 Jul 2018 04:21:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 3C3A378E; Tue, 17 Jul 2018 14:21:49 +0300 (EEST) From: "Kirill A. Shutemov" To: Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky Cc: Dave Hansen , Kai Huang , Jacob Pan , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" Subject: [PATCHv5 13/19] x86/mm: Rename CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING Date: Tue, 17 Jul 2018 14:20:23 +0300 Message-Id: <20180717112029.42378-14-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180717112029.42378-1-kirill.shutemov@linux.intel.com> References: <20180717112029.42378-1-kirill.shutemov@linux.intel.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Rename the option to CONFIG_MEMORY_PHYSICAL_PADDING. It will be used not only for KASLR. Signed-off-by: Kirill A. Shutemov --- arch/x86/Kconfig | 2 +- arch/x86/mm/kaslr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 6d4774f203d0..b6f1785c2176 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2197,7 +2197,7 @@ config RANDOMIZE_MEMORY If unsure, say Y. -config RANDOMIZE_MEMORY_PHYSICAL_PADDING +config MEMORY_PHYSICAL_PADDING hex "Physical memory mapping padding" if EXPERT depends on RANDOMIZE_MEMORY default "0xa" if MEMORY_HOTPLUG diff --git a/arch/x86/mm/kaslr.c b/arch/x86/mm/kaslr.c index 61db77b0eda9..4408cd9a3bef 100644 --- a/arch/x86/mm/kaslr.c +++ b/arch/x86/mm/kaslr.c @@ -102,7 +102,7 @@ void __init kernel_randomize_memory(void) */ BUG_ON(kaslr_regions[0].base != &page_offset_base); memory_tb = DIV_ROUND_UP(max_pfn << PAGE_SHIFT, 1UL << TB_SHIFT) + - CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING; + CONFIG_MEMORY_PHYSICAL_PADDING; /* Adapt phyiscal memory region size based on available memory */ if (memory_tb < kaslr_regions[0].size_tb)