Re: [PATCH v2 3/3] KVM: x86: use static calls to reduce kvm_x86_ops overhead

2021-01-15 Thread Paolo Bonzini
On 15/01/21 10:45, Peter Zijlstra wrote: On Thu, Jan 14, 2021 at 10:27:56PM -0500, Jason Baron wrote: diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 5060922..9d4492b 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1350,

Re: [PATCH v2 3/3] KVM: x86: use static calls to reduce kvm_x86_ops overhead

2021-01-15 Thread Peter Zijlstra
On Fri, Jan 15, 2021 at 10:45:49AM +0100, Peter Zijlstra wrote: > On Thu, Jan 14, 2021 at 10:27:56PM -0500, Jason Baron wrote: > > diff --git a/arch/x86/include/asm/kvm_host.h > > b/arch/x86/include/asm/kvm_host.h > > index 5060922..9d4492b 100644 > > --- a/arch/x86/include/asm/kvm_host.h > > +++

Re: [PATCH v2 3/3] KVM: x86: use static calls to reduce kvm_x86_ops overhead

2021-01-15 Thread Peter Zijlstra
On Fri, Jan 15, 2021 at 10:53:51AM +0100, Peter Zijlstra wrote: > @@ -190,6 +191,7 @@ extern int static_call_text_reserved(voi > #elif defined(CONFIG_HAVE_STATIC_CALL) > > static inline long __static_call_return0(void) { return 0; } > +static inline long __static_call_return0(void) { return 1;

Re: [PATCH v2 3/3] KVM: x86: use static calls to reduce kvm_x86_ops overhead

2021-01-15 Thread Peter Zijlstra
On Thu, Jan 14, 2021 at 10:27:56PM -0500, Jason Baron wrote: > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 5060922..9d4492b 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -1350,7 +1350,7 @@ void kvm_arch_free_vm

[PATCH v2 3/3] KVM: x86: use static calls to reduce kvm_x86_ops overhead

2021-01-14 Thread Jason Baron
Convert kvm_x86_ops to use static calls. Note that all kvm_x86_ops are covered here except for 'pmu_ops and 'nested ops'. Here are some numbers running cpuid in a loop of 1 million calls averaged over 5 runs, measured in the vm (lower is better). Intel Xeon 3000MHz: |default|mitig