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.8782.1678170707774506721 for ; Mon, 06 Mar 2023 22:31:48 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=G7F5holl; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: zhiguang.liu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678170707; x=1709706707; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=PQ5CV6W16ZWjUgR7i5VUor94lOHuhneMm5chz4tdcDE=; b=G7F5hollpFt43hY4/PlpnAs2R1Cl5YIuTY4S2Hck8qFQ4YyjeNNw0T3s SfSG46Ie3Itm+EVZKCxEbFklNLrEihaS65ido3fmxp4sH01z2O9Zbz7aa 5iZmB+k5hau8ny2jSEPi1fSaV4hjgOkZ2v5bMTXGinW29+WHZcXAIoVpH Ey4gZVvgkIhv4zYpBNrZqD0Ch+aXNL7Geys7n53cG3DCl2t0QgOsmS7Oq oJgUWYiIgDQA0dBg6FB1AG3voQIis0StRuPOknf8PDAD6NZ/Cw1A9pdcf 6jSTu0WNfQh/FWzWY3vMkjng85VK16glGHaootXOPc3o3v7gIzMV/txNp Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="319605587" X-IronPort-AV: E=Sophos;i="5.98,240,1673942400"; d="scan'208";a="319605587" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 22:31:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="765519047" X-IronPort-AV: E=Sophos;i="5.98,240,1673942400"; d="scan'208";a="765519047" Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 22:31:43 -0800 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Star Zeng , Mike Maslenkin Subject: [PATCH v2] UefiCpuPkg: Calculate DisplayFamily correctly Date: Tue, 7 Mar 2023 14:31:36 +0800 Message-Id: <20230307063136.1615-1-zhiguang.liu@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4348 Per SDM: DisplayFamily = Extended_Family_ID + Family_ID. DisplayModelID = (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. - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -217,12 +217,12 @@ CpuidVersionInfo ( DisplayFamily = Eax.Bits.FamilyId; if (Eax.Bits.FamilyId == 0x0F) { - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); + DisplayFamily += Eax.Bits.ExtendedFamilyId; } DisplayModel = Eax.Bits.Model; if ((Eax.Bits.FamilyId == 0x06) || (Eax.Bits.FamilyId == 0x0f)) { - DisplayModel |= (Eax.Bits.ExtendedModelId << 4); + DisplayModel += (Eax.Bits.ExtendedModelId << 4); } Print (L" Family = %x Model = %x Stepping = %x\n", DisplayFamily, DisplayModel, Eax.Bits.SteppingId); diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/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. - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
+ Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -67,12 +67,12 @@ FillProcessorInfo ( DisplayedFamily = Eax.Bits.FamilyId; if (Eax.Bits.FamilyId == 0x0F) { - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); + DisplayedFamily += Eax.Bits.ExtendedFamilyId; } DisplayedModel = Eax.Bits.Model; if ((Eax.Bits.FamilyId == 0x06) || (Eax.Bits.FamilyId == 0x0f)) { - DisplayedModel |= (Eax.Bits.ExtendedModelId << 4); + DisplayedModel += (Eax.Bits.ExtendedModelId << 4); } CpuInfo->DisplayFamily = DisplayedFamily; -- 2.31.1.windows.1