public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: Fix mmu_reload() clash with nested vmx event injection
Date: Wed, 16 May 2012 18:12:44 -0300	[thread overview]
Message-ID: <20120516211244.GA25397@amt.cnet> (raw)
In-Reply-To: <1337008076-18956-1-git-send-email-avi@redhat.com>

On Mon, May 14, 2012 at 06:07:56PM +0300, Avi Kivity wrote:
> Currently the inject_pending_event() call during guest entry happens after
> kvm_mmu_reload().  This is for historical reasons - we used to
> inject_pending_event() in atomic context, while kvm_mmu_reload() needs task
> context.
> 
> A problem is that nested vmx can cause the mmu context to be reset, if event
> injection is intercepted and causes a #VMEXIT instead (the #VMEXIT resets
> CR0/CR3/CR4).  If this happens, we end up with invalid root_hpa, and since
> kvm_mmu_reload() has already run, no one will fix it and we end up entering
> the guest this way.
> 
> Fix by reordering event injection to be before kvm_mmu_reload().  Use
> ->cancel_injection() to undo if kvm_mmu_reload() fails.
> 
> https://bugzilla.kernel.org/show_bug.cgi?id=42980
> 
> Reported-by: Luke-Jr <luke-jr+linuxbugs@utopios.org>
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
>  arch/x86/kvm/x86.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Applied, thanks.


      reply	other threads:[~2012-05-16 21:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 15:07 [PATCH] KVM: Fix mmu_reload() clash with nested vmx event injection Avi Kivity
2012-05-16 21:12 ` Marcelo Tosatti [this message]

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=20120516211244.GA25397@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox