All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Kechen Lu <kechenl@nvidia.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/5] KVM: x86: Use common 'enable_apicv' variable for both APICv and AVIC
Date: Wed, 26 May 2021 18:52:24 +0300	[thread overview]
Message-ID: <8e2570c580baf6d4d650ebc28b98a5ed76cb4f9b.camel@redhat.com> (raw)
In-Reply-To: <YK5kQcTh8LmE0+8I@google.com>

On Wed, 2021-05-26 at 15:07 +0000, Sean Christopherson wrote:
> On Wed, May 26, 2021, Maxim Levitsky wrote:
> > On Tue, 2021-05-18 at 16:43 +0200, Vitaly Kuznetsov wrote:
> > > Unify VMX and SVM code by moving APICv/AVIC enablement tracking to common
> > > 'enable_apicv' variable. Note: unlike APICv, AVIC is disabled by default.
> > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > > index 9b6bca616929..23fdbba6b394 100644
> > > --- a/arch/x86/kvm/x86.c
> > > +++ b/arch/x86/kvm/x86.c
> > > @@ -209,6 +209,9 @@ EXPORT_SYMBOL_GPL(host_efer);
> > >  bool __read_mostly allow_smaller_maxphyaddr = 0;
> > >  EXPORT_SYMBOL_GPL(allow_smaller_maxphyaddr);
> > >  
> > > +bool __read_mostly enable_apicv = true;
> > 
> > Nitpick: I don't like this asymmetry.
> > 
> > VMX and the common code uses the enable_apicv module param and variable,
> > while SVM uses avic, which sets the enable_apicv variable.
> >  
> > I'll prefer both VMX and SVM have their own private variable for their
> > avic/apicv module param, which should set a common variable later.
> 
> I don't love the intermediate "avic" either, but there isn't a good alternative.
> Forcing VMX to also use an intermediate doesn't make much sense, we'd be penalizing
> ourselves in the form of unnecessary complexity just because AVIC needs to be
> disabled by default for reasons KVM can't fix.
This is also something we should eventually reconsider. 
These days, the AVIC works quite well and disables itself when needed.
When do you think it will be the time to enable it by default?

> 
> As for the asymmetry, I actually like it because it makes "avic" stand out and
> highlights that there is weirdness with enabling AVIC.
You mean that it is disabled by default?

Anyway I don't have that strong opinion on this,
so let it be like this.

Best regards,
	Maxim Levitsky


> 



  reply	other threads:[~2021-05-26 15:52 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 14:43 [PATCH v2 0/5] KVM: x86: hyper-v: Conditionally allow SynIC with APICv/AVIC Vitaly Kuznetsov
2021-05-18 14:43 ` [PATCH v2 1/5] KVM: SVM: Drop unneeded CONFIG_X86_LOCAL_APIC check for AVIC Vitaly Kuznetsov
2021-05-18 19:57   ` Sean Christopherson
2021-05-26  9:54   ` Maxim Levitsky
2021-05-18 14:43 ` [PATCH v2 2/5] KVM: VMX: Drop unneeded CONFIG_X86_LOCAL_APIC check from cpu_has_vmx_posted_intr() Vitaly Kuznetsov
2021-05-18 19:57   ` Sean Christopherson
2021-05-26  9:54   ` Maxim Levitsky
2021-05-18 14:43 ` [PATCH v2 3/5] KVM: x86: Use common 'enable_apicv' variable for both APICv and AVIC Vitaly Kuznetsov
2021-05-18 20:39   ` Sean Christopherson
2021-05-19  7:58     ` Vitaly Kuznetsov
2021-05-24 16:18     ` Paolo Bonzini
2021-05-24 16:52       ` Sean Christopherson
2021-05-24 17:02         ` Paolo Bonzini
2021-05-26  9:56   ` Maxim Levitsky
2021-05-26 15:07     ` Sean Christopherson
2021-05-26 15:52       ` Maxim Levitsky [this message]
2021-05-27 11:39         ` Paolo Bonzini
2021-05-18 14:43 ` [PATCH v2 4/5] KVM: x86: Invert APICv/AVIC enablement check Vitaly Kuznetsov
2021-05-18 21:05   ` Sean Christopherson
2021-05-26  9:57   ` Maxim Levitsky
2021-05-26 10:40     ` Vitaly Kuznetsov
2021-05-26 11:11       ` Maxim Levitsky
2021-05-18 14:43 ` [PATCH v2 5/5] KVM: x86: hyper-v: Deactivate APICv only when AutoEOI feature is in use Vitaly Kuznetsov
2021-05-24 16:21   ` Paolo Bonzini
2021-05-25  6:23     ` Vitaly Kuznetsov
2021-05-25  7:11       ` Paolo Bonzini
2021-05-26 10:02     ` Maxim Levitsky
2021-05-26 10:01   ` Maxim Levitsky
2021-05-26  9:54 ` [PATCH v2 0/5] KVM: x86: hyper-v: Conditionally allow SynIC with APICv/AVIC Maxim Levitsky
2021-05-27  8:35   ` Vitaly Kuznetsov
2021-05-27 15:49     ` Maxim Levitsky

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=8e2570c580baf6d4d650ebc28b98a5ed76cb4f9b.camel@redhat.com \
    --to=mlevitsk@redhat.com \
    --cc=jmattson@google.com \
    --cc=kechenl@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.