Received: by 10.223.164.202 with SMTP id h10csp116243wrb; Wed, 29 Nov 2017 18:15:07 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ13+aNEw2aITeRaHtE2rvlczF9H8vriXbb8XfDNsUb4I+9qN5ZE0XHM1tBqv/h6vkefjfq X-Received: by 10.98.103.156 with SMTP id t28mr4951896pfj.234.1512008107577; Wed, 29 Nov 2017 18:15:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512008107; cv=none; d=google.com; s=arc-20160816; b=awrnHkuP3Ib4z2+BRalcMjwPbP3n48GJnVIQgbwVqNbwrhb1Czi97886jjO6I9pXP2 iZ32r6JsHwdXWFryjnX3z4ZG1AeAl58X5gipY4ZDRF6QVOdkX2lpU8pG5gLs9/LsZCHe PbpFUyhyiQQBHUuyWQSDZWc3gwrd1EdkgL/AQqYjbyUKM4ff3PUofXuquJh1IV3vw8JS MJpvyOc+vZheWNY9f/zQC3GdI2Mohlt8xLMYEiZyVST368VaasB5cM1AjGWXGrcpnkAY 9/jVSpadAeiJ8x57mmlKq5JMeDWQYQ7N20VFZ9k9ZN2Sa8o6IxrFjazUTQTbIDMClaH7 aFcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=0IjkRb6rHrP5pNDyEXNSqWRQkhkDY75U4GJXSW/V9s8=; b=ux6nZV5DMN7yDdiqlItBSoPeQghhpUEC/C+su+sBnJfM506eISttx9NmDghmf5WFkD KicCHa0QH1AdM8CM4BQ20zlLZbkLCdjyufmblysFRb9x5GIuxJgQllIoeXZCXlE2w4xi akG3UTrMFc6cCo0k+lWK1uWpvEJbAlHM8seM26HUiPyBpOyR4lwUJNewpj1os5mzQoGs pCYmpvg3SoAr0ctXZ6voPhf+zeOg74rCJpZZflkZPbBzZ4FZdfoS4RGeVMSP9799gUMV B/7pBJuyPT4MbvWJgFkH3WDs0EFG6AfyaMmOk0jtGZ19ot/Q6TsGB0J3I97NQJPK8UAP +Gng== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si2207899plb.216.2017.11.29.18.14.53; Wed, 29 Nov 2017 18:15:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752913AbdK3COE (ORCPT + 99 others); Wed, 29 Nov 2017 21:14:04 -0500 Received: from smtp.twobit.us ([38.83.192.235]:53721 "EHLO smtp.twobit.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752449AbdK3COD (ORCPT ); Wed, 29 Nov 2017 21:14:03 -0500 Received: from [76.243.124.130] (helo=[192.168.73.121]) by smtp.twobit.us with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eKE9K-0003uz-QG; Thu, 30 Nov 2017 02:00:27 +0000 To: Javier Martinez Canillas , Jarkko Sakkinen Cc: linux-kernel@vger.kernel.org, Peter Huewe , Jerry Snitselaar , Jason Gunthorpe , Philip Tricca , linux-integrity@vger.kernel.org, William Roberts , James Bottomley References: <20171129110846.31892-1-javierm@redhat.com> <20171129175738.pim7is5zc3wmult6@linux.intel.com> From: Philip Tricca Message-ID: <32786a39-931d-e7bc-c752-c580eb3c66b2@twobit.us> Date: Wed, 29 Nov 2017 18:13:51 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 76.243.124.130 X-SA-Exim-Mail-From: flihp@twobit.us X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on smtp.twobit.us X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Subject: Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on smtp.twobit.us) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/29/2017 10:24 AM, Javier Martinez Canillas wrote: > Hello Jarkko, > > On 11/29/2017 06:57 PM, Jarkko Sakkinen wrote: >> On Wed, Nov 29, 2017 at 12:08:46PM +0100, Javier Martinez Canillas >> wrote: >>> +#define TPM2_RC_LAYER_SHIFT 16 +#define TPM2_RESMGRTPM_RC_LAYER >>> (11 << TPM2_RC_LAYER_SHIFT) >> >> I got this spec from Philip [1]. >> >> Couple of remarks: >> >> * What is the difference between TSS2_RESMGR_RC_LAYER and >> TSS2_RESMGR_TPM_RC_LAYER? > > The difference is the type of error returned in each case. TSS2_RESMGR_RC_LAYER > means that's an error internal to the TAB/RM and so the response code is one of > the TSS2_BASE_RC_* error values. > > But TSS2_RESMGR_TPM_RC_LAYER means that the resource manager is taking over some > TPM functionality (i.e: validation) and so the response code is a TSS2_RC_* error > value, liket is the case for this patch (TPM_RC_COMMAND_CODE). This distinction predates my participation in the spec. Personally I don't think users will really care so long as it's evident which 'layer' produced the error. Using the TSS2_RESMGR_TPM_RC_LAYER is the right thing to do though according to the spec. >> * Should the driver code use TSS2 or TPM2 prefix? >> > > That's a very good question. I used TPM2 as prefix instead of TSS2 to keep it > consistent with the rest of the driver, but probably TSS2 should be used instead > so people can search more easy the constant in the specification doc. +1 Philip >> [1] >> https://trustedcomputinggroup.org/wp-content/uploads/TCG-TSS-2.0-Overview-and-Common-Structures-Specification-Version-0.90-Revision-02.pdf >> >> /Jarkko >> > > Best regards, > From 1585453715788467123@xxx Thu Nov 30 01:48:08 +0000 2017 X-GM-THRID: 1585398450336580513 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread