Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp766192pxa; Wed, 19 Aug 2020 14:26:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkUaXRvNG43HkEgpHaOeY2THWnzcDTZEjMKLhdOxJ0CULDnT6ct0FGZ0dO70F5irzGJhZb X-Received: by 2002:a17:907:2126:: with SMTP id qo6mr264259ejb.536.1597872407544; Wed, 19 Aug 2020 14:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597872407; cv=none; d=google.com; s=arc-20160816; b=JFwdAeCW/SdtFXD/yVSVN83ZOkuo6vevwPzG0k+xIBFnifkauju2UFFdbeUZ5iadmP 7PYPcLB2/g9QDgtpokxb2Yu28l7jVxDmNlH+tBhWF747g30MusC6tnVWx1Cs3QLVWhMY kQG/X4H1cGrAmP4UfGApNkqtDnAwKhECtQdZNc4jykVtXUEZJ34qMYcXmi+B2sBTAPdB Wo+d3rGkSJILyGj4ccXxxpe0QSEUf1TVz5Vv2IVJ4K5dRBmSxmQDI+tFByWKF5+pYZtn uwL/V+4GKWYz8tVP1wmyDygES7YgT62h3ey/+QkdPIO8HCVqfft0oQpSYW/R7l1OeEcJ DNyw== 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=ksfBRcJ000l1tYgGWzJRoI2Bke23xmdC3Q7Ez/jx1aU=; b=NmDNAonAJ/fdgJvXThYVWTLSzxc470ctnxbOAVP1AcQmJGy5xkPFckVb9eqw1q3DCJ ctJgd/L/ObZLI9xiRbIJx6YhNQ+2PdV8B0YnKEQ5K6xrVRizt56rOcA0OAFdYwe9QgGw AIKU9AUmddQB4DQyboNwIn3n9wN9zVjcrUIJRJXzRXY0ROtJATXdN0MMUhQt6wklHO+H XPt9Q7jO4qYvarHiZPqioO9RBMcrWJ4w5+9WFGxV/7f3y/vR0ZfUFs+RTFQIVXeX3eE4 Re+8cflOhIi/K15UYz9gyEng5xLbwzZCopuya6oOhCZ3ohnncm69ACCtMdAI0lnDE8PH py/A== 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 p26si107413edq.362.2020.08.19.14.26.24; Wed, 19 Aug 2020 14:26: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 S1727830AbgHSVXX (ORCPT + 99 others); Wed, 19 Aug 2020 17:23:23 -0400 Received: from mga12.intel.com ([192.55.52.136]:30684 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbgHSVXW (ORCPT ); Wed, 19 Aug 2020 17:23:22 -0400 IronPort-SDR: nHWf+TfeVtnLZhsJUORWFQDEj1a6OBGVM6JnHdOdQc2l1epUlNCO93tlU8ndpU15P3ZSLVCgE7 BmUCgRetv4HA== X-IronPort-AV: E=McAfee;i="6000,8403,9718"; a="134719952" X-IronPort-AV: E=Sophos;i="5.76,332,1592895600"; d="scan'208";a="134719952" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2020 14:23:14 -0700 IronPort-SDR: tRb8EujjyCF0q4Yu824iRPVt9sZdfq6cyYnW7g0yXcljMbzu3dvfpJL0L5Cm6fwDUYNkV/9e0T sBw2f1edk84A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,332,1592895600"; d="scan'208";a="400947509" Received: from abojanow-mobl4.ger.corp.intel.com (HELO localhost) ([10.252.52.107]) by fmsmga001.fm.intel.com with ESMTP; 19 Aug 2020 14:23:08 -0700 Date: Thu, 20 Aug 2020 00:23:07 +0300 From: Jarkko Sakkinen To: Nathaniel McCallum Cc: Sean Christopherson , X86 ML , linux-sgx@vger.kernel.org, LKML , Andy Lutomirski , 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 , Andy Lutomirski , 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: <20200819212307.GG9942@linux.intel.com> References: <20200716135303.276442-1-jarkko.sakkinen@linux.intel.com> <20200716135303.276442-22-jarkko.sakkinen@linux.intel.com> <20200810222317.GG14724@linux.intel.com> <20200818145234.GC132200@linux.intel.com> <20200818150627.GD132200@linux.intel.com> <20200818164353.GH137138@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 Wed, Aug 19, 2020 at 09:33:45AM -0400, Nathaniel McCallum wrote: > On Tue, Aug 18, 2020 at 12:44 PM Jarkko Sakkinen > wrote: > > > > On Tue, Aug 18, 2020 at 11:15:32AM -0400, Nathaniel McCallum wrote: > > > That seems like overkill to me. I'm just asking for one additional mov > > > instruction. :) > > > > I started to consider eBPF since the complexity and constraints of the > > callback look like an overkill and without doubt will be a burden to > > maintain. > > That feels to me like more complexity just to move the existing > complexity from one place to another. My thinking was that there is like two parts on AEX handler: A. You have a set of data and some application dependent logic. Right now this part is written in assembly most of the time. B. You have code that decide how to continue based on that logic. I was thinking that you could have the logic manipulating data (the existing context structure we have can be passed directly to the BPF state machine) patchable with a BPF program. The logic would be executed in ring-0. vDSO would contain part B. It is better to at least make some rational conclusions about this because it seems to be the trend [1]. On the other hand the history with callbacks has not been a history of victory as far as it comes to all the possible issues with them. Like think about signals for example... [1] https://lwn.net/Articles/813261/ /Jarkko