Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4954334img; Tue, 26 Mar 2019 22:04:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHvv82gSCAyzFJ5iSc3OuLLgYHXOW7eKXo36zn+fqKB2UJJiojy15XqmAZNJm/XeyDPSej X-Received: by 2002:a62:e315:: with SMTP id g21mr32181358pfh.2.1553663050564; Tue, 26 Mar 2019 22:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553663050; cv=none; d=google.com; s=arc-20160816; b=c+pKazaXLmS6ADP0Ish0fadJ408gkFaOe5Ae70BttG+mYCuGwbzyD52u/Ru0sI33hY JQEvcopJw+3gZm8buNpGLFIQfHGlFc9xfcfdRmmnabpDx4FZBXBspO7iUFD3MkdtrTI4 QE3OW9umQ1WpqELhu+vfPmTGYL2l5vy6Ni7maS+MZH51sLli0lJjcxUO92J8os+wKFPB Fa2mJ9GURNGyB1YBO9jG7fsY01MHI5Nhx+H2rmQIyK8h2nD97zQRmMPfnyDkMBbXeoa1 QIs4fRovgTaf7DvbFMugR8XCj0pJMLKrjB3ekuSr6Iqc7TfpQKmb8m/gy+2z5u5CBurW OHiw== 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=Mcg5sxcJiAa6Mp/lEFkbAdZKGwEUYDri3RZ8GmywNSA=; b=VRs2+ao1QdFxbjwuzjxev92Ta3fAeGypBB+eJWHpsknZ2zbKwKMkpUJ0pg703d2HY2 Jpgv1ZseKXdPxHp1OOdTvs9z6Mnv5vPN5DiCe7AJk5Yk6hmqSe7aymdc5Hh5KcKcicS8 ITMV3pxSWmywZiTc5KPk7bPH8IRrVXqhPu1qPQVRCLuo+AyT8llFyvEZPO9q90kEFcev vTJekyrMX/ccrsjg6HtTXc+6UWOdM9QOVlVsEtI/ci6DxVF0xjFV6HFDnL3eqKQzhnnm sF3tS8hQPEVxBCLJo1D7SYMA8R21HkNZdiKNmhXV7Kn//FzqRoGhH9B7LhO5n+8t0pNA ECrg== 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 t33si17909620pgl.530.2019.03.26.22.03.55; Tue, 26 Mar 2019 22:04:10 -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 S1726313AbfC0FDJ (ORCPT + 99 others); Wed, 27 Mar 2019 01:03:09 -0400 Received: from mga17.intel.com ([192.55.52.151]:38205 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbfC0FDJ (ORCPT ); Wed, 27 Mar 2019 01:03:09 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2019 22:03:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,275,1549958400"; d="scan'208";a="156137125" Received: from yannluen-mobl.ccr.corp.intel.com (HELO localhost) ([10.249.254.205]) by fmsmga004.fm.intel.com with ESMTP; 26 Mar 2019 22:02:59 -0700 Date: Wed, 27 Mar 2019 07:02:58 +0200 From: Jarkko Sakkinen To: "Huang, Kai" Cc: "linux-kernel@vger.kernel.org" , "linux-sgx@vger.kernel.org" , "x86@kernel.org" , "Svahn, Kai" , "nhorman@redhat.com" , "Christopherson, Sean J" , "josh@joshtriplett.org" , "tglx@linutronix.de" , "suresh.b.siddha@intel.com" , "Ayoun, Serge" , "Huang, Haitao" , "akpm@linux-foundation.org" , "npmccallum@redhat.com" , "rientjes@google.com" , "luto@kernel.org" , "Katz-zamir, Shay" , "Hansen, Dave" , "bp@alien8.de" , "andriy.shevchenko@linux.intel.com" Subject: Re: [PATCH v19,RESEND 16/27] x86/sgx: Add the Linux SGX Enclave Driver Message-ID: <20190327050258.GE15397@linux.intel.com> References: <20190320162119.4469-1-jarkko.sakkinen@linux.intel.com> <20190320162119.4469-17-jarkko.sakkinen@linux.intel.com> <1553601688.17255.12.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1553601688.17255.12.camel@intel.com> 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 Tue, Mar 26, 2019 at 12:01:31PM +0000, Huang, Kai wrote: > On Wed, 2019-03-20 at 18:21 +0200, 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. > > > > This commit adds the Linux SGX Enclave Driver that provides an ioctl API > > to manage enclaves. The address range for an enclave, commonly referred > > as ELRANGE in the documentation (e.g. Intel SDM), is reserved with > > mmap() against /dev/sgx. After that a set ioctls is used to build > > the enclave to the ELRANGE. > > > > 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 > > --- > > Documentation/ioctl/ioctl-number.txt | 1 + > > arch/x86/Kconfig | 17 +- > > arch/x86/include/uapi/asm/sgx.h | 59 ++ > > arch/x86/kernel/cpu/sgx/Makefile | 5 +- > > arch/x86/kernel/cpu/sgx/driver/Makefile | 3 + > > arch/x86/kernel/cpu/sgx/driver/driver.h | 38 ++ > > arch/x86/kernel/cpu/sgx/driver/ioctl.c | 795 ++++++++++++++++++++++++ > > arch/x86/kernel/cpu/sgx/driver/main.c | 290 +++++++++ > > arch/x86/kernel/cpu/sgx/encl.c | 358 +++++++++++ > > arch/x86/kernel/cpu/sgx/encl.h | 88 +++ > > arch/x86/kernel/cpu/sgx/encls.c | 1 + > > arch/x86/kernel/cpu/sgx/main.c | 3 + > > arch/x86/kernel/cpu/sgx/sgx.h | 1 + > > 13 files changed, 1657 insertions(+), 2 deletions(-) > > create mode 100644 arch/x86/include/uapi/asm/sgx.h > > create mode 100644 arch/x86/kernel/cpu/sgx/driver/Makefile > > create mode 100644 arch/x86/kernel/cpu/sgx/driver/driver.h > > create mode 100644 arch/x86/kernel/cpu/sgx/driver/ioctl.c > > create mode 100644 arch/x86/kernel/cpu/sgx/driver/main.c > > create mode 100644 arch/x86/kernel/cpu/sgx/encl.c > > create mode 100644 arch/x86/kernel/cpu/sgx/encl.h > > Shouldn't the driver be located somewhere under drivers/, but not under arch/x86? > > I don't think x86 maintainers should have the burden to review every code change made to SGX driver? Not sure I got your angle. It is x86 tied code. $ git grep tristate arch/x86/ | wc -l 22 /Jarkko