This fixes an issue on POWER4 and POWER6 where PMU exceptions need to be
disabled when the context is in masked mode.
--
Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
Beaverton, OR
503-578-3507
[EMAIL PROTECTED]
This patch makes sure that PMU exceptions are disabled while the context
is masked on POWER4 and POWER6 processors. A similar patch was made in January
for POWER5, and it was an error to not make the same change for these other
two processors.
In addition to that fix, some comments were cleaned up a little in the POWER6
version.
Index: linux-2.6/arch/powerpc/perfmon/perfmon_power6.c
===================================================================
--- linux-2.6.orig/arch/powerpc/perfmon/perfmon_power6.c 2008-07-14
14:23:04.000000000 -0400
+++ linux-2.6/arch/powerpc/perfmon/perfmon_power6.c 2008-07-14
14:47:52.000000000 -0400
@@ -416,12 +416,16 @@
pfm_interrupt_handler(instruction_pointer(regs), regs);
mmcr0 = mfspr(SPRN_MMCR0);
- /* Reset the perfmon trigger. */
- mmcr0 |= MMCR0_PMXE;
/*
- * We must clear the PMAO bit on some (GQ) chips. Just do it
- * all the time.
+ * Reset the perfmon trigger if
+ * not in masking mode.
+ */
+ if (ctx->state != PFM_CTX_MASKED)
+ mmcr0 |= MMCR0_PMXE;
+
+ /*
+ * Clear the PMU Alert Occurred bit
*/
mmcr0 &= ~MMCR0_PMAO;
Index: linux-2.6/arch/powerpc/perfmon/perfmon_power4.c
===================================================================
--- linux-2.6.orig/arch/powerpc/perfmon/perfmon_power4.c 2008-07-09
15:31:29.000000000 -0400
+++ linux-2.6/arch/powerpc/perfmon/perfmon_power4.c 2008-07-14
14:43:32.000000000 -0400
@@ -232,8 +232,13 @@
pfm_interrupt_handler(instruction_pointer(regs), regs);
mmcr0 = mfspr(SPRN_MMCR0);
- /* Reset the perfmon trigger. */
- mmcr0 |= MMCR0_PMXE;
+
+ /*
+ * Reset the perfmon trigger if
+ * not in masking mode.
+ */
+ if (ctx->state != PFM_CTX_MASKED)
+ mmcr0 |= MMCR0_PMXE;
/*
* We must clear the PMAO bit on some (GQ) chips. Just do it
@@ -241,7 +246,6 @@
*/
mmcr0 &= ~MMCR0_PMAO;
-
/*
* Now clear the freeze bit, counting will not start until we
* rfid from this exception, because only at that point will
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel