From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Subject: Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Date: Sat, 8 Oct 2016 14:01:24 +0300 Message-ID: <20161008110124.GB7351@intel.com> References: <1475349926-476-1-git-send-email-jarkko.sakkinen@linux.intel.com> <1475349926-476-3-git-send-email-jarkko.sakkinen@linux.intel.com> <20161002212801.GC25872@obsidianresearch.com> <20161003122135.GB9990@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20161003122135.GB9990-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jason Gunthorpe Cc: "moderated list:TPM DEVICE DRIVER" , open list List-Id: tpmdd-devel@lists.sourceforge.net On Mon, Oct 03, 2016 at 03:21:35PM +0300, Jarkko Sakkinen wrote: > On Sun, Oct 02, 2016 at 03:28:01PM -0600, Jason Gunthorpe wrote: > > On Sat, Oct 01, 2016 at 10:25:25PM +0300, Jarkko Sakkinen wrote: > > > > > + for (i = (TPM_NUM_EVENT_LOG_FILES - 1); i >= 0; i--) { > > > + if (chip->bios_dir[i]) > > > > The entries can't actually be null here, right? > > They can because this function is called as a rollbcak procedure for > tpm_bios_log_setup. I've tested these with Dell E6400 laptop and IvyBridge NUC both with TPM 1.2 chip by repeating this a few iterations: 1. modprobe tpm_tis 2. Outputted sysfs attributes 3. Outputted measurement files. 4. rmmod tpm_tis I think these three commits could be applied at any point and would help with the event log series (shrunk it a bit). /Jarkko ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757982AbcJHLBg (ORCPT ); Sat, 8 Oct 2016 07:01:36 -0400 Received: from mga14.intel.com ([192.55.52.115]:8438 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751443AbcJHLB3 (ORCPT ); Sat, 8 Oct 2016 07:01:29 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,460,1473145200"; d="scan'208";a="1067796603" Date: Sat, 8 Oct 2016 14:01:24 +0300 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: Peter Huewe , Nayna Jain , Marcel Selhorst , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [PATCH RESEND 2/3] tpm: replace dynamically allocated bios_dir with a static array Message-ID: <20161008110124.GB7351@intel.com> References: <1475349926-476-1-git-send-email-jarkko.sakkinen@linux.intel.com> <1475349926-476-3-git-send-email-jarkko.sakkinen@linux.intel.com> <20161002212801.GC25872@obsidianresearch.com> <20161003122135.GB9990@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161003122135.GB9990@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 03, 2016 at 03:21:35PM +0300, Jarkko Sakkinen wrote: > On Sun, Oct 02, 2016 at 03:28:01PM -0600, Jason Gunthorpe wrote: > > On Sat, Oct 01, 2016 at 10:25:25PM +0300, Jarkko Sakkinen wrote: > > > > > + for (i = (TPM_NUM_EVENT_LOG_FILES - 1); i >= 0; i--) { > > > + if (chip->bios_dir[i]) > > > > The entries can't actually be null here, right? > > They can because this function is called as a rollbcak procedure for > tpm_bios_log_setup. I've tested these with Dell E6400 laptop and IvyBridge NUC both with TPM 1.2 chip by repeating this a few iterations: 1. modprobe tpm_tis 2. Outputted sysfs attributes 3. Outputted measurement files. 4. rmmod tpm_tis I think these three commits could be applied at any point and would help with the event log series (shrunk it a bit). /Jarkko