Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3013205imu; Mon, 19 Nov 2018 09:21:13 -0800 (PST) X-Google-Smtp-Source: AJdET5d4Hg+994Jw3M82OoPWYwsvbKHEXPYU799HzqsPPctcgZxfyhpcI0o3AWZC3uQjhZMMMpGK X-Received: by 2002:a63:5664:: with SMTP id g36mr20686025pgm.313.1542648073704; Mon, 19 Nov 2018 09:21:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542648073; cv=none; d=google.com; s=arc-20160816; b=MZVygMfioT+EPCriGU+nsUdRemh1TQzoxV2CuR27oHjpdVdOxSkiBV1ariVpLk/IZl kUebdYuS6hkoMVAQ4WpbFj8o/fQDvPRzczyZh41bCT34SUvrnThmmMwYHKJt9g4osJ0V xmSNMdV6gBZ9ALLx3xCzKU4x45ca9glv6xmmOzuzpG41Nh6jcjucrij8LaKZFE7Qa7JD rh1j+awT1pMPZobXU0IRfHmiJXuli+sVMPoyPQWXk06f3dP1StQypCqQwVK4GQ2mBsar zRSIqk4fYmgUjMOdxiIlwazuOapRRzZfMjQrj07FmQ7/Zs9iPlKyeAyhfjlF9xQeXm3j CwbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=e9SNW4A27cXfYjT5uWtB+rpQ1I6PE+oMDbgyD63Ku2s=; b=ujcuouM5GQCkqg/6+3cqSz+dxLLxqQ2PlDnwjr8KSOG5ZPatVHlUxof/wLxfbgJri8 IU7qxxBu/bmToCIcC6+K9P8hYkTmRFQRg79kRlV2v42VQECwru73+cPja1c7Fyja4RfJ /h0JiWAb6K0sJesprPUi8R9B8V0MiwtqfyVOa4o7vY0/+5sw1vat7R87T43Gtoa2eCRq qdp6QTLmbh2jiMnpoa9JtPNqqB/zMJY+TmPMvZTeY+yT1x+IHRLFX+h6jKzRUVMTYnG/ QYgHQtyfWIFSheZZYWR6toNge6cuCaXw4f15dOJq098UvmFLXdBTBUuDNjoYjq3cMFZC aiAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wEVyny+f; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j29si38942887pgm.554.2018.11.19.09.20.46; Mon, 19 Nov 2018 09:21:13 -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=@kernel.org header.s=default header.b=wEVyny+f; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405355AbeKTDYj (ORCPT + 99 others); Mon, 19 Nov 2018 22:24:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:37446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405345AbeKTDYi (ORCPT ); Mon, 19 Nov 2018 22:24:38 -0500 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C062222505 for ; Mon, 19 Nov 2018 17:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542646823; bh=4QGrRb/NX/u9ezQIPG+tiTfLwtuWQfaNCdAWB5BxLug=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=wEVyny+f5k/dOwYn8NaIcPRLv6mfKxyDkENQ+RIozuxMzekBPus0FAWcYhmFcUR2s U7pY+sBnhHpwvIOiH5RXeqKiAY5BxeYig65eVaJ3kT1ERLNIf6kIiBMNUq4jmP4nK5 JrdKCIb/pEfKNVmSHeZ4yJu3uSHl4Qeyy6i7ZBXI= Received: by mail-wm1-f53.google.com with SMTP id p2-v6so5955862wmc.2 for ; Mon, 19 Nov 2018 09:00:22 -0800 (PST) X-Gm-Message-State: AGRZ1gJDAvn61o991cY+hbrztujHLyQpKDhvWQCKOMtPZV13XR3lU9M8 9LVC0HKcng+Tma58Wn6EQo1flAwBxe07A21/bQoBhQ== X-Received: by 2002:a1c:f112:: with SMTP id p18mr7384002wmh.83.1542646821041; Mon, 19 Nov 2018 09:00:21 -0800 (PST) MIME-Version: 1.0 References: <20181118071548.GA4795@linux.intel.com> <20181119160204.GD13298@linux.intel.com> In-Reply-To: <20181119160204.GD13298@linux.intel.com> From: Andy Lutomirski Date: Mon, 19 Nov 2018 09:00:08 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: RFC: userspace exception fixups To: Jarkko Sakkinen Cc: Andrew Lutomirski , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 19, 2018 at 8:02 AM Jarkko Sakkinen wrote: > > 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. Sure, but how does the kernel know when to do that and when to send a signal? I don't really like decoding the instruction stream to figure it out.