[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <X/8rIgrMkb61/la9@google.com>
Date: Wed, 13 Jan 2021 09:17:22 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Jason Baron <jbaron@...mai.com>, kvm@...r.kernel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
peterz@...radead.org, aarcange@...hat.com, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] KVM: x86: introduce definitions to support static
calls for kvm_x86_ops
On Wed, Jan 13, 2021, Paolo Bonzini wrote:
> If you need to choose between DECLARE_STATIC_CALL_NULL and
> DECLARE_STATIC_CALL, you can have kvm-x86-ops.h use one of two macros
> KVM_X86_OP_NULL and KVM_X86_OP.
>
> #define KVM_X86_OP(func) \
> DECLARE_STATIC_CALL(kvm_x86_##func, \
> *(((struct kvm_x86_ops *)0)->func));
>
> #define KVM_X86_OP_NULL(func) \
> DECLARE_STATIC_CALL_NULL(kvm_x86_##func, \
Gah, DECLARE_STATIC_CALL_NULL doesn't exist, though it's referenced in a comment.
I assume these should be s/DECLARE/DEFINE? I haven't fully grokked the static
call code yet...
> *(((struct kvm_x86_ops *)0)->func));
>
> #include <asm/kvm-x86-ops.h>
>
> ...
>
> #define KVM_X86_OP(func) \
> static_call_update(kvm_x86_##func, kvm_x86_ops.func)
> #define KVM_X86_OP_NULL(func) \
> static_call_update(kvm_x86_##func, kvm_x86_ops.func)
> #include <asm/kvm-x86-ops.h>
>
> In that case vmx.c and svm.c could define KVM_X86_OP_NULL to an empty string
> and list the optional callbacks manually.
>
> Paolo
>
Powered by blists - more mailing lists