linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/x86/intel: Add support for MISPREDICT bit on Knights Landing cpus
@ 2018-07-28  6:56 Jacek Tomaka
  2018-07-30 12:08 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Jacek Tomaka @ 2018-07-28  6:56 UTC (permalink / raw)
  To: linux-kernel, Thomas Gleixner, Ingo Molnar; +Cc: Jacek Tomaka

From: Jacek Tomaka <jacekt@dugeo.com>

Knights Landing supports half baked LBR_FORMAT_TIME format. The addresses are linear but it does have MISPREDICT bit but nothing else.
Unfortunately IA32_PERF_CAPABILITIES[5:0] will report LBR_FORMAT_LIP. This change teaches LBR about this Knights Landing quirk.
---
 arch/x86/events/intel/lbr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index cf372b9055..0f73e60315 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -1230,4 +1230,10 @@ void intel_pmu_lbr_init_knl(void)
 
 	x86_pmu.lbr_sel_mask = LBR_SEL_MASK;
 	x86_pmu.lbr_sel_map  = snb_lbr_sel_map;
+
+	/* Knights Landing supports half baked LBR format. The addresses are linear but it does have MISPREDICT bit.
+	 * Unfortunately IA32_PERF_CAPABILITIES[5:0] will report LBR_FORMAT_LIP.
+	 */
+	if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_LIP)
+		lbr_desc[LBR_FORMAT_LIP] |= LBR_EIP_FLAGS;
 }
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] perf/x86/intel: Add support for MISPREDICT bit on Knights Landing cpus
  2018-07-28  6:56 [PATCH] perf/x86/intel: Add support for MISPREDICT bit on Knights Landing cpus Jacek Tomaka
@ 2018-07-30 12:08 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2018-07-30 12:08 UTC (permalink / raw)
  To: Jacek Tomaka; +Cc: LKML, Ingo Molnar, Jacek Tomaka, Peter Zijlstra

On Sat, 28 Jul 2018, Jacek Tomaka wrote:

> From: Jacek Tomaka <jacekt@dugeo.com>
> 
> Knights Landing supports half baked LBR_FORMAT_TIME format. The addresses are linear but it does have MISPREDICT bit but nothing else.

I really have no idea what you are trying to explain here.

> Unfortunately IA32_PERF_CAPABILITIES[5:0] will report LBR_FORMAT_LIP. This change teaches LBR about this Knights Landing quirk.

Please use proper line breaks around 78 characters. Also 'This change...'
is equally wrong as 'This patch...'. We know already that this is a
change/patch, right?

See Documentation/process/submitting-patches.rst and search for 'This
patch'.

> ---
>  arch/x86/events/intel/lbr.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
> index cf372b9055..0f73e60315 100644
> --- a/arch/x86/events/intel/lbr.c
> +++ b/arch/x86/events/intel/lbr.c
> @@ -1230,4 +1230,10 @@ void intel_pmu_lbr_init_knl(void)
>  
>  	x86_pmu.lbr_sel_mask = LBR_SEL_MASK;
>  	x86_pmu.lbr_sel_map  = snb_lbr_sel_map;
> +
> +	/* Knights Landing supports half baked LBR format. The addresses are linear but it does have MISPREDICT bit.
> +	 * Unfortunately IA32_PERF_CAPABILITIES[5:0] will report LBR_FORMAT_LIP.
> +	 */

This also wants proper line breaks and please use proper comment style:

       /*
        * This is how a proper multi-line should
	* be formatted.
	*/

> +	if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_LIP)
> +		lbr_desc[LBR_FORMAT_LIP] |= LBR_EIP_FLAGS;

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-30 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-28  6:56 [PATCH] perf/x86/intel: Add support for MISPREDICT bit on Knights Landing cpus Jacek Tomaka
2018-07-30 12:08 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).