Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp497244pxu; Wed, 7 Oct 2020 08:24:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyesJR3Y+OSSp2Y4fOOAahMY2Ib6NZbhcfy4duz3NBeUHCNfiA6o4hbr6/SD1ZFucsRw/9A X-Received: by 2002:a05:6402:8:: with SMTP id d8mr3947581edu.15.1602084265182; Wed, 07 Oct 2020 08:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602084265; cv=none; d=google.com; s=arc-20160816; b=riCizhJUfuTDYyxgONkIYbA9eEt8BOmEXlAbyL6Yd42dzNlddslOy7amYbiZ0UhFyb XAR6crl2jXIU44ra7KMgT1A90NYmuIJTUTxa+YB/r8i3epqi5qA9mx/pGv01byDvYxJ4 odJxaQrsQqe6VayKB57Qh5/w/XsKgF901mKGrRurZGU+0wJv4FJjCWK3Y/Aa+RQa68C9 uErUR66NUZyXgXR5THWGYH+N2WCgL1GK9mB5+6sjQqrBczRDx//4Kw3lumwXwtYjqO1R mHOu7FkZ51oycg8+ba5vCDwbauGSDxAwMSPfFINUUUj2rka858KMIzNN/byHzb2Ck2Ch 7b0g== 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=ELCi+h0EOaKaAO1ZwoUKDXDeDopua/lAgR8hX+wA7t0=; b=vjFgkVAT/FeMm5UfKn2yLYNWuEL3/HKuewonKySvdu3fFEY7vlBz2G0MNJJS2SCMi1 4cy4pZNiCc+vBGninNIs9HdcEgrU1PCwMNtwQuXkbyqmgOm7YAlVdKLLzJzV5bALGVfD 1fbqdAAV+//sOSSNaeRxqqBCcbd7QmkGG3CCutCML8y5OcTf5I3nYNBPurhroi+yfoO7 9Pg9kiqJJKdddPaPSjmbSkLoXFoNFHDj8p5tLW76aXMtnUma8Wvxi4L9pclQ5Rs35tvn xCl0BwII8wC6gg0zolq+ZvINJm8LZqmOwnIy05lpsIoTkHVq6MSta85cL57QdVEP5QgF WGAw== 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 cy8si1550446edb.527.2020.10.07.08.23.57; Wed, 07 Oct 2020 08:24:25 -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 S1727789AbgJGIE2 (ORCPT + 99 others); Wed, 7 Oct 2020 04:04:28 -0400 Received: from mga06.intel.com ([134.134.136.31]:62660 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbgJGIE1 (ORCPT ); Wed, 7 Oct 2020 04:04:27 -0400 IronPort-SDR: rRiuTHbTn7yIrLk46eSktQGNLzd2xX9beTdGQNda6DND3f4RnmsaeaxDre5fDbLBijqh6GWtkF 3F5ewrPA8adg== X-IronPort-AV: E=McAfee;i="6000,8403,9766"; a="226446204" X-IronPort-AV: E=Sophos;i="5.77,345,1596524400"; d="scan'208";a="226446204" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 01:04:26 -0700 IronPort-SDR: qAZrGJWZW5CwC7nZO1xy6Lb7ans0/3wAfGuHuHMDS/PXpHbM55bjBoIK+xkQi2E/UgFwJWMOMS 7fDO2489KDmQ== X-IronPort-AV: E=Sophos;i="5.77,345,1596524400"; d="scan'208";a="527837821" Received: from juliahar-mobl.ger.corp.intel.com (HELO localhost) ([10.249.32.223]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 01:04:13 -0700 Date: Wed, 7 Oct 2020 11:04:08 +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: <20201007080408.GA4610@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> 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 10:39:23AM +0300, Jarkko Sakkinen wrote: > On Tue, Oct 06, 2020 at 09:34:19PM -0700, Sean Christopherson wrote: > > Even more hypothetical would be if Andy gets one of his wishes, and EENTER2 > > comes along that doesn't allow the enclave to dictate the exit point, > > "returns" an error code on enclave failure, and allows the kernel to > > auto-restart the enclave on IRQs/NMIs. That (very hypothetical) scenario > > fits nicely into the exit_reason handling. > > > > 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. > > And since the field 'leaf' is there, and was before too, no degrees of > freedom are lost. Removing one variable does not make more of a mess. I think the reserved space should be expanded though. I'd go with that 256 bytes as it was before. It's still fast to validate and the loop construct for that is already in place. I complement that with addition to the changelog with the reasoning that I gave earlier. That was lacking for that detail in earlier patch set versions. /Jarkko