Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5194285imm; Tue, 19 Jun 2018 06:40:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJiyXt4dAt516Z+smZCYNZ9ALK8671noPYnv4J4Kb2pnYb2ffSgfvTtZzUgvo2AN+6nfEpz X-Received: by 2002:a17:902:6b45:: with SMTP id g5-v6mr19044135plt.67.1529415605425; Tue, 19 Jun 2018 06:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529415605; cv=none; d=google.com; s=arc-20160816; b=Pi+Pwb5QrZVRVLeqJOFqZ1A/DAo+hUcse6nA71vPFxDysj6uZHPEjW4c6VSsVeeN22 H2BFYVtp7UrthxBvsX05T7O7QtJd8M+NHBaGj8kNQqEFjlDS9IMxv47OKWLJHbHz0an5 qyI0ppWJ7oXvEXI4+WM0F4tDwyfbWIsSanXz7Ict3ujFBL6hUOoBnIT/lk1/iiBw6UxR zdAZ4/wTP4bV2qxKhaeUz+3WCEJeZurnxWsZt2GvPA063/8Huw9JEGcAkOWbz/lDFO20 24bZhhCx6hbH/jTwv4C1MMTLgK/2N0iihoCATxdrM+5F1vIu6qDKpKemYMvA8TAi1VEo NRwg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=gE09kIPzaJTJ6muRjdMxEdLAO4P4H6klfeqLdF0p0M0=; b=LW7+n4RAP0VmDGAH0Cf+SJDG8c7cAXDBw4zngZBt5+R00i4y8Pnv33lgl9IlFEUjWZ Oj/S95s4TWNZQaTEbs9PROQB89DBP1kPS169DV5Zt0jrURbt+WkJcRFavIW1wueTZOUo LQcSMSZCSroN0/pcaxFkvX6zI018SfkuQeHMQou19dXJZMqVW0EF5TuwO70AwsEx7EIT XzD/VMiK02UeOvCvzT6vkt5q+NhLsAmGUn+jJjqM3aY4fXDRm0H+AIuSaOMB7vne6MDj wEJbgOCnzWv213iBgATXzuGjm3b7Khuxbw30cf9sPgzh8Bas5xrS7Jdo7kp4boQR7d7d sE2w== 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 u191-v6si14091777pgd.667.2018.06.19.06.39.51; Tue, 19 Jun 2018 06:40:05 -0700 (PDT) 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 S965698AbeFSNiq (ORCPT + 99 others); Tue, 19 Jun 2018 09:38:46 -0400 Received: from mga06.intel.com ([134.134.136.31]:44155 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937544AbeFSNio (ORCPT ); Tue, 19 Jun 2018 09:38:44 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2018 06:38:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,243,1526367600"; d="scan'208";a="48238732" Received: from aluisell-mobl2.ger.corp.intel.com (HELO localhost) ([10.249.254.128]) by fmsmga007.fm.intel.com with ESMTP; 19 Jun 2018 06:38:38 -0700 Date: Tue, 19 Jun 2018 16:38:37 +0300 From: Jarkko Sakkinen To: Sean Christopherson Cc: Dave Hansen , x86@kernel.org, platform-driver-x86@vger.kernel.org, nhorman@redhat.com, npmccallum@redhat.com, Darren Hart , Andy Shevchenko , "open list:INTEL SGX" , open list Subject: Re: [PATCH v11 11/13] intel_sgx: ptrace() support Message-ID: <20180619133837.GK5609@linux.intel.com> References: <20180608171216.26521-1-jarkko.sakkinen@linux.intel.com> <20180608171216.26521-12-jarkko.sakkinen@linux.intel.com> <91e35b3e-b42d-b3d5-752c-031973e69273@intel.com> <1528729329.9779.28.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1528729329.9779.28.camel@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 11, 2018 at 08:02:09AM -0700, Sean Christopherson wrote: > On Fri, 2018-06-08 at 11:34 -0700, Dave Hansen wrote: > > On 06/08/2018 10:09 AM, Jarkko Sakkinen wrote: > > > > > > + ret = sgx_edbgrd(encl, entry, align, data); > > > + if (ret) > > > + break; > > > + if (write) { > > > + memcpy(data + offset, buf + i, cnt); > > > + ret = sgx_edbgwr(encl, entry, align, data); > > > + if (ret) > > > + break; > > > + } > > > + else > > > + memcpy(buf + i,data + offset, cnt); > > > + } > > The SGX instructions like "edbgrd" be great to put on a license plat, > > but we can do better in the kernel.??Can you give these reasonable > > english names, please???sgx_debug_write(), maybe? > > IMO the function names for ENCLS leafs are appropriate. ?The real > issue is the lack of documentation of the ENCLS helpers and their > naming conventions. > > The sgx_ functions, e.g. sgx_edbgrd(), are essentially?direct > invocations of the specific leaf, i.e. they are dumb wrappers to > the lower level leaf functions, e.g. __edbgrd(). ?The wrappers exist > primarily to deal with the boilerplate necessary to access a page in > the EPC. ?sgx_ conveys that the function contains the preamble > and/or postamble needed to execute its leaf, but otherwise does not > contain any logic. > > Functions with actual logic do have English names, e.g. > sgx_encl_init(), sgx_encl_add_page(),?sgx_encl_modify_pages() etc... I agree with Sean on the naming and agree with Dave on his comments in earlier patch in the series needs a better documentation. /Jarkko