lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 3 May 2024 06:24:47 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Wei W Wang <wei.w.wang@...el.com>
Cc: "pbonzini@...hat.com" <pbonzini@...hat.com>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>, 
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 3/3] KVM: x86/pmu: Add KVM_PMU_CALL() to simplify
 static calls of kvm_pmu_ops

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ