From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH v2 3/3] tpm: parse TPM event logs based on EFI table Date: Mon, 11 Sep 2017 10:47:50 -0600 Message-ID: <20170911164750.GA2607@obsidianresearch.com> References: <20170911100022.7251-1-tweek@google.com> <20170911100022.7251-4-tweek@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20170911100022.7251-4-tweek-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Thiebaud Weksteen Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, mjg59-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, peterhuewe-Mmb7MZpHnFY@public.gmane.org, jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, tpmdd-yWjUBOtONefk1uMJSBkQmQ@public.gmane.org List-Id: linux-efi@vger.kernel.org On Mon, Sep 11, 2017 at 12:00:22PM +0200, Thiebaud Weksteen wrote: > chip->bin_log_seqops.chip = chip; > - if (chip->flags & TPM_CHIP_FLAG_TPM2) > + > + if (log_version == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 || > + (!log_version && (chip->flags & TPM_CHIP_FLAG_TPM2))) > chip->bin_log_seqops.seqops = > &tpm2_binary_b_measurements_seqops; Lets have all the read_log_* versions return the postitive log_version and get rid of the chip->flags check here. ie Doesn't ACPI always return the TPM 1 version? Jason From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752206AbdIKQsC (ORCPT ); Mon, 11 Sep 2017 12:48:02 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:39362 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752106AbdIKQsA (ORCPT ); Mon, 11 Sep 2017 12:48:00 -0400 Date: Mon, 11 Sep 2017 10:47:50 -0600 From: Jason Gunthorpe To: Thiebaud Weksteen Cc: linux-efi@vger.kernel.org, ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk, linux-kernel@vger.kernel.org, mjg59@google.com, tpmdd-devel@lists.sourceforge.net, peterhuewe@gmx.de, jarkko.sakkinen@linux.intel.com, tpmdd@selhorst.net Subject: Re: [PATCH v2 3/3] tpm: parse TPM event logs based on EFI table Message-ID: <20170911164750.GA2607@obsidianresearch.com> References: <20170911100022.7251-1-tweek@google.com> <20170911100022.7251-4-tweek@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170911100022.7251-4-tweek@google.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 11, 2017 at 12:00:22PM +0200, Thiebaud Weksteen wrote: > chip->bin_log_seqops.chip = chip; > - if (chip->flags & TPM_CHIP_FLAG_TPM2) > + > + if (log_version == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 || > + (!log_version && (chip->flags & TPM_CHIP_FLAG_TPM2))) > chip->bin_log_seqops.seqops = > &tpm2_binary_b_measurements_seqops; Lets have all the read_log_* versions return the postitive log_version and get rid of the chip->flags check here. ie Doesn't ACPI always return the TPM 1 version? Jason