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 356A47803CC for ; Mon, 25 Sep 2023 03:08:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=do4eHHDxbYGJwVsg8au5p8bqJOkQhkgFHbucsMGiXUI=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1695611280; v=1; b=R8zr/J83iwA9MkpdRUdnesXazB8kSyVvrpV7Dnb3SwiCkz2TIqUTRuLF+FC7Dd77aALnk7TQ HS/mAxhQRoAPJ0DzhRblXHKCzHwXy1P24jNErfbXgoRdfu4CATids3Z4cHj3N2D8AVJIgwmlA7u U7NXZ6woD0kc83Wv5uuDJmwM= X-Received: by 127.0.0.2 with SMTP id f9k3YY7687511x93VybEmQxq; Sun, 24 Sep 2023 20:08:00 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.54100.1695611279996644244 for ; Sun, 24 Sep 2023 20:08:00 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="360538902" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="360538902" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2023 20:07:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="838439538" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="838439538" X-Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by FMSMGA003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 24 Sep 2023 20:07:54 -0700 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Sun, 24 Sep 2023 20:07:53 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Sun, 24 Sep 2023 20:07:53 -0700 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Sun, 24 Sep 2023 20:07:53 -0700 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Sun, 24 Sep 2023 20:07:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lnRL3www+VPi8rdx3rkgBLDDAoeLXcgAPwUxAd2eXika/NvGtgG5+gL6uIYG4aBXygPRSEPlE5JZs5n72CyxZ4++EsqpXxPJG5tN31BuNj+yffxXqBCqBsngO8rg4SOQpbsSjR0kKguhlYF5ItSV+Z1KXBjiONtjPUJ9TR3YbwfRojamglJFtzguLwrdZhQolWbN4jGi0RjPRkWT3hoMSfCfuJGnCiPBnOSM8oRv90VjB/qub7gwEp0e19MCyHOBQrqmhvQtfJl+00gH9EU7uKQU/gWW9XjyfeHNJAAZ286n4E6GEYRYVpNUh/Dg46mU7qXFt0FCFSLE/RPDGOqfjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dhJKPGoh/qtLYvLk9tIhiMx1aWhu4DsjpMWIjJRt5V8=; b=Ak6GRVXL5xLEqsipZ9zGmY7zksKjBqaHyBV0/ePwHm7QiVT+IW4/QUVmdHxhb+tjDrNHriYDmbvre3KgTo7fuwRSADQ7XEc0amyuDgu8qPXjqHpwt1J4CDFK5hb7y987/4bloNgT5BvQh0BzRctqS0K5L0N3W+r8fp4ygOhPncKd5oxTvlzk2uX1YOHdnVBD3ee7/D7qc0+bADezqP4UrBzQ/NBTcusA5tqgcL2rvW4aFc5w+W58wvh7LG4eEsa8oVMRlLsXz3WjeVDeX6pWBPqFYO9KL+92J5Tctcmb4UcWCLe/AxbfK+G8vNYik6rbTpU+Cgn0g3Q8rg2KN5TcNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from BL1PR11MB5478.namprd11.prod.outlook.com (2603:10b6:208:31d::12) by MW4PR11MB7104.namprd11.prod.outlook.com (2603:10b6:303:22b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Mon, 25 Sep 2023 03:07:50 +0000 X-Received: from BL1PR11MB5478.namprd11.prod.outlook.com ([fe80::b852:2d61:939f:53ea]) by BL1PR11MB5478.namprd11.prod.outlook.com ([fe80::b852:2d61:939f:53ea%5]) with mapi id 15.20.6813.017; Mon, 25 Sep 2023 03:07:50 +0000 From: "Guo, Gua" To: "Lien, HoraceX" , "devel@edk2.groups.io" CC: "Liu, Zhiguang" , "Bi, Dandan" , "Kinney, Michael D" , "Zeng, Star" , "Gao, Zhichao" Subject: Re: [edk2-devel] [PATCH v2] MdeModulePkg/SmbiosDxe: Fix BcdRevision is not match with SMBIOS version Thread-Topic: [PATCH v2] MdeModulePkg/SmbiosDxe: Fix BcdRevision is not match with SMBIOS version Thread-Index: AQHZ71UHIkrtnZZm3Uu1rF0576qzD7Aq3EGQ Date: Mon, 25 Sep 2023 03:07:50 +0000 Message-ID: References: <20230925020642.14874-1-horacex.lien@intel.com> In-Reply-To: <20230925020642.14874-1-horacex.lien@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BL1PR11MB5478:EE_|MW4PR11MB7104:EE_ x-ms-office365-filtering-correlation-id: eb9f0437-52dc-43ec-a941-08dbbd749a35 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: KUduOkux0LCQdq6P5/fRcsCXa7RF/C/l4rJd9maWufSS/BEt/TLsD3WZVNcE4AmFFirHnDs6bu4bh9XnyBjiWCpmT4Dap7YGwmdXzsdB7OFIPdRcfSxh2voPNizNTKY9JMdHYO7vZ5xd7QlkV4M30ovaF7FG99ANWnWk+C5A8d4ogyNbuRgF4UgftAfaUGL8cMG4qsno4ntaVIw6iLQGdYLSCvpcvESbkVukWl53YxyC0vO9MWQc+FMOT5bbQ0/oUJZPPJlP7dfBXp9pvmkS/qEcAkMEAsXm8ZdCGtsYvISPsSa27aLJIA8y4zTmlCQtMuQykQ31Q3VAkprCYrJ+OCIZwAVGXKXOY2woD2J0BbNGqoyVpARDqRptzA6DHysMPnlu5CUMFt2+iOyyFrdLDI/W0mqOpcOvJj8UjIGFri9TQ3S1ojvB++DkEFi8IUyYOhAwbdylxlJmGU++G/5pMNldx5GiwP3pf7zoTwRahetyU1YinV/1xflGUlIbpYiB97hmRAbB9CQ7fV0UGPpByb0iNXu8v7Op5iw3dLOS7H+Uu2bi5bLbXWZKJ6UDpmQeCZZxYLWiQVqLE5tWK013T1ysiCU1Gu1r93pry9/HadI= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LX9eLzdZvX3e3MgBDuPzph8Ysa2qPqgoTW4AhSGW6oYxKvg2Vg/KU8NG1v7l?= =?us-ascii?Q?yCYniiFC6/3XTsbjpHUHeRR9lUPu0wVFqzqnQfO39ywgrGj2WTzL+EVq4XJu?= =?us-ascii?Q?O1tXU1NiY4H5hKAI/VkE4k6sV5EBMM3+nwe3kB65xfRlmu5WF8tAap/RGud0?= =?us-ascii?Q?xYe+g/yA6R4HkpZ5smy6+mib9uXR5SrGKHaZ5Jm+F67aDjiXylZljgjxEceK?= =?us-ascii?Q?pkNkNq6IdRdHQ2+WwssT5RFzUcD5KDE2h+mXyQKM+A93YyOYr6vxnpRlCsa+?= =?us-ascii?Q?YCLC4K+1rZoc7iPqI3TPc0f+ZoUKDPCz7McKKtVzPu91vON5fiTdhJW+2FTC?= =?us-ascii?Q?TuKQG44yu5I8kzJm1yUepC2QpDB9AJUyT90kinmNUVlp9A5Dmh+y2vVlfKot?= =?us-ascii?Q?4wpxeQ6gL8K5yIHgPx1aOVOH5LRa7nSn/E+o0BVPbhDGpitJ36kLxheL6Sgn?= =?us-ascii?Q?kKdRWww13aE03YYho2Iz85jAa000BLTiWElf3PnPZO1ESC0FFvz9ZTH23Y/7?= =?us-ascii?Q?NQPQ1y+IM/56hy5/ed+7B1MP+B47hrOLspR0TUXO0TvPTJnW6uMgzwo1F+8y?= =?us-ascii?Q?3Z1RL+Lm45JeXxtkXr3KaKnxTy4bsGrDc9qwwH/Ym/Ck+0Zs9AtKqcGrBuFj?= =?us-ascii?Q?WqDY2UVRipLoI8dBx6AvJhlyAcoaKaupubrCs8o0mHAU7lNobYhOZP6XZmXo?= =?us-ascii?Q?dAGfn5G5k4zA5hvP8IVhPCFCP6Jmhmw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-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5478.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb9f0437-52dc-43ec-a941-08dbbd749a35 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2023 03:07:50.3673 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AwNFxBkl2B3rFLHCVpBI/GhSOKBIlxUPPOPe6ZYuh7D9pcahO5WrF4+hzwNqQCOOYmpYKj++iWv2HAY/euv9NQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB7104 X-OriginatorOrg: intel.com 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,gua.guo@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 2C5P281fsXTbww04KT5QhRjMx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" 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="R8zr/J83"; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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 Reviewed-by: Gua Guo -----Original Message----- From: Lien, HoraceX =20 Sent: Monday, September 25, 2023 10:07 AM To: devel@edk2.groups.io Cc: Lien, HoraceX ; Liu, Zhiguang ; Guo, Gua ; Bi, Dandan ; Ki= nney, Michael D ; Zeng, Star ; Gao, Zhichao Subject: [PATCH v2] MdeModulePkg/SmbiosDxe: Fix BcdRevision is not match wi= th SMBIOS version 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) &&=20 + (mPrivateData.Smbios.MinorVersion <=3D 9)) { + EntryPointStructureData.SmbiosBcdRevision =3D=20 + ((mPrivateData.Smbios.MajorVersion & 0x0f) << 4) |=20 + (mPrivateData.Smbios.MinorVersion & 0x0f); + } + + PhysicalAddress =3D 0xffffffff; + Status =3D gBS->AllocatePages ( + AllocateMaxAddress, + EfiRuntimeServicesData, + EFI_SIZE_TO_PAGES (sizeof=20 + (SMBIOS_TABLE_ENTRY_POINT)), + &PhysicalAddress + ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "SmbiosCreateTable () could not allocate EntryP= ointStructure < 4GB\n")); Status =3D gBS->AllocatePages ( -- 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 (#109031): https://edk2.groups.io/g/devel/message/109031 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-