lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <5f198292-247a-e3bd-f3b2-0052d318fc20@intel.com>
Date:   Wed, 13 Apr 2022 16:43:38 +0800
From:   kernel test robot <yujie.liu@...el.com>
To:     Stephane Eranian <eranian@...gle.com>
CC:     <llvm@...ts.linux.dev>, <kbuild-all@...ts.01.org>,
        "Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
        x86 <x86@...nel.org>
Subject: [tip:perf/core 3/10] arch/x86/events/amd/core.c:722:3: warning: Value
 stored to 'hwc' is never read [clang-analyzer-deadcode.DeadStores]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core
head:   7bebfe9dd802b80abff5a43e00ab68d98893a22c
commit: ada543459cab7f653dcacdaba4011a8bb19c627c [3/10] perf/x86/amd: Add AMD Fam19h Branch Sampling support
config: x86_64-randconfig-c007 (https://download.01.org/0day-ci/archive/20220411/202204110431.SBvb4g5G-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c29a51b3a257908aebc01cd7c4655665db317d66)
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://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=ada543459cab7f653dcacdaba4011a8bb19c627c
         git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
         git fetch --no-tags tip perf/core
         git checkout ada543459cab7f653dcacdaba4011a8bb19c627c
         # save the config file to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <yujie.liu@...el.com>


clang-analyzer warnings: (new ones prefixed by >>)

 >> arch/x86/events/amd/core.c:722:3: warning: Value stored to 'hwc' is never read [clang-analyzer-deadcode.DeadStores]
                    hwc = &cpuc->events[idx]->hw;
                    ^     ~~~~~~~~~~~~~~~~~~~~~~

vim +/hwc +722 arch/x86/events/amd/core.c

ada543459cab7f Stephane Eranian 2022-03-22  712
ada543459cab7f Stephane Eranian 2022-03-22  713  static void amd_pmu_enable_all(int added)
ada543459cab7f Stephane Eranian 2022-03-22  714  {
ada543459cab7f Stephane Eranian 2022-03-22  715  	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
ada543459cab7f Stephane Eranian 2022-03-22  716  	struct hw_perf_event *hwc;
ada543459cab7f Stephane Eranian 2022-03-22  717  	int idx;
ada543459cab7f Stephane Eranian 2022-03-22  718
ada543459cab7f Stephane Eranian 2022-03-22  719  	amd_brs_enable_all();
ada543459cab7f Stephane Eranian 2022-03-22  720
ada543459cab7f Stephane Eranian 2022-03-22  721  	for (idx = 0; idx < x86_pmu.num_counters; idx++) {
ada543459cab7f Stephane Eranian 2022-03-22 @722  		hwc = &cpuc->events[idx]->hw;
ada543459cab7f Stephane Eranian 2022-03-22  723
ada543459cab7f Stephane Eranian 2022-03-22  724  		/* only activate events which are marked as active */
ada543459cab7f Stephane Eranian 2022-03-22  725  		if (!test_bit(idx, cpuc->active_mask))
ada543459cab7f Stephane Eranian 2022-03-22  726  			continue;
ada543459cab7f Stephane Eranian 2022-03-22  727
ada543459cab7f Stephane Eranian 2022-03-22  728  		amd_pmu_enable_event(cpuc->events[idx]);
ada543459cab7f Stephane Eranian 2022-03-22  729  	}
ada543459cab7f Stephane Eranian 2022-03-22  730  }
ada543459cab7f Stephane Eranian 2022-03-22  731

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ