Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965034AbcKQRmu (ORCPT ); Thu, 17 Nov 2016 12:42:50 -0500 Received: from mga06.intel.com ([134.134.136.31]:55449 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941731AbcKQRmm (ORCPT ); Thu, 17 Nov 2016 12:42:42 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,506,1473145200"; d="scan'208";a="1060763443" Date: Thu, 17 Nov 2016 09:42:41 -0800 From: Jarkko Sakkinen To: Nayna Cc: Peter Huewe , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [tpmdd-devel] [PATCH RFC 2/2] tpm: refactor tpm2_get_tpm_pt to tpm2_getcap_cmd Message-ID: <20161117174241.wvyd7g5lj4ibfnry@intel.com> References: <1476008057-2395-1-git-send-email-jarkko.sakkinen@linux.intel.com> <1476008057-2395-3-git-send-email-jarkko.sakkinen@linux.intel.com> <58254759.80406@linux.vnet.ibm.com> <20161112000242.63hgv5ujmkr7hy6a@intel.com> <582D998C.40605@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <582D998C.40605@linux.vnet.ibm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 860 Lines: 21 On Thu, Nov 17, 2016 at 05:20:36PM +0530, Nayna wrote: > I tested this for capability TPM2_CAP_PCRS. It seems TPM2_CAP_PCRS > capability always returns full PCR allocation, and more_data as 0, So, I > think the idea of looping over based on more_data may not work for this > capability. You can always request one value at a time until there's no more. If you request N values, depending on the hardware, the hardware returns to you anything from 1 to N values. If you implement a function that requests N values in the command, you *must* handle the case where moreData is 1 even if the hardware you are testing that never happens. That's the reason why I would start with a function that you request one property of one capability and optimize it in future if it doesn't scale for some workload. Do you have a workload where it doesn't scale? /Jarkko