From nobody Thu May 16 22:30:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109028+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109028+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1695607644; cv=none; d=zohomail.com; s=zohoarc; b=T6JbXOt+f3YiO1gLxIkgAGA4KZnYGY4SMLTSlrALBzhq20i7i7Ih2g9/Jk8L43XeXgdyXvGBwCxtKtsI0tHvFQhOG73XRiudtYxQyjuZDXr0NdA/Nq0lMX914N0wCEdn2C2t+gtfz1hbAT321UI+mPb6U8HDLYHKlEQ6iJ3e7pM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695607644; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=AzV2jCxuMjI2nylYSJjCqq8GIn/O03uoX0SoeuFDJnk=; b=gWM+WTTyesNpNwVeJOq9PbWT4SbfO19MwP0D46vIfnvImmbogTOVzd6wvuTq2drp09XZ3ccERscY5Wcz2PDY4d/J3esTQo4EWveksTTQM7aSSe5nUmo4ld2KhxwNOGKfPLEH1ojOwbf2fmodJEFGh86wP43X6QTnBUErwZ3O0wM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109028+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169560764398065.92434186550929; Sun, 24 Sep 2023 19:07:23 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=TgqBSzF9ZqtsH4CboewRQR2ARqwmPM/AaKMAEgKhPpE=; 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=S+TcFK32/IwrigzpW3Iu2Bf3a4ai/1ldNthoy1ejZ19QDo/b6JK3nxLw59uCj6RV8CFZqbxi lCB7ke00sUBwnbsECoZWAFoU4rW0Mk2GZUw6fMeDApXkEqa1MPxq4tC7fyW8UGuyKyvO9EBFs10 yEENO4KFrl3Q/cKzCsoOiUTE= X-Received: by 127.0.0.2 with SMTP id kHEiYY1788612xKqABPoKejJ; 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: lIgPXlnWrEXdK2nO78Zw8vNNx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695607644777100003 Content-Type: text/plain; charset="utf-8" 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")); EntryPointStructureData.MajorVersion =3D mPrivateData.Smbios.Majo= rVersion; EntryPointStructureData.MinorVersion =3D mPrivateData.Smbios.Mino= rVersion; - EntryPointStructureData.SmbiosBcdRevision =3D (UINT8)((PcdGet16 (PcdSm= biosVersion) >> 4) & 0xf0) | (UINT8)(PcdGet16 (PcdSmbiosVersion) & 0x0f); - PhysicalAddress =3D 0xffffffff; - Status =3D gBS->AllocatePages ( - AllocateMaxAddress, - EfiRuntimeServicesD= ata, - EFI_SIZE_TO_PAGES (= sizeof (SMBIOS_TABLE_ENTRY_POINT)), - &PhysicalAddress - ); + EntryPointStructureData.SmbiosBcdRevision =3D 0; + if ((mPrivateData.Smbios.MajorVersion <=3D 9) && (mPrivateData.Smbios.= MinorVersion <=3D 9)) { + EntryPointStructureData.SmbiosBcdRevision =3D ((mPrivateData.Smbios.= MajorVersion & 0x0f) << 4) | (mPrivateData.Smbios.MinorVersion & 0x0f); + } + + PhysicalAddress =3D 0xffffffff; + Status =3D 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 EntryP= ointStructure < 4GB\n")); Status =3D gBS->AllocatePages ( --=20 2.31.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-