From nobody Mon Apr 29 18:07:01 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1499744045464208.4641518005676; Mon, 10 Jul 2017 20:34:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 931FE21D147B2; Mon, 10 Jul 2017 20:32:18 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 689EB21D147AD for ; Mon, 10 Jul 2017 20:32:17 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2017 20:34:02 -0700 Received: from shwde7172.ccr.corp.intel.com ([10.239.9.14]) by FMSMGA003.fm.intel.com with ESMTP; 10 Jul 2017 20:34:01 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,344,1496127600"; d="scan'208";a="877437701" From: Liming Gao To: edk2-devel@lists.01.org Date: Tue, 11 Jul 2017 11:33:58 +0800 Message-Id: <1499744038-13992-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [edk2] [Patch] UefiCpuPkg: Update RegisterCpuFeaturesLib to consume PcdGetSize with UINTN X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" PcdGetSize() returns UINTN data type. The consumer code should use UINTN da= ta to get its size. This issue is found when PcdCpuFeaturesSupport is configured as patchable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao Reviewed-by: Jeff Fan --- UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 2 +- .../Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c | 8 ++++= ---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitializ= e.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c index 5e11b2b..e305aca 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -149,7 +149,7 @@ CpuInitDataInitialize ( CpuFeaturesData =3D GetCpuFeaturesData (); CpuFeaturesData->InitOrder =3D AllocateZeroPool (sizeof (CPU_FEATURES_IN= IT_ORDER) * NumberOfCpus); ASSERT (CpuFeaturesData->InitOrder !=3D NULL); - CpuFeaturesData->BitMaskSize =3D PcdGetSize (PcdCpuFeaturesSupport); + CpuFeaturesData->BitMaskSize =3D (UINT32) PcdGetSize (PcdCpuFeaturesSupp= ort); =20 // // Collect CPU Features information diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesL= ib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c index 338f1a4..dd6a82b 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c @@ -29,7 +29,7 @@ IsCpuFeatureMatch ( IN UINT8 *SecondFeatureMask ) { - UINT32 BitMaskSize; + UINTN BitMaskSize; =20 BitMaskSize =3D PcdGetSize (PcdCpuFeaturesSupport); if (CompareMem (FirstFeatureMask, SecondFeatureMask, BitMaskSize) =3D=3D= 0) { @@ -51,7 +51,7 @@ DumpCpuFeatureMask ( { UINTN Index; UINT8 *Data8; - UINT32 BitMaskSize; + UINTN BitMaskSize; =20 BitMaskSize =3D PcdGetSize (PcdCpuFeaturesSupport); Data8 =3D (UINT8 *) FeatureMask; @@ -258,7 +258,7 @@ RegisterCpuFeatureWorker ( CPU_FEATURES_DATA *CpuFeaturesData; CPU_FEATURES_ENTRY *CpuFeatureEntry; LIST_ENTRY *Entry; - UINT32 BitMaskSize; + UINTN BitMaskSize; BOOLEAN FeatureExist; =20 BitMaskSize =3D PcdGetSize (PcdCpuFeaturesSupport); @@ -267,7 +267,7 @@ RegisterCpuFeatureWorker ( InitializeListHead (&CpuFeaturesData->FeatureList); InitializeSpinLock (&CpuFeaturesData->MsrLock); InitializeSpinLock (&CpuFeaturesData->MemoryMappedLock); - CpuFeaturesData->BitMaskSize =3D BitMaskSize; + CpuFeaturesData->BitMaskSize =3D (UINT32) BitMaskSize; } ASSERT (CpuFeaturesData->BitMaskSize =3D=3D BitMaskSize); =20 --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel