diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2013-04-02 17:48:12 -0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-03 15:06:37 -0500 |
commit | a509d632c877f7b5fa07368879b8ae5919a6d345 (patch) | |
tree | 176b3f2526183e252445ef75c38dc7ea87414669 /target-i386/cpu.c | |
parent | 8243b0464b247ff460178a15f1fe306ef9c70b49 (diff) | |
download | qemu-a509d632c877f7b5fa07368879b8ae5919a6d345.zip qemu-a509d632c877f7b5fa07368879b8ae5919a6d345.tar.gz qemu-a509d632c877f7b5fa07368879b8ae5919a6d345.tar.bz2 |
target-i386: Check for host features before filter_features_for_kvm()
commit 5ec01c2e96910e1588d1a0de8609b9dda7618c7f 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>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r-- | target-i386/cpu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 4b43759..bf717d5 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -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 |