Message ID | 20220221115201.22208-10-likexu@tencent.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: x86/pmu: Get rid of PERF_TYPE_HARDWAR and other minor fixes | expand |
Hi Like, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on kvm/master] [also build test WARNING on linus/master v5.17-rc5 next-20220217] [cannot apply to tip/perf/core mst-vhost/linux-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Like-Xu/KVM-x86-pmu-Get-rid-of-PERF_TYPE_HARDWAR-and-other-minor-fixes/20220221-195359 base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git master config: x86_64-randconfig-c007-20220221 (https://download.01.org/0day-ci/archive/20220222/202202220414.dzxjtMiF-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/29bdfb8b85a85f36e3fca739146845d7050a372d git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Like-Xu/KVM-x86-pmu-Get-rid-of-PERF_TYPE_HARDWAR-and-other-minor-fixes/20220221-195359 git checkout 29bdfb8b85a85f36e3fca739146845d7050a372d # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/kvm/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): >> arch/x86/kvm/pmu.c:471:66: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] return !((pmc->eventsel ^ perf_get_hw_event_config(perf_hw_id)) && ^ arch/x86/kvm/pmu.c:471:66: note: use '&' for a bitwise operation return !((pmc->eventsel ^ perf_get_hw_event_config(perf_hw_id)) && ^~ & arch/x86/kvm/pmu.c:471:66: note: remove constant to silence this warning return !((pmc->eventsel ^ perf_get_hw_event_config(perf_hw_id)) && ~^~ 1 warning generated. vim +471 arch/x86/kvm/pmu.c 467 468 static inline bool eventsel_match_perf_hw_id(struct kvm_pmc *pmc, 469 unsigned int perf_hw_id) 470 { > 471 return !((pmc->eventsel ^ perf_get_hw_event_config(perf_hw_id)) && 472 AMD64_RAW_EVENT_MASK_NB); 473 } 474 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index edd51ec7711d..a6bfcbd3412d 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -468,13 +468,8 @@ static void kvm_pmu_incr_counter(struct kvm_pmc *pmc) static inline bool eventsel_match_perf_hw_id(struct kvm_pmc *pmc, unsigned int perf_hw_id) { - u64 old_eventsel = pmc->eventsel; - unsigned int config; - - pmc->eventsel &= (ARCH_PERFMON_EVENTSEL_EVENT | ARCH_PERFMON_EVENTSEL_UMASK); - config = kvm_x86_ops.pmu_ops->pmc_perf_hw_id(pmc); - pmc->eventsel = old_eventsel; - return config == perf_hw_id; + return !((pmc->eventsel ^ perf_get_hw_event_config(perf_hw_id)) && + AMD64_RAW_EVENT_MASK_NB); } static inline bool cpl_is_matched(struct kvm_pmc *pmc)