Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp755230pxb; Wed, 3 Feb 2021 17:37:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdkxUmVv535fzZ2GaJjAMPQUsytzO4VVuzeuS4CMb45c9lsF1Q6Nt4HkLDcF/eFPquwpBS X-Received: by 2002:a50:fc18:: with SMTP id i24mr6074278edr.308.1612402665782; Wed, 03 Feb 2021 17:37:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612402665; cv=none; d=google.com; s=arc-20160816; b=TBIxbZoqNVgU0LLPxlxdSN2Iy7XpvDnn2f/7GQiWPIR1ZmYeThALfFr6pNiTw6mzZ+ VH0zcQ/lePps07Czl+vwHJP43/tJvXuxP+E46vjR3NOEU43q1sah8ckY0YPv6z/2QUiU zVHyOioCabrbDGrj1ulN1ckM5k7gMKTNCeW8t3RooIuV1EMl4qLhh+rx2sxMSIRYhlD6 X6S+dSlOEgdIp3e8n9RMxqqEhj13oCNKb7OZs3McElc3/P+KKboi2lfOT+vBZ9c+pfKk TG/0XfMABt57igw0YzcIjZUYAAPKgdVjPQgY7HSJ19u6cK66RtEwEdhObviVN58ayQJl lfkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=mf9Om4aJKxCp7+g+lOL02KEQ8BhzSUEBa6tkuZ+6lkQ=; b=bOiE7kqkKoB1KFQt9WmHO31KSRvYyPk5AoqKsulzm0wsYXZ7ScelFGgABNxgxNlhVI d0/2bO5MsX5y7Clm9l7u9c0rzRfi9MaEowlyNMWknpUMw6apqbDEo4pk2Wi/j2BUiQ7o P33YxNpZuQfN4Xnn9+g9fwkQmKWAkjmlYe/2WHf7qU7iPjb2l4HWyIHH6/LRkvIn/56J JdFeTqEXcKAVYib3Z4aM9Zbe/dyM/CSPX9Fcb1fgVyaNIhnLI2q/Hqo5jFRL0nA3YWr9 t+dR/XQs+WqrvKunOWZEn7JxB6r5gx9sbiHQ61cQtEMgIn04NCbAGmoEqgmrsj8Fgr1q d6Rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg13si2939321ejc.616.2021.02.03.17.37.21; Wed, 03 Feb 2021 17:37:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231969AbhBCUKm (ORCPT + 99 others); Wed, 3 Feb 2021 15:10:42 -0500 Received: from vps-vb.mhejs.net ([37.28.154.113]:56634 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231920AbhBCUKi (ORCPT ); Wed, 3 Feb 2021 15:10:38 -0500 Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.93.0.4) (envelope-from ) id 1l7OTG-0005c9-S7; Wed, 03 Feb 2021 21:09:50 +0100 To: Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Igor Mammedov , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Huacai Chen , Vitaly Kuznetsov , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <771da54d-0601-ccd2-8edf-814086739e53@maciej.szmigiero.name> <7b15ae06-4b56-0259-6950-6781622020ab@redhat.com> From: "Maciej S. Szmigiero" Subject: Re: [PATCH 1/2] KVM: x86/mmu: Make HVA handler retpoline-friendly Message-ID: Date: Wed, 3 Feb 2021 21:09:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <7b15ae06-4b56-0259-6950-6781622020ab@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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