All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Kashyap Chamarthy <kchamart@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	kvm@vger.kernel.org, dgilbert@redhat.com
Subject: Re: [nVMX] With 3.20.0-0.rc0.git5.1 on L0, booting L2 guest results in L1 *rebooting*
Date: Thu, 19 Feb 2015 17:02:22 +0100	[thread overview]
Message-ID: <20150219160221.GB19057@potion.brq.redhat.com> (raw)
In-Reply-To: <20150219150159.GA19057@potion.brq.redhat.com>

2015-02-19 16:01+0100, Radim Krčmář:
> 2015-02-19 13:07+0100, Kashyap Chamarthy:
> 5f3d5799974b8 KVM: nVMX: Rework event injection and recovery:
>   This concept is based on the rule that a pending vmlaunch/vmresume is
>   not canceled. Otherwise, we would risk to lose injected events or leak
>   them into the wrong queues. Encode this rule via a WARN_ON_ONCE at the
>   entry of nested_vmx_vmexit.
> 
> I wonder if we have broken the invariant since 3.9 ...

e011c663b9c786d115c0f45e5b0bfae0c39428d4
KVM: nVMX: Check all exceptions for intercept during delivery to L2

  All exceptions should be checked for intercept during delivery to L2,
  but we check only #PF currently. Drop nested_run_pending while we are
  at it since exception cannot be injected during vmentry anyway.

The last sentence is not true.

Can you try if the following patch works?
(I know little about nested, so it might be introducing another bug.)

Thanks.

---8<---
KVM: nVMX: fix L2 to L1 interrupt leak

When vmx->nested.nested_run_pending is set, we aren't expected to exit
to L1, but nested_vmx_check_exception() could, since e011c663b9c7.
Prevent that.

Fixes: e011c663b9c7 ("Check all exceptions for intercept during delivery to L2")
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 arch/x86/kvm/vmx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 3f73bfad0349..389166a1b79a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2098,6 +2098,9 @@ static int nested_vmx_check_exception(struct kvm_vcpu *vcpu, unsigned nr)
 {
 	struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
 
+	if (to_vmx(vcpu)->nested.nested_run_pending)
+		return 0;
+
 	if (!(vmcs12->exception_bitmap & (1u << nr)))
 		return 0;
 
-- 
2.3.0


  reply	other threads:[~2015-02-19 16:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 20:40 [nVMX] With 3.20.0-0.rc0.git5.1 on L0, booting L2 guest results in L1 *rebooting* Kashyap Chamarthy
2015-02-17  6:02 ` Jan Kiszka
2015-02-17 11:24   ` Kashyap Chamarthy
2015-02-17 18:00     ` Bandan Das
2015-02-17 18:07       ` Jan Kiszka
2015-02-18 10:20         ` Kashyap Chamarthy
2015-02-18 16:42     ` Paolo Bonzini
2015-02-19 12:07       ` Kashyap Chamarthy
2015-02-19 15:01         ` Radim Krčmář
2015-02-19 16:02           ` Radim Krčmář [this message]
2015-02-19 16:07             ` Radim Krčmář
2015-02-19 21:10             ` Kashyap Chamarthy
2015-02-19 22:28               ` Kashyap Chamarthy
2015-02-20 16:14                 ` Radim Krčmář
2015-02-20 19:45                   ` Kashyap Chamarthy
2015-02-22 15:46                     ` Kashyap Chamarthy
2015-02-23 13:56                       ` Radim Krčmář
2015-02-23 16:14                         ` Kashyap Chamarthy
2015-02-23 17:09                           ` Kashyap Chamarthy
2015-02-23 18:05                             ` Kashyap Chamarthy
2015-02-24 16:30                               ` [PATCH] KVM: nVMX: mask unrestricted_guest if disabled on L0 Radim Krčmář
2015-02-24 16:39                                 ` Jan Kiszka
2015-02-24 18:32                                   ` Bandan Das
2015-02-25 15:50                                 ` Kashyap Chamarthy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150219160221.GB19057@potion.brq.redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kchamart@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.