summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2017-01-08 15:32:33 -0200
committerEduardo Habkost <ehabkost@redhat.com>2017-01-23 21:26:27 -0200
commitd74460ec1bfaad740eee79bf7cb111b1125ffdef (patch)
treeca402f6c57c25d29361a70443126fba7c810b336
parent3964ec6c0b49e4c2fa3e48fdbbb7d8ff0c1cb00b (diff)
downloadfocaccia-qemu-d74460ec1bfaad740eee79bf7cb111b1125ffdef.tar.gz
focaccia-qemu-d74460ec1bfaad740eee79bf7cb111b1125ffdef.zip
kvm: Simplify invtsc check
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>
Message-Id: <20170108173234.25721-2-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--target/i386/kvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index e6c4f754ab..9744552b8a 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -963,8 +963,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"