tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: e64d5ad244c9a8a62e31ee8e6e2e02e01226aa4d commit: 6c6848e7e00cdff4e22650bd2d5658a9e5c23b1d [1532/1532] drivers: perf: arm_pmuv3: Enable branch stack sampling via FEAT_BRBE config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20241128/202411280328.NxDLQwcX-lkp@i...) compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241128/202411280328.NxDLQwcX-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202411280328.NxDLQwcX-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/perf/arm_pmuv3.c:17: In file included from include/linux/acpi.h:37: In file included from include/acpi/acpi_io.h:7: In file included from arch/arm64/include/asm/acpi.h:14: In file included from include/linux/memblock.h:12: In file included from include/linux/mm.h:2243: include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 509 | item]; | ~~~~ include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 516 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 528 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 537 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~
drivers/perf/arm_pmuv3.c:902:20: warning: stack frame size (2112) exceeds limit (2048) in 'armv8pmu_handle_irq' [-Wframe-larger-than]
902 | static irqreturn_t armv8pmu_handle_irq(struct arm_pmu *cpu_pmu) | ^ 6 warnings generated.
vim +/armv8pmu_handle_irq +902 drivers/perf/arm_pmuv3.c
6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 901 0788f1e97324d83 arch/arm64/kernel/perf_event.c Mark Rutland 2018-05-10 @902 static irqreturn_t armv8pmu_handle_irq(struct arm_pmu *cpu_pmu) 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 903 { 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 904 u32 pmovsr; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 905 struct perf_sample_data data; 6475b2d846176e3 arch/arm64/kernel/perf_event.c Mark Rutland 2015-10-02 906 struct pmu_hw_events *cpuc = this_cpu_ptr(cpu_pmu->hw_events); 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 907 struct pt_regs *regs; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 908 int idx; 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 909 bool branch_captured = false; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 910 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 911 /* 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 912 * Get and reset the IRQ flags 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 913 */ 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 914 pmovsr = armv8pmu_getreset_flags(); 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 915 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 916 /* 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 917 * Did an overflow occur? 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 918 */ 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 919 if (!armv8pmu_has_overflowed(pmovsr)) 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 920 return IRQ_NONE; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 921 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 922 /* 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 923 * Handle the counter(s) overflow(s) 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 924 */ 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 925 regs = get_irq_regs(); 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 926 3cce50dfec4a5b0 arch/arm64/kernel/perf_event.c Suzuki K Poulose 2018-07-10 927 /* 3cce50dfec4a5b0 arch/arm64/kernel/perf_event.c Suzuki K Poulose 2018-07-10 928 * Stop the PMU while processing the counter overflows 3cce50dfec4a5b0 arch/arm64/kernel/perf_event.c Suzuki K Poulose 2018-07-10 929 * to prevent skews in group events. 3cce50dfec4a5b0 arch/arm64/kernel/perf_event.c Suzuki K Poulose 2018-07-10 930 */ 3cce50dfec4a5b0 arch/arm64/kernel/perf_event.c Suzuki K Poulose 2018-07-10 931 armv8pmu_stop(cpu_pmu); 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 932 for (idx = 0; idx < cpu_pmu->num_events; ++idx) { 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 933 struct perf_event *event = cpuc->events[idx]; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 934 struct hw_perf_event *hwc; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 935 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 936 /* Ignore if we don't have an event. */ 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 937 if (!event) 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 938 continue; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 939 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 940 /* 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 941 * We have a single interrupt for all counters. Check that 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 942 * each counter has overflowed before we process it. 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 943 */ 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 944 if (!armv8pmu_counter_has_overflowed(pmovsr, idx)) 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 945 continue; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 946 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 947 hwc = &event->hw; 6475b2d846176e3 arch/arm64/kernel/perf_event.c Mark Rutland 2015-10-02 948 armpmu_event_update(event); 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 949 perf_sample_data_init(&data, 0, hwc->last_period); 6475b2d846176e3 arch/arm64/kernel/perf_event.c Mark Rutland 2015-10-02 950 if (!armpmu_event_set_period(event)) 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 951 continue; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 952 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 953 /* 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 954 * PMU IRQ should remain asserted until all branch records 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 955 * are captured and processed into struct perf_sample_data. 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 956 */ 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 957 if (has_branch_stack(event) && cpu_pmu->has_branch_stack) 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 958 read_branch_records(cpuc, event, &data, &branch_captured); 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 959 05ab72813340d11 arch/arm64/kernel/perf_event.c Julien Thierry 2020-09-24 960 /* 05ab72813340d11 arch/arm64/kernel/perf_event.c Julien Thierry 2020-09-24 961 * Perf event overflow will queue the processing of the event as 05ab72813340d11 arch/arm64/kernel/perf_event.c Julien Thierry 2020-09-24 962 * an irq_work which will be taken care of in the handling of 05ab72813340d11 arch/arm64/kernel/perf_event.c Julien Thierry 2020-09-24 963 * IPI_IRQ_WORK. 05ab72813340d11 arch/arm64/kernel/perf_event.c Julien Thierry 2020-09-24 964 */ 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 965 if (perf_event_overflow(event, &data, regs)) 6475b2d846176e3 arch/arm64/kernel/perf_event.c Mark Rutland 2015-10-02 966 cpu_pmu->disable(event); 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 967 } 3cce50dfec4a5b0 arch/arm64/kernel/perf_event.c Suzuki K Poulose 2018-07-10 968 armv8pmu_start(cpu_pmu); 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 969 if (cpu_pmu->has_branch_stack) 6c6848e7e00cdff drivers/perf/arm_pmuv3.c Anshuman Khandual 2024-06-13 970 armv8pmu_branch_stack_reset(); 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 971 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 972 return IRQ_HANDLED; 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 973 } 030896885ade0a1 arch/arm64/kernel/perf_event.c Will Deacon 2012-03-05 974
:::::: The code at line 902 was first introduced by commit :::::: 0788f1e97324d8378e860dc2560699ddc6f3aef9 arm_pmu: simplify arm_pmu::handle_irq
:::::: TO: Mark Rutland mark.rutland@arm.com :::::: CC: Will Deacon will.deacon@arm.com