From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: [PATCH v3 1/2] kvm: Simplify invtsc check Date: Sun, 8 Jan 2017 15:32:33 -0200 Message-ID: <20170108173234.25721-2-ehabkost@redhat.com> References: <20170108173234.25721-1-ehabkost@redhat.com> Cc: Marcelo Tosatti , Paolo Bonzini , kvm@vger.kernel.org, Haozhong Zhang To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50894 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752549AbdAHRcl (ORCPT ); Sun, 8 Jan 2017 12:32:41 -0500 In-Reply-To: <20170108173234.25721-1-ehabkost@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Instead of searching the table we have just built, we can check the env->features field directly. Reviewed-by: Marcelo Tosatti Signed-off-by: Eduardo Habkost --- 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