Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp619025pxu; Wed, 7 Oct 2020 11:15:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbylnFKUhjNpRhQOPvCia2Jn+XmNHPNjm+f4Ifj99lDL2EiFI63s47PGBsbkYsiJ7ur6Xh X-Received: by 2002:a17:906:2752:: with SMTP id a18mr4553604ejd.350.1602094549509; Wed, 07 Oct 2020 11:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602094549; cv=none; d=google.com; s=arc-20160816; b=ckbGGLrJmH83EH9qv5tX3TMTe2q79P9zmabO1skN4ikAltWZWGgo6thlxH6Fias+rn 7OTSuqkl40plKqpmAnH739nNmK3dT2BWrtAxfQQU95X7ZzIpQfOvMrfWTrisCqXk1Cne j8CS5lcpncYm5jPyW8Sg+gCdLT1KXWga0lH2rIOGKAK9JxBNFeqqop1VCr3r2hf9Ap7F r/QgWlvKyNQNU6Irves2TJGOkewAinggMHe8IbhWOfuCYmqqOY9g0WmyyN/RKOPM9FSX 2R3iKDt77lMFo4d7R1Y8ok9ln8ll/pBq7sZEhnedcslCdPqMvq5SFXaiJe3lPDmjZWNB oPRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=ROXbnUUAk9Lahgh5M9IqGbtl9Lo1RikodKRT+6kVqmk=; b=vo1z2U0qrCLMjN8ubWT6KvFzNR7qImnJAm8u8fpuHyNtOQsnbRv9h09xEifgKvV73P dBwc57bsmS7gDZbZeuD1d8EXLEwGEbSr95X1NSk3CR6QifRkTsMrPUoaImqjrfvZ+FCM DfFNrAF7ZyRh8mgszLkwvq5/zsjqGvRJHiuf+VRubV7CwfV2UIF7gpJouqW6XVcbwi7l 936g90J6MAxM11O41XHRZe/aSi1WqXWlF8Z6hihNvAI/OYvUtp5L+qE3iFrlMPkizv5e 504DeJyTqbR4UVbVtHCub12/ZFMTg0E0lhMq9OkjuE7ST5qsSWYz56bkhm2k/OTervOA UTeA== 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 ng3si2034861ejb.345.2020.10.07.11.15.26; Wed, 07 Oct 2020 11:15:49 -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 S1727918AbgJGRNh (ORCPT + 99 others); Wed, 7 Oct 2020 13:13:37 -0400 Received: from mga07.intel.com ([134.134.136.100]:1539 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726168AbgJGRNg (ORCPT ); Wed, 7 Oct 2020 13:13:36 -0400 IronPort-SDR: zDcwdFoQJAPj/U/Zq6r1lPvtKAHcAONP+xi5hrEcEvq1xv34m77Yr1vieXApWY38YfZSk/jdbL vMbf5iuqN15w== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="229180102" X-IronPort-AV: E=Sophos;i="5.77,347,1596524400"; d="scan'208";a="229180102" 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 10:13:36 -0700 IronPort-SDR: uq+ehLW7EhgsAAI5A6AXPSZWsdHzpY6vAGGpcTrWPJrkmq71vHLWKgGp73StACevklOxkf3S63 0t5zw16LCKxg== X-IronPort-AV: E=Sophos;i="5.77,347,1596524400"; d="scan'208";a="528059100" Received: from dumser-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.51.100]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 10:13:22 -0700 Date: Wed, 7 Oct 2020 20:13:18 +0300 From: Jarkko Sakkinen To: Sean Christopherson 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: <20201007171318.GC3885@linux.intel.com> References: <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> <20201007152545.GB758@linux.intel.com> <20201007170818.GB3885@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007170818.GB3885@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 08:08:32PM +0300, Jarkko Sakkinen wrote: > On Wed, Oct 07, 2020 at 08:25:45AM -0700, Sean Christopherson wrote: > > 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. > > The fact is that AEP path is not actual right now. > > I'm not even interested to go further on discussing about feature that > does not exist. Perhaps if/when it exist it turns out that we want a > variable lets say 'exit_reason' to present something in that context. > > I'm neither against that or for it because it is all speculative. > > > > > 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? > > I rather pick the word redundant: > > 1. 'leaf' exist anyway. > 2. It can represent all the state we need right now. > 3. It does not block anything., > > I care deeply about wasting 4 bytes in a fixed size struct for > absolutely nothing. And I do care about what to pick for the struct size. My remarks on that are lost somewhere in this thread. I absoutely do not have any interest whether 'exit_reason' in some future situation is useful or not. /Jarkko