diff options
author | jmlatten@linux.vnet.ibm.com <jmlatten@linux.vnet.ibm.com> | 2015-02-20 18:11:24 -0600 |
---|---|---|
committer | Peter Huewe <peterhuewe@gmx.de> | 2015-03-06 22:35:48 +0100 |
commit | 62dfd912ab3b5405b6fe72d0135c37e9648071f1 (patch) | |
tree | 4af818acdcd1d88d8d1632bf7a6369d391ef4881 /drivers/char/tpm/tpm_ibmvtpm.h | |
parent | 5f237425f352487a2e3fdef2f0557eedcd97d898 (diff) | |
download | talos-obmc-linux-62dfd912ab3b5405b6fe72d0135c37e9648071f1.tar.gz talos-obmc-linux-62dfd912ab3b5405b6fe72d0135c37e9648071f1.zip |
tpm/ibmvtpm: Additional LE support for tpm_ibmvtpm_send
Problem: When IMA and VTPM are both enabled in kernel config,
kernel hangs during bootup on LE OS.
Why?: IMA calls tpm_pcr_read() which results in tpm_ibmvtpm_send
and tpm_ibmtpm_recv getting called. A trace showed that
tpm_ibmtpm_recv was hanging.
Resolution: tpm_ibmtpm_recv was hanging because tpm_ibmvtpm_send
was sending CRQ message that probably did not make much sense
to phype because of Endianness. The fix below sends correctly
converted CRQ for LE. This was not caught before because it
seems IMA is not enabled by default in kernel config and
IMA exercises this particular code path in vtpm.
Tested with IMA and VTPM enabled in kernel config and VTPM
enabled on both a BE OS and a LE OS ppc64 lpar. This exercised
CRQ and TPM command code paths in vtpm.
Patch is against Peter's tpmdd tree on github which included
Vicky's previous vtpm le patches.
Signed-off-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> # eb71f8a5e33f: "Added Little Endian support to vtpm module"
Cc: <stable@vger.kernel.org>
Reviewed-by: Ashley Lai <ashley@ahsleylai.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Diffstat (limited to 'drivers/char/tpm/tpm_ibmvtpm.h')
-rw-r--r-- | drivers/char/tpm/tpm_ibmvtpm.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/char/tpm/tpm_ibmvtpm.h b/drivers/char/tpm/tpm_ibmvtpm.h index f595f14426bf..6af92890518f 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.h +++ b/drivers/char/tpm/tpm_ibmvtpm.h @@ -22,9 +22,9 @@ struct ibmvtpm_crq { u8 valid; u8 msg; - u16 len; - u32 data; - u64 reserved; + __be16 len; + __be32 data; + __be64 reserved; } __attribute__((packed, aligned(8))); struct ibmvtpm_crq_queue { |