Received: from eggs.gnu.org ([2001:4830:134:3::10]:38624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1yqZ-0005Yr-Cr for qemu-devel@nongnu.org; Thu, 26 Nov 2015 10:52:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1yqY-0001l1-LY for qemu-devel@nongnu.org; Thu, 26 Nov 2015 10:52:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1yqY-0001kv-GV for qemu-devel@nongnu.org; Thu, 26 Nov 2015 10:52:34 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 2EA9BE7097 for ; Thu, 26 Nov 2015 15:52:34 +0000 (UTC) From: Paolo Bonzini Date: Thu, 26 Nov 2015 16:52:17 +0100 Message-Id: <1448553137-22191-10-git-send-email-pbonzini@redhat.com> In-Reply-To: <1448553137-22191-1-git-send-email-pbonzini@redhat.com> References: <1448553137-22191-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 9/9] target-i386: kvm: Print warning when clearing mcg_cap bits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eduardo Habkost From: Eduardo Habkost Instead of silently clearing mcg_cap bits when the host doesn't support them, print a warning when doing that. Signed-off-by: Eduardo Habkost [Avoid \n at end of error_report. - Paolo] Signed-off-by: Paolo Bonzini Message-Id: <1448471956-66873-10-git-send-email-pbonzini@redhat.com> --- target-i386/kvm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 90bd447..6dc9846 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -774,7 +774,7 @@ int kvm_arch_init_vcpu(CPUState *cs) && (env->features[FEAT_1_EDX] & (CPUID_MCE | CPUID_MCA)) == (CPUID_MCE | CPUID_MCA) && kvm_check_extension(cs->kvm_state, KVM_CAP_MCE) > 0) { - uint64_t mcg_cap; + uint64_t mcg_cap, unsupported_caps; int banks; int ret; @@ -790,6 +790,12 @@ int kvm_arch_init_vcpu(CPUState *cs) return -ENOTSUP; } + unsupported_caps = env->mcg_cap & ~(mcg_cap | MCG_CAP_BANKS_MASK); + if (unsupported_caps) { + error_report("warning: Unsupported MCG_CAP bits: 0x%" PRIx64, + unsupported_caps); + } + env->mcg_cap &= mcg_cap | MCG_CAP_BANKS_MASK; ret = kvm_vcpu_ioctl(cs, KVM_X86_SETUP_MCE, &env->mcg_cap); if (ret < 0) { -- 2.5.0