RE: [RFC v1 3/9] KVM: x86: Implement MSR_IA32_PEBS_ENABLE read/write emulation

2019-08-29 Thread Kang, Luwei
> > + case MSR_IA32_PEBS_ENABLE: > > + if (pmu->pebs_enable == data) > > + return 0; > > + if (!(data & pmu->pebs_enable_mask) && > > +(data & MSR_IA32_PEBS_OUTPUT_MASK) == > > +

Re: [RFC v1 3/9] KVM: x86: Implement MSR_IA32_PEBS_ENABLE read/write emulation

2019-08-29 Thread Andi Kleen
> + case MSR_IA32_PEBS_ENABLE: > + if (pmu->pebs_enable == data) > + return 0; > + if (!(data & pmu->pebs_enable_mask) && > + (data & MSR_IA32_PEBS_OUTPUT_MASK) == > +

[RFC v1 3/9] KVM: x86: Implement MSR_IA32_PEBS_ENABLE read/write emulation

2019-08-28 Thread Luwei Kang
This patch implements the MSR_IA32_PEBS_ENABLE register read/write emulation for KVM guest. MSR_IA32_PEBS_ENABLE register can be accessed only when PEBS is supported in KVM. VMM need to reprogram the counter when the value of this MSR changed because some of the counters will be created or