lkml.org 
[lkml]   [2012]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] perf_event use rdpmc rather than rdmsr when possible in kernel
From
Date
On Mon, 2012-02-27 at 11:06 -0500, Vince Weaver wrote:
> > > + new_raw_count=native_read_pmc(hwc->event_base_rdpmc);
> >
> > That really wants to be rdpmc(), bypassing paravirt like that isn't
> > nice.
>
> I couldn't find another usable rdpmc() call in the kernel. Should I add
> one? I admit I hadn't thought that this might break VMs not expecting
> rdpmc calls from the kernel.

arch/x86/include/asm/msr.h

#define rdpmc(counter, low, high) \
do { \
u64 _l = native_read_pmc((counter)); \
(low) = (u32)_l; \
(high) = (u32)(_l >> 32); \
} while (0)



\
 
 \ /
  Last update: 2012-02-27 17:21    [W:0.033 / U:9.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site