qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, Haozhong Zhang <haozhong.zhang@intel.com>
Subject: [Qemu-devel] [PATCH v3 1/2] kvm: Simplify invtsc check
Date: Sun,  8 Jan 2017 15:32:33 -0200	[thread overview]
Message-ID: <20170108173234.25721-2-ehabkost@redhat.com> (raw)
In-Reply-To: <20170108173234.25721-1-ehabkost@redhat.com>

Instead of searching the table we have just built, we can check
the env->features field directly.

Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 10a9cd8f7f..a26290fdc1 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -962,8 +962,8 @@ int kvm_arch_init_vcpu(CPUState *cs)
         has_msr_mcg_ext_ctl = has_msr_feature_control = true;
     }
 
-    c = cpuid_find_entry(&cpuid_data.cpuid, 0x80000007, 0);
-    if (c && (c->edx & 1<<8) && invtsc_mig_blocker == NULL) {
+    if ((env->features[FEAT_8000_0007_EDX] & CPUID_APM_INVTSC) &&
+        invtsc_mig_blocker == NULL) {
         /* for migration */
         error_setg(&invtsc_mig_blocker,
                    "State blocked by non-migratable CPU device"
-- 
2.11.0.259.g40922b1

  reply	other threads:[~2017-01-08 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-08 17:32 [Qemu-devel] [PATCH v3 0/2] Allow migration with invtsc if TSC frequency is explicitly set Eduardo Habkost
2017-01-08 17:32 ` Eduardo Habkost [this message]
2017-01-08 17:32 ` [Qemu-devel] [PATCH v3 2/2] kvm: Allow invtsc migration if tsc-khz is set explicitly Eduardo Habkost
2017-01-18 12:11 ` [Qemu-devel] [PATCH v3 0/2] Allow migration with invtsc if TSC frequency is explicitly set Marcelo Tosatti

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=20170108173234.25721-2-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=haozhong.zhang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@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).