Hi Chao B,

I think you are right, the Manufacture ID is a byte array. The order in ACPI 
HID is correct.

But Tpm2GetCapabilityManufactureID return a UINT32 value.
Tpm2GetCapabilityManufactureID (
  OUT     UINT32                    *ManufactureId

This is confused . When the caller use ManufactureId as UINT32, the byte order 
is confused.
For example in Tcg2Dxe.c, it print:
Tpm2GetCapabilityManufactureID - 204D5453

Which should be "53544D20" in the case.

  Status = Tpm2GetCapabilityManufactureID (&mTcgDxeData.BsCap.ManufacturerID);
  if (EFI_ERROR (Status)) {
    DEBUG ((EFI_D_ERROR, "Tpm2GetCapabilityManufactureID fail!\n"));
  } else {
    DEBUG ((EFI_D_INFO, "Tpm2GetCapabilityManufactureID - %08x\n", 

How about changing the returning value to a 4 bytes array?


From: Zhang, Chao B [mailto:chao.b.zh...@intel.com]
Sent: Friday, February 23, 2018 11:03 AM
To: Lin, Derek (HPS UEFI Dev) <derek.l...@hpe.com>; edk2-devel@lists.01.org
Cc: Yao, Jiewen <jiewen....@intel.com>; Zeng, Star <star.z...@intel.com>
Subject: RE: TPM 2.0 Manufacutre ID wrong byte order

Hi Derek:
    Can you specify the "reversed" ManufactureId issue?  What did you get from 
this interface?
The implementation follows Vendor ID registry spec. The vendor ID is octet 
array. There is no endian issue here.
We haven't seen any disorder before.

From: Lin, Derek (HPS UEFI Dev) [mailto:derek.l...@hpe.com]
Sent: Thursday, February 22, 2018 7:25 PM
To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>; Zhang, Chao B 
Cc: Yao, Jiewen <jiewen....@intel.com<mailto:jiewen....@intel.com>>; Zeng, Star 
Subject: TPM 2.0 Manufacutre ID wrong byte order

Hi TPM expert,

The line in 
 change the byte order of Manufacture ID in Tpm2GetCapabilityManufactureID ().

I see it return "reversed" ManufactureId for two TPM vendor's module.
Also, all other Capability data in Tpm2Capability.c use SwapBytes32 since TPM 
is big-endian, which seems correct.

Can you check this and confirm?


edk2-devel mailing list

Reply via email to