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:   Mon, 8 Nov 2021 15:41:56 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     Like Xu <like.xu.linux@...il.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] KVM: x86: Introduce definitions to support static
 calls for kvm_pmu_ops

On Mon, Nov 08, 2021, Like Xu wrote:
> On 5/11/2021 11:48 pm, Sean Christopherson wrote:
> > On Wed, Nov 03, 2021, Like Xu wrote:
> > > diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
> > > index 0db1887137d9..b6f08c719125 100644
> > > --- a/arch/x86/kvm/pmu.c
> > > +++ b/arch/x86/kvm/pmu.c
> > > @@ -50,6 +50,13 @@
> > >   struct kvm_pmu_ops kvm_pmu_ops __read_mostly;
> > >   EXPORT_SYMBOL_GPL(kvm_pmu_ops);
> > > +#define	KVM_X86_PMU_OP(func)	\
> > > +	DEFINE_STATIC_CALL_NULL(kvm_x86_pmu_##func,	\
> > > +				*(((struct kvm_pmu_ops *)0)->func))
> > > +#define	KVM_X86_PMU_OP_NULL	KVM_X86_PMU_OP
> > 
> > More of a question for the existing code, what's the point of KVM_X86_OP_NULL?
> 
> The comment says:
> 
>  * KVM_X86_OP_NULL() can leave a NULL definition for the
>  * case where there is no definition or a function name that
>  * doesn't match the typical naming convention is supplied.
> 
> Does it help ?

No.  I understand the original intent of KVM_X86_OP_NULL, but unless there's some
form of enforcement, it does more harm than good because it can very easily become
stale, e.g. see get_cs_db_l_bits().  I guess "what's the point of KVM_X86_OP_NULL?"
was somewhat of a rhetorical question.

> > AFAICT, it always resolves to KVM_X86_OP.  Unless there's some magic I'm missing,
> > I vote we remove KVM_X86_OP_NULL and then not introduce KVM_X86_PMU_OP_NULL.
> > And I'm pretty sure it's useless, e.g. get_cs_db_l_bits is defined with the NULL

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ