Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1122362imm; Fri, 8 Jun 2018 10:21:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKItgRtj4rk/m7Dsu59xe4Drd7KkggKzB+CDxAZ8bZIL2uKjnWC2wBbWnrMn/Orgxoi7KqO+ X-Received: by 2002:a65:634a:: with SMTP id p10-v6mr6022428pgv.184.1528478470949; Fri, 08 Jun 2018 10:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528478470; cv=none; d=google.com; s=arc-20160816; b=UaD3o4mM0wFLIgziabk1kNfbKJg14rbwKVCdqrU7AmEwWJ2W1gANaCHfhUM8qXepgT PfjP3ndbMfN+lxRsJ3RrRSUX6/8B53fsvEXBSr4LV/qGyIr77kDceIFI1cECxzJLUSxX 8TU1yEFE0uUH0Oefd8wf33R+01MCTilDQ4S9EoKMRB0wEMKCiy5XDa2vZ1K/63b9hYAw x1wo1SysqyGBEoqhgpvhuuusYBk9fAeGgXzNQaiVmxdgc9w9ngA4MZfKYD8xln4Gs6+d pBrbK1+HQfQpYmthKieoh91KxH9A2NcIxxP+SE8nVXXjIDEZJ03V7Ekmi/OXOrnEmLgB FHpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=TZE4ow2VnOhl1ctlnXOfqo9+QdxW7rF3lcmytkp03MM=; b=OC/lETHdcnJ7WMccHZTbsTHVuGejenQLzGCaUJx/g/gB8mOmZEjuffq4XaN/jc3Opd rjANI4195H69g6/00d9fJrAqRN/bxXxAgqJ9eGtvoRXue2kM5d4eKjBW/DvlXjlrgKHz qhPR6jd6ItsUJYrF6rl0jyEdTyO+EhTjhkBruaqROERvQAu6IvxJPgr4+Rf9MZWC8Ci4 r6/aWkfMBDV43RY4OfCK4KBhGE0D6Epf5rNGnWvx9ZDGSnKeQjaIIBRveMCoEiVO5Zfm MdEKl4zqJSf8886fqBxu/mqWct1xhbiPn3gj39oXnRtPjdXVMe/5xCfj7umKZpADvDr3 UMxA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si57389769plx.517.2018.06.08.10.20.55; Fri, 08 Jun 2018 10:21:10 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932101AbeFHRUJ (ORCPT + 99 others); Fri, 8 Jun 2018 13:20:09 -0400 Received: from mga11.intel.com ([192.55.52.93]:9280 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112AbeFHRUH (ORCPT ); Fri, 8 Jun 2018 13:20:07 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 10:20:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,490,1520924400"; d="scan'208";a="231035018" Received: from nzou1-mobl1.ccr.corp.intel.com (HELO localhost) ([10.249.254.60]) by orsmga005.jf.intel.com with ESMTP; 08 Jun 2018 10:19:59 -0700 From: Jarkko Sakkinen To: x86@kernel.org, platform-driver-x86@vger.kernel.org Cc: dave.hansen@intel.com, sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, Haim Cohen , Jarkko Sakkinen , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Tom Lendacky , Konrad Rzeszutek Wilk , David Woodhouse , Greg Kroah-Hartman , Janakarajan Natarajan , linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)), intel-sgx-kernel-dev@lists.01.org (open list:INTEL SGX) Subject: [PATCH v11 04/13] x86, sgx: add SGX definitions to msr-index.h Date: Fri, 8 Jun 2018 19:09:39 +0200 Message-Id: <20180608171216.26521-5-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180608171216.26521-1-jarkko.sakkinen@linux.intel.com> References: <20180608171216.26521-1-jarkko.sakkinen@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Christopherson ENCLS and ENCLU are usable if and only if SGX_ENABLE is set and After SGX is activated the IA32_SGXLEPUBKEYHASHn MSRs are writable if SGX_LC_WR is set and the feature control is locked. SGX related bits in IA32_FEATURE_CONTROL cannot be set before SGX is activated by the pre-boot firmware. SGX activation is triggered by setting bit 0 in the MSR 0x7a. Until SGX is activated, the LE hash MSRs are writable to allow pre-boot firmware to lock down the LE root key with a non-Intel value. Signed-off-by: Sean Christopherson Signed-off-by: Haim Cohen Tested-by: Serge Ayoun Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- arch/x86/include/asm/msr-index.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index fda2114197b3..a7355fb7344f 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -479,6 +479,8 @@ #define FEATURE_CONTROL_LOCKED (1<<0) #define FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX (1<<1) #define FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX (1<<2) +#define FEATURE_CONTROL_SGX_ENABLE (1<<18) +#define FEATURE_CONTROL_SGX_LE_WR (1<<17) #define FEATURE_CONTROL_LMCE (1<<20) #define MSR_IA32_APICBASE 0x0000001b @@ -545,6 +547,12 @@ #define PACKAGE_THERM_INT_LOW_ENABLE (1 << 1) #define PACKAGE_THERM_INT_PLN_ENABLE (1 << 24) +/* Intel SGX MSRs */ +#define MSR_IA32_SGXLEPUBKEYHASH0 0x0000008C +#define MSR_IA32_SGXLEPUBKEYHASH1 0x0000008D +#define MSR_IA32_SGXLEPUBKEYHASH2 0x0000008E +#define MSR_IA32_SGXLEPUBKEYHASH3 0x0000008F + /* Thermal Thresholds Support */ #define THERM_INT_THRESHOLD0_ENABLE (1 << 15) #define THERM_SHIFT_THRESHOLD0 8 -- 2.17.0