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

From: Kang, Luwei
Date: Thu Aug 29 2019 - 20:22:14 EST


> > + case MSR_IA32_PEBS_ENABLE:
> > + if (pmu->pebs_enable == data)
> > + return 0;
> > + if (!(data & pmu->pebs_enable_mask) &&
> > + (data & MSR_IA32_PEBS_OUTPUT_MASK) ==
> > + MSR_IA32_PEBS_OUTPUT_PT)
> {
> > + pebs_enable_changed(pmu, data);
> > + return 0;
> > + }
>
> Need #GP for bad values

Yes, this function will return 1 if neither of above two conditions check are not true. And will inject a #GP to guest.

Thanks,
Luwei Kang