mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Liran Alon <LIRAN.ALON@ORACLE.COM>, Wanpeng Li <kernellwp@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm <kvm@vger.kernel.org>, "Radim Krčmář" <rkrcmar@redhat.com>,
	"Wanpeng Li" <wanpeng.li@hotmail.com>,
	"Dmitry Vyukov" <dvyukov@google.com>
Subject: Re: [PATCH] KVM: VMX: Fix vmx->nested freeing when no SMI handler
Date: Wed, 22 Nov 2017 17:56:26 +0100	[thread overview]
Message-ID: <e4d0ef8d-bddf-0514-1f3e-7b56806cfe49@redhat.com> (raw)
In-Reply-To: <5A1546A7.4080506@ORACLE.COM>

On 22/11/2017 10:43, Liran Alon wrote:
>>>
>>> I think we should also set "vmx->nested.smm.vmxon = false;"
>>> after "vmx->nested.vmxon = false;" to correctlyhandle the case
>>> VMXOFF is executed from SMI handler. Otherwise, when SMI handler
>>> executes RSM, we will reach vmx_pre_leave_smm() which will set
>>> again "vmx->nested.vmxon = true;" which I think shouldn't
>>> happen.
>>
>> I didn't see a real scenario for this.
>
> Actually I later saw that handle_vmoff() calls
> nested_vmx_check_permission() which indeed won't allow to continue
> executing if running from SMI because vmx->nested.vmxon=false; and
> therefore this will raise a #UD. So you are right. :)

Still, not clearing the flag is wrong.  free_nested is also called by
vmx_leave_nested when the host writes 0 to MSR_IA32_FEATURE_CONTROL with
KVM_SET_MSRS.

Paolo

  parent reply	other threads:[~2017-11-22 16:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22  7:56 Wanpeng Li
2017-11-22  8:45 ` Liran Alon
2017-11-22  8:49   ` Wanpeng Li
2017-11-22  9:07   ` Liran Alon
2017-11-22  9:31     ` Wanpeng Li
2017-11-22  9:43       ` Liran Alon
2017-11-22 10:06         ` Dmitry Vyukov
2017-11-22 16:56         ` Paolo Bonzini [this message]
2017-11-23  9:13           ` Wanpeng Li

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=e4d0ef8d-bddf-0514-1f3e-7b56806cfe49@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=LIRAN.ALON@ORACLE.COM \
    --cc=dvyukov@google.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=wanpeng.li@hotmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®