Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2256495ybi; Sat, 13 Jul 2019 10:11:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyU3ar185ALv2Qd3F8/yAB6ukFBznQ5X1z/cIFT5JHHP8a9i7cpMWYKOFzUpGe2OwyNKXTi X-Received: by 2002:a17:902:e282:: with SMTP id cf2mr18874495plb.301.1563037878199; Sat, 13 Jul 2019 10:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563037878; cv=none; d=google.com; s=arc-20160816; b=iG1utvVZAsI+by+fhM1P0c3CfByyqnIw+iMEsdBLw9DavibP92d9F46/pikJx6ACeB M6ML4pe7Oa+Bb5DQf99SaKZH1yDxQQbj0RMsR692vYo0tE//s2Md23VEAp2dtphStxAJ 2MEm8u9sqtUB2j/SMGcZtuY3xGvmnbcXkGcz/ViNzMHkZdXkDqfdFmylxSQWtVvDp8TT rwj5fErYLbAqJQEa1ctLoCIUNuR1DGGbaIWD06Uh05lSkNjmdjFkL8UJVLBdBxQQdc+7 ESk6ITCQo5Jg7jdN8n9XBSX6mfSUiBhnII95XpIsxPbyCd81/ZZId+Qi9XL5ywLwpTfD mWHQ== 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=Uka+K3YNKjktD/63IGAmVUbJosPUkOhQ3hH6vS80UyY=; b=jEpDCYCPHX60Ot7HUi9isF1oD6zFI61g4v/Zutv0jrr1uACCfSeWidr45Cnr/40HsT rOfD0QAMP/ttYRxZu1a7YZbRW1atM51Pqi0Ry/G5mmL71NSxI1pwuFJ1DpA+jDpfbhEr 6zBu9iSWQODn2SwKASmOqMZCdvc+S4wizum1vjXIVCRBZC6/LJatvOITGpQ30SQZ3gc9 4EVTPboIDiHopXKhiuOh1j/dYSY2O1qBKHFjMRCqp5V/ua6riUAkVVrqCHotOxn9OIFR XDrSNMNDT1A5lNyM+ITh2w17oZdPc+tgO4k0nK5sSthjGflvbR10OSoWNLNnPB1zPhGM Q35A== 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 m184si8444424pgm.580.2019.07.13.10.11.01; Sat, 13 Jul 2019 10:11:18 -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 S1728043AbfGMRIo (ORCPT + 99 others); Sat, 13 Jul 2019 13:08:44 -0400 Received: from mga07.intel.com ([134.134.136.100]:22200 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727784AbfGMRIn (ORCPT ); Sat, 13 Jul 2019 13:08:43 -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 orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jul 2019 10:08:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,487,1557212400"; d="scan'208";a="341981112" Received: from hbriegel-mobl.ger.corp.intel.com (HELO localhost) ([10.252.50.48]) by orsmga005.jf.intel.com with ESMTP; 13 Jul 2019 10:08:34 -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, cedric.xing@intel.com, Jarkko Sakkinen Subject: [PATCH v21 03/28] x86/msr: Add IA32_FEATURE_CONTROL.SGX_ENABLE definition Date: Sat, 13 Jul 2019 20:07:39 +0300 Message-Id: <20190713170804.2340-4-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190713170804.2340-1-jarkko.sakkinen@linux.intel.com> References: <20190713170804.2340-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 6b4fc2788078..c006ba8187aa 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -542,6 +542,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.20.1