Skip to content

Commit

Permalink
MdeModulePkg/SmbiosDxe: Fix BcdRevision is not match with SMBIOS version
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4544

These value of Major/Minor version are updated from SMBIOS memory data,
but BCD Revision is updated from PCD PcdSmbiosVersion.
We should also update BCD Revision from SMBIOS memory data,
to ensure that get consistent version value.

Cc: Zhiguang Liu <[email protected]>
Reviewed-by: Gua Guo <[email protected]>
Reviewed-by: Dandan Bi <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Zhichao Gao <[email protected]>
Signed-off-by: HoraceX Lien <[email protected]>
  • Loading branch information
liencx authored and mdkinney committed Nov 7, 2023
1 parent 7f0802c commit 7714765
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,14 +1072,18 @@ SmbiosCreateTable (
DEBUG ((DEBUG_INFO, "SmbiosCreateTable: Initialize 32-bit entry point structure\n"));
EntryPointStructureData.MajorVersion = mPrivateData.Smbios.MajorVersion;
EntryPointStructureData.MinorVersion = mPrivateData.Smbios.MinorVersion;
EntryPointStructureData.SmbiosBcdRevision = (UINT8)((PcdGet16 (PcdSmbiosVersion) >> 4) & 0xf0) | (UINT8)(PcdGet16 (PcdSmbiosVersion) & 0x0f);
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)),
&PhysicalAddress
);
EntryPointStructureData.SmbiosBcdRevision = 0;
if ((mPrivateData.Smbios.MajorVersion <= 9) && (mPrivateData.Smbios.MinorVersion <= 9)) {
EntryPointStructureData.SmbiosBcdRevision = ((mPrivateData.Smbios.MajorVersion & 0x0f) << 4) | (mPrivateData.Smbios.MinorVersion & 0x0f);
}

PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)),
&PhysicalAddress
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "SmbiosCreateTable () could not allocate EntryPointStructure < 4GB\n"));
Status = gBS->AllocatePages (
Expand Down

0 comments on commit 7714765

Please sign in to comment.