答复: [PATCH] [v4] KVM: X86: support APERF/MPERF registers

From: Li,Rongqing
Date: Thu May 07 2020 - 21:57:58 EST


> Hi Li,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on kvm/linux-next] [also build test WARNING on
> next-20200505] [cannot apply to tip/auto-latest linus/master linux/master
> v5.7-rc4] [if your patch is applied to the wrong git tree, please drop us a note to
> help improve the system. BTW, we also suggest to use '--base' option to specify
> the base tree in git format-patch, please see
> https://stackoverflow.com/a/37406982]
>
> url:
> https://github.com/0day-ci/linux/commits/Li-RongQing/KVM-X86-support-APE
> RF-MPERF-registers/20200507-023327
> base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
> config: x86_64-allmodconfig (attached as .config)
> compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@xxxxxxxxx>
>
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>
> All warnings (new ones prefixed by >>):
>
> arch/x86/kvm/x86.c: In function 'vcpu_enter_guest':
> >> arch/x86/kvm/x86.c:8219:13: warning: 'aperf' may be used
> >> uninitialized in this function [-Wmaybe-uninitialized]
> u64 mperf, aperf;
> ^~~~~
> >> arch/x86/kvm/x86.c:8219:6: warning: 'mperf' may be used uninitialized
> >> in this function [-Wmaybe-uninitialized]
> u64 mperf, aperf;
> ^~~~~

I think this is a FALSE warning, set and use mperf/aperf only if enable_aperfmperf is true


-Li