Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp337722imu; Fri, 16 Nov 2018 03:24:29 -0800 (PST) X-Google-Smtp-Source: AJdET5cPdoiIkMQttP/X3v9BtdunB/HaGY74DxGMo2Ee+9c2Ry51RDNSN3gwHJYqchSB/4sE/kUA X-Received: by 2002:a62:16d6:: with SMTP id 205mr2484980pfw.256.1542367469337; Fri, 16 Nov 2018 03:24:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542367469; cv=none; d=google.com; s=arc-20160816; b=ojipro0hoOBeDNo8R04aQH4DqIIYve6ma2RL2le8J338pG/Byt5GVIid4e5VkrV0XC UH6ciBy0iOzaNXng54kwCSYfkYY0H5vY9mClK+odE0F7L7LU0OfGXUlzh79m4bRuSDt2 BYVxEsnB5igjAyLENJv0kfASKd/A0lkeNYGJCHK/9Y9AJ+ptoHD9bvYebOX5PLR5IVS9 jMHgkM4ubYX4jdwFAq6SFyz0doe0cSdQzzh2n0/4HEplBruLS2oP4zMlAsGxC4Y8oRLk cJE13F2v5QJ99cORjTB9Jr4bC2qwqXzoJtlKt4q42U5ihKg0KlK0HFzOItJATWk9+YgX EE2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KmqJmpZCXA2KdVrqri7AgNAoMHuhgIUUQ0H4i9k+MTo=; b=oxWKuqwJxI0RILkR5VMzb1prtHucf12LOfvG4R2pS0JSD5jqoL+KdoBt8Otbt5xKvf GOg4JmzlbxEqEdwgF0xelgGr4GhZzoQSLw92//QAPf9IDX8LNf158DbQm4KWkQSQ14Bu DUejzwukH1QEqbz06Rva5q+4xBYMf/5+jo1mYdi1vrcDTk7ljQXWEhWWh9rnRAtplaW2 MJiJnXSEh9+3BH/oi4HgJsDmDFWrY/pO6k9il53Tb0tm6XVl2AEx18Xta8OYogJsPllN jsro2NiyfCe02Is5//Aj7SWuQBUNp4QQ2q+5Sp2ogIRZKzHuFEoVlTXrpLHR/ecSgUwI bXRA== 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 m6-v6si34330653pfg.282.2018.11.16.03.24.14; Fri, 16 Nov 2018 03:24:29 -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; 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 S2389558AbeKPVfa (ORCPT + 99 others); Fri, 16 Nov 2018 16:35:30 -0500 Received: from mga17.intel.com ([192.55.52.151]:29336 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727567AbeKPVfa (ORCPT ); Fri, 16 Nov 2018 16:35:30 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Nov 2018 03:23:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,240,1539673200"; d="scan'208";a="96809630" Received: from unknown (HELO localhost) ([10.249.254.90]) by FMSMGA003.fm.intel.com with ESMTP; 16 Nov 2018 03:23:27 -0800 Date: Fri, 16 Nov 2018 13:23:26 +0200 From: Jarkko Sakkinen To: Randy Dunlap Cc: x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-sgx@vger.kernel.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@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)" Subject: Re: [PATCH v17 18/23] platform/x86: Intel SGX driver Message-ID: <20181116112326.GA6445@linux.intel.com> References: <20181116010412.23967-1-jarkko.sakkinen@linux.intel.com> <20181116010412.23967-19-jarkko.sakkinen@linux.intel.com> <6fe0687b-70c9-9e7d-6f05-8963f18f0636@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6fe0687b-70c9-9e7d-6f05-8963f18f0636@infradead.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 05:37:27PM -0800, Randy Dunlap wrote: > 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 Thank you. Addressed now in https://github.com/jsakkine-intel/linux-sgx.git. /Jarkko