From patchwork Tue Jun 12 14:39:15 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: 10460529 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 189C66020F for ; Tue, 12 Jun 2018 14:40:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1422828847 for ; Tue, 12 Jun 2018 14:40:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0724E2884B; Tue, 12 Jun 2018 14:40:28 +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 9D23528848 for ; Tue, 12 Jun 2018 14:40:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 034816B026D; Tue, 12 Jun 2018 10:39:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EBE9A6B0273; Tue, 12 Jun 2018 10:39:35 -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 C95886B0272; Tue, 12 Jun 2018 10:39:35 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 7FE7A6B026D for ; Tue, 12 Jun 2018 10:39:35 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id d10-v6so7809752pgv.8 for ; Tue, 12 Jun 2018 07:39:35 -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=kSXdXxWfS7zxJMMqqV3s1VlG+zUBxvqZnP8EcUGLkPU=; b=ZvzrOcPot/zu1U8iT/UWaLBXAME181C2GNzXksPrHsUWdCr3+UH5eN9itBvdgTw8Ku TB934mwImvi/SahHyBvN2nra/bvn/5e20zftwa48/x7XMSaak1LBRABFNzMhzj9xJ2wb pLz3+3vB8i9teXgyTkgaqiQoHJMewzJpKCNliQAA/K+gt9UF5Ez9tYX7KbHb7+zgbHpk CsbzRXx3gY7TuuqZz2/InRbIVPSea12ZMQMlFXK6g53kLb0Seu1vbRSShiWSiG9dxYPw gwAoOB4oIs1F742Hz1arL8KKfHx6yTeHLf5bwTYx3fey8gqAFeaGHGhnlQexZsQKE0Xy koEg== 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.20 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: APt69E1QRLbHiOLRQ+bgPpKgrmIIn0zKoccp7AwTdxfqlB7vM2N3cNIG Cf2D4nIa4+lkec+wJEgpXpWSpH5C5nhpTQNyoUZ3QyPX1azKN+nPdkwpGS0eiJBu6Tcu9fKdSAZ irpXp1weBEBSaGqFC2qXQF3eMvIGTqxjd/TNppwpAeGBpmbdWEQmGjUlJ/dXgHH148Q== X-Received: by 2002:a62:9804:: with SMTP id q4-v6mr684447pfd.65.1528814375203; Tue, 12 Jun 2018 07:39:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKItizetXwUuS59EnyXFHDz+UZbZg98m0ibdrpO5B7MF4tU9D+ThS05eNpzKZnor2XeLYVgQ X-Received: by 2002:a62:9804:: with SMTP id q4-v6mr684382pfd.65.1528814374038; Tue, 12 Jun 2018 07:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528814374; cv=none; d=google.com; s=arc-20160816; b=dhWu72hkcK7YLidOS1smX+BI3rdCeFmuCQbFZHugpefvAq8UwMGzrVUDcJYBIj6iBL lXTXOX0Itpb3HCZsoYgCtN0Tz1/s4ZQ7f2f6h34P5uPyW5mxBZmh1YoAgL4+BxkY5GuY w11/L0h1l19vezXUnBmZ4JTAAu02rdM9NfEZIYwfoAmTWtmrHtyfvr3HumIS5bEMeeDi JMkq/bSvjRzV7jCVUt2zfkE3DyKVxmroBqgFW2vYh0SEsETCkJH0K9PnyMxYvvvKCBA5 BuKBpOsmIofg5gc4gJgKePXoeyvKGjhFAzZVwXMejMaaROxkacS8HdjbCAWON2SlKQGn 7H/Q== 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=kSXdXxWfS7zxJMMqqV3s1VlG+zUBxvqZnP8EcUGLkPU=; b=qL/+Bupo0uetDrKYuB5rhhqEkhohU/GpaWksjtPO8lRgbbn3OS6B+H4iVWsaNAMoIZ A0K6ETzJYYy5gSWG7lDGY0TFPQICCRogJtAMUkICUmcpgfNephy3gbDdyxi+bui1C/tp CV5+Tjt1wa1zPdjgSqtchFJXUyvzKH4hqBgvhXcvgXbkI87FwIH08+0WufXphDH9mb0f FijCvA1P4z5hrOhJPade9jZSuSFgh8dM5t5pDgj1oyoMQl7bBUtIVrjPr7e+hr+dUX7s l5gw3kAowakBK8H7cvmGszJ9poHihr6KdWC9eCWDq1yoMeLG9C+1/BOuyePR+OKdnGrO YEqA== 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.20 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga02.intel.com (mga02.intel.com. [134.134.136.20]) by mx.google.com with ESMTPS id bf10-v6si279581plb.423.2018.06.12.07.39.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 07:39:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.20 as permitted sender) client-ip=134.134.136.20; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.20 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 orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2018 07:39:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,215,1526367600"; d="scan'208";a="46538453" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 12 Jun 2018 07:39:30 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 53F47892; 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 17/17] x86: Introduce CONFIG_X86_INTEL_MKTME Date: Tue, 12 Jun 2018 17:39:15 +0300 Message-Id: <20180612143915.68065-18-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 Add new config option to enabled/disable Multi-Key Total Memory Encryption support. MKTME uses MEMORY_PHYSICAL_PADDING to reserve enough space in per-KeyID direct mappings for memory hotplug. Signed-off-by: Kirill A. Shutemov --- arch/x86/Kconfig | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 4fa2cf807321..d013495bb4ae 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1513,6 +1513,23 @@ config ARCH_USE_MEMREMAP_PROT def_bool y depends on AMD_MEM_ENCRYPT +config X86_INTEL_MKTME + bool "Intel Multi-Key Total Memory Encryption" + select DYNAMIC_PHYSICAL_MASK + select PAGE_EXTENSION + depends on X86_64 && CPU_SUP_INTEL + ---help--- + Say yes to enable support for Multi-Key Total Memory Encryption. + This requires Intel processor that has support of the feature. + + Multikey Total Memory Encryption (MKTME) is a technology that allows + transparent memory encryption in upcoming Intel platforms. + + MKTME is built on top of TME. TME allows encryption of the entirety + of system memory using a single key. MKTME allows to have multiple + encryption domains, each having own key -- different memory pages can + be encrypted with different keys. + # Common NUMA Features config NUMA bool "Numa Memory Allocation and Scheduler Support" @@ -2189,7 +2206,7 @@ config RANDOMIZE_MEMORY config MEMORY_PHYSICAL_PADDING hex "Physical memory mapping padding" if EXPERT - depends on RANDOMIZE_MEMORY + depends on RANDOMIZE_MEMORY || X86_INTEL_MKTME default "0xa" if MEMORY_HOTPLUG default "0x0" range 0x1 0x40 if MEMORY_HOTPLUG