Skip to content

Commit

Permalink
KVM: SVM: Allow setting the SVME bit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Graf authored and Avi Kivity committed Mar 24, 2009
1 parent eb6f302 commit 236de05
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ static int npt = 1;

module_param(npt, int, S_IRUGO);

static int nested = 0;
module_param(nested, int, S_IRUGO);

static void kvm_reput_irq(struct vcpu_svm *svm);
static void svm_flush_tlb(struct kvm_vcpu *vcpu);

Expand Down Expand Up @@ -443,6 +446,11 @@ static __init int svm_hardware_setup(void)
if (boot_cpu_has(X86_FEATURE_NX))
kvm_enable_efer_bits(EFER_NX);

if (nested) {
printk(KERN_INFO "kvm: Nested Virtualization enabled\n");
kvm_enable_efer_bits(EFER_SVME);
}

for_each_online_cpu(cpu) {
r = svm_cpu_init(cpu);
if (r)
Expand Down

0 comments on commit 236de05

Please sign in to comment.