OSDN Git Service

target-i386: kvm: Abort if MCE bank count is not supported by host
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 25 Nov 2015 17:19:14 +0000 (18:19 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 26 Nov 2015 15:48:07 +0000 (16:48 +0100)
commit49b69cbfcd6e32e2178d6ff7e5d60689c3f79c6e
treee39c6cb19968f106fb350974227c3d1740748e4f
parent3e32e8a96e6995cde3d8a13d68e31226ee83f290
target-i386: kvm: Abort if MCE bank count is not supported by host

Instead of silently changing the number of banks in mcg_cap based
on kvm_get_mce_cap_supported(), abort initialization if the host
doesn't support MCE_BANKS_DEF banks.

Note that MCE_BANKS_DEF was always 10 since it was introduced in
QEMU, and Linux always returned 32 at KVM_CAP_MCE since
KVM_CAP_MCE was introduced, so no behavior is being changed and
the error can't be triggered by any Linux version. The point of
the new check is to ensure we won't silently change the bank
count if we change MCE_BANKS_DEF or make the bank count
configurable in the future.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
[Avoid Yoda condition and \n at end of error_report. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1448471956-66873-8-git-send-email-pbonzini@redhat.com>
target-i386/kvm.c