KVM: SVM: Sync efer back into nested vmcb
authorJoerg Roedel <joerg.roedel@amd.com>
Tue, 27 Jul 2010 16:14:20 +0000 (18:14 +0200)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:50:03 +0000 (10:50 +0200)
This patch fixes a bug in a nested hypervisor that heavily
switches between real-mode and long-mode. The problem is
fixed by syncing back efer into the guest vmcb on emulated
vmexit.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/svm.c

index 8a3f9f64f86f9e7fee5bc5112bf50a04fbe37b15..09704a0501d76b3d6d15a45ead12eb0809610429 100644 (file)
@@ -1896,6 +1896,7 @@ static int nested_svm_vmexit(struct vcpu_svm *svm)
        nested_vmcb->save.ds     = vmcb->save.ds;
        nested_vmcb->save.gdtr   = vmcb->save.gdtr;
        nested_vmcb->save.idtr   = vmcb->save.idtr;
+       nested_vmcb->save.efer   = svm->vcpu.arch.efer;
        nested_vmcb->save.cr0    = kvm_read_cr0(&svm->vcpu);
        nested_vmcb->save.cr3    = svm->vcpu.arch.cr3;
        nested_vmcb->save.cr2    = vmcb->save.cr2;