mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Gaoning Pan <pgn@zju.edu.cn>, Yongkang Jia <kangel@zju.edu.cn>
Subject: Re: [PATCH 4/4] KVM: x86: Skip KVM_GUESTDBG_BLOCKIRQ APICv update if APICv is disabled
Date: Mon, 18 Apr 2022 15:50:00 +0300	[thread overview]
Message-ID: <e04e7ad7630d64a2d159ea80b0751f6d09f95514.camel@redhat.com> (raw)
In-Reply-To: <20220416034249.2609491-5-seanjc@google.com>

On Sat, 2022-04-16 at 03:42 +0000, Sean Christopherson wrote:
> Skip the APICv inhibit update for KVM_GUESTDBG_BLOCKIRQ if APICv is
> disabled at the module level to avoid having to acquire the mutex and
> potentially process all vCPUs. The DISABLE inhibit will (barring bugs)
> never be lifted, so piling on more inhibits is unnecessary.
> 
> Fixes: cae72dcc3b21 ("KVM: x86: inhibit APICv when KVM_GUESTDBG_BLOCKIRQ active")
> Cc: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>  arch/x86/kvm/x86.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 09a270cc1c8f..16c5fa7d165d 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -11048,6 +11048,9 @@ static void kvm_arch_vcpu_guestdbg_update_apicv_inhibit(struct kvm *kvm)
>  	struct kvm_vcpu *vcpu;
>  	unsigned long i;
>  
> +	if (!enable_apicv)
> +		return;
> +
>  	down_write(&kvm->arch.apicv_update_lock);
>  
>  	kvm_for_each_vcpu(i, vcpu, kvm) {

Makes sense as a precation.

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>


Best regards,
	Maxim Levitsky


      reply	other threads:[~2022-04-18 13:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-16  3:42 [PATCH 0/4] KVM: x86: APICv fixes Sean Christopherson
2022-04-16  3:42 ` [PATCH 1/4] KVM: x86: Tag APICv DISABLE inhibit, not ABSENT, if APICv is disabled Sean Christopherson
2022-04-18  8:37   ` Maxim Levitsky
2022-04-16  3:42 ` [PATCH 2/4] KVM: nVMX: Defer APICv updates while L2 is active until L1 is active Sean Christopherson
2022-04-18 12:49   ` Maxim Levitsky
2022-04-18 15:35     ` Sean Christopherson
2022-04-19  6:44       ` Maxim Levitsky
2022-04-19 15:57         ` Sean Christopherson
2022-04-16  3:42 ` [PATCH 3/4] KVM: x86: Pend KVM_REQ_APICV_UPDATE during vCPU creation to fix a race Sean Christopherson
2022-04-18 12:49   ` Maxim Levitsky
2022-04-16  3:42 ` [PATCH 4/4] KVM: x86: Skip KVM_GUESTDBG_BLOCKIRQ APICv update if APICv is disabled Sean Christopherson
2022-04-18 12:50   ` Maxim Levitsky [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=e04e7ad7630d64a2d159ea80b0751f6d09f95514.camel@redhat.com \
    --to=mlevitsk@redhat.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kangel@zju.edu.cn \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=pgn@zju.edu.cn \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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

Powered by JetHome