qemu-e2k/target
Jan Dakinevich 0b368a10c7 i386/cpu/kvm: look at PMU's CPUID before setting MSRs
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@virtuozzo.com>
Signed-off-by: Jan Dakinevich <jan.dakinevich@virtuozzo.com>
Message-Id: <1514383466-7257-1-git-send-email-jan.dakinevich@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-01-12 13:22:02 +01:00
..
alpha tcg: Remove TCGV_UNUSED* and TCGV_IS_UNUSED* 2017-12-29 12:43:39 -08:00
arm target/arm: Make disas_thumb2_insn() generate its own UNDEF exceptions 2018-01-11 13:25:40 +00:00
cris tcg: Dynamically allocate TCGOps 2017-12-29 12:43:39 -08:00
hppa tcg: Remove TCGV_UNUSED* and TCGV_IS_UNUSED* 2017-12-29 12:43:39 -08:00
i386 i386/cpu/kvm: look at PMU's CPUID before setting MSRs 2018-01-12 13:22:02 +01:00
lm32 tcg: Dynamically allocate TCGOps 2017-12-29 12:43:39 -08:00
m68k -----BEGIN PGP SIGNATURE----- 2018-01-08 21:39:44 +00:00
microblaze tcg: Dynamically allocate TCGOps 2017-12-29 12:43:39 -08:00
mips tcg: Remove TCGV_UNUSED* and TCGV_IS_UNUSED* 2017-12-29 12:43:39 -08:00
moxie target/moxie: Fix tlb_fill 2017-12-27 17:20:44 -08:00
nios2 tcg: Remove TCGV_UNUSED* and TCGV_IS_UNUSED* 2017-12-29 12:43:39 -08:00
openrisc target/*helper: don't check retaddr before calling cpu_restore_state 2017-12-27 17:20:44 -08:00
ppc target/ppc: more use of the PPC_*() macros 2018-01-10 12:53:00 +11:00
s390x tcg: Remove TCGV_UNUSED* and TCGV_IS_UNUSED* 2017-12-29 12:43:39 -08:00
sh4 tcg: Remove TCGV_UNUSED* and TCGV_IS_UNUSED* 2017-12-29 12:43:39 -08:00
sparc target/sparc: remove MemoryRegionSection check code from sparc_cpu_get_phys_page_debug() 2018-01-09 21:31:31 +00:00
tilegx tcg: Remove TCGV_UNUSED* and TCGV_IS_UNUSED* 2017-12-29 12:43:39 -08:00
tricore target/*helper: don't check retaddr before calling cpu_restore_state 2017-12-27 17:20:44 -08:00
unicore32 tcg: Remove TCGV_UNUSED* and TCGV_IS_UNUSED* 2017-12-29 12:43:39 -08:00
xtensa target/xtensa: implement disassembler 2018-01-09 09:55:39 -08:00