From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.9038.1678172504310684947 for ; Mon, 06 Mar 2023 23:01:44 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=PvtnqX6z; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: star.zeng@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678172504; x=1709708504; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=rScyahZ/Ky5+iSw1nCZAQMpZnVoatFNjc0lh+QBsnJw=; b=PvtnqX6zpReBSXDjlvrZ5ECvgBUbBJfFJVdYPiRJoTEsuqEdPMSi8oqn QPedkb5eVqnAmJBT3oMTVc0plRbcKpV/hvyBH1nx9ZKbyhJ99nQZc2AnY AwRuRggIku7gGUJnCS4WKOWWlwULxl1HoDKdGtyPL/ZRJHnTYUV1mXuxJ PtRGU14Q/IGBspwSn/sx34eMJxLL7TjzzYTiMWgCxdzIGuraKLbzghOwa AR66sRmUTf+Qa7nLXj8CqWSlR4Y8F00SZiV33Fw+MrYYH7cjvo+UWgY/7 T4SJPfR1Hax/R6WOO503EoyMhhcfrnX5TQAOR7B5nYbegi7WbR33yH449 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="319611432" X-IronPort-AV: E=Sophos;i="5.98,240,1673942400"; d="scan'208";a="319611432" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 23:01:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="653875808" X-IronPort-AV: E=Sophos;i="5.98,240,1673942400"; d="scan'208";a="653875808" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga006.jf.intel.com with ESMTP; 06 Mar 2023 23:01:42 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.21; Mon, 6 Mar 2023 23:01:42 -0800 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.21 via Frontend Transport; Mon, 6 Mar 2023 23:01:42 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.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.21; Mon, 6 Mar 2023 23:01:42 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LwELHpYKvBYb19B0HeTHxDEenMcL2pwFK+k8Nr5QHhIFjN+1k3It1U6VfwV8LN+TOairygdHHZrjL/YOG99uPzp79XZpKlDbsjR3h8HTWfk6pn9PUrJPkwNqp3L1J/UMWqBuE+HPVSeRVHbHY/Dpumlr2zvviv7s18lh8ND6GqA4k7U/y55ph7qTPY5TXatUDBW3+F10oa4vIML6k3IraHZFfPyH6TE2f2Fjm0xAi4wHzJfZMcyXs4a7lNgvCLx/EHfpo0XuiLdmjacpXGFxNpoS0NCySR+DV4qq/hqSm7nO/QzC5keEaYZeSxB3RWbjBoCsfRHE48Q0VVHnt4NjeQ== 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=CwPAG1iQpTo19E/IQv+2RcXbdS04gQUSIgxbnNjpjdM=; b=S4Y2YyvloG4NvOPF9V6gTCDMPon4E2uJ1qXjdcWhsCbqypKMs1vclWn3eU6kNX7r8gWqiKMC8TSrwSjMXzc9Qn5PvhwPvUwsPwPhFbOY3Y7ALuOg6Vc26WA8DmK7p9hzcUazxcyAuolxgYTcpixFI87Y68iCNWDISD+mp7rpAltrEnufEVaUFuXxxmRGotE8map8ENRHrAa8D37mqmEeP+0Ew0zxYYHTDbfbTk+Q6nMPbHC4N7g1FQrqUtAga2O53/0OMP9u6Om093GwIirR48CniwZ/hbfncQ8I2s89WNCJDJbg1CSqSu2Z54r4evgrwfJWfwc8DZVZEf6zw/N2Iw== 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 Received: from DM8PR11MB5623.namprd11.prod.outlook.com (2603:10b6:8:25::20) by MN0PR11MB6253.namprd11.prod.outlook.com (2603:10b6:208:3c6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.27; Tue, 7 Mar 2023 07:01:40 +0000 Received: from DM8PR11MB5623.namprd11.prod.outlook.com ([fe80::4548:1db9:bd40:4a26]) by DM8PR11MB5623.namprd11.prod.outlook.com ([fe80::4548:1db9:bd40:4a26%8]) with mapi id 15.20.6156.029; Tue, 7 Mar 2023 07:01:40 +0000 From: "Zeng, Star" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Ni, Ray" , "Kumar, Rahul R" , Gerd Hoffmann , "Mike Maslenkin" , "Zeng, Star" Subject: Re: [PATCH v2] UefiCpuPkg: Calculate DisplayFamily correctly Thread-Topic: [PATCH v2] UefiCpuPkg: Calculate DisplayFamily correctly Thread-Index: AQHZUL6Bj8aR+SpQJESq/YbBsEMxi67u48xg Date: Tue, 7 Mar 2023 07:01:40 +0000 Message-ID: References: <20230307063136.1615-1-zhiguang.liu@intel.com> In-Reply-To: <20230307063136.1615-1-zhiguang.liu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM8PR11MB5623:EE_|MN0PR11MB6253:EE_ x-ms-office365-filtering-correlation-id: 52eea881-2492-4c66-4fc9-08db1ed9cd53 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HU9hGfZlE/4tepqJGaKu/2Wt2Ei8Z+9UAUjwwTNkaiyGeeY3ux1Xf1X6drr4DIX0cU0dSFPOXMDhQbOnLNoS0oDm1TbM8h2Yjeyqtn3XkGDGEyHfGUJ7x7DYmjmgnRIgWwHeQ+frdjcGdNUBvFT0GarIHGTIKefRdPL6yOLG8Kod2lD62xBPrJrBsdhygf5m659Q78XFcSjCWdRCdBuWc/QAVGsepNTpSdLwCpqSIppIiWtrGlewEz9xfNSmnYacsLzi9l7bdHKcRp1ZbHk7ovtLxfEjyEsc3d/ZRCDCkXk3ZJ36qtMYLszI2eWeg4UEl4GrFBZ+2WSeN7b/8x2j4NdPyEjPP/LkKe0SL3ZObpfmF6U3SLmOR9MshQHkDsyB0Dmtaycwp5tFbrJuOCF2ttGfcsUOeJX/nhwVRFCzqY+VpXTI3VPj4oZLzdNrSv7Qd3gHc19f7/RU/s7E0i+HUW4pbjtEFH7yU0B2Ebyl/y5n9GPDgAP98VeJSuLlFIvpbVcF1mgaDZHCDpVTXUE31BJw3Kyate0mBKbJ8M79LJtvJ7yPCDfG+3m+4qkWvTWgN+0G6I6gE7tGHbeXxkvHrz5DA/AmPIDrpEhombh0lUoDBlFrkyGIx7gS74nR0kt5k6oEhhljhg7x98c8+LZ+ooEpq/3ti34XVjwVvIs6LkoDpvPcMlVh7ThlOUbbHQU/ x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR11MB5623.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(136003)(39860400002)(376002)(346002)(396003)(366004)(451199018)(33656002)(54906003)(82960400001)(316002)(110136005)(478600001)(966005)(5660300002)(71200400001)(7696005)(52536014)(66946007)(8936002)(76116006)(2906002)(4326008)(64756008)(66476007)(66446008)(8676002)(66556008)(41300700001)(55016003)(38070700005)(6506007)(38100700002)(86362001)(9686003)(26005)(186003)(107886003)(53546011)(122000001)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?HSPkgKgMFaejub5xptHIWR6GH2NtRAN5iEjmjwkEhkGJqdF+5ntB/Liv+qvb?= =?us-ascii?Q?2bNYZ7XgWqM9gA8wPrn151b9WyLGyYQrjUitl7DGccqx0XYNAnIhclAUtWF2?= =?us-ascii?Q?qKlmIPbXU9FobLPY7530F8ohrKog4XcIZrwr1NkhK5vdnTcNmdQkAAkaaUI5?= =?us-ascii?Q?KLkbjrEyiDKG6u7mvYTTwKP2qziFKJqKqqhs+NdBzKECs6ZEHkjAbqnSdLxq?= =?us-ascii?Q?4kuFsxF9EGVnnaojyEPOnAIPAxsQcavi8xjv2eCZtBGB0vrq5Fo+Xm924JRR?= =?us-ascii?Q?dNfY/Jc7/vlbWqAqmlesF6w9nQ8f5tOBpB++AWttwhPQP2xNjGAj61cVu6DW?= =?us-ascii?Q?kU0jC5jWfr7Ki10cg1fH/D62ZRy9pZwQToo0xDdLj5vepWBQ1BZiUFoAmlLa?= =?us-ascii?Q?CdfxDsaprNk1UabtQpCg2fwyUOv+b5A51gnTPCpm2hqTR2vb4eWIdbYnfnOf?= =?us-ascii?Q?9+6piCENPp9Y2YRXbAeYJYqTQWA3NBzSLVleP+TmiCJqKPio6kdm0wLvMqIh?= =?us-ascii?Q?lCbrs8hsDKj3RII+2XpRRne/nSqjLzgfJ72QuOjyc0n4rKnPl5ePToItvNsu?= =?us-ascii?Q?Zi+NmsFOExu36WGW/Ny+ex8HwcFvpj6HXf2G65kSeT97x66qOrl5HfM8s2jT?= =?us-ascii?Q?z7tJOdeD6jIDr3bihwhs2J3Elzsi4pN2QmEjMre+LXni9XgyC0NKrCFt2ndA?= =?us-ascii?Q?U+lgC446NQnvKmWEDTM1vArVWdaH366ewBkQrSnLCM3WleXIt51h5sYCp8ar?= =?us-ascii?Q?HITCuekhOR6yarbYkEmRJwVl+oicRvi4e9XrjsFFdXi29nwVFfmV1NSpXbpp?= =?us-ascii?Q?o60XpIaEWCwyu3EgifReDl4IWkykqbHP71eLd+vhfQ2qca1RfZUhMV3U1mlF?= =?us-ascii?Q?+cGeI7yVvaCeRbpFpnuRvTQJYhho+D9+dabQdPtl54zyL+xgk45dE/1HLqVm?= =?us-ascii?Q?8waVt0ydkbEL+hkeDHSbQtwYISP/nWyqLI63s3BLC3kn9Cng56CkTX50/i8I?= =?us-ascii?Q?lauav0wn+DfV+0/h8QlFQIbgPaaawDU8n4HJ1HVkzkNO6JdvHkYgvMiSLeSR?= =?us-ascii?Q?zkwjln92ZlVz5h8wYwW81btT9Vumc/tzVBhOMycsNF0rINUdAIqp5yWUYGmr?= =?us-ascii?Q?DwWW3oeMNfT/EgrpjR/ESTImlCzulKiKEggZj3Iwea06INfjQoHy3p0X90GV?= =?us-ascii?Q?SYqnGT8hBbTDcbFVaQ4kJWB561vjLhsBcLr9MN9fUDYLqG1+AB9X1rBBI1sm?= =?us-ascii?Q?STdGfLFxTJ44DQ1aSCAiExvYxksg4EDrxt0SxRXmQnVbVMNND3gak/WcABjd?= =?us-ascii?Q?YI0gUOg+bjVaTUKmKfiAHhCq0th9l4Y1exDsno2Sw4n6XF2HeTZGe3DtL327?= =?us-ascii?Q?W3mTBSe7ShH5HQ84UOgEqFm2XttIlZ6gpKtS+1ZDClLHnMlnz4dgjO9LQG4b?= =?us-ascii?Q?SuuggHbFykcONAvD1FFJJYHKtc3jd4ienz18G1ssJFLV8CKw+k9ecGS0F8+c?= =?us-ascii?Q?xTHffyWedffoQyjDmeZ9BHOcDYNTh5aRbafN5nkW0K7yOvGBYIQ9dgZgXwgz?= =?us-ascii?Q?VySqjvWS0P4Vq1stOzIXFdTLZ7lpUD400djCYEfe?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5623.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52eea881-2492-4c66-4fc9-08db1ed9cd53 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Mar 2023 07:01:40.4270 (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: ALC7VRdbTzB8D19N7larjDNTZfxvLF7mViRaK3oCTczL3XB6P8+V3kZfE/0mqIGeCI3aifk4y1+y2G472eePyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR11MB6253 Return-Path: star.zeng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Liu, Zhiguang =20 Sent: Tuesday, March 7, 2023 2:32 PM To: devel@edk2.groups.io Cc: Liu, Zhiguang ; Dong, Eric ; Ni, Ray ; Kumar, Rahul R ; Ge= rd Hoffmann ; Zeng, Star ; Mike Mas= lenkin Subject: [PATCH v2] UefiCpuPkg: Calculate DisplayFamily correctly REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4348 Per SDM: DisplayFamily =3D Extended_Family_ID + Family_ID. DisplayModelID =3D (Extended_Model_ID << 4) + Family_ID. Correct the related code. Cc: Eric Dong Reviewed-by: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Reviewed-by: Star Zeng Cc: Mike Maslenkin Signed-off-by: Zhiguang Liu --- UefiCpuPkg/Application/Cpuid/Cpuid.c | 6 +++--- .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c b/UefiCpuPkg/Application/= Cpuid/Cpuid.c index 372c6ef87d..172476a275 100644 --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c @@ -1,7 +1,7 @@ /** @file UEFI Application to display CPUID leaf information. =20 - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2023, Intel Corporation. All rights=20 + reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -217,12 +217,12 @@ CpuidVersionInfo ( =20 DisplayFamily =3D Eax.Bits.FamilyId; if (Eax.Bits.FamilyId =3D=3D 0x0F) { - DisplayFamily |=3D (Eax.Bits.ExtendedFamilyId << 4); + DisplayFamily +=3D Eax.Bits.ExtendedFamilyId; } =20 DisplayModel =3D Eax.Bits.Model; if ((Eax.Bits.FamilyId =3D=3D 0x06) || (Eax.Bits.FamilyId =3D=3D 0x0f)) = { - DisplayModel |=3D (Eax.Bits.ExtendedModelId << 4); + DisplayModel +=3D (Eax.Bits.ExtendedModelId << 4); } =20 Print (L" Family =3D %x Model =3D %x Stepping =3D %x\n", DisplayFamil= y, DisplayModel, Eax.Bits.SteppingId); diff --git a/UefiCpuPkg/Library/Regi= sterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpu= FeaturesLib/CpuFeaturesInitialize.c index a8e4f920fc..552fdab417 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -1,7 +1,7 @@ /** @file CPU Features Initialize functions. =20 - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2023, Intel Corporation. All rights=20 + reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -67,12 +67,12 @@ FillProcessorInfo ( =20 DisplayedFamily =3D Eax.Bits.FamilyId; if (Eax.Bits.FamilyId =3D=3D 0x0F) { - DisplayedFamily |=3D (Eax.Bits.ExtendedFamilyId << 4); + DisplayedFamily +=3D Eax.Bits.ExtendedFamilyId; } =20 DisplayedModel =3D Eax.Bits.Model; if ((Eax.Bits.FamilyId =3D=3D 0x06) || (Eax.Bits.FamilyId =3D=3D 0x0f)) = { - DisplayedModel |=3D (Eax.Bits.ExtendedModelId << 4); + DisplayedModel +=3D (Eax.Bits.ExtendedModelId << 4); } =20 CpuInfo->DisplayFamily =3D DisplayedFamily; -- 2.31.1.windows.1