Revision: 18814
          http://sourceforge.net/p/edk2/code/18814
Author:   vanjeff
Date:     2015-11-16 08:13:36 +0000 (Mon, 16 Nov 2015)
Log Message:
-----------
MdeModulePkg SmbiosMeasurementDxe: Use SMBIOS table and GUID correctly

1. Smbios3Table used as SmbiosTable wrongly after SmbiosTable got from 
configuration table.
2. Use correct VendorGuid and VendorTable to measure.

(Sync patch r18691 from main trunk.)

Cc: Jiewen Yao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18691

Modified Paths:
--------------
    
branches/UDK2015/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c

Modified: 
branches/UDK2015/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
===================================================================
--- 
branches/UDK2015/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
 2015-11-16 08:12:48 UTC (rev 18813)
+++ 
branches/UDK2015/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
 2015-11-16 08:13:36 UTC (rev 18814)
@@ -478,6 +478,8 @@
       DEBUG ((EFI_D_INFO, "  TableAddress                - 0x%016lx\n", 
Smbios3Table->TableAddress));
     }
   }
+
+  if (Smbios3Table == NULL) {
     Status = EfiGetSystemConfigurationTable (
                &gEfiSmbiosTableGuid,
                (VOID **) &SmbiosTable
@@ -485,10 +487,10 @@
     if (!EFI_ERROR (Status)) {
       DEBUG ((EFI_D_INFO, "SmbiosTable:\n"));
       DEBUG ((EFI_D_INFO, "  AnchorString                - '%c%c%c%c'\n",
-        Smbios3Table->AnchorString[0],
-        Smbios3Table->AnchorString[1],
-        Smbios3Table->AnchorString[2],
-        Smbios3Table->AnchorString[3]
+        SmbiosTable->AnchorString[0],
+        SmbiosTable->AnchorString[1],
+        SmbiosTable->AnchorString[2],
+        SmbiosTable->AnchorString[3]
         ));
       DEBUG ((EFI_D_INFO, "  EntryPointStructureChecksum - 0x%02x\n", 
SmbiosTable->EntryPointStructureChecksum));
       DEBUG ((EFI_D_INFO, "  EntryPointLength            - 0x%02x\n", 
SmbiosTable->EntryPointLength));
@@ -516,6 +518,7 @@
       DEBUG ((EFI_D_INFO, "  NumberOfSmbiosStructures    - 0x%04x\n", 
SmbiosTable->NumberOfSmbiosStructures));
       DEBUG ((EFI_D_INFO, "  SmbiosBcdRevision           - 0x%02x\n", 
SmbiosTable->SmbiosBcdRevision));
     }
+  }
 
   if (Smbios3Table != NULL) {
     SmbiosTableAddress = (VOID *)(UINTN)Smbios3Table->TableAddress;
@@ -542,8 +545,13 @@
     InternalDumpHex (TableAddress, TableLength);
 
     HandoffTables.NumberOfTables = 1;
-    HandoffTables.TableEntry[0].VendorGuid  = gEfiSmbiosTableGuid;
-    HandoffTables.TableEntry[0].VendorTable = SmbiosTable;
+    if (Smbios3Table != NULL) {
+      CopyGuid (&(HandoffTables.TableEntry[0].VendorGuid), 
&gEfiSmbios3TableGuid);
+      HandoffTables.TableEntry[0].VendorTable = Smbios3Table;
+    } else {
+      CopyGuid (&(HandoffTables.TableEntry[0].VendorGuid), 
&gEfiSmbiosTableGuid);
+      HandoffTables.TableEntry[0].VendorTable = SmbiosTable;
+    }
     Status = TpmMeasureAndLogData (
                1,                       // PCRIndex
                EV_EFI_HANDOFF_TABLES,   // EventType


------------------------------------------------------------------------------
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a 
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to