Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753379AbbEHXKn (ORCPT ); Fri, 8 May 2015 19:10:43 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:36896 "EHLO e28smtp09.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbbEHXKi (ORCPT ); Fri, 8 May 2015 19:10:38 -0400 Subject: Re: [PATCH 3/3] vTPM: support little endian guests From: "Hon Ching (Vicky) Lo" To: Ashley Lai Cc: tpmdd-devel@lists.sourceforge.net, Peter Huewe , Mimi Zohar , Vicky Lo , linux-kernel@vger.kernel.org, Joy Latten In-Reply-To: References: <1430873486-25868-1-git-send-email-honclo@linux.vnet.ibm.com> <1430873486-25868-4-git-send-email-honclo@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 08 May 2015 19:10:24 -0400 Message-ID: <1431126624.25419.11.camel@vtpm2014.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-34.el6) Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15050823-0033-0000-0000-0000059E2490 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1621 Lines: 44 Thanks Ashley! > > The event log in ppc64 arch is always in big endian format. PowerPC > > supports both little endian and big endian guests. This patch converts > > the event log entries to guest format. > > I'm a little confused here. If this patch is to convert the event log > entries why are we convert in the conditional statements? One example > below: > > + if (((convert_to_host_format(event->event_type) == 0) && > + (convert_to_host_format(event->event_size) == 0)) > + || > + ((v + sizeof(struct tcpa_event) + > + convert_to_host_format(event->event_size)) > limit)) > > > > > We defined a macro to convert to guest format. In addition, > > tpm_binary_bios_measurements_show() is modified to parse the event > > and print each field individually. > We do not convert the whole event entry. Instead, we're converting only what's necessary such as pcr_index, event_type and event_size. pcr_value and event_data are of type u8. They do not need LE conversion. > It's nice to have human readable format but it may break existing tools > that parse or understand the machine readable format. Any comments on > this anyone? I got comments on the format, so I tried to make that conditional statement all in one line, but the 'Lindent' tool puts the lines back to the above format.. Regards, Vicky -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/