From patchwork Tue Jun 12 14:39:09 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: 10460515 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 D27D46020F for ; Tue, 12 Jun 2018 14:40:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC52D287F2 for ; Tue, 12 Jun 2018 14:40:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0B81287FD; Tue, 12 Jun 2018 14:40:04 +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=ham 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 4342A287E6 for ; Tue, 12 Jun 2018 14:40:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D3C606B0269; Tue, 12 Jun 2018 10:39:29 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C22016B026B; Tue, 12 Jun 2018 10:39:29 -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 825C06B026D; Tue, 12 Jun 2018 10:39:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f69.google.com (mail-pl0-f69.google.com [209.85.160.69]) by kanga.kvack.org (Postfix) with ESMTP id 1D3C36B026A for ; Tue, 12 Jun 2018 10:39:29 -0400 (EDT) Received: by mail-pl0-f69.google.com with SMTP id t19-v6so4670346plo.9 for ; Tue, 12 Jun 2018 07:39:29 -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=uadA4uhxVsVH42LUHoS0HxxO4vSZW86ZPY9PttQE7uE=; b=pLmNvZPTmEkKDHUASK7wBqa0qsGPYgmtcv/ucLWVctPnD2EF6VBa2zSOZO/5L6aXOu /CvFBmu8hkXo7APcRvNu9J60Hn2Utod58n9slutmFas4hBvEfWVgwDErOKejPJz5BlR4 R4txe+ij4hVzaXBAwvWaxHkJwusGhtIa/irgP/4Y9cjidDBPE0HdwVCvUd6uh9gActGi WYaKw5WE8DaDVgD4sQmEW08xvCZDgjSFjOvgPpHev4kapImGBNVLR+ja/iDtoCzFbizC LCzCzIqxIwedS3GoAUiZB/uk6ciDd1PUx01C9G5FgF6PYw9VJCv/THrAvlUk8s8sbNPZ p5eg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.31 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: APt69E2XJtjtcAhkOV0XWu0Gd+Ds5tPCHj73ItzRE9nnMtU5+zKTc7Uk sejwcB3sUemqIpvh2uj6reg4+W3JStvP4goPWgnfVsqgFo5BRz2z3US+xe22Qwz9fM/we9+CQ50 ikrrduq3WbkHX3wPjdKTABVyk1JAeiYE19jAH9iqFvVpBvKFd4YwYUIasQZMGkRmZhw== X-Received: by 2002:a63:7b03:: with SMTP id w3-v6mr608957pgc.52.1528814368804; Tue, 12 Jun 2018 07:39:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLNOkQQrE+OLqXEsQ6dTf6L5OJovtxEPeeWksOnRZkb6FYWCG9JioxHLAKm4hQTmvqBvVWa X-Received: by 2002:a63:7b03:: with SMTP id w3-v6mr608911pgc.52.1528814367912; Tue, 12 Jun 2018 07:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528814367; cv=none; d=google.com; s=arc-20160816; b=Fs1eI/mvIvaOBSTK5MGaDn8uRANWwku2j9VJ+Fi2XXIiRkbKKwV7Pmj2f8vdC41ClX OADI+vrSqpIlDWBbjSHGQxoNUJIh0oUa9sEppkNXWlMTMo8dtzI+hxhUIPDSL3vRiAvJ 4dtqlHc/qiBNj2FDyUiw2nwEXmeRBrhBLvbBXMakgLJKBY0yONrEJhWsKM2vQ/fTmdzH U00nysWZMcLbpbdzEl1jyjmgJQrzm7s8SgHu9uzf7iZ9DSFg8elOdODNaWY0UR8mqab1 pGhE/FTGjnUMoQ6u9zMNmh+aYY1JMRx25T2oX/WDtinXH1mpKPnpYlkDl2t2s+YgjtRm OYOA== 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=uadA4uhxVsVH42LUHoS0HxxO4vSZW86ZPY9PttQE7uE=; b=TAq4JUkGK0mgfR2G3kXiyPd2phOAn0KwvymRJoLTDFbO+tv9/unH3G40LboyALYzuo e512tAl91Fi2zZz/k7L8+CZGbLSvHiedP5YUMY4nrfwM+HVOKrH+l6fms6OZCXL8Xh6M QhR6PZ1AIHLXD2InQgCVZuTsDsmd8MLx8R4Uhr+N2Cl9W7CwsVesbnNqBZr543x6VPQJ pkw6fwntstAJGeFxkIP67XQopx1MyypkS9TsyBisi1b7vvis5y9lSnafP+XETWQc7T3+ etkzmQhAWW8oaFOXuYbzamfTxdVBiqs16UBFukL7HK91EHGao6HVBbPXSvYPPRAz/dEx vsJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga06.intel.com (mga06.intel.com. [134.134.136.31]) by mx.google.com with ESMTPS id o4-v6si259891plk.321.2018.06.12.07.39.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 07:39:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.31 as permitted sender) client-ip=134.134.136.31; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.31 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 fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2018 07:39:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,215,1526367600"; d="scan'208";a="46538433" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 12 Jun 2018 07:39:24 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 1D193493; Tue, 12 Jun 2018 17:39:21 +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: [PATCHv3 11/17] x86/mm: Rename CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING Date: Tue, 12 Jun 2018 17:39:09 +0300 Message-Id: <20180612143915.68065-12-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612143915.68065-1-kirill.shutemov@linux.intel.com> References: <20180612143915.68065-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 4992598ae411..4fa2cf807321 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2187,7 +2187,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)