]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/SMBIOS: Reuse handles supplied by underlying VM
authorGabriel Somlo <somlo@cmu.edu>
Tue, 20 May 2014 16:33:11 +0000 (16:33 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 20 May 2014 16:33:11 +0000 (16:33 +0000)
The SMBIOS specification requires some structure types to
contain reference fields to other structures' handles. When
InstallAllStructures() rebuilds the SMBIOS tables by traversing
an existing source table, the use of SMBIOS_HANDLE_PI_RESERVED
causes automatically generated, arbitrary handle numbers to be
assigned to each cloned structure. This causes all reference
handle fields to become invalid.

This patch modifies InstallAllStructures() to reuse the original
handle numbers supplied by the underlying VM, preserving the
correctness of any included handle references.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Anthony PERARD <anthony.perard@citrix.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15541 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c

index 42a5132e0e7b2f1752d2def4c571fca497f3758f..ac48fb720819292092c6eba44cd9aaa7fef6db22 100644 (file)
@@ -106,7 +106,7 @@ InstallAllStructures (
     //\r
     // Log the SMBIOS data for this structure\r
     //\r
-    SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
+    SmbiosHandle = SmbiosTable.Hdr->Handle;\r
     Status = Smbios->Add (\r
                        Smbios,\r
                        NULL,\r