From: "Robert Richter" <robert.richter@amd.com>
To: "Stephane Eranian" <eranian@hpl.hp.com>
Cc: "Andi Kleen" <andi@firstfloor.org>, linux-kernel@vger.kernel.org
Subject: [patch 5/8] 2.6.22-rc3 perfmon2 : IBS implementation for AMD64
Date: Fri, 15 Jun 2007 19:00:02 +0200 [thread overview]
Message-ID: <20070615093331.256368000@localhost> (raw)
In-Reply-To: 20070614215818.509851000@localhost
This patch implements an initial AMD64 PMU configuration.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Index: linux-2.6.22-rc3/arch/i386/perfmon/perfmon.c
===================================================================
--- linux-2.6.22-rc3.orig/arch/i386/perfmon/perfmon.c
+++ linux-2.6.22-rc3/arch/i386/perfmon/perfmon.c
@@ -325,6 +325,12 @@ static int pfm_stop_save_p6(struct pfm_c
return 0;
}
+static int pfm_stop_save_amd64(struct pfm_context *ctx,
+ struct pfm_event_set *set)
+{
+ return pfm_stop_save_p6(ctx, set);
+}
+
static int pfm_stop_save_core(struct pfm_context *ctx,
struct pfm_event_set *set)
{
@@ -843,6 +849,11 @@ static int __kprobes pfm_has_ovfl_p6(voi
return 0;
}
+static int __kprobes pfm_has_ovfl_amd64(void)
+{
+ return pfm_has_ovfl_p6();
+}
+
/*
* detect is counters have overflowed.
* return:
@@ -998,6 +1009,10 @@ int pfm_arch_pmu_config_init(struct _pfm
pfm_stop_save = pfm_stop_save_core;
pfm_has_ovfl = pfm_has_ovfl_core;
break;
+ case PFM_X86_PMU_AMD64:
+ pfm_stop_save = pfm_stop_save_amd64;
+ pfm_has_ovfl = pfm_has_ovfl_amd64;
+ break;
default:
PFM_INFO("unknown pmu_style=%d", arch_info->pmu_style);
return -EINVAL;
Index: linux-2.6.22-rc3/include/asm-i386/msr-index.h
===================================================================
--- linux-2.6.22-rc3.orig/include/asm-i386/msr-index.h
+++ linux-2.6.22-rc3/include/asm-i386/msr-index.h
@@ -73,7 +73,7 @@
#define MSR_P6_EVNTSEL0 0x00000186
#define MSR_P6_EVNTSEL1 0x00000187
-/* K7/K8 MSRs. Not complete. See the architecture manual for a more
+/* AMD64 MSRs. Not complete. See the architecture manual for a more
complete list. */
/* K8 MSRs */
Index: linux-2.6.22-rc3/arch/x86_64/perfmon/perfmon_k8.c
===================================================================
--- linux-2.6.22-rc3.orig/arch/x86_64/perfmon/perfmon_k8.c
+++ linux-2.6.22-rc3/arch/x86_64/perfmon/perfmon_k8.c
@@ -25,7 +25,7 @@
#include <asm/nmi.h>
MODULE_AUTHOR("Stephane Eranian <eranian@hpl.hp.com>");
-MODULE_DESCRIPTION("Athlon/Opteron 64 (K8) PMU description table");
+MODULE_DESCRIPTION("AMD64 PMU description table");
MODULE_LICENSE("GPL");
static int force_nmi;
@@ -45,7 +45,7 @@ static struct pfm_arch_pmu_info pfm_k8_p
/* pmd2 */ {{MSR_K7_PERFCTR2, 0}, 0, PFM_REGT_CTR},
/* pmd3 */ {{MSR_K7_PERFCTR3, 0}, 0, PFM_REGT_CTR},
},
- .pmu_style = PFM_X86_PMU_P6
+ .pmu_style = PFM_X86_PMU_AMD64
};
/*
@@ -331,11 +331,13 @@ static int pfm_k8_probe_pmu(void)
if (current_cpu_data.x86_max_cores > 1)
pfm_k8_setup_nb_event_control();
+ PFM_INFO("Using AMD64 PMU");
+
return 0;
}
-static struct pfm_pmu_config pfm_k8_pmu_conf={
- .pmu_name = "AMD K8",
+static struct pfm_pmu_config pfm_k8_pmu_conf = {
+ .pmu_name = "AMD64",
.counter_width = 47,
.pmd_desc = pfm_k8_pmd_desc,
.pmc_desc = pfm_k8_pmc_desc,
Index: linux-2.6.22-rc3/include/asm-i386/perfmon.h
===================================================================
--- linux-2.6.22-rc3.orig/include/asm-i386/perfmon.h
+++ linux-2.6.22-rc3/include/asm-i386/perfmon.h
@@ -98,16 +98,17 @@ struct pfm_arch_pmu_info {
/*
* X86 PMU style
*/
-#define PFM_X86_PMU_P4 1 /* Intel P4/Xeon/EM64T processor PMU */
-#define PFM_X86_PMU_P6 2 /* Intel P6/Pentium M, AMD X86-64 processor PMU */
-#define PFM_X86_PMU_CORE 3 /* Intel Core PMU */
+#define PFM_X86_PMU_P4 1 /* Intel P4/Xeon/EM64T processor PMU */
+#define PFM_X86_PMU_P6 2 /* Intel P6/Pentium M */
+#define PFM_X86_PMU_CORE 3 /* Intel Core PMU */
+#define PFM_X86_PMU_AMD64 4 /* AMD64 PMU (K8, family 10h) */
/*
* PMU feature flags
*/
-#define PFM_X86_FL_PMU_DS 0x1 /* Intel: support for Data Save Area (DS) */
-#define PFM_X86_FL_PMU_PEBS 0x2 /* Intel: support PEBS (implies DS) */
-#define PFM_X86_FL_USE_NMI 0x4 /* must use NMI interrupt */
+#define PFM_X86_FL_PMU_DS 0x01 /* Intel: support for Data Save Area (DS) */
+#define PFM_X86_FL_PMU_PEBS 0x02 /* Intel: support PEBS (implies DS) */
+#define PFM_X86_FL_USE_NMI 0x04 /* must use NMI interrupt */
void __pfm_read_reg_p4(const struct pfm_arch_ext_reg *xreg, u64 *val);
void __pfm_write_reg_p4(const struct pfm_arch_ext_reg *xreg, u64 val);
--
AMD Saxony, Dresden, Germany
Operating System Research Center
email: robert.richter@amd.com
next prev parent reply other threads:[~2007-06-15 16:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-15 16:56 [patch 0/8] 2.6.22-rc3 perfmon2 : IBS implementation for AMD64 Robert Richter
2007-06-15 16:57 ` [patch 1/8] " Robert Richter
2007-06-15 18:54 ` David Rientjes
2007-06-20 18:36 ` Robert Richter
2007-06-19 12:39 ` Stephane Eranian
2007-06-15 16:58 ` [patch 2/8] " Robert Richter
2007-06-19 12:39 ` Stephane Eranian
2007-06-15 16:58 ` [patch 3/8] " Robert Richter
2007-06-19 12:40 ` Stephane Eranian
2007-06-15 16:59 ` [patch 4/8] " Robert Richter
2007-06-15 18:52 ` David Rientjes
2007-06-20 18:36 ` Robert Richter
2007-06-19 13:34 ` Stephane Eranian
2007-06-15 17:00 ` Robert Richter [this message]
2007-06-15 17:00 ` [patch 6/8] " Robert Richter
2007-06-15 20:15 ` David Rientjes
2007-06-20 18:38 ` Robert Richter
2007-06-15 17:01 ` [patch 7/8] " Robert Richter
2007-06-15 17:02 ` [patch 8/8] " Robert Richter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070615093331.256368000@localhost \
--to=robert.richter@amd.com \
--cc=andi@firstfloor.org \
--cc=eranian@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.