Re: [PATCH V3 2/2] perf/x86: Reset the dirty counter to prevent the leak for an RDPMC task

From: kernel test robot
Date: Tue Apr 13 2021 - 19:41:48 EST


Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tip/perf/core]
[also build test WARNING on tip/master linux/master linus/master v5.12-rc7 next-20210413]
[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/kan-liang-linux-intel-com/perf-x86-Move-cpuc-running-into-P4-specific-code/20210414-030649
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git cface0326a6c2ae5c8f47bd466f07624b3e348a7
config: x86_64-randconfig-a014-20210413 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9829f5e6b1bca9b61efc629770d28bb9014dec45)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/83f02393e1b5a2723294d8697f4fd5473d70602c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review kan-liang-linux-intel-com/perf-x86-Move-cpuc-running-into-P4-specific-code/20210414-030649
git checkout 83f02393e1b5a2723294d8697f4fd5473d70602c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> arch/x86/events/core.c:2309:6: warning: no previous prototype for function 'x86_pmu_clear_dirty_counters' [-Wmissing-prototypes]
void x86_pmu_clear_dirty_counters(void)
^
arch/x86/events/core.c:2309:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void x86_pmu_clear_dirty_counters(void)
^
static
1 warning generated.


vim +/x86_pmu_clear_dirty_counters +2309 arch/x86/events/core.c

2308
> 2309 void x86_pmu_clear_dirty_counters(void)
2310 {
2311 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
2312 int i;
2313
2314 if (bitmap_empty(cpuc->dirty, X86_PMC_IDX_MAX))
2315 return;
2316
2317 /* Don't need to clear the assigned counter. */
2318 for (i = 0; i < cpuc->n_events; i++)
2319 __clear_bit(cpuc->assign[i], cpuc->dirty);
2320
2321 for_each_set_bit(i, cpuc->dirty, X86_PMC_IDX_MAX) {
2322 /* Metrics and fake events don't have corresponding HW counters. */
2323 if (is_metric_idx(i) || (i == INTEL_PMC_IDX_FIXED_VLBR))
2324 continue;
2325 else if (i >= INTEL_PMC_IDX_FIXED)
2326 wrmsrl(MSR_ARCH_PERFMON_FIXED_CTR0 + (i - INTEL_PMC_IDX_FIXED), 0);
2327 else
2328 wrmsrl(x86_pmu_event_addr(i), 0);
2329 }
2330
2331 bitmap_zero(cpuc->dirty, X86_PMC_IDX_MAX);
2332 }
2333

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip