aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2008-11-25 14:17:10 -0500
committerAvi Kivity <avi@redhat.com>2009-03-24 05:02:48 -0400
commit236de05553a7ef8f6940de8686ae9bf1272cd2cf (patch)
tree0e68d3d58ba9d0cc97add91205cb530bb5124298 /arch/x86/kvm/svm.c
parenteb6f302edff9da963e687bf6c15dcf88843b1c3b (diff)
KVM: SVM: Allow setting the SVME bit
Normally setting the SVME bit in EFER is not allowed, as we did not support SVM. Not since we do, we should also allow enabling SVM mode. v2 comes as last patch, so we don't enable half-ready code v4 introduces a module option to enable SVM v6 warns that nesting is enabled Acked-by: Joerg Roedel <joro@8bytes.org> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index df5b41192661..0fbbde54ecae 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -69,6 +69,9 @@ static int npt = 1;
69 69
70module_param(npt, int, S_IRUGO); 70module_param(npt, int, S_IRUGO);
71 71
72static int nested = 0;
73module_param(nested, int, S_IRUGO);
74
72static void kvm_reput_irq(struct vcpu_svm *svm); 75static void kvm_reput_irq(struct vcpu_svm *svm);
73static void svm_flush_tlb(struct kvm_vcpu *vcpu); 76static void svm_flush_tlb(struct kvm_vcpu *vcpu);
74 77
@@ -443,6 +446,11 @@ static __init int svm_hardware_setup(void)
443 if (boot_cpu_has(X86_FEATURE_NX)) 446 if (boot_cpu_has(X86_FEATURE_NX))
444 kvm_enable_efer_bits(EFER_NX); 447 kvm_enable_efer_bits(EFER_NX);
445 448
449 if (nested) {
450 printk(KERN_INFO "kvm: Nested Virtualization enabled\n");
451 kvm_enable_efer_bits(EFER_SVME);
452 }
453
446 for_each_online_cpu(cpu) { 454 for_each_online_cpu(cpu) {
447 r = svm_cpu_init(cpu); 455 r = svm_cpu_init(cpu);
448 if (r) 456 if (r)