Re: [PATCH] x86/perf: Add hardware performance events support for Zhaoxin CPU.

From: CodyYao-oc
Date: Thu Apr 16 2020 - 02:16:46 EST


On 2020/4/15 äå5:36, Borislav Petkov wrote:
On Mon, Apr 13, 2020 at 11:14:29AM +0800, CodyYao-oc wrote:
Zhaoxin CPU has provided facilities for monitoring performance
via PMU(Performance Monitor Unit), but the functionality is unused so far.
Therefore, add support for zhaoxin pmu to make performance related
hardware events available.

Signed-off-by: CodyYao-oc <CodyYao-oc@xxxxxxxxxxx>
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

What exactly did the 0day bot report?

Put that in []

above the Reported-by line pls.


Dear Boris,

It's a warning message about uninitialized variable, paste the log below, sorry for missing it.

Furthermore, it will disappear on next version patch because of the code changes, anyway I'll paste it when resend next version patch.

[All warnings (new ones prefixed by >>):

>> arch/x86/events/zhaoxin/core.c:362:6: warning: variable 'is_zxc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (boot_cpu_data.x86 == 0x06 &&
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/events/zhaoxin/core.c:369:6: note: uninitialized use occurs here
if (is_zxc)
^~~~~~
arch/x86/events/zhaoxin/core.c:362:2: note: remove the 'if' if its condition is always true
if (boot_cpu_data.x86 == 0x06 &&
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/events/zhaoxin/core.c:362:6: warning: variable 'is_zxc' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
if (boot_cpu_data.x86 == 0x06 &&
^~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/events/zhaoxin/core.c:369:6: note: uninitialized use occurs here
if (is_zxc)
^~~~~~
arch/x86/events/zhaoxin/core.c:362:6: note: remove the '&&' if its condition is always true
if (boot_cpu_data.x86 == 0x06 &&
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/events/zhaoxin/core.c:352:13: note: initialize the variable 'is_zxc' to silence this warning
bool is_zxc;
^
= 0
2 warnings generated.]

Reported-by:kbuild test robot<lkp@xxxxxxxxx>

Thanks
Cody