public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nVMX: Fix bug preventing more than two levels of nesting
@ 2011-06-02  8:54 Nadav Har'El
  2011-06-03  2:06 ` Marcelo Tosatti
  0 siblings, 1 reply; 2+ messages in thread
From: Nadav Har'El @ 2011-06-02  8:54 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, Tian, Kevin

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>
---
 arch/x86/kvm/vmx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- .before/arch/x86/kvm/vmx.c	2011-06-02 10:46:13.000000000 +0300
+++ .after/arch/x86/kvm/vmx.c	2011-06-02 10:46:13.000000000 +0300
@@ -5691,8 +5691,8 @@ static int vmx_handle_exit(struct kvm_vc
 	if (vmx->nested.nested_run_pending)
 		kvm_make_request(KVM_REQ_EVENT, vcpu);
 
-	if (exit_reason == EXIT_REASON_VMLAUNCH ||
-	    exit_reason == EXIT_REASON_VMRESUME)
+	if (!is_guest_mode(vcpu) && (exit_reason == EXIT_REASON_VMLAUNCH ||
+	    exit_reason == EXIT_REASON_VMRESUME))
 		vmx->nested.nested_run_pending = 1;
 	else
 		vmx->nested.nested_run_pending = 0;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] nVMX: Fix bug preventing more than two levels of nesting
  2011-06-02  8:54 [PATCH] nVMX: Fix bug preventing more than two levels of nesting Nadav Har'El
@ 2011-06-03  2:06 ` Marcelo Tosatti
  0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2011-06-03  2:06 UTC (permalink / raw)
  To: Nadav Har'El; +Cc: Avi Kivity, kvm, Tian, Kevin

On Thu, Jun 02, 2011 at 11:54:52AM +0300, Nadav Har'El wrote:
> 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>

Applied, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-03  2:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-02  8:54 [PATCH] nVMX: Fix bug preventing more than two levels of nesting Nadav Har'El
2011-06-03  2:06 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox