From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.2888.1580799842650516190 for ; Mon, 03 Feb 2020 23:04:02 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: star.zeng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2020 23:04:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,398,1574150400"; d="scan'208";a="429701954" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 03 Feb 2020 23:04:02 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 3 Feb 2020 23:04:02 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.126]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.141]) with mapi id 14.03.0439.000; Tue, 4 Feb 2020 15:03:39 +0800 From: "Zeng, Star" To: "devel@edk2.groups.io" , "Zeng, Star" CC: "Dong, Eric" , "Ni, Ray" , "Laszlo Ersek" Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg RegisterCpuFeaturesLib: Match data type and format specifier Thread-Topic: [edk2-devel] [PATCH] UefiCpuPkg RegisterCpuFeaturesLib: Match data type and format specifier Thread-Index: AQHV2yhfzeuOzp+TpUyHMx4tKQ/Kd6gKnB6Q Date: Tue, 4 Feb 2020 07:03:39 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB04831040538E09@shsmsx102.ccr.corp.intel.com> References: <15F020B7DFF40F56.10001@groups.io> In-Reply-To: <15F020B7DFF40F56.10001@groups.io> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDVlMzEzYzQtZTE4ZS00N2MxLWFhMmUtNDEwNGZiNGJjNDU0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMlBNMCtMRmx3cnhnQ1pqd2FmUWljaGRUSVRcL2xlUXhRaEJubTRXaEJQOWxMZ1VGd0FtRnBEZWtqSDlYcnRmMkEifQ== dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: star.zeng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sorry, the title is incorrect. Please see the thread with title " [PATCH V2= ] UefiCpuPkg RegisterCpuFeaturesLib: Match data type and format specifier" > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Zeng, > Star > Sent: Tuesday, February 4, 2020 2:57 PM > To: devel@edk2.groups.io > Cc: Zeng, Star ; Dong, Eric ; = Ni, > Ray ; Laszlo Ersek > Subject: [edk2-devel] [PATCH] UefiCpuPkg RegisterCpuFeaturesLib: Match > data type and format specifier >=20 > 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. >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Signed-off-by: Star Zeng > --- >=20 > Notes: > v2: Address Laszlo's feedback in v1 at > https://edk2.groups.io/g/devel/message/53663. >=20 > .../CpuFeaturesInitialize.c | 24 +++++++++---------- > 1 file changed, 12 insertions(+), 12 deletions(-) >=20 > diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.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 > Length: %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 > Length: %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, Bi= t > Length: %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->HighIndex, 32), > RegisterTableEntry->ValidBitStart, > RegisterTableEntry->ValidBitLength, > @@ -465,9 +465,9 @@ DumpRegisterTableOnProcessor ( > case CacheControl: > DEBUG (( > DebugPrintErrorLevel, > - "Processor: %04d: Index %04d, CACHE: %08lx, Bit Start: %02d, Bi= t > Length: %02d, Value: %016lx\r\n", > - ProcessorNumber, > - FeatureIndex, > + "Processor: %04d: Index %04d, CACHE: %08x, Bit Start: %02d, Bit > Length: %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, > InvalidDepType)] > )); > break; > -- > 2.21.0.windows.1 >=20 >=20 >=20