From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Subject: Re: RFC: userspace exception fixups Date: Mon, 19 Nov 2018 18:02:04 +0200 Message-ID: <20181119160204.GD13298@linux.intel.com> References: <20181118071548.GA4795@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Andy Lutomirski Cc: Dave Hansen , "Christopherson, Sean J" , Jethro Beekman , Florian Weimer , Linux API , Jann Horn , Linus Torvalds , X86 ML , linux-arch , LKML , Peter Zijlstra , Rich Felker , 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 List-Id: linux-arch.vger.kernel.org On Mon, Nov 19, 2018 at 07:29:36AM -0800, Andy Lutomirski wrote: > 1. The kernel needs some way to know *when* to apply this fixup. > Decoding the instruction stream and doing it to all exceptions that > hit an ENCLU instruction seems like a poor design. I'm not sure why you would ever need to do any type of fixup as the idea is to just return to AEP i.e. from chosen exceptions (EPCM, #UD) the AEP would work the same way as for exceptions that the kernel can deal with except filling the exception information to registers. > 2. It starts exposing what looks like a more generic exception > handling mechanism to userspace, except that it's nonsensical for > anything other than ENCLU. Well, I see the user space and namely the run-time the host for the enclave i.e. middle-man to provide services for emulating instructions etc. /Jarkko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com ([192.55.52.120]:27569 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729928AbeKTC0N (ORCPT ); Mon, 19 Nov 2018 21:26:13 -0500 Date: Mon, 19 Nov 2018 18:02:04 +0200 From: Jarkko Sakkinen Subject: Re: RFC: userspace exception fixups Message-ID: <20181119160204.GD13298@linux.intel.com> References: <20181118071548.GA4795@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andy Lutomirski Cc: Dave Hansen , "Christopherson, Sean J" , Jethro Beekman , Florian Weimer , Linux API , Jann Horn , Linus Torvalds , X86 ML , linux-arch , LKML , Peter Zijlstra , Rich Felker , 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 Message-ID: <20181119160204.14dmVsASs8_6XGMY-jD6hEucwMpx3FcGwqEy84fxE6E@z> On Mon, Nov 19, 2018 at 07:29:36AM -0800, Andy Lutomirski wrote: > 1. The kernel needs some way to know *when* to apply this fixup. > Decoding the instruction stream and doing it to all exceptions that > hit an ENCLU instruction seems like a poor design. I'm not sure why you would ever need to do any type of fixup as the idea is to just return to AEP i.e. from chosen exceptions (EPCM, #UD) the AEP would work the same way as for exceptions that the kernel can deal with except filling the exception information to registers. > 2. It starts exposing what looks like a more generic exception > handling mechanism to userspace, except that it's nonsensical for > anything other than ENCLU. Well, I see the user space and namely the run-time the host for the enclave i.e. middle-man to provide services for emulating instructions etc. /Jarkko