Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4060561yba; Wed, 17 Apr 2019 03:50:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDdtqRe7825EHjae9fXfsnUcrwO7VNIYXSh3ImLOX45qJ/RQPANSnBxg5wvqYsgT6CyMiW X-Received: by 2002:a63:c104:: with SMTP id w4mr82772991pgf.409.1555498232930; Wed, 17 Apr 2019 03:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555498232; cv=none; d=google.com; s=arc-20160816; b=Mq5x5O2/XVz8osU+HCQK6ydoU0mIvXtSDRgWypSVezJo6OJ9tFENkjZYxYBj3qO82a qIQFa/HnngDY/IHTd/y8mYe9/DYiMlZtOFKVy6nlU10JLa6vzx+2gkEPQNA18uPrG3IQ s+BSJv9ut/v7V+bFhYo1yQpLhjD4sl4o4y7xscmggmpwK5SU+TJ2qi0QaRJ3i84QAnkN JpqEasWRxMFahaVT2YxTa+tOZaP9nRWIifPhZps+LVgT7uRedVE878/iMIbnEndlnxFH KLagEdF/M2OfuidlpG9dAq5c9M0xYhpJTCRQDOWZbCbBvO2y+4Vq5jaWZqClZ6rFNRLA Vtdg== 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=S9fAhWiTrwyQ0PPRK4NhHEtXh55xrAEcA1MjfvbOqz5WLtjG9lXRIu9fl96UeAbZ3X QGS4ZlnLsQyP7Bz2ZTrT0Guh/2XdXb9y0nGWdV9p9ZJwGE1458d8ieA3eKxqZBGjX+B9 Ma+EnC7vlueZIELd9mKK48hEyk21rYxIgKobtHg2aj0q5JJ9jC/PZz7bDRFVoES+nK4Q 9FKm6JwzrS/l9PMY+EZl/yyWGF+V0pmto5cDATjQrk3QzPgF0OUAXVyOBrvGdovK50bn QO04aaSvdXUeVW5pEFVRS/SPAMYDyy/3/Kz9pmdWGg/GbcjvODDPqHfIqBKoohpK7lWI iyKA== 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 i70si2078654pge.476.2019.04.17.03.50.17; Wed, 17 Apr 2019 03:50:32 -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 S1731721AbfDQKkM (ORCPT + 99 others); Wed, 17 Apr 2019 06:40:12 -0400 Received: from mga05.intel.com ([192.55.52.43]:7809 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731632AbfDQKkL (ORCPT ); Wed, 17 Apr 2019 06:40:11 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2019 03:40:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,361,1549958400"; d="scan'208";a="132119777" Received: from jsakkine-mobl1.tm.intel.com (HELO localhost) ([10.237.50.189]) by orsmga007.jf.intel.com with ESMTP; 17 Apr 2019 03:40:03 -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 v20 03/28] x86/msr: Add IA32_FEATURE_CONTROL.SGX_ENABLE definition Date: Wed, 17 Apr 2019 13:39:13 +0300 Message-Id: <20190417103938.7762-4-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190417103938.7762-1-jarkko.sakkinen@linux.intel.com> References: <20190417103938.7762-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