aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/events/intel/core.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 607bf565a90c..707b2a96e516 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -3339,7 +3339,8 @@ static void intel_pmu_cpu_starting(int cpu)
3339 3339
3340 cpuc->lbr_sel = NULL; 3340 cpuc->lbr_sel = NULL;
3341 3341
3342 flip_smm_bit(&x86_pmu.attr_freeze_on_smi); 3342 if (x86_pmu.version > 1)
3343 flip_smm_bit(&x86_pmu.attr_freeze_on_smi);
3343 3344
3344 if (!cpuc->shared_regs) 3345 if (!cpuc->shared_regs)
3345 return; 3346 return;
@@ -3502,6 +3503,8 @@ static __initconst const struct x86_pmu core_pmu = {
3502 .cpu_dying = intel_pmu_cpu_dying, 3503 .cpu_dying = intel_pmu_cpu_dying,
3503}; 3504};
3504 3505
3506static struct attribute *intel_pmu_attrs[];
3507
3505static __initconst const struct x86_pmu intel_pmu = { 3508static __initconst const struct x86_pmu intel_pmu = {
3506 .name = "Intel", 3509 .name = "Intel",
3507 .handle_irq = intel_pmu_handle_irq, 3510 .handle_irq = intel_pmu_handle_irq,
@@ -3533,6 +3536,8 @@ static __initconst const struct x86_pmu intel_pmu = {
3533 .format_attrs = intel_arch3_formats_attr, 3536 .format_attrs = intel_arch3_formats_attr,
3534 .events_sysfs_show = intel_event_sysfs_show, 3537 .events_sysfs_show = intel_event_sysfs_show,
3535 3538
3539 .attrs = intel_pmu_attrs,
3540
3536 .cpu_prepare = intel_pmu_cpu_prepare, 3541 .cpu_prepare = intel_pmu_cpu_prepare,
3537 .cpu_starting = intel_pmu_cpu_starting, 3542 .cpu_starting = intel_pmu_cpu_starting,
3538 .cpu_dying = intel_pmu_cpu_dying, 3543 .cpu_dying = intel_pmu_cpu_dying,
@@ -3911,8 +3916,6 @@ __init int intel_pmu_init(void)
3911 3916
3912 x86_pmu.max_pebs_events = min_t(unsigned, MAX_PEBS_EVENTS, x86_pmu.num_counters); 3917 x86_pmu.max_pebs_events = min_t(unsigned, MAX_PEBS_EVENTS, x86_pmu.num_counters);
3913 3918
3914
3915 x86_pmu.attrs = intel_pmu_attrs;
3916 /* 3919 /*
3917 * Quirk: v2 perfmon does not report fixed-purpose events, so 3920 * Quirk: v2 perfmon does not report fixed-purpose events, so
3918 * assume at least 3 events, when not running in a hypervisor: 3921 * assume at least 3 events, when not running in a hypervisor: