From 6b23d767f6c762178503cf26e4c6d066fd311f25 Mon Sep 17 00:00:00 2001 From: Gabriel Somlo Date: Tue, 20 May 2014 16:33:11 +0000 Subject: OvmfPkg/SMBIOS: Reuse handles supplied by underlying VM 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 Reviewed-by: Laszlo Ersek Reviewed-by: Jordan Justen Tested-by: Anthony PERARD git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15541 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OvmfPkg') diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c index 42a5132..ac48fb7 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -106,7 +106,7 @@ InstallAllStructures ( // // Log the SMBIOS data for this structure // - SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED; + SmbiosHandle = SmbiosTable.Hdr->Handle; Status = Smbios->Add ( Smbios, NULL, -- cgit v1.1