qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>
Subject: [Qemu-devel] [PULL 9/9] target-i386: kvm: Print warning when clearing mcg_cap bits
Date: Wed, 25 Nov 2015 18:19:16 +0100	[thread overview]
Message-ID: <1448471956-66873-10-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1448471956-66873-1-git-send-email-pbonzini@redhat.com>

From: Eduardo Habkost <ehabkost@redhat.com>

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 <ehabkost@redhat.com>
[Avoid \n at end of error_report. - Paolo]
Signed-off-by: Paolo Bonzini <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) {
-- 
1.8.3.1

  parent reply	other threads:[~2015-11-25 17:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 17:19 [Qemu-devel] [PULL 0/9] Misc patches for QEMU 2.5-rc2 (2015-11-25) Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 1/9] MAINTAINERS: Update TCG CPU cores section Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values Paolo Bonzini
2015-11-25 17:44   ` Peter Maydell
2015-11-25 17:50     ` Paolo Bonzini
2015-11-25 19:18       ` Peter Maydell
2015-11-25 19:30         ` Paolo Bonzini
2015-11-25 19:54           ` Peter Maydell
2015-11-25 21:05             ` Paolo Bonzini
2015-11-25 21:22               ` Peter Maydell
2015-11-25 17:19 ` [Qemu-devel] [PULL 3/9] call bdrv_drain_all() even if the vm is stopped Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 4/9] Revert "exec: silence hugetlbfs warning under qtest" Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 5/9] exec: remove warning about mempath and hugetlbfs Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 6/9] target-sparc: fix 32-bit truncation in fpackfix Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 7/9] target-i386: kvm: Abort if MCE bank count is not supported by host Paolo Bonzini
2015-11-25 17:19 ` [Qemu-devel] [PULL 8/9] target-i386: kvm: Use env->mcg_cap when setting up MCE Paolo Bonzini
2015-11-25 17:19 ` Paolo Bonzini [this message]
2015-11-26  9:46 ` [Qemu-devel] [PULL 0/9] Misc patches for QEMU 2.5-rc2 (2015-11-25) Peter Maydell
2015-11-26 10:40   ` Paolo Bonzini
2015-11-26 10:56     ` Peter Maydell
2015-11-26 11:23       ` Paolo Bonzini
2015-11-26 11:28         ` Peter Maydell
2015-11-26 12:15           ` Markus Armbruster
2015-11-26 12:19             ` Peter Maydell
2015-11-26 13:07               ` Paolo Bonzini
2015-11-26 13:04           ` Paolo Bonzini
2015-11-26 15:01             ` Peter Maydell
2015-11-26 15:40               ` Paolo Bonzini
2015-11-26 15:55                 ` Peter Maydell
2015-11-26 16:06                   ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2015-11-26 15:52 [Qemu-devel] [PULL v2 0/9] Misc patches for QEMU 2.5-rc2 Paolo Bonzini
2015-11-26 15:52 ` [Qemu-devel] [PULL 9/9] target-i386: kvm: Print warning when clearing mcg_cap bits Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448471956-66873-10-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).