Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=44264261d8fb87849118e41b2735bd95db28126f
Commit:     44264261d8fb87849118e41b2735bd95db28126f
Parent:     90ce4bc4542c10b63dc6482ac920ff1226a6e5ff
Author:     Venkatesh Pallipadi <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 13 13:26:23 2007 +0100
Committer:  Andi Kleen <[EMAIL PROTECTED]>
CommitDate: Tue Feb 13 13:26:23 2007 +0100

    [PATCH] i386: Handle 32 bit PerfMon Counter writes cleanly in oprofile
    
    Handle these 32 bit perfmon counter MSR writes cleanly in oprofile.
    
    Signed-off-by: Venkatesh Pallipadi <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
---
 arch/i386/oprofile/op_model_ppro.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/i386/oprofile/op_model_ppro.c 
b/arch/i386/oprofile/op_model_ppro.c
index ca2447e..c554f52 100644
--- a/arch/i386/oprofile/op_model_ppro.c
+++ b/arch/i386/oprofile/op_model_ppro.c
@@ -24,7 +24,8 @@
 
 #define CTR_IS_RESERVED(msrs,c) (msrs->counters[(c)].addr ? 1 : 0)
 #define CTR_READ(l,h,msrs,c) do {rdmsr(msrs->counters[(c)].addr, (l), (h));} 
while (0)
-#define CTR_WRITE(l,msrs,c) do {wrmsr(msrs->counters[(c)].addr, -(u32)(l), 
-1);} while (0)
+#define CTR_32BIT_WRITE(l,msrs,c)      \
+       do {wrmsr(msrs->counters[(c)].addr, -(u32)(l), 0);} while (0)
 #define CTR_OVERFLOWED(n) (!((n) & (1U<<31)))
 
 #define CTRL_IS_RESERVED(msrs,c) (msrs->controls[(c)].addr ? 1 : 0)
@@ -79,7 +80,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
        for (i = 0; i < NUM_COUNTERS; ++i) {
                if (unlikely(!CTR_IS_RESERVED(msrs,i)))
                        continue;
-               CTR_WRITE(1, msrs, i);
+               CTR_32BIT_WRITE(1, msrs, i);
        }
 
        /* enable active counters */
@@ -87,7 +88,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
                if ((counter_config[i].enabled) && (CTR_IS_RESERVED(msrs,i))) {
                        reset_value[i] = counter_config[i].count;
 
-                       CTR_WRITE(counter_config[i].count, msrs, i);
+                       CTR_32BIT_WRITE(counter_config[i].count, msrs, i);
 
                        CTRL_READ(low, high, msrs, i);
                        CTRL_CLEAR(low);
@@ -116,7 +117,7 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
                CTR_READ(low, high, msrs, i);
                if (CTR_OVERFLOWED(low)) {
                        oprofile_add_sample(regs, i);
-                       CTR_WRITE(reset_value[i], msrs, i);
+                       CTR_32BIT_WRITE(reset_value[i], msrs, i);
                }
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to