Re: [PATCH 14/17] KVM: monolithic: x86: inline more exit handlers in vmx.c
From: Paolo Bonzini
Date: Mon Sep 23 2019 - 06:19:18 EST
On 20/09/19 23:25, Andrea Arcangeli wrote:
> They can be called directly more efficiently, so we can as well mark
> some of them inline in case gcc doesn't decide to inline them.
What is the output of size(1) before and after?
Paolo
> Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx>
> ---
> arch/x86/kvm/vmx/vmx.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index ff46008dc514..a6e597025011 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -4588,7 +4588,7 @@ static int handle_exception_nmi(struct kvm_vcpu *vcpu)
> return 0;
> }
>
> -static int handle_external_interrupt(struct kvm_vcpu *vcpu)
> +static __always_inline int handle_external_interrupt(struct kvm_vcpu *vcpu)
> {
> ++vcpu->stat.irq_exits;
> return 1;
> @@ -4860,7 +4860,7 @@ static void vmx_set_dr7(struct kvm_vcpu *vcpu, unsigned long val)
> vmcs_writel(GUEST_DR7, val);
> }
>
> -static int handle_cpuid(struct kvm_vcpu *vcpu)
> +static __always_inline int handle_cpuid(struct kvm_vcpu *vcpu)
> {
> return kvm_emulate_cpuid(vcpu);
> }
> @@ -4891,7 +4891,7 @@ static int handle_interrupt_window(struct kvm_vcpu *vcpu)
> return 1;
> }
>
> -static int handle_halt(struct kvm_vcpu *vcpu)
> +static __always_inline int handle_halt(struct kvm_vcpu *vcpu)
> {
> return kvm_emulate_halt(vcpu);
> }
>