Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp840546imu; Mon, 5 Nov 2018 09:31:42 -0800 (PST) X-Google-Smtp-Source: AJdET5flbM2z9jFBnkG7tuBamuyBQf7HSfQa1lByRjS/n3CuC+p11VbmoofZvw3lxYXNoJZFtpYh X-Received: by 2002:a17:902:4481:: with SMTP id l1-v6mr22615541pld.123.1541439101955; Mon, 05 Nov 2018 09:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541439101; cv=none; d=google.com; s=arc-20160816; b=C218dWS0Xwk5ZFH15GcQ/DgeoumkIRHwSJWpGKXlyiSSV12IWrqmoDCMyJYoB7t6xS 8dOkX8xHkcacn6mAIU3iX6Kuvep4sJKfVWyiWPmBcJQ86fomymQqXur3y94LtaIHJFpm LnoFROYj8KDdS3ENRoscqKQ1p58gucx8S4aKLN+nBGOQuvmuRaYiBtRhO/MLijEhoz/T BTn+YvpEZntvOSXfGgjfl7+m3Hdf21/DvjnxsAgwPVjKOU8wOXqoStA5pmFt7YKDO9uM kw30EEax/D35pIdFS2ND4AT3sgDrmcOcojJe7KZPKhLltjmMM6l0pRdVyFuh2rOIlOTx NCfA== 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=f6h61QFSw96dpS22azPN0mnNOcpH3l1XMHw97Gx4Pzs=; b=W51/eL6V55RlkSmjQzu7sAgXJZrnh6ItdfTzU7UmPBj3uTkk7duGgOxVkwjTA00Kqq aHA7pSb7+HWrXL3Uwg+ab4DqsBxYvIR48ONEdEQ6hceN5iyNgGs6quEO95VhehqRi/9P 1C3831UcIgV6t1GqHbCRjFTeySKDY+OZKePvAwPVgoJCPKT/BwOlKCp4vN3Yia79ubCi LwoFJ0suqJ/Qgt57KxvMH7d6UIBi6QtHm8qZjqV3c2sPLzXYEsTPKq4SPN88BaS9nEHK 0F5fZP9+mfFXDBW6KzL6s9599pKcPLV/nczk7fUvuXOK8uXZKleQAevkqlqai0QsJTI8 z0hw== 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 q8si10131466pgk.40.2018.11.05.09.31.26; Mon, 05 Nov 2018 09:31:41 -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 S1730201AbeKFCvb (ORCPT + 99 others); Mon, 5 Nov 2018 21:51:31 -0500 Received: from mga04.intel.com ([192.55.52.120]:7718 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729800AbeKFCvb (ORCPT ); Mon, 5 Nov 2018 21:51:31 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2018 09:30:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,468,1534834800"; d="scan'208";a="271542607" Received: from wenjiewa-mobl2.ccr.corp.intel.com (HELO localhost) ([10.249.254.60]) by orsmga005.jf.intel.com with ESMTP; 05 Nov 2018 09:30:39 -0800 Date: Mon, 5 Nov 2018 19:30:38 +0200 From: Jarkko Sakkinen To: Andy Shevchenko Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Platform Driver , linux-sgx@vger.kernel.org, Dave Hansen , sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, mark.shanahan@intel.com, Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , suresh.b.siddha@intel.com, Linux Kernel Mailing List Subject: Re: [PATCH v15 15/23] x86/sgx: Add wrappers for ENCLS leaf functions Message-ID: <20181105173038.GD4502@linux.intel.com> References: <20181102231320.29164-1-jarkko.sakkinen@linux.intel.com> <20181102231320.29164-16-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 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 Sat, Nov 03, 2018 at 03:17:35PM +0200, Andy Shevchenko wrote: > On Sat, Nov 3, 2018 at 1:18 AM Jarkko Sakkinen > wrote: > > > > ENCLS is an umbrella instruction for a variety of cpl0 SGX functions. > > The ENCLS function that is executed is specified in EAX, with each > > function potentially having more leaf-specific operands beyond EAX. > > ENCLS introduces its own (positive value) error codes that (some) > > leafs use to return failure information in EAX. Leafs that return > > an error code also modify RFLAGS. And finally, ENCLS generates > > ENCLS-specific non-fatal #GPs and #PFs, i.e. a bug-free kernel may > > encounter faults on ENCLS that must be handled gracefully. > > > > Because of the complexity involved in encoding ENCLS and handling its > > assortment of failure paths, executing any given leaf is not a simple > > matter of emitting ENCLS. > > > > To enable adding support for ENCLS leafs with minimal fuss, add a > > two-layer macro system along with an encoding scheme to allow wrappers > > to return trap numbers along ENCLS-specific error codes. The bottom > > layer of the macro system splits between the leafs that return an > > error code and those that do not. The second layer generates the > > correct input/output annotations based on the number of operands for > > each leaf function. > > > +/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ > > > +/** > > I dunno if kernel-doc script still complains about this. Is there a way to ask for make htmldocs to do only a subset of docs? Still kind of trying to figure out what would be a good flow for working with Sphinx. /Jarkko