aboutsummaryrefslogtreecommitdiff
path: root/target-i386/cpu.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2014-10-03 16:39:51 -0300
committerAndreas Färber <afaerber@suse.de>2014-11-04 15:49:05 +0100
commit75d373ef9729bd22fbc46bfd8dcd158cbf6d9777 (patch)
treee16f2535c672136c7d3006f7fa1fe5985dba5cb5 /target-i386/cpu.c
parente93abc147fa628650bdbe7fd57f27462ca40a3c2 (diff)
target-i386: Disable SVM by default in KVM mode
Make SVM be disabled by default on all CPU models when in KVM mode. Nested SVM is enabled by default in the KVM kernel module, but it is probably less stable than nested VMX (which is already disabled by default). Add a new compat function, x86_cpu_compat_kvm_no_autodisable(), to keep compatibility on previous machine-types. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r--target-i386/cpu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index b731832077..fa860de55c 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -461,6 +461,7 @@ static uint32_t kvm_default_features[FEATURE_WORDS] = {
static uint32_t kvm_default_unset_features[FEATURE_WORDS] = {
[FEAT_1_EDX] = CPUID_ACPI,
[FEAT_1_ECX] = CPUID_EXT_MONITOR,
+ [FEAT_8000_0001_ECX] = CPUID_EXT3_SVM,
};
void x86_cpu_compat_kvm_no_autoenable(FeatureWord w, uint32_t features)
@@ -468,6 +469,11 @@ void x86_cpu_compat_kvm_no_autoenable(FeatureWord w, uint32_t features)
kvm_default_features[w] &= ~features;
}
+void x86_cpu_compat_kvm_no_autodisable(FeatureWord w, uint32_t features)
+{
+ kvm_default_unset_features[w] &= ~features;
+}
+
/*
* Returns the set of feature flags that are supported and migratable by
* QEMU, for a given FeatureWord.