Revision: 18691
          http://sourceforge.net/p/edk2/code/18691
Author:   lzeng14
Date:     2015-10-29 01:10:18 +0000 (Thu, 29 Oct 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.

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]>

Modified Paths:
--------------
    
trunk/edk2/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c

Modified: 
trunk/edk2/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
===================================================================
--- 
trunk/edk2/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c   
    2015-10-28 07:16:38 UTC (rev 18690)
+++ 
trunk/edk2/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c   
    2015-10-29 01:10:18 UTC (rev 18691)
@@ -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


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to