Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp535939pxu; Wed, 7 Oct 2020 09:18:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7WC+3Ig0HIQR8fXC2XROOtAnKJBKcnuN3Qlt4AXlqlPOmsFifsS7RilCV+QTtznIXoJZL X-Received: by 2002:a50:cd48:: with SMTP id d8mr4318146edj.286.1602087524565; Wed, 07 Oct 2020 09:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602087524; cv=none; d=google.com; s=arc-20160816; b=SiSpsNoNMlAwuABMUgdryec2cLXetnuCf06z3xR7bmwXA8n+7Z+acpQ33bN2odQeas YwAWxJUumSC3xPxs9OAw80zhl2RR9FeGKDxycSsAw9uqg17fiE9reZUyahZjfv02sK+A AQXP5aOEHjWGQBifwXmppXv13oxKXVRHwis9SDNhE+wm4OclCejtieJ/DWyj1q9cfAdM 3eq0gNJP93ShW9ZFBzhUqCW6GwLUgIiiMp2znptF0ILXR8UqygRYX8VAoZmEEnJxT6kS zCZhB9tiYJS/2k4n5s08jQwofFhq3DqQP9GTVMxylswO6BReiXGZ3ch5BEobvPEgwAva Yr1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=37TpM+Z3VEBKSYJK+Yp4CiV62sftvXvXIfOw1ECoYEk=; b=b2DBU3Cu3omyHn/fuTjvuSB7kn7bV9qUtwXYyAkX8wAKsYWew8x/AP0YHT9Quof4cu n4VL0FyY50gt3G5QATjdfOU1CUC720eNzPiRAQNwrpzPFJP1yj/hmOYXMLgvM6xyHy4A bIvri7trlTUl9/KP9GWxd4glnTfc2uZrSf35dAkAD51WM56K6/uPW5tOSMJw/+yxYctD XntUuQdhvhLV2FVJgQimAMYrZaGeKZk6ECfXgD4Xkys9k7vmRN/sL4Q/PpcDtvgDYgq5 30fyM+dxmlAdoI0UC9O4dcT7VBTvUAWae3/w52/dchmmeOoiIjPKoQytB+CoiHSBoXkD suLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g24si1672347edq.128.2020.10.07.09.18.21; Wed, 07 Oct 2020 09:18:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727750AbgJGPZr (ORCPT + 99 others); Wed, 7 Oct 2020 11:25:47 -0400 Received: from mga07.intel.com ([134.134.136.100]:45188 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727234AbgJGPZr (ORCPT ); Wed, 7 Oct 2020 11:25:47 -0400 IronPort-SDR: rMwHBY7oKATDN1JzivCa9Hs0A1GrCEBB4mO3Fu79jOxuRrG0AWno8T/xEVtGWkYjiXzKywLD/D LAqxNFNEKd9w== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="229119015" X-IronPort-AV: E=Sophos;i="5.77,347,1596524400"; d="scan'208";a="229119015" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 08:25:47 -0700 IronPort-SDR: U4G+8Dz0hbvSbJVN8+ZhvcSjwV1AiKrUz+F1fgEeh39SpeJn00LMXVbBt6ZGfTOfBR6j9JNM7K idBaX88YrJ/g== X-IronPort-AV: E=Sophos;i="5.77,347,1596524400"; d="scan'208";a="528006094" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.160]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 08:25:46 -0700 Date: Wed, 7 Oct 2020 08:25:45 -0700 From: Sean Christopherson To: Jarkko Sakkinen Cc: Jethro Beekman , x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Cedric Xing , akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, asapek@google.com, bp@alien8.de, chenalexchen@google.com, conradparker@google.com, cyhanish@google.com, dave.hansen@intel.com, haitao.huang@intel.com, kai.huang@intel.com, kai.svahn@intel.com, kmoy@google.com, ludloff@google.com, luto@kernel.org, nhorman@redhat.com, npmccallum@redhat.com, puiterwijk@redhat.com, rientjes@google.com, tglx@linutronix.de, yaozhangx@google.com, mikko.ylinen@intel.com Subject: Re: [PATCH v39 21/24] x86/vdso: Implement a vDSO for Intel SGX enclave call Message-ID: <20201007152545.GB758@linux.intel.com> References: <20201006025703.GG15803@linux.intel.com> <453c2d9b-0fd0-0d63-2bb9-096f255a6ff4@fortanix.com> <20201006151532.GA17610@linux.intel.com> <20201006172819.GA114208@linux.intel.com> <20201006232129.GB28981@linux.intel.com> <20201007002236.GA139112@linux.intel.com> <20201007011738.GE28981@linux.intel.com> <20201007031402.GA143690@linux.intel.com> <20201007043418.GG28981@linux.intel.com> <20201007073923.GA3632@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007073923.GA3632@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 10:39:23AM +0300, Jarkko Sakkinen wrote: > On Tue, Oct 06, 2020 at 09:34:19PM -0700, Sean Christopherson wrote: > > > Even if that was in place, you'd need to separate normal and interrupt. > > > Tristate is useless here. > > > > Huh? You mean like adding SGX_INTERRUPT_EXIT and SGX_EXCEPTION_EXIT? > > OK, so I'll throw something. > > 1. "normal" is either exception from either EENTER or ERESUME, > or just EEXIT. > 2. "interrupt" is something where you want to tailor AEP path. Manipulating the behavior of the vDSO, as in #2, would be done via an input flag. It may be related to the exit reason, e.g. the flag may also opt-in to a new exit reason, but that has no bearing on whether or not a dedicated exit reason is valuable. > > I'm not arguing that any of the above is even remotely likely. I just don't > > understand why we'd want an API that at best requires heuristics in userspace > > to determine why the enclave stopped running, and at worst will saddle us with > > an ugly mess in the future. All to save 4 bytes that no one cares about (they > > literally cost nothing), and a single MOV in a flow that is hundreds, if not > > thousands, of cycles. > > I don't care as much as saving bytes as defining API, which has zero > ambiguous state variables. How is exit_reason ambiguous?