From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8DDDC5CFFE for ; Tue, 11 Dec 2018 18:41:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9EE2A20855 for ; Tue, 11 Dec 2018 18:41:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EE2A20855 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-sgx-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726252AbeLKSlE (ORCPT ); Tue, 11 Dec 2018 13:41:04 -0500 Received: from mga07.intel.com ([134.134.136.100]:29382 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726551AbeLKSlD (ORCPT ); Tue, 11 Dec 2018 13:41:03 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 10:40:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,343,1539673200"; d="scan'208";a="97946756" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.154]) by orsmga007.jf.intel.com with ESMTP; 11 Dec 2018 10:40:56 -0800 Date: Tue, 11 Dec 2018 10:40:56 -0800 From: Sean Christopherson To: Andy Lutomirski Cc: Josh Triplett , Thomas Gleixner , Ingo Molnar , Borislav Petkov , X86 ML , Jarkko Sakkinen , Dave Hansen , Peter Zijlstra , "H. Peter Anvin" , LKML , linux-sgx@vger.kernel.org, Haitao Huang , Jethro Beekman , "Dr. Greg Wettstein" Subject: Re: [RFC PATCH v3 0/4] x86: Add exception fixup for SGX ENCLU Message-ID: <20181211184056.GF14731@linux.intel.com> References: <20181210232141.5425-1-sean.j.christopherson@intel.com> <20181210232449.GA11843@localhost> <20181211165253.GB14731@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-sgx-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org On Tue, Dec 11, 2018 at 09:58:19AM -0800, Andy Lutomirski wrote: > > On Dec 11, 2018, at 8:52 AM, Sean Christopherson wrote: > > > >> On Tue, Dec 11, 2018 at 07:41:27AM -0800, Andy Lutomirski wrote: > >> > >> > >>>> On Dec 10, 2018, at 3:24 PM, Josh Triplett wrote: > >>>> > >>>> On Mon, Dec 10, 2018 at 03:21:37PM -0800, Sean Christopherson wrote: > >>>> At that point I realized it's a hell of a lot easier to simply provide > >>>> an IOCTL via /dev/sgx that allows userspace to register a per-process > >>>> ENCLU exception handler. At a high level, the basic idea is the same > >>>> as the vDSO approach: provide a hardcoded fixup handler for ENCLU and > >>>> attempt to fixup select unhandled exceptions that occurred in user code. > >>> > >>> So, on the one hand, this is *absolutely* much cleaner than the VDSO > >>> approach. On the other hand, this is global process state and has some > >>> of the same problems as a signal handler as a result. > >> > >> I liked the old version better for this reason > > > > This isn't fundamentally different than forcing all EENTER calls through > > the vDSO, which is also per-process. Technically this is more flexible > > in that regard since userspace gets to choose where their one ENCLU gets > > to reside. Userspace can have per-enclave entry flows so long as the > > actual ENLU[EENTER] is common, same as vDSO. > > Right. The problem is that user libraries have a remarkably hard time > agreeing on where their one copy of anything lives. Ah, so vDSO is the mean parent that takes away their kids' toys because thay haven't learned to share :)