x86: Add rdpmcl()
authorAndi Kleen <ak@linux.intel.com>
Wed, 6 Jun 2012 00:56:50 +0000 (17:56 -0700)
committerIngo Molnar <mingo@kernel.org>
Wed, 6 Jun 2012 15:23:27 +0000 (17:23 +0200)
Add a version of rdpmc() that directly reads into a u64

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1338944211-28275-4-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/msr.h
arch/x86/include/asm/paravirt.h

index 084ef95274cd78ceb51b1ea7a208a7a5e486199a..e489c1475be9986fc77aab371932a90717726445 100644 (file)
@@ -237,6 +237,8 @@ do {                                                        \
        (high) = (u32)(_l >> 32);                       \
 } while (0)
 
+#define rdpmcl(counter, val) ((val) = native_read_pmc(counter))
+
 #define rdtscp(low, high, aux)                                 \
 do {                                                            \
        unsigned long long _val = native_read_tscp(&(aux));     \
index 6cbbabf52707f9d492a3e3d6687c37b24369cdfb..14ce05dfe04e7d2a5be094205bd4cab67694a6a2 100644 (file)
@@ -252,6 +252,8 @@ do {                                                \
        high = _l >> 32;                        \
 } while (0)
 
+#define rdpmcl(counter, val) ((val) = paravirt_read_pmc(counter))
+
 static inline unsigned long long paravirt_rdtscp(unsigned int *aux)
 {
        return PVOP_CALL1(u64, pv_cpu_ops.read_tscp, aux);