提交 f09509b9 编写于 作者: D David Carrillo-Cisneros 提交者: Ingo Molnar

perf/x86/intel: Print LBR support statement after validation

The following commit:

  338b522c ("perf/x86/intel: Protect LBR and extra_regs against KVM lying")

added an additional test to LBR support detection that is performed after
printing the LBR support statement to dmesg.

Move the LBR support output after the very last test, to make sure we
print the true status of LBR support.
Signed-off-by: NDavid Carrillo-Cisneros <davidcc@google.com>
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: NStephane Eranian <eranian@google.com>
Reviewed-by: NAndi Kleen <ak@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1466533874-52003-2-git-send-email-davidcc@google.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 8114e90e
...@@ -3958,6 +3958,8 @@ __init int intel_pmu_init(void) ...@@ -3958,6 +3958,8 @@ __init int intel_pmu_init(void)
x86_pmu.lbr_nr = 0; x86_pmu.lbr_nr = 0;
} }
if (x86_pmu.lbr_nr)
pr_cont("%d-deep LBR, ", x86_pmu.lbr_nr);
/* /*
* Access extra MSR may cause #GP under certain circumstances. * Access extra MSR may cause #GP under certain circumstances.
* E.g. KVM doesn't support offcore event * E.g. KVM doesn't support offcore event
......
...@@ -956,7 +956,6 @@ void __init intel_pmu_lbr_init_core(void) ...@@ -956,7 +956,6 @@ void __init intel_pmu_lbr_init_core(void)
* SW branch filter usage: * SW branch filter usage:
* - compensate for lack of HW filter * - compensate for lack of HW filter
*/ */
pr_cont("4-deep LBR, ");
} }
/* nehalem/westmere */ /* nehalem/westmere */
...@@ -977,7 +976,6 @@ void __init intel_pmu_lbr_init_nhm(void) ...@@ -977,7 +976,6 @@ void __init intel_pmu_lbr_init_nhm(void)
* That requires LBR_FAR but that means far * That requires LBR_FAR but that means far
* jmp need to be filtered out * jmp need to be filtered out
*/ */
pr_cont("16-deep LBR, ");
} }
/* sandy bridge */ /* sandy bridge */
...@@ -997,7 +995,6 @@ void __init intel_pmu_lbr_init_snb(void) ...@@ -997,7 +995,6 @@ void __init intel_pmu_lbr_init_snb(void)
* That requires LBR_FAR but that means far * That requires LBR_FAR but that means far
* jmp need to be filtered out * jmp need to be filtered out
*/ */
pr_cont("16-deep LBR, ");
} }
/* haswell */ /* haswell */
...@@ -1010,8 +1007,6 @@ void intel_pmu_lbr_init_hsw(void) ...@@ -1010,8 +1007,6 @@ void intel_pmu_lbr_init_hsw(void)
x86_pmu.lbr_sel_mask = LBR_SEL_MASK; x86_pmu.lbr_sel_mask = LBR_SEL_MASK;
x86_pmu.lbr_sel_map = hsw_lbr_sel_map; x86_pmu.lbr_sel_map = hsw_lbr_sel_map;
pr_cont("16-deep LBR, ");
} }
/* skylake */ /* skylake */
...@@ -1031,7 +1026,6 @@ __init void intel_pmu_lbr_init_skl(void) ...@@ -1031,7 +1026,6 @@ __init void intel_pmu_lbr_init_skl(void)
* That requires LBR_FAR but that means far * That requires LBR_FAR but that means far
* jmp need to be filtered out * jmp need to be filtered out
*/ */
pr_cont("32-deep LBR, ");
} }
/* atom */ /* atom */
...@@ -1057,7 +1051,6 @@ void __init intel_pmu_lbr_init_atom(void) ...@@ -1057,7 +1051,6 @@ void __init intel_pmu_lbr_init_atom(void)
* SW branch filter usage: * SW branch filter usage:
* - compensate for lack of HW filter * - compensate for lack of HW filter
*/ */
pr_cont("8-deep LBR, ");
} }
/* slm */ /* slm */
...@@ -1088,6 +1081,4 @@ void intel_pmu_lbr_init_knl(void) ...@@ -1088,6 +1081,4 @@ void intel_pmu_lbr_init_knl(void)
x86_pmu.lbr_sel_mask = LBR_SEL_MASK; x86_pmu.lbr_sel_mask = LBR_SEL_MASK;
x86_pmu.lbr_sel_map = snb_lbr_sel_map; x86_pmu.lbr_sel_map = snb_lbr_sel_map;
pr_cont("8-deep LBR, ");
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册