aboutsummaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/kvm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 2a9953b2d4..93d1f5eb6b 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -784,11 +784,14 @@ int kvm_arch_init_vcpu(CPUState *cs)
return ret;
}
- if (banks > MCE_BANKS_DEF) {
- banks = MCE_BANKS_DEF;
+ if (banks < MCE_BANKS_DEF) {
+ error_report("kvm: Unsupported MCE bank count (QEMU = %d, KVM = %d)",
+ MCE_BANKS_DEF, banks);
+ return -ENOTSUP;
}
+
mcg_cap &= MCE_CAP_DEF;
- mcg_cap |= banks;
+ mcg_cap |= MCE_BANKS_DEF;
ret = kvm_vcpu_ioctl(cs, KVM_X86_SETUP_MCE, &mcg_cap);
if (ret < 0) {
fprintf(stderr, "KVM_X86_SETUP_MCE: %s", strerror(-ret));