Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2665526imd; Fri, 2 Nov 2018 15:44:14 -0700 (PDT) X-Google-Smtp-Source: AJdET5dIO8wWX8ETgYeMBnaqcBsuihHnOpjEoeGxO7bY5WGqCZW41egwkuq9FdNSrTBcLNq8yx8o X-Received: by 2002:a17:902:6bc9:: with SMTP id m9-v6mr13649181plt.106.1541198654076; Fri, 02 Nov 2018 15:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541198654; cv=none; d=google.com; s=arc-20160816; b=R0ze8S2hnH9cb2izttbO0BWrq86q2Z7uzZ3OsW5k6aya/AY0wBownD1hruNprY1JI2 DFJfgn6xH5i+2uEJKG0xTL9HEeLSxig2IVlfXYtq0mM0h7uscme6uuDBsz3Ri4bp9dMU SWJgbXqjR13Ln5pblGDYeXvn7FIvReABtI3V0wjNrPs1r0Q4bCqRe4h6YRYkqSjr8zlU QuSMEUGOMur6InPWPJDxnfaUdORTxRWAH+QD3OoNh+9BiQEMOWn9MobrRCkDp9Kn6pVq c19fUttkn+nGfeQx25ZygWKsub9z7LC98Us5cYJ9mQ57jbIRgomc7yG4FJ+rASNI3JqQ Z0UA== 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=tFwo7q/gZjNdyyI6Nfr6AVw8aR8OvC1LQxPwcqibuwo=; b=D2KzOpqm4C1m7k0DtXbLAoX2teWYbUWD/OQ5bZbapfZLkr8VFUa1hlwwjjQxNEd37Y UAeid+KNDeL/NFL6BGnaaHr7B6genC+1LGrMziKaG/YHYNp8xDtQJd+mBKLGdWw+sP2z mUkMEQmFOQt6ZwJQLp6Imvr3LjB9dz1K8v4w+AD0He1llgfXs6iZKua0ODgWP3fvOrdC fht96NvSkZCRhhKT5gl7Dt/9kthGWpjPGMjYynR/ruIVOUslpHf+verIG8QLwRGS30TZ Q4L0wVS0jcEW4rdtMb60GjYaCkjMzH2Um7PRG6VoeV7GoTxIvzPVGCLUE1NjDSKW4W09 9Spg== 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 c68-v6si37754958pfa.45.2018.11.02.15.43.59; Fri, 02 Nov 2018 15:44:14 -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 S1728366AbeKCHvR (ORCPT + 99 others); Sat, 3 Nov 2018 03:51:17 -0400 Received: from mga05.intel.com ([192.55.52.43]:50503 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbeKCHvR (ORCPT ); Sat, 3 Nov 2018 03:51:17 -0400 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 fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Nov 2018 15:42:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,457,1534834800"; d="scan'208";a="93317178" Received: from btyborox-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.138]) by FMSMGA003.fm.intel.com with ESMTP; 02 Nov 2018 15:42:06 -0700 Date: Sat, 3 Nov 2018 00:42:04 +0200 From: Jarkko Sakkinen To: Sean Christopherson Cc: Jethro Beekman , Andy Lutomirski , Linus Torvalds , Rich Felker , Jann Horn , Dave Hansen , Florian Weimer , Linux API , X86 ML , linux-arch , LKML , Peter Zijlstra , "nhorman@redhat.com" , "npmccallum@redhat.com" , "Ayoun, Serge" , "shay.katz-zamir@intel.com" , "linux-sgx@vger.kernel.org" , Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Carlos O'Donell , "adhemerval.zanella@linaro.org" Subject: Re: RFC: userspace exception fixups Message-ID: <20181102224204.GC24373@linux.intel.com> References: <20181101185225.GC5150@brightrain.aerifal.cx> <20181101193107.GE5150@brightrain.aerifal.cx> <20181102163034.GB7393@linux.intel.com> <7e14ee0e-ce15-1e88-7ae9-4d0f40cb3d84@fortanix.com> <20181102165204.GC7393@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181102165204.GC7393@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 Fri, Nov 02, 2018 at 09:52:04AM -0700, Sean Christopherson wrote: > On Fri, Nov 02, 2018 at 04:37:10PM +0000, Jethro Beekman wrote: > > On 2018-11-02 09:30, Sean Christopherson wrote: > > >... The intended convention for EENTER is to have an ENCLU at the AEX target ... > > > > > >... to further enforce that the AEX target needs to be ENCLU. > > > > Some SGX runtimes may want to use a different AEX target. > > To what end? Userspace gets no indication as to why the AEX occurred. > And if exceptions are getting transfered to userspace the trampoline > would effectively be handling only INTR, NMI, #MC and EPC #PF. I've understood that in some cases run-time implementation requires to run a handler implemented inside the enclave i.e the sequence would be 1. #AEX 2. EENTER(in-enclave handler) 3. EEXIT(%rcx) 4. ERESUME /Jarkko