|
@@ -3339,7 +3339,8 @@ static void intel_pmu_cpu_starting(int cpu)
|
|
|
|
|
|
cpuc->lbr_sel = NULL;
|
|
cpuc->lbr_sel = NULL;
|
|
|
|
|
|
- flip_smm_bit(&x86_pmu.attr_freeze_on_smi);
|
|
|
|
|
|
+ if (x86_pmu.version > 1)
|
|
|
|
+ flip_smm_bit(&x86_pmu.attr_freeze_on_smi);
|
|
|
|
|
|
if (!cpuc->shared_regs)
|
|
if (!cpuc->shared_regs)
|
|
return;
|
|
return;
|
|
@@ -3502,6 +3503,8 @@ static __initconst const struct x86_pmu core_pmu = {
|
|
.cpu_dying = intel_pmu_cpu_dying,
|
|
.cpu_dying = intel_pmu_cpu_dying,
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+static struct attribute *intel_pmu_attrs[];
|
|
|
|
+
|
|
static __initconst const struct x86_pmu intel_pmu = {
|
|
static __initconst const struct x86_pmu intel_pmu = {
|
|
.name = "Intel",
|
|
.name = "Intel",
|
|
.handle_irq = intel_pmu_handle_irq,
|
|
.handle_irq = intel_pmu_handle_irq,
|
|
@@ -3533,6 +3536,8 @@ static __initconst const struct x86_pmu intel_pmu = {
|
|
.format_attrs = intel_arch3_formats_attr,
|
|
.format_attrs = intel_arch3_formats_attr,
|
|
.events_sysfs_show = intel_event_sysfs_show,
|
|
.events_sysfs_show = intel_event_sysfs_show,
|
|
|
|
|
|
|
|
+ .attrs = intel_pmu_attrs,
|
|
|
|
+
|
|
.cpu_prepare = intel_pmu_cpu_prepare,
|
|
.cpu_prepare = intel_pmu_cpu_prepare,
|
|
.cpu_starting = intel_pmu_cpu_starting,
|
|
.cpu_starting = intel_pmu_cpu_starting,
|
|
.cpu_dying = intel_pmu_cpu_dying,
|
|
.cpu_dying = intel_pmu_cpu_dying,
|
|
@@ -3911,8 +3916,6 @@ __init int intel_pmu_init(void)
|
|
|
|
|
|
x86_pmu.max_pebs_events = min_t(unsigned, MAX_PEBS_EVENTS, x86_pmu.num_counters);
|
|
x86_pmu.max_pebs_events = min_t(unsigned, MAX_PEBS_EVENTS, x86_pmu.num_counters);
|
|
|
|
|
|
-
|
|
|
|
- x86_pmu.attrs = intel_pmu_attrs;
|
|
|
|
/*
|
|
/*
|
|
* Quirk: v2 perfmon does not report fixed-purpose events, so
|
|
* Quirk: v2 perfmon does not report fixed-purpose events, so
|
|
* assume at least 3 events, when not running in a hypervisor:
|
|
* assume at least 3 events, when not running in a hypervisor:
|