Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5481931imu; Tue, 13 Nov 2018 07:15:15 -0800 (PST) X-Google-Smtp-Source: AJdET5eE1X6QHDcYqXOaKYkdWF074eHbLOYQCoxiWw8rh9x+lTz/521wXxNEb96H9qYrCISu4Kq/ X-Received: by 2002:a17:902:bd92:: with SMTP id q18mr3616549pls.167.1542122115382; Tue, 13 Nov 2018 07:15:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542122115; cv=none; d=google.com; s=arc-20160816; b=pz/SJUadaWBOybG6bjHuVr7baj8N6puOl8+Q0zqDe13RwAOqx+1Ny8sRdLhhHNESXh W3d9gy5BxUS2lmrp/1LFZjsAdiszCxGmfil07L0vjRHE0pYmbWH/XDFkfadJfmECd3nT 3Vk49Jrun+MIRYOZgDlAR5z7XxdU9oORMsfmahDhgfKefCIUD5OYEFBc86DTORBy9YlP 6suCwD/U90K8FEts+jJfP6KDSggh22pc6JY1psmb4uIH4A2hMXhHihIu2V/o8X+7ajBO f8i2CuMOymdfKlTcpce1WuPKBMx1CiMXwl5BuV977j0VqhqqtL0JsI5Wu3yQkqFM9HhC hUOQ== 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=nzgSnzmiV+56Wcz85hfhpeeVhPMCDlfBWXt3ElQCVE8=; b=07/kYh73nUjlF1YPcgeYeOQVSPHbA3Gn4hoWo7/G+Sgs5XhBPTy0a2gp7xnMcIJUuI +QqLO4sYQIZIiMBDLWhUcFQgRsLyo87C+JecgYlVEbF71E2okt6nZCZMgFSnEUqzGwVX ksGkP5r22VX9qfzM/dF9hVS1e5utRrg5mDXnolC6hBw4XyEC/vKjZhNI8SJHN30cfiGM UIm3GHdXfNmjLML/0TtHrnUdk8CTzfX5HVQyBzS/d99o0n67K9uxU4AYbKxEwMufccEi INw1XvwSy9/9IqBBEBPm2QErtezvZ+cndN4sQIFi7YpFXqThHQpFkpC1q6Dg//VlpD8e cJmw== 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 n1-v6si20607088pld.378.2018.11.13.07.14.23; Tue, 13 Nov 2018 07:15:15 -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 S2387453AbeKNBMB (ORCPT + 99 others); Tue, 13 Nov 2018 20:12:01 -0500 Received: from mga18.intel.com ([134.134.136.126]:53210 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731287AbeKNBMA (ORCPT ); Tue, 13 Nov 2018 20:12:00 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2018 07:13:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,499,1534834800"; d="scan'208";a="280732220" Received: from ibanaga-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.254.77]) by fmsmga006.fm.intel.com with ESMTP; 13 Nov 2018 07:13:18 -0800 Date: Tue, 13 Nov 2018 17:13:16 +0200 From: Jarkko Sakkinen To: Dave Hansen Cc: x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-sgx@vger.kernel.org, sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, mark.shanahan@intel.com, andriy.shevchenko@linux.intel.com, Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "open list:DOCUMENTATION" , open list Subject: Re: [PATCH v15 23/23] x86/sgx: Driver documentation Message-ID: <20181113151316.GA3796@linux.intel.com> References: <20181102231320.29164-1-jarkko.sakkinen@linux.intel.com> <20181102231320.29164-24-jarkko.sakkinen@linux.intel.com> <154ded23-fd1d-f324-4e0a-9de8eddcda6d@intel.com> <20181106054911.GA15575@linux.intel.com> <20181107163019.GA11509@linux.intel.com> <914dd171-b48a-12d9-eb77-3c40c8b210cb@intel.com> <20181108143942.GA13792@linux.intel.com> <20181108192040.GA21685@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181108192040.GA21685@linux.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 Thu, Nov 08, 2018 at 09:20:40PM +0200, Jarkko Sakkinen wrote: > On Thu, Nov 08, 2018 at 04:39:42PM +0200, Jarkko Sakkinen wrote: > > On Wed, Nov 07, 2018 at 09:09:37AM -0800, Dave Hansen wrote: > > > On 11/7/18 8:30 AM, Jarkko Sakkinen wrote: > > > >> Does this code run when I type "make kselftest"? If not, I think we > > > >> should rectify that. > > > > No, it doesn't. It is just my backup for the non-SDK user space code > > > > that I've made that I will use to fork my user space SGX projects in > > > > the future. > > > > > > > > I can work-out a selftest (and provide a new patch in the series) but > > > > I'm still wondering what the enclave should do. I would suggest that > > > > we start with an enclave that does just EEXIT and nothing else. > > > > > > Yeah, that's a start. But, a good selftest would include things like > > > faults and error conditions. > > > > Great. We can add more entry points to the enclave for different tests > > but I'll start with a bare minimum. And yeah but ever goes into next > > version I'll document the fault handling. > > For the v17 I'll add exactly two test cases: > > 1. EENTER/EEXIT > 2. EENTER/exception > > So that it will easier to evaluate and demonstrate exception handling. > > /Jarkko Here is my test program now: https://github.com/jsakkine-intel/sgx-selftest It is ~1100 lines ATM. Next I'll deploy it to the kernel tree. It has only (1) now but I'll add (2) too when I convert this to a kernel patch (probably by doing sgx_call() with a NULL pointer). /Jarkko