On Wed, Dec 27, 2017 at 05:04:26PM +0300, Jan Dakinevich wrote: > Certain PMU-related MSRs are not supported for CPUs with PMU > architecture below version 2. KVM rejects any access to them (see > intel_is_valid_msr_idx routine in KVM), and QEMU fails on the following > assertion: > > kvm_put_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed. > > QEMU also could fail if KVM exposes less fixed counters then 3. It could > happen if host system run inside another hypervisor, which is tweaking > PMU-related CPUID. To prevent possible fail, number of fixed counters now is > obtained in the same way as number of GP counters. > > Reviewed-by: Roman Kagan <rkagan@xxxxxxxxxxxxx> > Signed-off-by: Jan Dakinevich <jan.dakinevich@xxxxxxxxxxxxx> Reviewed-by: Eduardo Habkost <ehabkost@xxxxxxxxxx> -- Eduardo