]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/msr: Use the proper trace point conditional for writes
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 3 Jun 2016 18:00:59 +0000 (19:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2016 15:42:09 +0000 (08:42 -0700)
commit 08dd8cd06ed95625b9e2fac43c78fcb45b7eaf94 upstream.

The msr tracing for writes is incorrectly conditional on the read trace.

Fixes: 7f47d8cc039f "x86, tracing, perf: Add trace point for MSR accesses"
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: ak@linux.intel.com
Link: http://lkml.kernel.org/r/1464976859-21850-1-git-send-email-dgilbert@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/msr.h

index 7a79ee2778b3b5067fa816e541bf93bc26cf782d..33c709ca266696ec7921a48138332d5f32f2a98a 100644 (file)
@@ -112,7 +112,7 @@ static inline void native_write_msr(unsigned int msr,
                                    unsigned low, unsigned high)
 {
        asm volatile("wrmsr" : : "c" (msr), "a"(low), "d" (high) : "memory");
-       if (msr_tracepoint_active(__tracepoint_read_msr))
+       if (msr_tracepoint_active(__tracepoint_write_msr))
                do_trace_write_msr(msr, ((u64)high << 32 | low), 0);
 }
 
@@ -131,7 +131,7 @@ notrace static inline int native_write_msr_safe(unsigned int msr,
                     : "c" (msr), "0" (low), "d" (high),
                       [fault] "i" (-EIO)
                     : "memory");
-       if (msr_tracepoint_active(__tracepoint_read_msr))
+       if (msr_tracepoint_active(__tracepoint_write_msr))
                do_trace_write_msr(msr, ((u64)high << 32 | low), err);
        return err;
 }