Re: [PATCH] perf_event use rdpmc rather than rdmsr when possible inkernel

From: Vince Weaver
Date: Mon Feb 27 2012 - 12:04:30 EST


On Mon, 27 Feb 2012, Peter Zijlstra wrote:

> > 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)

ugh I did multiple recursive greps, and definitely searched msr.h by
hand various times looking for that and I somehow missed it each time.

I'll update the patch.

Vince

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/