From patchwork Tue Jul 17 11:20:29 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: 10529045 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 29095603ED for ; Tue, 17 Jul 2018 11:22:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1787028C30 for ; Tue, 17 Jul 2018 11:22:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B31D28C34; Tue, 17 Jul 2018 11:22:37 +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 A965828C0F for ; Tue, 17 Jul 2018 11:22:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 265426B027E; Tue, 17 Jul 2018 07:22:07 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1A67A6B027F; Tue, 17 Jul 2018 07:22:07 -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 E77BB6B0282; Tue, 17 Jul 2018 07:22:06 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id 95FD46B027E for ; Tue, 17 Jul 2018 07:22:06 -0400 (EDT) Received: by mail-pf0-f200.google.com with SMTP id v25-v6so389804pfm.11 for ; Tue, 17 Jul 2018 04:22:06 -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=zfF6wE27jk8EEZFVmr05watLtl7S0IbAWuZHUfNUQvg=; b=bgbw9f++1ZIcJ43xq3KwXohs6v/FxeUrUwsui9qLkGgatysscylh2D5nzwkyjE1Cx/ df16zsfHbJxtOt8sZ7JOkvFpolAXA1Z43l64N4mD6Xm8D/bf1QH1MesPy2OVhdQt0vT1 ZkxlhcdnsSQ75mrFglTE2p/SkTo8dwNDnPzEz4v0kv9hyX4+J+pJPhJHzlUxc2lzmH/S A2/ZA2MbalZ4Iv4FjMyUwFaPEXJAczRUAhObNcv9jXiJcXoOZ5mlle4vDJZuKiHQG2sf bTQmJbTj9hIvY034/bco2K6J2CedvzX8IT5CCqyVeQNizesJl/Z8HJZdeGEnKcozanCg Unrw== 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: AOUpUlH8PRTNNttiFkTv3s/ncV1U53So+RLDHtkNv3ln78DOh3uXQGat vbGZGwrafgXV09y0xVxYeRxMsAEWX0hxUUtfD5cwaLBrRaBWUfiGzqd0ZEZe/V8Ojl1Stlh+8NJ bV2DktVcBsJNuOw+Sc+wj4IJY4bY3UORtHonOU3PIyAbnBC8sU2bEY4GYb/AqxWvGyA== X-Received: by 2002:a17:902:8541:: with SMTP id d1-v6mr1241480plo.81.1531826526312; Tue, 17 Jul 2018 04:22:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd11geLuLtJWY60pu+FgFQS1lOK3REK4GQ/mpyW1QrNu8+izltPxNEzsqZsDcOusN/I5Y7z X-Received: by 2002:a17:902:8541:: with SMTP id d1-v6mr1241441plo.81.1531826525596; Tue, 17 Jul 2018 04:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531826525; cv=none; d=google.com; s=arc-20160816; b=vLn/06z6P4VWinHfLPzMdSxh+z91kLwYru729ySJ5ld30MBENBWJZ3xk4roi0g07cP +ucXCD0lqKbaS+OHolXFoNLtgdYLvoD+egTVMlftwNXjqxNlnQjFKiB8XvEL4Iv/QdZN Yo5XvAm+VciEVXtF2Qq1fxtHWMeiQnHHwHPNNOS5+2DbUS4/jLPiNjnI+BV4AxpTQkqK zD+uw4DHg4TkTciAZ952hn55ozyRZlT7gblA1tBk89Etipn7lRvo0t9l6l3/vvg3TMnd dOImf+ZrHTUGJbGcWTxWxNdT8pMglrXliGMqbioJKEo8kYY7bOrQvR6hyRAnHLnlHSUy QDvA== 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=zfF6wE27jk8EEZFVmr05watLtl7S0IbAWuZHUfNUQvg=; b=TXFLzLYfwKUYPc3cN0Ub3cAGYkEI8WbHulWISMmLuXpQP+vTw6rho2FudqvxcaClvc bjJJtV9Ck4jE1DoBkIYGLTxG+CLuFqGtmzhH1fhK4dyicgNC29/kF1Ge1Tyk7bsWbG7E 2uum93m0UqoTBYhZ+5Q2gxo81JXhGe4WaQK25NpmCYlE1Y6QKZ5ydS6J1r3VUsQqh4iQ 66equn9DSgxcqDbfyqbqZYL8Dtjxw8cDd9hmES4m1HiwLCK4IgEIoljyWlpOsZQz2e4X mc/s1c6VX6uOgZcS3W6Vv2UhyuVcL45f9cwatGLNlFuM7z5XIJWWaZ05RN/HbHTZoK0h SFJg== 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 f12-v6si685766pgm.601.2018.07.17.04.22.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jul 2018 04:22:05 -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 fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2018 04:22:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,365,1526367600"; d="scan'208";a="67665041" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 17 Jul 2018 04:21:48 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 7D14E85E; 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 19/19] x86: Introduce CONFIG_X86_INTEL_MKTME Date: Tue, 17 Jul 2018 14:20:29 +0300 Message-Id: <20180717112029.42378-20-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 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 b6f1785c2176..023a22568c06 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1523,6 +1523,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 an 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 having 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" @@ -2199,7 +2216,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