]> git.proxmox.com Git - mirror_qemu.git/commitdiff
kvm: Simplify invtsc check
authorEduardo Habkost <ehabkost@redhat.com>
Sun, 8 Jan 2017 17:32:33 +0000 (15:32 -0200)
committerEduardo Habkost <ehabkost@redhat.com>
Mon, 23 Jan 2017 23:26:27 +0000 (21:26 -0200)
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>
target/i386/kvm.c

index e6c4f754ab513f0abc20cd27480bc34694b15ba0..9744552b8aa9a0534c4c03d9a849d3d24f4c47c6 100644 (file)
@@ -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"