Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2690305imd; Fri, 2 Nov 2018 16:15:55 -0700 (PDT) X-Google-Smtp-Source: AJdET5cWFMU/AzeeGu4/WksPNAOZq0n/04Q6uLaTNR/wqONe4JU2wjVdYX1HKCswKKbqkrmtU+sn X-Received: by 2002:a62:2803:: with SMTP id o3-v6mr13758221pfo.57.1541200555607; Fri, 02 Nov 2018 16:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541200555; cv=none; d=google.com; s=arc-20160816; b=wuxDLWVYZaMPd3MKxGxObuMp3DD4WI24N60Es+Dx5/e9jK6Jdba6OO4JeSrRKIcMbm OaY7XFMfw5Uikh/tNWKuzE5CwjqKJHQgNcp/XlH3Ksc8bNb7tfsXk9XCeYZcA7giuy6U H1ImhFS6z2yH44WT36eN36bbW3so8ugCYIsLyJCGGfL+f6FRBwHj4OwMORh0jAQyrbgR sdzQE5bBgCT0TKhhZEkGBUcHsyODFYRGIL++A7YuQWvnsSZPC+TMvK7+USLA3/Gr0GZz /5IsZOb4s9gqBRIM1cwsKWOyzGAvSzOmtytm0xYjtRXwxrnO31vCWTE+CeCxgI89xeqY 0D4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZzuC+zRcmrKoXqDWtCwZbKu8Z4Yc/XL6jw5zIH4wFLs=; b=Lel5xKIaUIWjMpf/rHoDSBsvSEXeInK68f+vh40IcbjG7RpPApX4Hiz+EzXJf8J+1K XY4+R5HlOkriMtuGtZvA7pXGZsnPHux0vdik1bCsa0M+2aNOeakGplCA9bl2xV+4D8wv oriUXjrgXZNVxzQb3VkmBaqMAu//AMMubDt01TyaXNwg7bwAVxg+M0rQmxTwWFCgbs43 F5NSoLLnlFu0kFpNh8Luin7QAjBglUu3Y8RIPTJykh78p23MMpf5GoJo9dtGW9QPV446 zcqmxD+J55GK/BGhHVLExXh7Semhh25juMMllX3S8J53EoG7iqWLZvZQanBDNEDB3DL+ Neug== 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 r68-v6si36754480pfa.15.2018.11.02.16.15.37; Fri, 02 Nov 2018 16:15:55 -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 S1728568AbeKCIXs (ORCPT + 99 others); Sat, 3 Nov 2018 04:23:48 -0400 Received: from mga11.intel.com ([192.55.52.93]:57070 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726705AbeKCIXs (ORCPT ); Sat, 3 Nov 2018 04:23:48 -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; 02 Nov 2018 16:14:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,457,1534834800"; d="scan'208";a="270987706" Received: from btyborox-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.138]) by orsmga005.jf.intel.com with ESMTP; 02 Nov 2018 16:14:31 -0700 From: Jarkko Sakkinen To: x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-sgx@vger.kernel.org Cc: dave.hansen@intel.com, sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, mark.shanahan@intel.com, andriy.shevchenko@linux.intel.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Jarkko Sakkinen , Konrad Rzeszutek Wilk , Tom Lendacky , Paolo Bonzini , Matt Turner , Janakarajan Natarajan , David Woodhouse , linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [PATCH v15 04/23] x86/msr: Add IA32_FEATURE_CONTROL.SGX_ENABLE definition Date: Sat, 3 Nov 2018 01:11:03 +0200 Message-Id: <20181102231320.29164-5-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102231320.29164-1-jarkko.sakkinen@linux.intel.com> References: <20181102231320.29164-1-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Christopherson Add a new IA32_FEATURE_CONTROL bit, SGX_ENABLE, which must be set in order to execute SGX instructions, i.e. ENCL{S,U,V}. The existence of the bit is enumerated by CPUID as X86_FEATURE_SGX. Like all other flags in IA32_FEATURE_CONTROL, the MSR must be locked for SGX_ENABLE to take effect. Signed-off-by: Sean Christopherson --- arch/x86/include/asm/msr-index.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 4731f0cf97c5..2837f65ac817 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -486,6 +486,7 @@ #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_LMCE (1<<20) #define MSR_IA32_APICBASE 0x0000001b -- 2.19.1