All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: print microcode revision on PEBs errors
@ 2013-10-30 19:31 Michael S. Tsirkin
  2013-10-30 19:36 ` Joe Perches
  2013-10-31  8:15 ` Ingo Molnar
  0 siblings, 2 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2013-10-30 19:31 UTC (permalink / raw)
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Thomas Gleixner, H. Peter Anvin, x86,
	Stephane Eranian, Andi Kleen, linux-kernel

On Sandy bridge CPUs with old microcode, PEBs
fails and suggests a microcode update.
Print out the required and the actual revision to
make it easier to figure out what's wrong.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 arch/x86/kernel/cpu/perf_event_intel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index f31a165..81f2789 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -2105,6 +2105,8 @@ static int intel_snb_pebs_broken(int cpu)
 		}
 	}
 
+	pr_info("PEBS checking: microcode 0x%x min legal 0x%x\n",
+		cpu_data(cpu).microcode, rev);
 	return (cpu_data(cpu).microcode < rev);
 }
 
-- 
MST

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

* Re: [PATCH] x86: print microcode revision on PEBs errors
  2013-10-30 19:31 [PATCH] x86: print microcode revision on PEBs errors Michael S. Tsirkin
@ 2013-10-30 19:36 ` Joe Perches
  2013-10-31  8:15 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2013-10-30 19:36 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Thomas Gleixner, H. Peter Anvin, x86,
	Stephane Eranian, Andi Kleen, linux-kernel

On Wed, 2013-10-30 at 21:31 +0200, Michael S. Tsirkin wrote:
> On Sandy bridge CPUs with old microcode, PEBs
> fails and suggests a microcode update.
> Print out the required and the actual revision to
> make it easier to figure out what's wrong.
[]
> diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
[]
> @@ -2105,6 +2105,8 @@ static int intel_snb_pebs_broken(int cpu)
>  		}
>  	}
>  
> +	pr_info("PEBS checking: microcode 0x%x min legal 0x%x\n",
> +		cpu_data(cpu).microcode, rev);

Maybe only emit this with microcode < rev
otherwise it gets emitted once for each online cpu

>  	return (cpu_data(cpu).microcode < rev);
>  }
>  




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

* Re: [PATCH] x86: print microcode revision on PEBs errors
  2013-10-30 19:31 [PATCH] x86: print microcode revision on PEBs errors Michael S. Tsirkin
  2013-10-30 19:36 ` Joe Perches
@ 2013-10-31  8:15 ` Ingo Molnar
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2013-10-31  8:15 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Thomas Gleixner, H. Peter Anvin, x86,
	Stephane Eranian, Andi Kleen, linux-kernel


* Michael S. Tsirkin <mst@redhat.com> wrote:

> On Sandy bridge CPUs with old microcode, PEBs
> fails and suggests a microcode update.
> Print out the required and the actual revision to
> make it easier to figure out what's wrong.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  arch/x86/kernel/cpu/perf_event_intel.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
> index f31a165..81f2789 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel.c
> @@ -2105,6 +2105,8 @@ static int intel_snb_pebs_broken(int cpu)
>  		}
>  	}
>  
> +	pr_info("PEBS checking: microcode 0x%x min legal 0x%x\n",
> +		cpu_data(cpu).microcode, rev);

That's not a very informative message though.

Something like:

   "x86/perf/intel: PEBS turned off due to too old microcode version 0x%x\n"
   "x86/perf/intel: Minimum required microcode version for PEBS: 0x%x\n"

would work better I think.

Also, only output this once, and only output it if the check 
_fails_.

>  	return (cpu_data(cpu).microcode < rev);

Btw., please also fix the return statement, it doesn't need 
parentheses.

Thanks,

	Ingo

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

end of thread, other threads:[~2013-10-31  8:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-30 19:31 [PATCH] x86: print microcode revision on PEBs errors Michael S. Tsirkin
2013-10-30 19:36 ` Joe Perches
2013-10-31  8:15 ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.