Resending in case you did not get the attachment (looks like the list is 
rejecting attachments?)




>From 6137b3003bc6da896c28ff51511b3a5eebb675e6 Mon Sep 17 00:00:00 2001
From: "derek.lin2" <[email protected]>
Date: Tue, 29 Sep 2015 09:39:49 +0800
Subject: [PATCH] Fix TCG2 structure pack.

---
 MdePkg/Include/Protocol/Tcg2Protocol.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/Protocol/Tcg2Protocol.h 
b/MdePkg/Include/Protocol/Tcg2Protocol.h
index 0bda105..9fbdee3 100644
--- a/MdePkg/Include/Protocol/Tcg2Protocol.h
+++ b/MdePkg/Include/Protocol/Tcg2Protocol.h
@@ -22,6 +22,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #define EFI_TCG2_PROTOCOL_GUID \
   {0x607f766c, 0x7455, 0x42be, { 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 
0x0f }}
 
+#pragma pack(1)
+
 typedef struct tdEFI_TCG2_PROTOCOL EFI_TCG2_PROTOCOL;
 
 typedef struct tdEFI_TCG2_VERSION {
@@ -110,7 +112,6 @@ typedef struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY {
 
 #define MAX_PCR_INDEX  23
 
-#pragma pack(1)
 
 #define EFI_TCG2_EVENT_HEADER_VERSION  1
 
-- 
1.9.5.msysgit.1




-----Original Message-----
From: El-Haj-Mahmoud, Samer 
Sent: Friday, October 02, 2015 2:04 PM
To: Yao, Jiewen <[email protected]>; Matthew Garrett <[email protected]>; 
[email protected]
Cc: El-Haj-Mahmoud, Samer <[email protected]>; Lin, Derek (HPS UEFI 
Dev) <[email protected]>
Subject: RE: [edk2] Should TREE_BOOT_SERVICE_CAPABILITY be packed?

We probably cannot change Tree since it is used by Windows.

But what about the new Tcg2 Protocol? Same issue exists there.

See attached patch



-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Yao, 
Jiewen
Sent: Monday, September 28, 2015 9:45 PM
To: Matthew Garrett <[email protected]>; [email protected]
Subject: Re: [edk2] Should TREE_BOOT_SERVICE_CAPABILITY be packed?

Hi Matthew
Thanks! It is good catch on code/spec mismatch. We start discussion in TCG on 
packed/unpacked structure.

Since current code is validated on Win8 and Win10, I suggest we rely on TCG to 
give final conclusion.

Thank you
Yao Jiewen

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Matthew 
Garrett
Sent: Friday, September 25, 2015 8:43 AM
To: [email protected]
Subject: [edk2] Should TREE_BOOT_SERVICE_CAPABILITY be packed?

The TCG PC Client Protocol spec for TPM2 devices says:
                                                                                
                                                                                
                                        
"All structures defined in this specification are packed. Some compilers may 
insert space between fields of a structure to align them. This functionality 
SHALL be disabled, so structures are packed"
                                                                                
                                                                                
                                        
The TCG_EVENT_HEADER and TrEE_EVENT structures are defined in TrEEProtocol.h as 
being packed, but TREE_BOOT_SERVICE_CAPABILITY_1_0 isn't. Since implementations 
appear to have shipped with this it's clearly impossible to make any changes 
now, but should we expect systems with the 1.1 structure (ie, with the 
additional information regarding PCR banks) to be packed or not?

--
Matthew Garrett | [email protected]
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to