Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8767958imu; Thu, 15 Nov 2018 17:39:36 -0800 (PST) X-Google-Smtp-Source: AJdET5dhT8Hl9j1pa9iJ2CwIQtyJ3jaum9rnscQ/StbvrdZCoNc/dPb02ZErr/DSEG3MbkOjsvah X-Received: by 2002:a65:5c81:: with SMTP id a1-v6mr7943832pgt.390.1542332376889; Thu, 15 Nov 2018 17:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542332376; cv=none; d=google.com; s=arc-20160816; b=aLcd4AYov0jjpHMKwQ3eik2N1QSxPec1u51pkhV/jUyZ8gGh7i8KlIFIyUakyfdb3v 60ZEDzz4Y+fJtTSfZXnxPXMos2XBmxX6vcUAaIJ1ljhe7xaUIsPcdmiurpmEFApMxplU TqVmccua8+sqChDmbcYAie2kw+YO+7OIE69I8/xHtu4FKrtbdfwyggmOKdGb38LG2U0S hOO1gE5KaW10RtalYowjGiCx+rhGwb0ZFr/mPxRs8Bsg4v+gU0x0pZ5s48+6ZgESIMvH ra1I6FgpYUjYGx0VKEP3yR9Lf9IP0N2DFEfONI0F/h5Z9Dqg4GFfu6bYmI5JiG3PdRpJ VYIA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=PZ07iX1JWwuAxjhE7PxBrOGPytwl1A9OMwnDiGIXgCI=; b=HDl/z6ddJi4sLl8Zy+Lmmvjg4M7CH4k7Kn4FryBuz/ySZG3GWySlI4AyQ76OEehgJq MfFgup6uPZogkfHzUbrJAn2vZQKNrTwJCEcSyUHq25x2g8DyqrFVqTw83k9EzAxS05Hd IRk2ortyblV4zgsMT1mhPvj+zSxsmHwJ4JdvIli+N/W2IHZi9DRo27vzaRUjQbY7Zv2f mu90kZ8RkJdJbiKw9e5Z7TyECxryf99c6b85o5YBSRNoCOtmZa1bbkT9fxyKi8yUFRhw WgNV1agOaxW+Zp6on3JpcPbNBXZN8AgkINtIkVtJGVOQycQpvygQD1D9CjWdTaBsLsB+ tUJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=oKTECSGL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186-v6si31687594pfc.95.2018.11.15.17.39.22; Thu, 15 Nov 2018 17:39:36 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=oKTECSGL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727308AbeKPLry (ORCPT + 99 others); Fri, 16 Nov 2018 06:47:54 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:42606 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbeKPLry (ORCPT ); Fri, 16 Nov 2018 06:47:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PZ07iX1JWwuAxjhE7PxBrOGPytwl1A9OMwnDiGIXgCI=; b=oKTECSGLs7abiPe3mb9QWvcEu LkObuxVm2F5vjn5njgatxs6mDuw5RwkisqFxm/xrCGEN0wflQd/tRswUpRZaS9dA6RpPpFsKSaYsp Z7NJUqi0kJeEcfav+l/t4z1+Ds+fv6oMWMxnMiysCxu8IyEwNB4Lx5Ap1LVdi4TkidNsZdwQ6CjR4 SodTa4Af4eunBqgii3J9CyRkDwoUTE/pXmUuwy7a6FGdU+7KVT7u84N/zdCNaywtAAQwOW00ghvtv UvciZ+/nt4iayLBIH0PzCOmzko1HiUpb5Ewk1lgbOwX8CSTp66KjFCpbDXDCcJ9aSauYlZSd3wGl0 wAzYO8SKQ==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNT4d-00031j-MA; Fri, 16 Nov 2018 01:37:31 +0000 Subject: Re: [PATCH v17 18/23] platform/x86: Intel SGX driver To: Jarkko Sakkinen , 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@linux.intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, mark.shanahan@intel.com, luto@amacapital.net, Suresh Siddha , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Darren Hart , Andy Shevchenko , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" References: <20181116010412.23967-1-jarkko.sakkinen@linux.intel.com> <20181116010412.23967-19-jarkko.sakkinen@linux.intel.com> From: Randy Dunlap Message-ID: <6fe0687b-70c9-9e7d-6f05-8963f18f0636@infradead.org> Date: Thu, 15 Nov 2018 17:37:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181116010412.23967-19-jarkko.sakkinen@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/15/18 5:01 PM, Jarkko Sakkinen wrote: > Intel Software Guard eXtensions (SGX) is a set of CPU instructions that > can be used by applications to set aside private regions of code and > data. The code outside the enclave is disallowed to access the memory > inside the enclave by the CPU access control. > > SGX driver provides a ioctl API for loading and initializing enclaves. > Address range for enclaves is reserved with mmap() and they are > destroyed with munmap(). Enclave construction, measurement and > initialization is done with the provided the ioctl API. > > Signed-off-by: Jarkko Sakkinen > Co-developed-by: Sean Christopherson > Signed-off-by: Sean Christopherson > Co-developed-by: Serge Ayoun > Signed-off-by: Serge Ayoun > Co-developed-by: Shay Katz-zamir > Signed-off-by: Shay Katz-zamir > Co-developed-by: Suresh Siddha > Signed-off-by: Suresh Siddha > --- > diff --git a/arch/x86/include/uapi/asm/sgx.h b/arch/x86/include/uapi/asm/sgx.h > new file mode 100644 > index 000000000000..aadf9c76e360 > --- /dev/null > +++ b/arch/x86/include/uapi/asm/sgx.h > @@ -0,0 +1,59 @@ > +/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ > +/** > + * Copyright(c) 2016-18 Intel Corporation. > + */ > +#ifndef _UAPI_ASM_X86_SGX_H > +#define _UAPI_ASM_X86_SGX_H > + > +#include > +#include > + > +#define SGX_MAGIC 0xA4 > + > +#define SGX_IOC_ENCLAVE_CREATE \ > + _IOW(SGX_MAGIC, 0x00, struct sgx_enclave_create) > +#define SGX_IOC_ENCLAVE_ADD_PAGE \ > + _IOW(SGX_MAGIC, 0x01, struct sgx_enclave_add_page) > +#define SGX_IOC_ENCLAVE_INIT \ > + _IOW(SGX_MAGIC, 0x02, struct sgx_enclave_init) > + > +/* IOCTL return values */ > +#define SGX_POWER_LOST_ENCLAVE 0x40000000 Hi, The ioctl magic number should be documented in Documentation/ioctl/ioctl-number.txt. ta. -- ~Randy