From nobody Sun Apr 28 08:22:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+53701+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+53701+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1580799444249555.6931398723032; Mon, 3 Feb 2020 22:57:24 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Fp3nYY1788612xcbW7i84C1h; Mon, 03 Feb 2020 22:57:23 -0800 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.2941.1580799442687627963 for ; Mon, 03 Feb 2020 22:57:23 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2020 22:57:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,398,1574150400"; d="scan'208";a="225402852" X-Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.81]) by fmsmga008.fm.intel.com with ESMTP; 03 Feb 2020 22:57:19 -0800 From: "Zeng, Star" To: devel@edk2.groups.io Cc: Star Zeng , Eric Dong , Ray Ni , Laszlo Ersek Subject: [edk2-devel] [PATCH] UefiCpuPkg RegisterCpuFeaturesLib: Match data type and format specifier Date: Tue, 4 Feb 2020 14:57:17 +0800 Message-Id: <20200204065717.42980-1-star.zeng@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,star.zeng@intel.com X-Gm-Message-State: bWNpdWtvSSlC9doYoBwRokAVx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1580799443; bh=BnYmVZ1Q1vsswNOdvu4rP7FqxCgqGbvu+uUOOgWKMVY=; h=Cc:Date:From:Reply-To:Subject:To; b=Hc/6dVlRMb5LditlirBRpSIjyDKU1HjveI2onn9HaJzaqc1BxiyB3j7qvxsTB99HT3V cwoi3a16Aj/xIT2mtuEmdh3bXrpQzKBGYlUi3htU61iqwS5uecik/O+TvRgDPHQ+v+Loz NpRyQ0MeyBm9sKm/WuqsTcdEi1l7k4r/fiw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Match data type and format specifier for printing. 1. Type cast ProcessorNumber and FeatureIndex to UINT32 as %d only expects a UINT32. 2. Use %08x instead of %08lx for CacheControl to print Index as it is UINT32 type. 3. Use %016lx instead of %08lx for MemoryMapped to print (Index | LShiftU64 (HighIndex, 32)) as it is UINT64 type. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Star Zeng --- Notes: v2: Address Laszlo's feedback in v1 at https://edk2.groups.io/g/devel/m= essage/53663. .../CpuFeaturesInitialize.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitializ= e.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c index 0a4fcff033a3..fc96fb4372cf 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -430,8 +430,8 @@ DumpRegisterTableOnProcessor ( DEBUG (( DebugPrintErrorLevel, "Processor: %04d: Index %04d, MSR : %08x, Bit Start: %02d, Bit Le= ngth: %02d, Value: %016lx\r\n", - ProcessorNumber, - FeatureIndex, + (UINT32) ProcessorNumber, + (UINT32) FeatureIndex, RegisterTableEntry->Index, RegisterTableEntry->ValidBitStart, RegisterTableEntry->ValidBitLength, @@ -442,8 +442,8 @@ DumpRegisterTableOnProcessor ( DEBUG (( DebugPrintErrorLevel, "Processor: %04d: Index %04d, CR : %08x, Bit Start: %02d, Bit Le= ngth: %02d, Value: %016lx\r\n", - ProcessorNumber, - FeatureIndex, + (UINT32) ProcessorNumber, + (UINT32) FeatureIndex, RegisterTableEntry->Index, RegisterTableEntry->ValidBitStart, RegisterTableEntry->ValidBitLength, @@ -453,9 +453,9 @@ DumpRegisterTableOnProcessor ( case MemoryMapped: DEBUG (( DebugPrintErrorLevel, - "Processor: %04d: Index %04d, MMIO : %08lx, Bit Start: %02d, Bit L= ength: %02d, Value: %016lx\r\n", - ProcessorNumber, - FeatureIndex, + "Processor: %04d: Index %04d, MMIO : %016lx, Bit Start: %02d, Bit = Length: %02d, Value: %016lx\r\n", + (UINT32) ProcessorNumber, + (UINT32) FeatureIndex, RegisterTableEntry->Index | LShiftU64 (RegisterTableEntry->HighInd= ex, 32), RegisterTableEntry->ValidBitStart, RegisterTableEntry->ValidBitLength, @@ -465,9 +465,9 @@ DumpRegisterTableOnProcessor ( case CacheControl: DEBUG (( DebugPrintErrorLevel, - "Processor: %04d: Index %04d, CACHE: %08lx, Bit Start: %02d, Bit L= ength: %02d, Value: %016lx\r\n", - ProcessorNumber, - FeatureIndex, + "Processor: %04d: Index %04d, CACHE: %08x, Bit Start: %02d, Bit Le= ngth: %02d, Value: %016lx\r\n", + (UINT32) ProcessorNumber, + (UINT32) FeatureIndex, RegisterTableEntry->Index, RegisterTableEntry->ValidBitStart, RegisterTableEntry->ValidBitLength, @@ -478,8 +478,8 @@ DumpRegisterTableOnProcessor ( DEBUG (( DebugPrintErrorLevel, "Processor: %04d: Index %04d, SEMAP: %s\r\n", - ProcessorNumber, - FeatureIndex, + (UINT32) ProcessorNumber, + (UINT32) FeatureIndex, mDependTypeStr[MIN ((UINT32)RegisterTableEntry->Value, InvalidDepT= ype)] )); break; --=20 2.21.0.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 (#53701): https://edk2.groups.io/g/devel/message/53701 Mute This Topic: https://groups.io/mt/70967821/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-