Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp662963pxu; Tue, 6 Oct 2020 16:17:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyweNsdZm5herk98bLRooeOB7ZhTyo7WTNc1LBEKsQ3bPh8PizkcW9yF9d05uAuX6JkpUxA X-Received: by 2002:a17:906:a51:: with SMTP id x17mr401104ejf.137.1602026237202; Tue, 06 Oct 2020 16:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602026237; cv=none; d=google.com; s=arc-20160816; b=fW6sBpwOft0b9CR2wG2j6QQhbQtVnPAXW2QFiTuX4I9YvJujyLxl9JUAQ3mSJt4lWD peI7lP+MECuX8GDHg5wuYjKnAnNXvGwst9zCDoUSFwVUD341bIsko1X7GRr8uX+U36nl WwdkbMC8F1pWtJiHjeJ7v1Rn5zYmpT1vPqELqhwywgr/VY6V14tUAhGq4SgecuD77k+u wJh8yQ8wagupZnbqwUOmkp1fCNKciLut5qv+n2IEiozMNRciZiKMFldaIVTb06I/H49M 8gr/qoEoCmIA0q4oTmEAwOBzqrDzshjn4U0O+sxIMKN767DlbL+DCPXhzgClergsOvUZ g9HA== 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=gn2JrRbOQNlu0DZsUnr+eoCu99wRh0wbmZW/M4OJefM=; b=yeMBG0mfW5mMJR7EBpSznKwtY1frRiVrBfk2/apK5IpeBeSFFMUo3UghTetW/x5jnA 7j79Sgs2el4zlDEGws99M5Ptt8jR9fete/pjCIkebHyuxGSOSfRm+iZ+gNC9grS5ZSSH w0SQ3H09Uqhhu+Lz0AQVE/V0fXtsPn1MTePHv0sXRxMkPL1USSYZ/mvsWddxKJ14VciK 367FxX4gW9mMq6xt+QkKRCahhJU5NFgey+zVM9jre5PJzoDl22VnD18jVaUxHfuCVZl4 wasf1tOlEnPacZyRPRRTHnParRbytI0PmbQHTkdorrKSI1Oo42IlyvX7IMZIpFev+Scw Z/wQ== 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 m1si50598edv.507.2020.10.06.16.16.47; Tue, 06 Oct 2020 16:17:17 -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 S1727257AbgJFVjm (ORCPT + 99 others); Tue, 6 Oct 2020 17:39:42 -0400 Received: from mga05.intel.com ([192.55.52.43]:34353 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbgJFVjm (ORCPT ); Tue, 6 Oct 2020 17:39:42 -0400 IronPort-SDR: 9XGqDjiqtrUYV0KlU8DWkVAEVJftzxGa0kKjO44Bi2//ljugVD6ra7UKMfPqYwz4f1OuC/zaTK HjsX4ahYA5ng== X-IronPort-AV: E=McAfee;i="6000,8403,9766"; a="249417694" X-IronPort-AV: E=Sophos;i="5.77,343,1596524400"; d="scan'208";a="249417694" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2020 14:39:42 -0700 IronPort-SDR: xwAgZuFlMjuMIPVTGKSiVBZcuPmai61VqTFeIzNfv7GhMjKrM6kvpW5vO3nPTAS5Olg7duMjw0 0/uopQuHPqsw== X-IronPort-AV: E=Sophos;i="5.77,343,1596524400"; d="scan'208";a="527608885" Received: from thijsmet-mobl.ger.corp.intel.com (HELO localhost) ([10.249.34.36]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2020 14:39:35 -0700 Date: Wed, 7 Oct 2020 00:39:27 +0300 From: Jarkko Sakkinen To: Sean Christopherson Cc: x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Jethro Beekman , 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: <20201006213927.GA117517@linux.intel.com> References: <20201003045059.665934-1-jarkko.sakkinen@linux.intel.com> <20201003045059.665934-22-jarkko.sakkinen@linux.intel.com> <20201006025703.GG15803@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201006025703.GG15803@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 Mon, Oct 05, 2020 at 07:57:05PM -0700, Sean Christopherson wrote: > On Sat, Oct 03, 2020 at 07:50:56AM +0300, Jarkko Sakkinen wrote: > > + __u16 exception_vector; > > + __u16 exception_error_code; > > + __u64 exception_addr; > > + __u8 reserved[24]; > > I also think it's a waste of space to bother with multiple reserved fields. > 24 bytes isn't so much that it guarantees we'll never run into problems in > the future. But I care far less about this than I do about exit_reason. For me the real problem is that there has not been "no brainer" basis for any size, so a one cache line worth of data is just something that makes sense, because would neither make much sense to have less. I'll throw an argument to have it a bit bigger amount of reserved space for future use. First, there is always some amount of unknown unknowns when it comes to run-time structures, given the evolution of microarchitectures. So yes, some more "state" might be needed in the future. Secondly, this is a bigger problem for the vDSO than it is for ioctl's because we can have only one. With ioctl's, in the absolute worst case, we can have a second version of the same ioctl. At least 256 bytes would be probably a good number, if we want to increase it. The reserved space zero validation that I implemented to this version probably does not add much to the overhead anyway. I'm not sure why care about one struct field more than making sure that the run-time structure can stand time. /Jarkko