From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 34D6E940F8A for ; Mon, 25 Sep 2023 02:07:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=UNt07PLUEuB3TO9AMQdIC2K7cHLJgDR3UDb2lmXw6EU=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695607643; v=1; b=myDd5mk+tAqBc0afgmNVLpGkUf6kBuPcn/xLewedKwElmfYIcbtcKkMfPcv+PbB/1EujwfAn owCnRyw7EHX4zvRZpzrMGxn4NyR480aWTHQJzocm+H4F6t9g9lWGH9tAAWckb4Ra5XL8X0c+4Cn yrDzD4vCv17ArYk9hqDvJhwA= X-Received: by 127.0.0.2 with SMTP id 6kmHYY7687511xaQej147fmx; Sun, 24 Sep 2023 19:07:23 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.52762.1695607642498304495 for ; Sun, 24 Sep 2023 19:07:22 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="366204895" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="366204895" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2023 19:07:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="863685044" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="863685044" X-Received: from shserverbios518.ccr.corp.intel.com ([10.5.215.122]) by fmsmga002.fm.intel.com with ESMTP; 24 Sep 2023 19:07:19 -0700 From: "Lien, HoraceX" To: devel@edk2.groups.io Cc: HoraceX Lien , Zhiguang Liu , Gua Guo , Dandan Bi , Michael D Kinney , Star Zeng , Zhichao Gao Subject: [edk2-devel] [PATCH v2] MdeModulePkg/SmbiosDxe: Fix BcdRevision is not match with SMBIOS version Date: Mon, 25 Sep 2023 10:06:42 +0800 Message-Id: <20230925020642.14874-1-horacex.lien@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,horacex.lien@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: m0YHf4qAmJ8ZRaabRqpRhdzKx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=myDd5mk+; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: HoraceX Lien REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4544 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 Reviewed-by: Gua Guo Reviewed-by: Dandan Bi Reviewed-by: Michael D Kinney Cc: Star Zeng Cc: Zhichao Gao Signed-off-by: HoraceX Lien --- MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c b/MdeModulePkg/Un= iversal/SmbiosDxe/SmbiosDxe.c index 1a86e69d3c..2ef7b8e21c 100644 --- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c +++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c @@ -1072,14 +1072,18 @@ SmbiosCreateTable ( DEBUG ((DEBUG_INFO, "SmbiosCreateTable: Initialize 32-bit entry point = structure\n"));=0D EntryPointStructureData.MajorVersion =3D mPrivateData.Smbios.Majo= rVersion;=0D EntryPointStructureData.MinorVersion =3D mPrivateData.Smbios.Mino= rVersion;=0D - EntryPointStructureData.SmbiosBcdRevision =3D (UINT8)((PcdGet16 (PcdSm= biosVersion) >> 4) & 0xf0) | (UINT8)(PcdGet16 (PcdSmbiosVersion) & 0x0f);=0D - PhysicalAddress =3D 0xffffffff;=0D - Status =3D gBS->AllocatePages (=0D - AllocateMaxAddress,= =0D - EfiRuntimeServicesD= ata,=0D - EFI_SIZE_TO_PAGES (= sizeof (SMBIOS_TABLE_ENTRY_POINT)),=0D - &PhysicalAddress=0D - );=0D + EntryPointStructureData.SmbiosBcdRevision =3D 0;=0D + if ((mPrivateData.Smbios.MajorVersion <=3D 9) && (mPrivateData.Smbios.= MinorVersion <=3D 9)) {=0D + EntryPointStructureData.SmbiosBcdRevision =3D ((mPrivateData.Smbios.= MajorVersion & 0x0f) << 4) | (mPrivateData.Smbios.MinorVersion & 0x0f);=0D + }=0D +=0D + PhysicalAddress =3D 0xffffffff;=0D + Status =3D gBS->AllocatePages (=0D + AllocateMaxAddress,=0D + EfiRuntimeServicesData,=0D + EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY= _POINT)),=0D + &PhysicalAddress=0D + );=0D if (EFI_ERROR (Status)) {=0D DEBUG ((DEBUG_ERROR, "SmbiosCreateTable () could not allocate EntryP= ointStructure < 4GB\n"));=0D Status =3D gBS->AllocatePages (=0D --=20 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109028): https://edk2.groups.io/g/devel/message/109028 Mute This Topic: https://groups.io/mt/101567470/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-