stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf, x86: Update event scheduling constraints for AMD family 15h models
@ 2012-05-18 10:40 Robert Richter
  2012-05-18 11:29 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Richter @ 2012-05-18 10:40 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Stephane Eranian, LKML, Robert Richter, stable, #,
	v2.6.39+

This update is for newer family 15h cpu models from 0x02 to 0x1f.

Cc: stable@vger.kernel.org # v2.6.39+
Signed-off-by: Robert Richter <robert.richter@amd.com>
---
 arch/x86/kernel/cpu/perf_event_amd.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c
index 6565226..11a4eb9 100644
--- a/arch/x86/kernel/cpu/perf_event_amd.c
+++ b/arch/x86/kernel/cpu/perf_event_amd.c
@@ -496,6 +496,7 @@ static __initconst const struct x86_pmu amd_pmu = {
  * 0x023	DE	PERF_CTL[2:0]
  * 0x02D	LS	PERF_CTL[3]
  * 0x02E	LS	PERF_CTL[3,0]
+ * 0x031	LS	PERF_CTL[2:0] (**)
  * 0x043	CU	PERF_CTL[2:0]
  * 0x045	CU	PERF_CTL[2:0]
  * 0x046	CU	PERF_CTL[2:0]
@@ -509,10 +510,12 @@ static __initconst const struct x86_pmu amd_pmu = {
  * 0x0DD	LS	PERF_CTL[5:0]
  * 0x0DE	LS	PERF_CTL[5:0]
  * 0x0DF	LS	PERF_CTL[5:0]
+ * 0x1C0	EX	PERF_CTL[5:3]
  * 0x1D6	EX	PERF_CTL[5:0]
  * 0x1D8	EX	PERF_CTL[5:0]
  *
- * (*) depending on the umask all FPU counters may be used
+ * (*)  depending on the umask all FPU counters may be used
+ * (**) only one unitmask enabled at a time
  */
 
 static struct event_constraint amd_f15_PMC0  = EVENT_CONSTRAINT(0, 0x01, 0);
@@ -562,6 +565,12 @@ amd_get_event_constraints_f15h(struct cpu_hw_events *cpuc, struct perf_event *ev
 			return &amd_f15_PMC3;
 		case 0x02E:
 			return &amd_f15_PMC30;
+		case 0x031:
+			if (hweight_long(hwc->config & ARCH_PERFMON_EVENTSEL_UMASK) <= 1)
+				return &amd_f15_PMC20;
+			return &emptyconstraint;
+		case 0x1C0:
+			return &amd_f15_PMC53;
 		default:
 			return &amd_f15_PMC50;
 		}
-- 
1.7.8.4



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

* Re: [PATCH] perf, x86: Update event scheduling constraints for AMD family 15h models
  2012-05-18 10:40 [PATCH] perf, x86: Update event scheduling constraints for AMD family 15h models Robert Richter
@ 2012-05-18 11:29 ` Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2012-05-18 11:29 UTC (permalink / raw)
  To: Robert Richter; +Cc: Ingo Molnar, Stephane Eranian, LKML, stable

On Fri, 2012-05-18 at 12:40 +0200, Robert Richter wrote:
> +               case 0x031:
> +                       if (hweight_long(hwc->config & ARCH_PERFMON_EVENTSEL_UMASK) <= 1)
> +                               return &amd_f15_PMC20;
> +                       return &emptyconstraint;
> +               case 0x1C0:
> +                       return &amd_f15_PMC53; 

Oh man, that's just vile.. I hope you've given your hardware team a big
hug for this.. :-)

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

end of thread, other threads:[~2012-05-18 11:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-18 10:40 [PATCH] perf, x86: Update event scheduling constraints for AMD family 15h models Robert Richter
2012-05-18 11:29 ` Peter Zijlstra

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).