This patchset exposes an emulated version 2 architectural performancemonitoring unit to KVM guests. The PMU is emulated using perf_events,so the host kernel can multiplex host-wide, host-user, and theguest on available resources.

The patches are against next branch on kvm.git.

If you want to try running perf in a guest you need to apply the patchbelow to qemu-kvm and use -cpu host on qemu command line. But DO NOTTRY those patches without applying [1][2] to the host kernel first.Don't tell me I didn't warn you!

Changelog: v1->v2 - put index into struct kvm_pmc instead of calculating it - use locked version of bitops - inject pmi from irq work if vcpu was not in a guest mode during NMI - providing stub for perf_get_x86_pmu_capability() for !PERF_EVENTS