Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1122127imm; Fri, 8 Jun 2018 10:20:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI8x6GQUAxjvkaXoT/yrxfoHNDFBvX7JaNHcJDsOsDkpFLiO5oXTBjiVHSZTPnoJjck8mQa X-Received: by 2002:a62:4395:: with SMTP id l21-v6mr6455787pfi.196.1528478457946; Fri, 08 Jun 2018 10:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528478457; cv=none; d=google.com; s=arc-20160816; b=I6Zr62dJrgnJsH6a0lmVaLG0w+UHVDUIlTJZfXepWvoFQ3dlwXaUeTK4BQ3InmAfgv kjo6AJXHQ76XrI63HfRNFAUjnbUN4qSNKsyolD6fI3Bq0d44URRiOsgLRBMrfxEmL18S BiVWQIpo9PyzztDjORARbj08sI3UpukuGEYUI6Qhaw4OG6M7z/eiEt2awjkD0v+ZVqIS xheyDmTroqyHk+8iPlm6lSkjjp30BmQZXUPQyODc9yzBTsbIWtSSRXCCI0+iZ+MZS4g1 r0leP9hh8s5XygX7ru5fnMi3jMJDbgCG/0hGiD7ZOM8t4sr+0WSPM9WWf9NDD/8/YLov d8Lw== 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=gGBQ/eD2HsMKU0lwTWmww2iaIxw4YwGLuzzZQB6qNbU=; b=XEnvaykZzmKpn/on2FDevX0b4QtcEV55y/Mzu2Lm6u5lyoVpoYrTHQzk9AEoWVQtF/ 9d53F/+O0uOjqzvS0/m5lQdh2HBn5ODYV+qH+bOZ5qxza9lDTAZI0lGpCJHroxvqUsRs a62GGxRR2nGjUBTbc+Dfq6rRp/CDWHkrPJLDlQMn02IMVCTbrMiL4BxIglCmHyNsvWdY OGn+LsXa2Aj0i6ZztOQKElrDpY3+PWhHtjJc7idOM5tlqcbu1GSj504FzwHIk7gMYoUS fL7wV3Ay1p1u43AFFoueKouGZGTpe9uJ1K+hLbGE9RyS8+xAr7x/NRpCeQ50G8EixBON iVNg== 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 s65-v6si20749504pfe.290.2018.06.08.10.20.41; Fri, 08 Jun 2018 10:20:57 -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 S1753099AbeFHRT6 (ORCPT + 99 others); Fri, 8 Jun 2018 13:19:58 -0400 Received: from mga14.intel.com ([192.55.52.115]:6051 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753077AbeFHRT5 (ORCPT ); Fri, 8 Jun 2018 13:19:57 -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 fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 10:19:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,490,1520924400"; d="scan'208";a="231034913" 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:48 -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, Kai Huang , Jarkko Sakkinen , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , David Woodhouse , Konrad Rzeszutek Wilk , Tom Lendacky , Janakarajan Natarajan , linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [PATCH v11 03/13] x86, sgx: add SGX definitions to cpufeature Date: Fri, 8 Jun 2018 19:09:38 +0200 Message-Id: <20180608171216.26521-4-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: Kai Huang Added X86_FEATURE_SGX and X86_FEATURE_SGX_LC definitions that define the bits CPUID level 7 bits for determining whether the CPU supports SGX and launch configuration other than the Intel proprietary key. If this the case, IA32_SGXLEPUBKEYHASHn MSRs (0 < n < 4) are available for defining the root key for enclaves. Signed-off-by: Kai Huang Tested-by: Serge Ayoun Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- arch/x86/include/asm/cpufeatures.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index fb00a2fca990..54d5269e1b86 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -234,6 +234,7 @@ /* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */ #define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/ #define X86_FEATURE_TSC_ADJUST ( 9*32+ 1) /* TSC adjustment MSR 0x3B */ +#define X86_FEATURE_SGX ( 9*32+ 2) /* Software Guard Extensions */ #define X86_FEATURE_BMI1 ( 9*32+ 3) /* 1st group bit manipulation extensions */ #define X86_FEATURE_HLE ( 9*32+ 4) /* Hardware Lock Elision */ #define X86_FEATURE_AVX2 ( 9*32+ 5) /* AVX2 instructions */ @@ -327,6 +328,7 @@ #define X86_FEATURE_LA57 (16*32+16) /* 5-level page tables */ #define X86_FEATURE_RDPID (16*32+22) /* RDPID instruction */ #define X86_FEATURE_CLDEMOTE (16*32+25) /* CLDEMOTE instruction */ +#define X86_FEATURE_SGX_LC (16*32+30) /* supports SGX launch configuration */ /* AMD-defined CPU features, CPUID level 0x80000007 (EBX), word 17 */ #define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* MCA overflow recovery support */ -- 2.17.0