lkml.org 
[lkml]   [2021]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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
>

\
 
 \ /
  Last update: 2021-01-13 18:19    [W:0.637 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site