Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp887636imu; Thu, 20 Dec 2018 06:57:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ub+abeRd9JZEP+ePy4iQiZ3Q7vJooBJ2ghXkng5tP2X9twBRBeHH6Kctojgk3DsYacr3ae X-Received: by 2002:a63:8043:: with SMTP id j64mr10702810pgd.405.1545317831761; Thu, 20 Dec 2018 06:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545317831; cv=none; d=google.com; s=arc-20160816; b=XTZbj3Xfs27fjYRI15w3jXfZSos54XP9yADex16tEaVs8AxXQWNN3TKjGkTryHNNgt oP7BG/4zBcb7pRDFpBVWfuqmKuhgTxjIl54duR+k8Tdq1pzU2tF6Xdbz6JbFUE3NinYa LeeA7UIiBMWoOGAdUU9/QiQdeXnwOseVe25dTRVwhym/ky+2vzlTq/uAnA0pdmMEVr60 WU23tW0k0a6RFDeG8jBNXIuRDW1vOXeo7XBfJQXysvdxkpbeY2y30cKYiexzxY5vA/ci rU94z6t+jaNuVsqaS827x+yh4BkRCvN9BdK4oiFeHcEeMEOp8q+W9X2A6Ad/5WoaFsqE zw9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fl66lb4WI1iC2/Qxs48cgh1w0GnQ59Pwy1zuTm+r3uc=; b=vQog65B5QF8ax0tfsc4qbj9C6In3tlStMVLfCm7/pxOBmuiYcJ4Osv8oWEdfitKAYt m2uSwq+ENier7G0xBLenntxt/fKy0Z5dlLB36KarQdAWLibL4w6YX2vBOjSFv2YaBSvu 601u/Fd1g8+8defEMmy2DXpP3hMUo/Gd2oTuwLaUb/fXHhVNs8txH3FppAsB6qUAP7fr stcOoLOolH5rcetp8hSrccamaF8Wqbb1nPBJ9UuU8Hd+8orXGzwgUYu++jMHw5cBMh9K ijGkcQ0dYnPxZnyZD0rXfNfK7aWtpqsd7FeUVJ+yQekkDdrwhrhsdqEfL1WTUySNRFUR oZ0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id q32si18267331pgm.410.2018.12.20.06.56.55; Thu, 20 Dec 2018 06:57:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728961AbeLTKa1 (ORCPT + 99 others); Thu, 20 Dec 2018 05:30:27 -0500 Received: from mga06.intel.com ([134.134.136.31]:17464 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbeLTKa0 (ORCPT ); Thu, 20 Dec 2018 05:30:26 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2018 02:30:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,376,1539673200"; d="scan'208";a="127616368" Received: from quwen-mobl.ccr.corp.intel.com (HELO localhost) ([10.249.254.215]) by fmsmga002.fm.intel.com with ESMTP; 20 Dec 2018 02:30:19 -0800 Date: Thu, 20 Dec 2018 12:30:17 +0200 From: Jarkko Sakkinen To: Sean Christopherson Cc: Jethro Beekman , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "x86@kernel.org" , Dave Hansen , Peter Zijlstra , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , "linux-sgx@vger.kernel.org" , Andy Lutomirski , Josh Triplett , Haitao Huang , "Dr . Greg Wettstein" Subject: Re: x86/sgx: uapi change proposal Message-ID: <20181220103017.GA26410@linux.intel.com> References: <20181214215729.4221-1-sean.j.christopherson@intel.com> <7706b2aa71312e1f0009958bcab24e1e9d8d1237.camel@linux.intel.com> <598cd050-f0b5-d18c-96a0-915f02525e3e@fortanix.com> <20181219091148.GA5121@linux.intel.com> <613c6814-4e71-38e5-444a-545f0e286df8@fortanix.com> <20181219144515.GA30909@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181219144515.GA30909@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 19, 2018 at 06:45:15AM -0800, Sean Christopherson wrote: > I agree with Jethro, passing the enclave_fd as a param is obnoxious. > And it means the user needs to open /dev/sgx to do anything with an > enclave fd, e.g. the enclave fd might be passed to a builder thread, Please note that this is not really a thing that I care that much in the end of the day because either approach is straight forward to implement. That is why asked from Jethro, which is more superfluous. > Take a look at virt/kvm/kvm_main.c to see how KVM manages anon inodes > and ioctls for VMs and vCPUs. I actually grabbed anon inode code from in-kernel LE code and started to transform it to this framework just because I was familiar with that snippet (because I wrote it) but yeah the idea is similar as in there. /Jarkko