Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp796328imu; Tue, 11 Dec 2018 07:44:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/XhrxwCkbzWlnJS7RaxxevAjR/8cwnqyeXO5r8tiGVxV79avGDwiY4LSi0XUKjV9SAqAITY X-Received: by 2002:a65:514c:: with SMTP id g12mr14907840pgq.169.1544543040229; Tue, 11 Dec 2018 07:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543040; cv=none; d=google.com; s=arc-20160816; b=Fc5N8Qmnlyuzw/Q1Yoxdc6MfwCP8nkel6O9JW5UrrsLn7gJmEqH6GvH86TIxMkx74u FBkHz4dSL7c/5yA9QAfR+IZhW3bPSOuGGV+p03UkQM5bPPQlo2naPGbOyTKycOX75QuC xtgrizaRkprhjWrKRNl0rvWU4eRQxJLd2JbdbbbpC9cVdAjddkKoffdyuZrp6fctjcvL Ms7rVg0teEmQB+2hoXnZQKkuzEkSzyf4dlKX5dJwFHwNq96+ux/ieX4RY9bdFAqpB4ZV xDmE7638jZi4oumiwuvBaCUi1npfWyoFvlR23tPRISsH8MVNrV9+Asd0drsTO6VGpfSW /gaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=U9cQk/oU0NjVhkyahB/PaBaJmR2qTHCOw8kIX+qQC5E=; b=KQlN+PRk2erC4sbsw3WYKFS3F8KUaiiVr96s5ssNj4ilFGo1+QrmYiC9eMago6h4VI MVkWSopJonv2RX0dqCzbq8SLRrNCh1DajDqhBfdPk/p2RgXdvjJvaXuAI7yTo+cmve/l jvYAz6O8BTUiF/GaQ4eFiqo1M8JIvOqZRMyZoH/lHC+seFDYDZdv8jDBV2FsTYXSVPLD Ou+c6cdBR8Ws/tX5pohvBJHheAsb5s4aouDJO97pFeTwP5Yg1ynb9KYI7WqEFWNnjDBq R0BGkPQ9efBI8oi7bXfICPAiMZvM176mDLcYkTXefMOdD8ucTITOWxS1mCKSTAa9wXRl kt3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=YnrB4isO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si12183486plo.293.2018.12.11.07.43.45; Tue, 11 Dec 2018 07:44:00 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=YnrB4isO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727062AbeLKPla (ORCPT + 99 others); Tue, 11 Dec 2018 10:41:30 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36319 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726499AbeLKPla (ORCPT ); Tue, 11 Dec 2018 10:41:30 -0500 Received: by mail-pl1-f193.google.com with SMTP id g9so7098364plo.3 for ; Tue, 11 Dec 2018 07:41:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=U9cQk/oU0NjVhkyahB/PaBaJmR2qTHCOw8kIX+qQC5E=; b=YnrB4isOJtN8m49WvsMv2NrOcPDBReeYRpwMX6Ehl/jYSnmjN85hZx2wuJ6lCX4Cc6 9yVM4JUDc33P7JKuqL7gYJJvV1q4ypasrT20LTaLtIciY0JNi24UgDciyALWpRm1deeO x8GClN+J7yp2kLToiS6CV0aEywGNRGycQse6V9QtuCBSLI9lEDpo78GQFe8QbZABKZsx yM8TPp+JVuV9Pe4hJj3f0HyZTZ/KvvS/58aKLrPvuBa8KlEjrOd6S3WWi5/nHp+hyebT F5V1r+kKx3CZoF9nehRae2vA9TJenUYf9xG6AUTNWy7gW3u2//g6xUwoVIWZ7JGizP5t y6vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=U9cQk/oU0NjVhkyahB/PaBaJmR2qTHCOw8kIX+qQC5E=; b=CO85Iw8VpRj9BmQeVjHQ6bIGuH7cePEVm8M71/BRux6cRw7G2R6Y+n7HHtN3yhEP5N Kb63sEjD2FhyUJjC2nnv5kTB6Vxip3EHYXFDitz7CkVvlSFoKPaX7+8PwxX/9Obt7icJ XMxcwqBQ8qQSSvFtvKd8ZQEK1ti7JLAMM+EQ49pxYen1tc0o9PozJ2D3zQ/zlhlCe6c2 Fu4/NG+8ENJSAeOCwhT5pIUSOQGwZSXhUt3bsqGnQYr5qi2F4sHQDID972fCzpqebcYS hIqrBjf9JDUXW4jk8sTOVrudmvvEODE5zv8LKcdXtD+4BBAgTZxfIh2sMzMWclpw2I// dKaA== X-Gm-Message-State: AA+aEWaS6WpO7sXSsAzsU/ArFWxUiQRqqg1aQxEJP7pRl1Mjqcck5U8f 4Le6OOLUOE3m0RIu4G/ISHh3Lg== X-Received: by 2002:a17:902:4a0c:: with SMTP id w12mr16679813pld.8.1544542889578; Tue, 11 Dec 2018 07:41:29 -0800 (PST) Received: from ?IPv6:2601:646:c200:7429:cc12:b7da:e644:c670? ([2601:646:c200:7429:cc12:b7da:e644:c670]) by smtp.gmail.com with ESMTPSA id u8sm20350831pfl.16.2018.12.11.07.41.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 07:41:28 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [RFC PATCH v3 0/4] x86: Add exception fixup for SGX ENCLU From: Andy Lutomirski X-Mailer: iPhone Mail (16B92) In-Reply-To: <20181210232449.GA11843@localhost> Date: Tue, 11 Dec 2018 07:41:27 -0800 Cc: Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Jarkko Sakkinen , Dave Hansen , Andy Lutomirski , Peter Zijlstra , "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org, Haitao Huang , Jethro Beekman , "Dr . Greg Wettstein" Content-Transfer-Encoding: quoted-printable Message-Id: References: <20181210232141.5425-1-sean.j.christopherson@intel.com> <20181210232449.GA11843@localhost> To: Josh Triplett Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Dec 10, 2018, at 3:24 PM, Josh Triplett wrote: >=20 >> 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. >=20 > 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 and for another reason: while= this new one looks very very simple, it still has the hidden complexity tha= t the magic values written to registers in the event of an exception are ver= y much Linux specific. OTOH, the old approach clobbered more regs than needed, but that=E2=80=99s a= easy fix.=