Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp717825img; Wed, 20 Mar 2019 09:23:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqybZD/MSHBRy1QgCutBVcAvKa2KeE2v+NAWJui5JGCwrrfdfO7WvpkNpI8k0kaut2YrphkN X-Received: by 2002:a65:4385:: with SMTP id m5mr7962414pgp.406.1553098992355; Wed, 20 Mar 2019 09:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553098992; cv=none; d=google.com; s=arc-20160816; b=jm2SUAwfD94P2hLWmPUiU4pmzeiIDc0+VgNPszfe1TRc+cnfxsvXn+QYuh5dh8HLVY OCr+uu4AWhDvOJ+NGEDUcY44S7dvA1rjhnDBAJlGbTCCyn5h/qYARVMhvmIkEojnHNCX rFYofiUVbPM//FnC4aa5f5PPXU7MX9Q8AwzVU85x1/H4PTJkhaRjFWMWtSEAOTUpe6es h6JTLRcyXr1Z4SugGoob41gKd6AINvgUw16pIaQX9hVfrhK2YgNifnUSRuEFI0rwG4GG uMAefeUCaGjdh4oXt2gnXj0F8weMhh99xc/Cbcsp60BtTvcYlVinHGqu9G/WEhHCBwzg KBaw== 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=UWNjYJPb9ynVrC919FYij6fuN2LZdylR/B5ELrEbuRg=; b=vDHne/0PxSfLHVpTQvPzq9GP5m31eqJIMkFZjPXw5HSAsffV4a88/QRSSo1cSakcFT sAKHrcONG9a8UO+3nEIgFrQDKvYP3k2c8PchxL0If+htK67ka/b9d3deEwQF/jY7w7nd 0o8M6z7mqj8ynWUtlyBFVeYyB/XW8w28yKxXe9B+OlUwgqE/WvEaoGUFLfK9Ttl4qQ7U t7gtOxgfjIGFCJ15Vp4FYtgqeDCehi/Qiahk+B3bCkVnwUR11DiQ7IcTnNKU5lUXg068 UHIwcqsKzlpFWz3wAsSttbeZxYCqFvWe8EzD3piZDpHE8zVkFx//tJ14TimnyA4VToml a0uA== 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 d17si1981603pgg.391.2019.03.20.09.22.57; Wed, 20 Mar 2019 09:23:12 -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 S1727563AbfCTQWC (ORCPT + 99 others); Wed, 20 Mar 2019 12:22:02 -0400 Received: from mga01.intel.com ([192.55.52.88]:41235 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbfCTQWB (ORCPT ); Wed, 20 Mar 2019 12:22:01 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2019 09:22:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,249,1549958400"; d="scan'208";a="135714626" Received: from sorenthe-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.254.203]) by orsmga003.jf.intel.com with ESMTP; 20 Mar 2019 09:21:53 -0700 From: Jarkko Sakkinen To: linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org Cc: akpm@linux-foundation.org, 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, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, bp@alien8.de, josh@joshtriplett.org, luto@kernel.org, kai.huang@intel.com, rientjes@google.com, Jarkko Sakkinen Subject: [PATCH v19,RESEND 03/27] x86/msr: Add IA32_FEATURE_CONTROL.SGX_ENABLE definition Date: Wed, 20 Mar 2019 18:20:55 +0200 Message-Id: <20190320162119.4469-4-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190320162119.4469-1-jarkko.sakkinen@linux.intel.com> References: <20190320162119.4469-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 Signed-off-by: Jarkko Sakkinen --- 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 ca5bc0eacb95..6efaa8026c64 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -525,6 +525,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