Hi Liming, This is a minor change and has been reviewed by Laszlo and Eric. It will be better if it can be caught by 202002 stable tag. You or Eric may help submit it.
Thanks, Star > -----Original Message----- > From: Dong, Eric <[email protected]> > Sent: Wednesday, February 5, 2020 10:43 AM > To: [email protected]; Zeng, Star <[email protected]> > Cc: Ni, Ray <[email protected]>; Laszlo Ersek <[email protected]> > Subject: RE: [edk2-devel] [PATCH V2] UefiCpuPkg RegisterCpuFeaturesLib: > Match data type and format specifier > > Reviewed-by: Eric Dong <[email protected]> > > -----Original Message----- > From: [email protected] <[email protected]> On Behalf Of Zeng, > Star > Sent: Tuesday, February 4, 2020 3:02 PM > To: [email protected] > Cc: Zeng, Star <[email protected]>; Dong, Eric <[email protected]>; Ni, > Ray <[email protected]>; Laszlo Ersek <[email protected]> > Subject: [edk2-devel] [PATCH V2] UefiCpuPkg RegisterCpuFeaturesLib: > Match data type and format specifier > > 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 <[email protected]> > Cc: Ray Ni <[email protected]> > Cc: Laszlo Ersek <[email protected]> > Signed-off-by: Star Zeng <[email protected]> > --- > .../CpuFeaturesInitialize.c | 24 +++++++++---------- > 1 file changed, 12 insertions(+), 12 deletions(-) > > 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, Bit > 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, Bit > 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 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#54566): https://edk2.groups.io/g/devel/message/54566 Mute This Topic: https://groups.io/mt/70967864/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
