KVM Archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Wei W Wang <wei.w.wang@intel.com>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 3/3] KVM: x86/pmu: Add KVM_PMU_CALL() to simplify static calls of kvm_pmu_ops
Date: Fri, 3 May 2024 06:24:47 -0700	[thread overview]
Message-ID: <ZjTlkSi9jYn2e9oc@google.com> (raw)
In-Reply-To: <DS0PR11MB6373EA67C70B8579A194089EDC1F2@DS0PR11MB6373.namprd11.prod.outlook.com>

On Fri, May 03, 2024, Wei W Wang wrote:
> On Friday, May 3, 2024 7:36 AM, Sean Christopherson wrote:
> > On Thu, Apr 25, 2024, Wei Wang wrote:
> > >  #define KVM_X86_CALL(func) static_call(kvm_x86_##func)
> > > +#define KVM_PMU_CALL(func) static_call(kvm_x86_pmu_##func)
> > 
> > ...
> > 
> > > @@ -796,7 +796,7 @@ void kvm_pmu_init(struct kvm_vcpu *vcpu)
> > >  	struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
> > >
> > >  	memset(pmu, 0, sizeof(*pmu));
> > > -	static_call(kvm_x86_pmu_init)(vcpu);
> > > +	KVM_PMU_CALL(init)(vcpu);
> > >  	kvm_pmu_refresh(vcpu);
> > 
> > I usually like macros to use CAPS so that they're clearly macros, but in this case
> > I find the code a bit jarring.  Essentially, I *want* my to be fooled into thinking
> > it's a function call, because that's really what it is.
> > 
> > So rather than all caps, what if we follow function naming style?  E.g.
> 
> Yep, it looks good to me, and the coding-style doc mentions that "CAPITALIZED
> macro names are appreciated but macros resembling functions may be named in
> lower case".
> 
> To maintain consistency, maybe apply the same lower-case style for KVM_X86_CALL()?

Yeah, for sure, I should have explicitly called that out.

      reply	other threads:[~2024-05-03 13:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25 12:52 [PATCH v3 0/3] KVM/x86: Enhancements to static calls Wei Wang
2024-04-25 12:52 ` [PATCH v3 1/3] KVM: x86: Replace static_call_cond() with static_call() Wei Wang
2024-04-25 12:52 ` [PATCH v3 2/3] KVM: x86: Introduce KVM_X86_CALL() to simplify static calls of kvm_x86_ops Wei Wang
2024-04-25 12:52 ` [PATCH v3 3/3] KVM: x86/pmu: Add KVM_PMU_CALL() to simplify static calls of kvm_pmu_ops Wei Wang
2024-05-02 23:36   ` Sean Christopherson
2024-05-03  2:15     ` Wang, Wei W
2024-05-03 13:24       ` Sean Christopherson [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=ZjTlkSi9jYn2e9oc@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=wei.w.wang@intel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).