Re: [tpmdd-devel] [PATCH v5 2/3] tpm: enhance read_log_of() to support Physical TPM event log

2016-11-24 Thread Jarkko Sakkinen
On Wed, Nov 23, 2016 at 12:27:36PM -0500, Nayna Jain wrote: > - memcpy(log->bios_event_log, __va(*basep), *sizep); > + if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0) > + memcpy(chip->log.bios_event_log, __va(be64_to_cpup(basep)), > +

Re: [tpmdd-devel] [PATCH v5 2/3] tpm: enhance read_log_of() to support Physical TPM event log

2016-11-23 Thread Nayna
On 11/24/2016 01:07 AM, Jason Gunthorpe wrote: > On Wed, Nov 23, 2016 at 12:27:36PM -0500, Nayna Jain wrote: >> sizep = of_get_property(np, "linux,sml-size", NULL); >> +if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0) >> +log_size = be32_to_cpup(sizep); >> +

Re: [tpmdd-devel] [PATCH v5 2/3] tpm: enhance read_log_of() to support Physical TPM event log

2016-11-23 Thread Jason Gunthorpe
On Wed, Nov 23, 2016 at 12:27:36PM -0500, Nayna Jain wrote: > sizep = of_get_property(np, "linux,sml-size", NULL); > + if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0) > + log_size = be32_to_cpup(sizep); > + else > + log_size = *sizep; > + Uh,

[tpmdd-devel] [PATCH v5 2/3] tpm: enhance read_log_of() to support Physical TPM event log

2016-11-23 Thread Nayna Jain
Physical TPMs use Open Firmware Device Tree bindings that are similar to the IBM Power virtual TPM to support event log. However, these properties store the values in different endianness for Physical and Virtual TPM. This patch fixes the endianness issue by doing appropriate conversion based on