Skip to content

Commit

Permalink
target-i386: Check for host features before filter_features_for_kvm()
Browse files Browse the repository at this point in the history
commit 5ec01c2 broke "-cpu ..,enforce",
as it has moved kvm_check_features_against_host() after the
filter_features_for_kvm() call. filter_features_for_kvm() removes all
features not supported by the host, so this effectively made
kvm_check_features_against_host() impossible to fail.

This patch changes the call so we check for host feature support before
filtering the feature bits.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-id: 1364935692-24004-1-git-send-email-ehabkost@redhat.com
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
ehabkost authored and Anthony Liguori committed Apr 3, 2013
1 parent 8243b04 commit a509d63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions target-i386/cpu.c
Expand Up @@ -2131,14 +2131,14 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
env->cpuid_ext3_features &= TCG_EXT3_FEATURES;
env->cpuid_svm_features &= TCG_SVM_FEATURES;
} else {
#ifdef CONFIG_KVM
filter_features_for_kvm(cpu);
#endif
if (check_cpuid && kvm_check_features_against_host(cpu)
&& enforce_cpuid) {
error_setg(errp, "Host's CPU doesn't support requested features");
return;
}
#ifdef CONFIG_KVM
filter_features_for_kvm(cpu);
#endif
}

#ifndef CONFIG_USER_ONLY
Expand Down

0 comments on commit a509d63

Please sign in to comment.