From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752275AbdK2SZ0 (ORCPT ); Wed, 29 Nov 2017 13:25:26 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37752 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751645AbdK2SYv (ORCPT ); Wed, 29 Nov 2017 13:24:51 -0500 X-Google-Smtp-Source: AGs4zMYby5K4gcAJ6Iq7vrXTTjAA3BePR+iujarOv3VWllBxQ8oSr7YXKR6qf+vz3lyQxIUYowjpyQ== Subject: Re: [PATCH v2] tpm: return a TPM_RC_COMMAND_CODE response if a command isn't implemented To: 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: Javier Martinez Canillas Message-ID: Date: Wed, 29 Nov 2017 19:24:48 +0100 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: <20171129175738.pim7is5zc3wmult6@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). > * 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] > https://trustedcomputinggroup.org/wp-content/uploads/TCG-TSS-2.0-Overview-and-Common-Structures-Specification-Version-0.90-Revision-02.pdf > > /Jarkko > Best regards, -- Javier Martinez Canillas Software Engineer - Desktop Hardware Enablement Red Hat