Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3169141pxa; Tue, 18 Aug 2020 08:16:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxX7u5/WnYI3Z8pSqvMvmUdRy1oUm42gyKHSeBJ/dABdr+n4EQGk1bkwzOnc5pXJRGEP0wi X-Received: by 2002:a05:6402:1cb3:: with SMTP id cz19mr19655520edb.299.1597763807481; Tue, 18 Aug 2020 08:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597763807; cv=none; d=google.com; s=arc-20160816; b=okGRWccF82Zjqr96hTh6YRolDFlrbE6AxAlZPrgJLy5zejdeqNf1OtIJvHBHHJFfxs AJSWxW+QwBiO9O4hA6aOFIL0+K3iltYArQE1N/wk31QGqjt4N/fjoOAH8/3Z2BWo7baN ElYrZgVrPMRsMyCATP5LzzdwAdR6uH0FUEjLePOxO+mgxBoNGY+J7Ib5kS00Fshx9l7Z dnM4hSH4ftZflQprZqjQY1ZyZ/tWjsmxR/ZJqr59Lbb0G5ypmrRHO7t1VeacystFO+xK Cnq5Z4oI2asM50zyk9YwwiJqM9t5hV9AAm7cLZuZ6HQnnl8i7A+gjKE0vv9jCWND84qq 71aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=Epg2mipoipSX93wbslurNHwVNpAIcHJxONau2gYLso0=; b=tG3m/JwGAsuPDURlBVRwgI7Row6gh61dCdn6/Q7tf2FOY8vtJOj8R0hs/JL5MFF89r IUlzkHVqM71VjiqqZSbfqSAjHKfli7BkprfhwX4AK1NbjA0RN/nqIytI3hgEtd7kke2E rTzyiSew5+M+Mp5jChjNvYKSPUqW1I+y0bXy7VDCINOWuHbI6nkmLUW/Uyq+DZB2hUom /gHxoBr9CgXjcBozqQaFj8cXDo6agpsSgCv3tbRxtp2kywWUp5972Z6GIKHq36NrH5Bt NHOxbUZVbbpetYyULyYkywjwVepR58dbzXFLRjIcfN206So7itPva9pTNH8bwOSVCufx NNOw== 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 e10si13835590ejk.32.2020.08.18.08.16.23; Tue, 18 Aug 2020 08:16:47 -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 S1727836AbgHRPPi (ORCPT + 99 others); Tue, 18 Aug 2020 11:15:38 -0400 Received: from mga02.intel.com ([134.134.136.20]:15056 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727798AbgHRPPc (ORCPT ); Tue, 18 Aug 2020 11:15:32 -0400 IronPort-SDR: L+KLM5mBO9MBXbeEhSZ8wMk/MGFojmdiLGNrMQE9cESn2ivslhys2JC0WpBn5KR733aNULPm9c IwmKiaL2s/Eg== X-IronPort-AV: E=McAfee;i="6000,8403,9716"; a="142751550" X-IronPort-AV: E=Sophos;i="5.76,327,1592895600"; d="scan'208";a="142751550" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2020 08:15:31 -0700 IronPort-SDR: 7uBaeP3VopyWjRQpdT30PXi+A+KSFPgMgAA8KTz87yr9M3wOPDd4MbvkETy3M7Z4GJ8DOFhNBs ATIClkKbotfg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,327,1592895600"; d="scan'208";a="296879410" Received: from ribnhajh-mobl.ger.corp.intel.com (HELO localhost) ([10.249.47.113]) by orsmga006.jf.intel.com with ESMTP; 18 Aug 2020 08:15:25 -0700 Date: Tue, 18 Aug 2020 18:15:24 +0300 From: Jarkko Sakkinen To: Andy Lutomirski Cc: Nathaniel McCallum , X86 ML , linux-sgx@vger.kernel.org, LKML , Sean Christopherson , Jethro Beekman , Cedric Xing , Andrew Morton , Andy Shevchenko , asapek@google.com, Borislav Petkov , chenalexchen@google.com, Conrad Parker , cyhanish@google.com, Dave Hansen , "Huang, Haitao" , Josh Triplett , "Huang, Kai" , "Svahn, Kai" , Keith Moyer , Christian Ludloff , Neil Horman , Patrick Uiterwijk , David Rientjes , Thomas Gleixner , yaozhangx@google.com Subject: Re: [PATCH v36 21/24] x86/vdso: Implement a vDSO for Intel SGX enclave call Message-ID: <20200818151524.GE132200@linux.intel.com> References: <20200716135303.276442-1-jarkko.sakkinen@linux.intel.com> <20200716135303.276442-22-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 10, 2020 at 04:08:46PM -0700, Andy Lutomirski wrote: > On Thu, Aug 6, 2020 at 7:55 AM Nathaniel McCallum wrote: > > > > In a past revision of this patch, I had requested a void *misc > > parameter that could be passed through vdso_sgx_enter_enclave_t into > > sgx_enclave_exit_handler_t. This request encountered some push back > > and I dropped the issue. However, I'd like to revisit it or something > > similar. > > Why do you need an exit handler at all? IIRC way back when I > suggested that we simply not support it at all. If you want to > call__vdso_sgx_enter_enclave() in a loop, call it in a loop. If you > want to wrap it intelligently in Rust, you don't want a callback > anyway -- that forces you have an FFI (or non-Rust, anyway) frame on > the stack, which interacts poorly with panic handling and prevents you > from using await in your Rust callback handler. If, on the other > hand, you just call __vdso_sg_enter_enclave() in a loop, all these > problems go away and, if you really want, you can pass in a callback > in Rust and call the callback from Rust. How would Intel SDK be able to do its stack manipulation? > What am I missing? I still don't really understand why we are > supporting this mechanism at all. Just the asm code to invoke the > callback seems to be about half of the entire function. I'm most worried maintaining all of this given all the innovative ways that users can exploit an uapi. /Jarkko