History

Merge branch 'kvm-arm64/kill_oprofile_dependency' into kvmarm-master/next

Marc Zyngier committed 5 years ago

Commit 9a8aae62 parents 4085ae8 7f318848 files · +6 −84Browse files

Unified · Split

8 files
  1. arch/arm64/kvm/perf.c +1 −7
  2. arch/arm64/kvm/pmu-emul.c +1 −1
  3. arch/s390/kernel/perf_event.c +0 −21
  4. arch/sh/kernel/perf_event.c +0 −18
  5. drivers/perf/arm_pmu.c +0 −30
  6. include/kvm/arm_pmu.h +4 −0
  7. include/linux/perf_event.h +0 −2
  8. kernel/events/core.c +0 −5
arch/arm64/kvm/perf.c+1−7
@@ -50,13 +50,7 @@ static struct perf_guest_info_callbacks kvm_guest_cbs = { · 49 unmodified lines
50 50
51int kvm_perf_init(void)51int kvm_perf_init(void)
52{52{
53 /*53 if (kvm_pmu_probe_pmuver() != 0xf && !is_protected_kvm_enabled())
54 * Check if HW_PERF_EVENTS are supported by checking the number of
55 * hardware performance counters. This could ensure the presence of
56 * a physical PMU and CONFIG_PERF_EVENT is selected.
57 */
58 if (IS_ENABLED(CONFIG_ARM_PMU) && perf_num_counters() > 0
59 && !is_protected_kvm_enabled())
60 static_branch_enable(&kvm_arm_pmu_available);54 static_branch_enable(&kvm_arm_pmu_available);
61 55
62 return perf_register_guest_info_callbacks(&kvm_guest_cbs);56 return perf_register_guest_info_callbacks(&kvm_guest_cbs);
arch/arm64/kvm/pmu-emul.c+1−1
@@ -739,7 +739,7 @@ void kvm_pmu_set_counter_event_type(struct kvm_vcpu *vcpu, u64 data, · 738 unmodified lines
739 kvm_pmu_create_perf_event(vcpu, select_idx);739 kvm_pmu_create_perf_event(vcpu, select_idx);
740}740}
741 741
742static int kvm_pmu_probe_pmuver(void)742int kvm_pmu_probe_pmuver(void)
743{743{
744 struct perf_event_attr attr = { };744 struct perf_event_attr attr = { };
745 struct perf_event *event;745 struct perf_event *event;
arch/s390/kernel/perf_event.c+0−21
@@ -23,27 +23,6 @@ · 22 unmodified lines
23#include <asm/sysinfo.h>23#include <asm/sysinfo.h>
24#include <asm/unwind.h>24#include <asm/unwind.h>
25 25
26const char *perf_pmu_name(void)
27{
28 if (cpum_cf_avail() || cpum_sf_avail())
29 return "CPU-Measurement Facilities (CPU-MF)";
30 return "pmu";
31}
32EXPORT_SYMBOL(perf_pmu_name);
33
34int perf_num_counters(void)
35{
36 int num = 0;
37
38 if (cpum_cf_avail())
39 num += PERF_CPUM_CF_MAX_CTR;
40 if (cpum_sf_avail())
41 num += PERF_CPUM_SF_MAX_CTR;
42
43 return num;
44}
45EXPORT_SYMBOL(perf_num_counters);
46
47static struct kvm_s390_sie_block *sie_block(struct pt_regs *regs)26static struct kvm_s390_sie_block *sie_block(struct pt_regs *regs)
48{27{
49 struct stack_frame *stack = (struct stack_frame *) regs->gprs[15];28 struct stack_frame *stack = (struct stack_frame *) regs->gprs[15];
arch/sh/kernel/perf_event.c+0−18
@@ -57,24 +57,6 @@ static inline int sh_pmu_initialized(void) · 56 unmodified lines
57 return !!sh_pmu;57 return !!sh_pmu;
58}58}
59 59
60const char *perf_pmu_name(void)
61{
62 if (!sh_pmu)
63 return NULL;
64
65 return sh_pmu->name;
66}
67EXPORT_SYMBOL_GPL(perf_pmu_name);
68
69int perf_num_counters(void)
70{
71 if (!sh_pmu)
72 return 0;
73
74 return sh_pmu->num_events;
75}
76EXPORT_SYMBOL_GPL(perf_num_counters);
77
78/*60/*
79 * Release the PMU if this is the last perf_event.61 * Release the PMU if this is the last perf_event.
80 */62 */
drivers/perf/arm_pmu.c+0−30
@@ -581,33 +581,6 @@ static const struct attribute_group armpmu_common_attr_group = { · 580 unmodified lines
581 .attrs = armpmu_common_attrs,581 .attrs = armpmu_common_attrs,
582};582};
583 583
584/* Set at runtime when we know what CPU type we are. */
585static struct arm_pmu *__oprofile_cpu_pmu;
586
587/*
588 * Despite the names, these two functions are CPU-specific and are used
589 * by the OProfile/perf code.
590 */
591const char *perf_pmu_name(void)
592{
593 if (!__oprofile_cpu_pmu)
594 return NULL;
595
596 return __oprofile_cpu_pmu->name;
597}
598EXPORT_SYMBOL_GPL(perf_pmu_name);
599
600int perf_num_counters(void)
601{
602 int max_events = 0;
603
604 if (__oprofile_cpu_pmu != NULL)
605 max_events = __oprofile_cpu_pmu->num_events;
606
607 return max_events;
608}
609EXPORT_SYMBOL_GPL(perf_num_counters);
610
611static int armpmu_count_irq_users(const int irq)584static int armpmu_count_irq_users(const int irq)
612{585{
613 int cpu, count = 0;586 int cpu, count = 0;
@@ -979,9 +952,6 @@ int armpmu_register(struct arm_pmu *pmu) · 365 unmodified lines
979 if (ret)952 if (ret)
980 goto out_destroy;953 goto out_destroy;
981 954
982 if (!__oprofile_cpu_pmu)
983 __oprofile_cpu_pmu = pmu;
984
985 pr_info("enabled with %s PMU driver, %d counters available%s\n",955 pr_info("enabled with %s PMU driver, %d counters available%s\n",
986 pmu->name, pmu->num_events,956 pmu->name, pmu->num_events,
987 has_nmi ? ", using NMIs" : "");957 has_nmi ? ", using NMIs" : "");
include/kvm/arm_pmu.h+4−0
@@ -61,6 +61,7 @@ int kvm_arm_pmu_v3_get_attr(struct kvm_vcpu *vcpu, · 60 unmodified lines
61int kvm_arm_pmu_v3_has_attr(struct kvm_vcpu *vcpu,61int kvm_arm_pmu_v3_has_attr(struct kvm_vcpu *vcpu,
62 struct kvm_device_attr *attr);62 struct kvm_device_attr *attr);
63int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu);63int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu);
64int kvm_pmu_probe_pmuver(void);
64#else65#else
65struct kvm_pmu {66struct kvm_pmu {
66};67};
@@ -116,6 +117,9 @@ static inline u64 kvm_pmu_get_pmceid(struct kvm_vcpu *vcpu, bool pmceid1) · 49 unmodified lines
116{117{
117 return 0;118 return 0;
118}119}
120
121static inline int kvm_pmu_probe_pmuver(void) { return 0xf; }
122
119#endif123#endif
120 124
121#endif125#endif
include/linux/perf_event.h+0−2
@@ -951,8 +951,6 @@ extern void perf_event_itrace_started(struct perf_event *event); · 950 unmodified lines
951extern int perf_pmu_register(struct pmu *pmu, const char *name, int type);951extern int perf_pmu_register(struct pmu *pmu, const char *name, int type);
952extern void perf_pmu_unregister(struct pmu *pmu);952extern void perf_pmu_unregister(struct pmu *pmu);
953 953
954extern int perf_num_counters(void);
955extern const char *perf_pmu_name(void);
956extern void __perf_event_task_sched_in(struct task_struct *prev,954extern void __perf_event_task_sched_in(struct task_struct *prev,
957 struct task_struct *task);955 struct task_struct *task);
958extern void __perf_event_task_sched_out(struct task_struct *prev,956extern void __perf_event_task_sched_out(struct task_struct *prev,
kernel/events/core.c+0−5
@@ -580,11 +580,6 @@ static u64 perf_event_time(struct perf_event *event); · 579 unmodified lines
580 580
581void __weak perf_event_print_debug(void) { }581void __weak perf_event_print_debug(void) { }
582 582
583extern __weak const char *perf_pmu_name(void)
584{
585 return "pmu";
586}
587
588static inline u64 perf_clock(void)583static inline u64 perf_clock(void)
589{584{
590 return local_clock();585 return local_clock();