Received: by 10.223.176.5 with SMTP id f5csp625598wra; Wed, 7 Feb 2018 05:01:00 -0800 (PST) X-Google-Smtp-Source: AH8x226FklrGZZxyYPNZCDLRcQseac8PaHqlfeABLeyrwnec9jc2vXGkH/AtPGclsL01JTsTSxf+ X-Received: by 2002:a17:902:6943:: with SMTP id k3-v6mr5864713plt.285.1518008459989; Wed, 07 Feb 2018 05:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518008459; cv=none; d=google.com; s=arc-20160816; b=DCBIMHMKp7Plfu3L2ttE1C5fd4NyG/0rhGzcn6Wnt5GkvyRrjbXR5UsP4NnbocHHcA IPR4G4ZrTMqpRgSbc/g1NN7y3LxlQoow2qdPs72tT+eive3SRVy61EhPxDDR7Lc8rXpL NQZtDJfR4I42XAi+AwBfaNZpD9xKxXZblI2mevba7/NpCpxm6/Ky4p5jVYKavCzon5ZK j29VNKlWckuTR2zDGRlT4meBnutarHtSDAnH3q0Hx5DlMgxImClIAlTQ4l/2JnYf9zFC MOn/KtdZ3t7R6A2mS/EVUj5e/UDdln5rITanxpPvcxSPg2x3mHa0pKlsJggHPKBK8Mpp BuNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BKQopyLuEXdPti5C0iV+lZDQtZ3eH1AytxyiIPtxhHc=; b=RPRc1+8Wr9YjkLyuu2nhIyLu4Qb07BCoBPTkGJJJUZuGAjHWQ13Bus/lp8uUhce0cW 8ro6bMsFPpyaqf9m+ASGdV4I0nrZICjMR3xzcHem0infwwKoJaEpv8OrBFK7z/LWMp3x dcf0hbUqgez+i+Epq72CnzKTCWDlbKHwePvljCrOCIs5cIGIlhtMaI3fHYSmvWwgnp6/ i1OamjU5x1yTievULDUT2Kxvogrjgx0jvoFtqyufJqW0i2c2iaS9M+68UPPcVRzHcgjp INatV/AIVZUtXEq7ytqC3Moo+BzVRacA5rh5w3VYIvBwQTpUfLRnzjvub1sGFzbEWNbr T3aw== 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 e1-v6si1050316ple.452.2018.02.07.05.00.46; Wed, 07 Feb 2018 05:00:59 -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 S1754117AbeBGM76 (ORCPT + 99 others); Wed, 7 Feb 2018 07:59:58 -0500 Received: from mga14.intel.com ([192.55.52.115]:61853 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754059AbeBGM7z (ORCPT ); Wed, 7 Feb 2018 07:59:55 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 04:59:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,473,1511856000"; d="scan'208";a="16284038" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 07 Feb 2018 04:59:50 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 871DF6C9; Wed, 7 Feb 2018 14:59:49 +0200 (EET) From: "Kirill A. Shutemov" To: Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" Cc: Tom Lendacky , Dave Hansen , Kai Huang , linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv2 0/5] x86: Enumerate TME and PCONFIG, add MKTME_KEY_PROG helper Date: Wed, 7 Feb 2018 15:59:41 +0300 Message-Id: <20180207125946.5906-1-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patchset does some ground work for MKTME enabling: - Adds two new cpufeatures: TME and PCONFIG; - Detects if BIOS enabled TME and MKTME; - Enumerates what PCONFIG targets are supported; - Provides helper to program encryption keys into CPU; As part of TME enumeration we check of how many bits from physical address are claimed for encryption key ID. This may be critical as we or guest VM must not use these bits for physical address. Please review and consider applying. v2: - Fixes for TME enumeration; - Add PCONFIG CPUID leaf support; - Add MKTME_KEY_PROG helper; [1] https://software.intel.com/sites/default/files/managed/a5/16/Multi-Key-Total-Memory-Encryption-Spec.pdf Kirill A. Shutemov (5): x86/cpufeatures: Add Intel Total Memory Encryption cpufeature x86/tme: Detect if TME and MKTME is activated by BIOS x86/cpufeatures: Add Intel PCONFIG cpufeature x86/pconfig: Detect PCONFIG targets x86/pconfig: Provide defines and helper to run MKTME_KEY_PROG leaf arch/x86/include/asm/cpufeatures.h | 2 + arch/x86/include/asm/intel_pconfig.h | 65 +++++++++++++++++++++++++ arch/x86/kernel/cpu/Makefile | 2 +- arch/x86/kernel/cpu/intel.c | 94 ++++++++++++++++++++++++++++++++++++ arch/x86/kernel/cpu/intel_pconfig.c | 82 +++++++++++++++++++++++++++++++ 5 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 arch/x86/include/asm/intel_pconfig.h create mode 100644 arch/x86/kernel/cpu/intel_pconfig.c -- 2.15.1