qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Liran Alon <liran.alon@oracle.com>, qemu-devel@nongnu.org
Cc: Karl Heubaum <karl.heubaum@oracle.com>, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] target/i386: kvm: Fix when nested state is needed for migration
Date: Tue, 2 Jul 2019 18:39:58 +0200	[thread overview]
Message-ID: <6499083f-c159-1c3e-0339-87aa5b13c2c0@redhat.com> (raw)
In-Reply-To: <20190624230514.53326-1-liran.alon@oracle.com>

On 25/06/19 01:05, Liran Alon wrote:
> When vCPU is in VMX operation and enters SMM mode,
> it temporarily exits VMX operation but KVM maintained nested-state
> still stores the VMXON region physical address, i.e. even when the
> vCPU is in SMM mode then (nested_state->hdr.vmx.vmxon_pa != -1ull).
> 
> Therefore, there is no need to explicitly check for
> KVM_STATE_NESTED_SMM_VMXON to determine if it is necessary
> to save nested-state as part of migration stream.
> 
> In addition, destination must enable eVMCS if it is enabled on
> source as specified by the KVM_STATE_NESTED_EVMCS flag, even if
> the VMXON region is not set. Thus, change the code to require saving
> nested-state as part of migration stream in case it is set.
> 
> Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
> Signed-off-by: Liran Alon <liran.alon@oracle.com>
> ---
>  target/i386/machine.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/i386/machine.c b/target/i386/machine.c
> index 851b249d1a39..e7d72faf9e24 100644
> --- a/target/i386/machine.c
> +++ b/target/i386/machine.c
> @@ -999,7 +999,7 @@ static bool vmx_nested_state_needed(void *opaque)
>  
>      return ((nested_state->format == KVM_STATE_NESTED_FORMAT_VMX) &&
>              ((nested_state->hdr.vmx.vmxon_pa != -1ull) ||
> -             (nested_state->hdr.vmx.smm.flags & KVM_STATE_NESTED_SMM_VMXON)));
> +             (nested_state->flags & KVM_STATE_NESTED_EVMCS)));
>  }
>  
>  static const VMStateDescription vmstate_vmx_nested_state = {
> 

Queued, thanks.

Paolo


  reply	other threads:[~2019-07-02 18:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 23:05 [Qemu-devel] [PATCH] target/i386: kvm: Fix when nested state is needed for migration Liran Alon
2019-07-02 16:39 ` Paolo Bonzini [this message]
2019-07-04 14:31   ` Liran Alon
2019-07-04 15:29     ` Paolo Bonzini
2019-07-04 15:34       ` Liran Alon

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=6499083f-c159-1c3e-0339-87aa5b13c2c0@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=karl.heubaum@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=liran.alon@oracle.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).