Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3655733imm; Mon, 25 Jun 2018 02:18:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIvENBM2QJ3Bc6XvsaAenGlMH5mA3Llju1W4VVeApcsSQeztx22ryGdLAE2nX7SXTPKgpQU X-Received: by 2002:a17:902:88:: with SMTP id a8-v6mr11413819pla.156.1529918302089; Mon, 25 Jun 2018 02:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529918302; cv=none; d=google.com; s=arc-20160816; b=jK3pU+1u47DbKpn6fTNJ3y372ULRINKC9tyDSToEv2fAe9kjIkQdOFteUpwoPEveYP qkjeS1JS7VADegJkW5/qJbBqKMdJ5DSlwSyeT47Elhya7/BQwigXZRIbyKXlon8AtAzF RDQsQEkRE9mol10D1vQCfDSdhfMplYNFGk8el40nABFLuNcU9iNngGE1UlLG0EoPs8I4 yLp8iAuLj4WTsY4REcBQsxJKjssnQ3Vcz6XvR5qqs7UaFAiU3HSY3f728lcYS8BUq/7L Z3Q/quOuQ64m32Mhx0hyORwGtlzguXjJ/rbAf32TL2jLtk3Ph91tdtMwotgEX/FqZuum QU4g== 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 :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=Z0HLWiu9b3Ri+YPDBzYoRmVBKKf62h56iEtKuk+y0qs=; b=ezFWjgEsXGO+/aiDNqhm/O+cf2edBgULFEiEeN9ff+n6Aw5CGP61i1AadOlUC2RQI9 6ZVmki1EvMUWKCRQ1ufK9F44bkqxCueoRc7fwjaRy8K/UDDXX4wvznbWCNiOfMuGLsim j2C52lTIE+GIOEIAhypnbbuqC+rSKQ2BeiYrsmvjF6xee79bAc87rHoU1bxfmrNbsO+C 5QYm1tEoY+BgginlYJJwXL5FwjGJkk+7C3JgPysEETzT5A8JvkhxUEtPVl9ZEIbnkB+U jzZwoai2SMjX5Mj/KlVBxP+3HI3znBJom/QXMSc8utldTmVx6UULolh9Fs7WUH1uXHEI loEA== 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 c18-v6si12903129pfn.245.2018.06.25.02.18.07; Mon, 25 Jun 2018 02:18:22 -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 S1754869AbeFYJQJ (ORCPT + 99 others); Mon, 25 Jun 2018 05:16:09 -0400 Received: from mga18.intel.com ([134.134.136.126]:47736 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754683AbeFYJQH (ORCPT ); Mon, 25 Jun 2018 05:16:07 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2018 02:16:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,269,1526367600"; d="scan'208";a="52654289" Received: from jsakkine-mobl1.tm.intel.com (HELO sfriis-mobl.ger.corp.intel.com) ([10.237.50.42]) by orsmga006.jf.intel.com with ESMTP; 25 Jun 2018 02:16:04 -0700 Message-ID: Subject: Re: [PATCH v11 08/13] x86, sgx: added ENCLS wrappers From: Jarkko Sakkinen To: Sean Christopherson , x86@kernel.org, platform-driver-x86@vger.kernel.org Cc: dave.hansen@intel.com, nhorman@redhat.com, npmccallum@redhat.com, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "open list:INTEL SGX" Date: Mon, 25 Jun 2018 12:16:03 +0300 In-Reply-To: <1529500355.9779.51.camel@intel.com> References: <20180608171216.26521-1-jarkko.sakkinen@linux.intel.com> <20180608171216.26521-9-jarkko.sakkinen@linux.intel.com> <1529500355.9779.51.camel@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-06-20 at 06:12 -0700, Sean Christopherson wrote: > On Fri, 2018-06-08 at 19:09 +0200, Jarkko Sakkinen wrote: > > This commit adds wrappers for Intel(R) SGX ENCLS opcode functionality. > > > > Signed-off-by: Jarkko Sakkinen > > --- > > arch/x86/include/asm/sgx.h | 198 +++++++++++++++++++++++++++++++++++++ > > 1 file changed, 198 insertions(+) > > > > diff --git a/arch/x86/include/asm/sgx.h b/arch/x86/include/asm/sgx.h > > index fa3e6e0eb8af..a2f727f85b91 100644 > > --- a/arch/x86/include/asm/sgx.h > > +++ b/arch/x86/include/asm/sgx.h > > @@ -10,6 +10,10 @@ > > #ifndef _ASM_X86_SGX_H > > #define _ASM_X86_SGX_H > > > > +#include > > +#include > > +#include > > +#include > > #include > > > > #define SGX_CPUID 0x12 > > @@ -20,6 +24,200 @@ enum sgx_cpuid { > > SGX_CPUID_EPC_BANKS = 2, > > }; > > > > +enum sgx_commands { > > This should be something like "sgx_encls_leafs" and probably moved > to sgx_arch.h (as Dave alluded to, these are architectural values). > "sgx_commands" is not accurate (they're only the cpl0 "commands") > and will have collision issues in the future, e.g. with the ENCLV > instruction and its leafs. > > > + ECREATE = 0x0, > > + EADD = 0x1, > > + EINIT = 0x2, > > + EREMOVE = 0x3, > > + EDGBRD = 0x4, > > + EDGBWR = 0x5, > > + EEXTEND = 0x6, > > Even though it's not used in the code (yet...), I think ELDB, > leaf 0x7, should be defined here for completeness. Sure. /Jarkko