aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorNadav Har'El <nyh@il.ibm.com>2011-06-02 04:54:52 -0400
committerAvi Kivity <avi@redhat.com>2011-07-12 06:16:11 -0400
commit509c75ea198fe524adaf90ca1021487b733447ce (patch)
treeca92220fc48fca56c882a395bd8527863983a936 /arch/x86
parent7f4382e8fd8c87bcb7122a2f63c03e8713f594a0 (diff)
KVM: nVMX: Fix bug preventing more than two levels of nesting
The nested VMX feature is supposed to fully emulate VMX for the guest. This (theoretically) not only allows it to run its own guests, but also also to further emulate VMX for its own guests, and allow arbitrarily deep nesting. This patch fixes a bug (discovered by Kevin Tian) in handling a VMLAUNCH by L2, which prevented deeper nesting. Deeper nesting now works (I only actually tested L3), but is currently *absurdly* slow, to the point of being unusable. Signed-off-by: Nadav Har'El <nyh@il.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/vmx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 58badf1657d4..f5b49c7fc89d 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5694,8 +5694,8 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
5694 if (vmx->nested.nested_run_pending) 5694 if (vmx->nested.nested_run_pending)
5695 kvm_make_request(KVM_REQ_EVENT, vcpu); 5695 kvm_make_request(KVM_REQ_EVENT, vcpu);
5696 5696
5697 if (exit_reason == EXIT_REASON_VMLAUNCH || 5697 if (!is_guest_mode(vcpu) && (exit_reason == EXIT_REASON_VMLAUNCH ||
5698 exit_reason == EXIT_REASON_VMRESUME) 5698 exit_reason == EXIT_REASON_VMRESUME))
5699 vmx->nested.nested_run_pending = 1; 5699 vmx->nested.nested_run_pending = 1;
5700 else 5700 else
5701 vmx->nested.nested_run_pending = 0; 5701 vmx->nested.nested_run_pending = 0;