Skip to content

Commit 30fe774

Browse files
committed
Merge: perf: Sync with upstream v6.13
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/544 JIRA: https://issues.redhat.com/browse/RHEL-77935 The following patches will be included in the next perf update, omit them here: ``` Omitted-fix: 99deaf5 Author: Arnaldo Carvalho de Melo <acme@redhat.com> perf maps: Introduce map__set_kmap_maps() for kernel maps RH-Fixes: 187e626 ("perf tools: Fixup end address of modules") Omitted-fix: f7a46e0 Author: Namhyung Kim <namhyung@kernel.org> perf machine: Fixup kernel maps ends after adding extra maps RH-Fixes: 187e626 ("perf tools: Fixup end address of modules") Omitted-fix: 888751e Author: Thomas Richter <tmricht@linux.ibm.com> perf test: Fix Hwmon PMU test endianess issue RH-Fixes: 01c2ee3 ("perf test: Add hwmon "PMU" test") Omitted-fix: 7e442be Author: Likhitha Korrapati <likhitha@linux.ibm.com> perf tools: Fix is_compat_mode build break in ppc64 RH-Fixes: 091e779 ("tools/perf/powerpc/util: Add support to handle compatible mode PVR for perf json events") Omitted-fix: ee8aef2 Author: Kan Liang <kan.liang@linux.intel.com> perf tools: Add skip check in tool_pmu__event_to_str() RH-Fixes: aed1ef9 ("perf tool_pmu: Move expr literals to tool_pmu") Omitted-fix: 615ec00 Author: James Clark <james.clark@linaro.org> perf tests: Fix Tool PMU test segfault RH-Fixes: aed1ef9 ("perf tool_pmu: Move expr literals to tool_pmu") Omitted-fix: 72c6f57 Author: James Clark <james.clark@linaro.org> perf pmu: Dynamically allocate tool PMU RH-Fixes: 1caffd7 ("perf tool_pmu: Factor tool events into their own PMU") Omitted-fix: 431db90 Author: Thomas Richter <tmricht@linux.ibm.com> perf pmu: Handle memory failure in tool_pmu__new() RH-Fixes: 1caffd7 ("perf tool_pmu: Factor tool events into their own PMU") Omitted-fix: b74683b Author: Dapeng Mi <dapeng1.mi@linux.intel.com> perf x86/topdown: Fix topdown leader sampling test error on hybrid RH-Fixes: a9fe537 ("perf x86/topdown: Correct leader selection with sample_read enabled") Omitted-fix: 02ba09c Author: Veronika Molnarova <vmolnaro@redhat.com> perf test stat_all_pmu.sh: Correctly check 'perf stat' result RH-Fixes: 58065c1 ("perf test: Ignore security failures in all PMU test") Omitted-fix: ff99d5b Author: Vaibhav Jain <vaibhav@linux.ibm.com> powerpc/perf: Fix ref-counting on the PMU 'vpa_pmu' RH-Fixes: f44d93e ("powerpc/perf: Add perf interface to expose vpa counters") Omitted-fix: 7e512f5 Author: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com> perf/x86/rapl: Fix error handling in init_rapl_pmus() RH-Fixes: 2db4edf ("perf/x86/rapl: Move the pmu allocation out of CPU hotplug") Omitted-fix: 858c7bf Author: Anshuman Khandual <anshuman.khandual@arm.com> arm64/boot: Enable EL2 requirements for FEAT_PMUv3p9 RH-Fixes: 0a00179 ("perf/arm_pmuv3: Add PMUv3.9 per counter EL0 access control") ``` Signed-off-by: Michael Petlan <mpetlan@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: Jerome Marchand <jmarchan@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 2350450 + 1f6b3ab commit 30fe774

File tree

389 files changed

+10660
-4545
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

389 files changed

+10660
-4545
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
What: /sys/bus/event_source/devices/vpa_pmu/format
2+
Date: November 2024
3+
Contact: Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
4+
Description: Read-only. Attribute group to describe the magic bits
5+
that go into perf_event_attr.config for a particular pmu.
6+
(See ABI/testing/sysfs-bus-event_source-devices-format).
7+
8+
Each attribute under this group defines a bit range of the
9+
perf_event_attr.config. Supported attribute are listed
10+
below::
11+
12+
event = "config:0-31" - event ID
13+
14+
For example::
15+
16+
l1_to_l2_lat = "event=0x1"
17+
18+
What: /sys/bus/event_source/devices/vpa_pmu/events
19+
Date: November 2024
20+
Contact: Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
21+
Description: Read-only. Attribute group to describe performance monitoring
22+
events for the Virtual Processor Area events. Each attribute
23+
in this group describes a single performance monitoring event
24+
supported by vpa_pmu. The name of the file is the name of
25+
the event (See ABI/testing/sysfs-bus-event_source-devices-events).

arch/arm/include/asm/arm_pmuv3.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ static inline void write_pmuserenr(u32 val)
212212
write_sysreg(val, PMUSERENR);
213213
}
214214

215+
static inline void write_pmuacr(u64 val) {}
216+
215217
static inline void kvm_set_pmu_events(u32 set, struct perf_event_attr *attr) {}
216218
static inline void kvm_clr_pmu_events(u32 clr) {}
217219
static inline bool kvm_pmu_counter_deferred(struct perf_event_attr *attr)
@@ -231,6 +233,7 @@ static inline void kvm_vcpu_pmu_resync_el0(void) {}
231233
#define ARMV8_PMU_DFR_VER_V3P1 0x4
232234
#define ARMV8_PMU_DFR_VER_V3P4 0x5
233235
#define ARMV8_PMU_DFR_VER_V3P5 0x6
236+
#define ARMV8_PMU_DFR_VER_V3P9 0x9
234237
#define ARMV8_PMU_DFR_VER_IMP_DEF 0xF
235238

236239
static inline bool pmuv3_implemented(int pmuver)
@@ -249,6 +252,11 @@ static inline bool is_pmuv3p5(int pmuver)
249252
return pmuver >= ARMV8_PMU_DFR_VER_V3P5;
250253
}
251254

255+
static inline bool is_pmuv3p9(int pmuver)
256+
{
257+
return pmuver >= ARMV8_PMU_DFR_VER_V3P9;
258+
}
259+
252260
static inline u64 read_pmceid0(void)
253261
{
254262
u64 val = read_sysreg(PMCEID0);

arch/arm/include/asm/perf_event.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
#ifndef __ARM_PERF_EVENT_H__
99
#define __ARM_PERF_EVENT_H__
1010

11-
#ifdef CONFIG_PERF_EVENTS
12-
struct pt_regs;
13-
extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
14-
extern unsigned long perf_misc_flags(struct pt_regs *regs);
15-
#define perf_misc_flags(regs) perf_misc_flags(regs)
16-
#endif
17-
1811
#define perf_arch_fetch_caller_regs(regs, __ip) { \
1912
(regs)->ARM_pc = (__ip); \
2013
frame_pointer((regs)) = (unsigned long) __builtin_frame_address(0); \

arch/arm/kernel/perf_callchain.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,3 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re
9696
arm_get_current_stackframe(regs, &fr);
9797
walk_stackframe(&fr, callchain_trace, entry);
9898
}
99-
100-
unsigned long perf_instruction_pointer(struct pt_regs *regs)
101-
{
102-
return instruction_pointer(regs);
103-
}
104-
105-
unsigned long perf_misc_flags(struct pt_regs *regs)
106-
{
107-
int misc = 0;
108-
109-
if (user_mode(regs))
110-
misc |= PERF_RECORD_MISC_USER;
111-
else
112-
misc |= PERF_RECORD_MISC_KERNEL;
113-
114-
return misc;
115-
}

arch/arm64/include/asm/arm_pmuv3.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ static inline void write_pmuserenr(u32 val)
152152
write_sysreg(val, pmuserenr_el0);
153153
}
154154

155+
static inline void write_pmuacr(u64 val)
156+
{
157+
write_sysreg_s(val, SYS_PMUACR_EL1);
158+
}
159+
155160
static inline u64 read_pmceid0(void)
156161
{
157162
return read_sysreg(pmceid0_el0);
@@ -178,4 +183,9 @@ static inline bool is_pmuv3p5(int pmuver)
178183
return pmuver >= ID_AA64DFR0_EL1_PMUVer_V3P5;
179184
}
180185

186+
static inline bool is_pmuv3p9(int pmuver)
187+
{
188+
return pmuver >= ID_AA64DFR0_EL1_PMUVer_V3P9;
189+
}
190+
181191
#endif

arch/arm64/include/asm/perf_event.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
#include <asm/ptrace.h>
1111

1212
#ifdef CONFIG_PERF_EVENTS
13-
struct pt_regs;
14-
extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
15-
extern unsigned long perf_misc_flags(struct pt_regs *regs);
16-
#define perf_misc_flags(regs) perf_misc_flags(regs)
1713
#define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs
1814
#endif
1915

arch/arm64/kernel/perf_callchain.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,3 @@ void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
3838

3939
arch_stack_walk(callchain_trace, entry, current, regs);
4040
}
41-
42-
unsigned long perf_instruction_pointer(struct pt_regs *regs)
43-
{
44-
if (perf_guest_state())
45-
return perf_guest_get_ip();
46-
47-
return instruction_pointer(regs);
48-
}
49-
50-
unsigned long perf_misc_flags(struct pt_regs *regs)
51-
{
52-
unsigned int guest_state = perf_guest_state();
53-
int misc = 0;
54-
55-
if (guest_state) {
56-
if (guest_state & PERF_GUEST_USER)
57-
misc |= PERF_RECORD_MISC_GUEST_USER;
58-
else
59-
misc |= PERF_RECORD_MISC_GUEST_KERNEL;
60-
} else {
61-
if (user_mode(regs))
62-
misc |= PERF_RECORD_MISC_USER;
63-
else
64-
misc |= PERF_RECORD_MISC_KERNEL;
65-
}
66-
67-
return misc;
68-
}

arch/arm64/tools/sysreg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,13 @@ Field 4 P
22302230
Field 3:0 ALIGN
22312231
EndSysreg
22322232

2233+
Sysreg PMUACR_EL1 3 0 9 14 4
2234+
Res0 63:33
2235+
Field 32 F0
2236+
Field 31 C
2237+
Field 30:0 P
2238+
EndSysreg
2239+
22332240
Sysreg PMSELR_EL0 3 3 9 12 5
22342241
Res0 63:5
22352242
Field 4:0 SEL

arch/powerpc/include/asm/kvm_book3s_64.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,12 @@ int kmvhv_counters_tracepoint_regfunc(void);
688688
void kmvhv_counters_tracepoint_unregfunc(void);
689689
int kvmhv_get_l2_counters_status(void);
690690
void kvmhv_set_l2_counters_status(int cpu, bool status);
691+
u64 kvmhv_get_l1_to_l2_cs_time(void);
692+
u64 kvmhv_get_l2_to_l1_cs_time(void);
693+
u64 kvmhv_get_l2_runtime_agg(void);
694+
u64 kvmhv_get_l1_to_l2_cs_time_vcpu(void);
695+
u64 kvmhv_get_l2_to_l1_cs_time_vcpu(void);
696+
u64 kvmhv_get_l2_runtime_agg_vcpu(void);
691697

692698
#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
693699

arch/powerpc/include/asm/kvm_host.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,11 @@ struct kvm_vcpu_arch {
871871
struct kvmhv_tb_accumulator cede_time; /* time napping inside guest */
872872
#endif
873873
#endif /* CONFIG_KVM_BOOK3S_HV_EXIT_TIMING */
874+
#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
875+
u64 l1_to_l2_cs;
876+
u64 l2_to_l1_cs;
877+
u64 l2_runtime_agg;
878+
#endif
874879
};
875880

876881
#define VCPU_FPR(vcpu, i) (vcpu)->arch.fp.fpr[i][TS_FPROFFSET]

0 commit comments

Comments
 (0)