mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peng Hao <flyingpenghao@gmail.com>, seanjc@google.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM:nVMX: Make setup/unsetup under the same conditions
Date: Thu, 24 Feb 2022 15:23:43 +0100	[thread overview]
Message-ID: <3896e3b5-0e6c-858a-8e4f-732ab03b7286@redhat.com> (raw)
In-Reply-To: <20220222104054.70286-1-flyingpeng@tencent.com>

On 2/22/22 11:40, Peng Hao wrote:
> From: Peng Hao <flyingpeng@tencent.com>
> 
> Make sure nested_vmx_hardware_setup/unsetup() are called in pairs under
> the same conditions.  Calling nested_vmx_hardware_unsetup() when nested
> is false "works" right now because it only calls free_page() on zero-
> initialized pointers, but it's possible that more code will be added to
> nested_vmx_hardware_unsetup() in the future.
> 
> Reviewed-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>
> ---
>   arch/x86/kvm/vmx/vmx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 75ed7d6f35cc..9fad3c73395a 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -7852,7 +7852,7 @@ static __init int hardware_setup(void)
>   	vmx_set_cpu_caps();
>   
>   	r = alloc_kvm_area();
> -	if (r)
> +	if (r && nested)
>   		nested_vmx_hardware_unsetup();
>   
>   	kvm_set_posted_intr_wakeup_handler(pi_wakeup_handler);

Queued, thanks.

Paolo

      parent reply	other threads:[~2022-02-24 14:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 10:40 Peng Hao
2022-02-22 15:19 ` Sean Christopherson
2022-02-24 14:23 ` Paolo Bonzini [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=3896e3b5-0e6c-858a-8e4f-732ab03b7286@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=flyingpenghao@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanjc@google.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®