Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-13 Thread Sean Christopherson
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, \ >

Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-13 Thread Sean Christopherson
On Wed, Jan 13, 2021, Jason Baron wrote: > > On 1/13/21 7:53 AM, Paolo Bonzini wrote: > > #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 > > > > In t

Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-13 Thread Paolo Bonzini
On 13/01/21 17:16, Jason Baron wrote: +#define DEFINE_KVM_OPS_STATIC_CALL(func)    \ +    DEFINE_STATIC_CALL_NULL(kvm_x86_##func,    \ +    *(((struct kvm_x86_ops *)0)->func)) +#define DEFINE_KVM_OPS_STATIC_CALLS() \ +    FOREACH_KVM_X86_OPS(DEFINE_KVM_OPS_STATIC_CALL) Something wron

Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-13 Thread Jason Baron
On 1/13/21 11:16 AM, Jason Baron wrote: > > > On 1/13/21 7:53 AM, Paolo Bonzini wrote: >> On 11/01/21 17:57, Jason Baron wrote: >>> +#define DEFINE_KVM_OPS_STATIC_CALL(func)    \ >>> +    DEFINE_STATIC_CALL_NULL(kvm_x86_##func,    \ >>> +    *(((struct kvm_x86_ops *)0)->func)) >>>

Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-13 Thread Sean Christopherson
On Wed, Jan 13, 2021, Paolo Bonzini wrote: > On 13/01/21 05:12, Jason Baron wrote: > > > > > Looking at the vmx definitions I see quite a few that don't > > match that naming. For example: > > > > hardware_unsetup, > > hardware_enable, > > hardware_disable, > > report_flexpriority, > > update_exc

Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-13 Thread Jason Baron
On 1/13/21 7:53 AM, Paolo Bonzini wrote: > On 11/01/21 17:57, Jason Baron wrote: >> +#define DEFINE_KVM_OPS_STATIC_CALL(func)    \ >> +    DEFINE_STATIC_CALL_NULL(kvm_x86_##func,    \ >> +    *(((struct kvm_x86_ops *)0)->func)) >> +#define DEFINE_KVM_OPS_STATIC_CALLS() \ >> +    FORE

Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-13 Thread Paolo Bonzini
On 11/01/21 17:57, Jason Baron wrote: +#define DEFINE_KVM_OPS_STATIC_CALL(func) \ + DEFINE_STATIC_CALL_NULL(kvm_x86_##func, \ + *(((struct kvm_x86_ops *)0)->func)) +#define DEFINE_KVM_OPS_STATIC_CALLS() \ + FOREACH_KVM_X86_OPS(DEFINE_KVM_OPS_STATIC_

Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-13 Thread Paolo Bonzini
On 13/01/21 05:12, Jason Baron wrote: Looking at the vmx definitions I see quite a few that don't match that naming. For example: hardware_unsetup, hardware_enable, hardware_disable, report_flexpriority, update_exception_bitmap, enable_nmi_window, enable_irq_window, update_cr8_intercept, pi_ha

Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-12 Thread Jason Baron
On 1/12/21 6:04 PM, Sean Christopherson wrote: On Mon, Jan 11, 2021, Jason Baron wrote: Use static calls to improve kvm_x86_ops performance. Introduce the definitions that will be used by a subsequent patch to actualize the savings. Note that all kvm_x86_ops are covered here except for 'pmu_ops

Re: [PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-12 Thread Sean Christopherson
On Mon, Jan 11, 2021, Jason Baron wrote: > Use static calls to improve kvm_x86_ops performance. Introduce the > definitions that will be used by a subsequent patch to actualize the > savings. > > Note that all kvm_x86_ops are covered here except for 'pmu_ops' and > 'nested ops'. I think they can b

[PATCH 1/2] KVM: x86: introduce definitions to support static calls for kvm_x86_ops

2021-01-11 Thread Jason Baron
Use static calls to improve kvm_x86_ops performance. Introduce the definitions that will be used by a subsequent patch to actualize the savings. Note that all kvm_x86_ops are covered here except for 'pmu_ops' and 'nested ops'. I think they can be covered by static calls in a simlilar manner, but w