On 01/02/21 16:19, Maciej S. Szmigiero wrote:
> On 01.02.2021 09:21, Paolo Bonzini wrote:
>> On 01/02/21 09:13, Maciej S. Szmigiero wrote:
>>> static int kvm_handle_hva_range(struct kvm *kvm,
>>> unsigned long start,
>>> unsigned long end,
>>> @@ -1495,8 +1534,9 @@ static int kvm_handle_hva_range(struct kvm *kvm,
>>
>>
>>> -static int kvm_tdp_mmu_handle_hva_range(struct kvm *kvm, unsigned
>>> long start,
>>> - unsigned long end, unsigned long data,
>>> - int (*handler)(struct kvm *kvm, struct kvm_memory_slot *slot,
>>> - struct kvm_mmu_page *root, gfn_t start,
>>> - gfn_t end, unsigned long data))
>>> -{
>>
>> Can you look into just marking these functions __always_inline? This
>> should help the compiler change (*handler)(...) into a regular
>> function call.
>
> That looks even better - I see the compiler then turns the indirect call
> into a direct one.
>
> Will change to __always_inline instead of static dispatch in the next
> version.
> Thanks for the pointer.
Feel free to send this separately as it's a self-contained change.
Thanks,
Paolo
On 03.02.2021 15:43, Paolo Bonzini wrote:
> On 01/02/21 16:19, Maciej S. Szmigiero wrote:
>> On 01.02.2021 09:21, Paolo Bonzini wrote:
>>> On 01/02/21 09:13, Maciej S. Szmigiero wrote:
>>>> static int kvm_handle_hva_range(struct kvm *kvm,
>>>> unsigned long start,
>>>> unsigned long end,
>>>> @@ -1495,8 +1534,9 @@ static int kvm_handle_hva_range(struct kvm *kvm,
>>>
>>>
>>>> -static int kvm_tdp_mmu_handle_hva_range(struct kvm *kvm, unsigned long start,
>>>> - unsigned long end, unsigned long data,
>>>> - int (*handler)(struct kvm *kvm, struct kvm_memory_slot *slot,
>>>> - struct kvm_mmu_page *root, gfn_t start,
>>>> - gfn_t end, unsigned long data))
>>>> -{
>>>
>>> Can you look into just marking these functions __always_inline? This should help the compiler change (*handler)(...) into a regular function call.
>>
>> That looks even better - I see the compiler then turns the indirect call
>> into a direct one.
>>
>> Will change to __always_inline instead of static dispatch in the next
>> version.
>> Thanks for the pointer.
>
> Feel free to send this separately as it's a self-contained change.
Will do!
> Thanks,
>
> Paolo
>
Thanks,
Maciej