From patchwork Thu Feb 13 16:13:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rik van Riel X-Patchwork-Id: 13973609 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3486C021A0 for ; Thu, 13 Feb 2025 16:17:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1AE026B0088; Thu, 13 Feb 2025 11:17:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 15E9E6B0089; Thu, 13 Feb 2025 11:17:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0264A280001; Thu, 13 Feb 2025 11:16:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D7C6E6B0088 for ; Thu, 13 Feb 2025 11:16:59 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8B0F1C11E3 for ; Thu, 13 Feb 2025 16:16:59 +0000 (UTC) X-FDA: 83115425358.27.189FBAD Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf13.hostedemail.com (Postfix) with ESMTP id 1AC732001D for ; Thu, 13 Feb 2025 16:16:55 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf13.hostedemail.com: domain of riel@shelob.surriel.com designates 96.67.55.147 as permitted sender) smtp.mailfrom=riel@shelob.surriel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739463417; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ict0ZUfh5/z/IoUmcY6i3Lw6+8ZsHB39bOyYhjfs4aA=; b=IRslqIZ+3GuqVON9vCf52zNWE6DKOOtXIGGjJabLwDurU5Epx7s1EMQ9SF48t2PHqPW5gP i4tH6dW/GyxJsjpBeBMOsbr+oqJgd3VcMTxbM23+oQomKyvqS+njoijin2ypu24K5bvnoD LF04MkzdCtlJZqzyDL1Iz0J/pQD2Otg= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf13.hostedemail.com: domain of riel@shelob.surriel.com designates 96.67.55.147 as permitted sender) smtp.mailfrom=riel@shelob.surriel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739463417; a=rsa-sha256; cv=none; b=ed7RfAr8yzILMQC7/WyvJw53VpdPsbCTr0YshgYav3ac6VqRnBkWQ16Ck5nGOWZwl+DRcE epoNnTphwCgPPfrgGMIEbNoEkEVUjI2yL2p7D5q2ekAeOvU3VaazfQXLDbjoFpdQ+rb66n JRwMBor3QbfC0vBT5Augt4ZxQP96LB0= Received: from fangorn.home.surriel.com ([10.0.13.7]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1tibr7-000000003xx-0VBu; Thu, 13 Feb 2025 11:14:25 -0500 From: Rik van Riel To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, bp@alien8.de, peterz@infradead.org, dave.hansen@linux.intel.com, zhengqi.arch@bytedance.com, nadav.amit@gmail.com, thomas.lendacky@amd.com, kernel-team@meta.com, linux-mm@kvack.org, akpm@linux-foundation.org, jackmanb@google.com, jannh@google.com, mhklinux@outlook.com, andrew.cooper3@citrix.com, Rik van Riel , Manali Shukla Subject: [PATCH v11 02/12] x86/mm: remove pv_ops.mmu.tlb_remove_table call Date: Thu, 13 Feb 2025 11:13:53 -0500 Message-ID: <20250213161423.449435-3-riel@surriel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250213161423.449435-1-riel@surriel.com> References: <20250213161423.449435-1-riel@surriel.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1AC732001D X-Stat-Signature: 775dx6asn5ku99xagtd7gfywugnwcra9 X-HE-Tag: 1739463415-379377 X-HE-Meta: U2FsdGVkX18POtE0JYPt4AA00EXK8NFiA8b4x2XJ5wjcooifo9ddjEdprkM6CKHlMjlFwuM1BG7nNyDHpkRq2esDVFFZNsPc2J6dsCJrzIfAxYjjgaaRnn9oL7FQCgyqlDUV4Xx78FwZehBdHzP5AwQ3R9TgUKz9zkOlxhAS8qC5G1duss29bkcwBwFwpxUfXVi28jJ7gTaUGEwSMJPs00dx5a21gsIhnkh/3hUxSoUMtj1KVAcKzXYsmKg0Cj5ju/KRw4ubaFEQGJpYtHRuXP7GKCVIHMHwbXva4pzNEWZ8Sx9Hd+SB6hKQU8G8LuIccIDHWuTh9e44AK4uAovwWw8g8IoJ8W5QejuKgI3YMu3w2KNtCH+PZvBjwtUhRxnTEKkcETfJPm3aMmky/DUF9OyagdpvwyImW4n0tyvvkmK9PD2ce0WjH7hnsCJ0enG5Tp32dm5a2scHbmVsUBJ+yvVloUH2Loe++VG61S9D/MvtQGhc0EtlctB2U/rw7dgxeBqQiR4Zvvad3vhrQP5yjsJmQZVQQiTuub1tbTaf3N7u4ailtDqkpRj0+FZeHYAPnX/vBeGF7k1/zV/TCqtupDZCE9qKb0jgI+rMBgl54vYnpPVE1VSjJBnF5qnpYRJYO0msfKF83GxLiO7B/69u86UOUHQgsuGjwJ9ng2bc8MAVNqnA6FzdMNfXpMRT+HM8ngRolBmWa7ybBi9nTdCrSMmVY5dOBF8kOkOR1gUN26Ujs93L/NFKReDinio5wUYRfiYU0Y35IiDpEzlC4SKmE4Kc0yPy16eOuutHvvXqUZfKAKjwBoeuingC4CnsSPNeqogf55OkpcXJZesUcayo1/dV9ZCdX99SmthBDa4esoY93Tdh9cH9cy4ue/yIsiIf2OANYUbWx/mjVZhdhHVCU6jQ4GHmpc2V3OVv2Ami7ab1uF50aelY8zAB1oqi3UH7LEQKXVQ6a1KM80ONa97 QKC7oUsG HHAgCLbgDRc8JEebIAY8SvwwunZmphkeJWKJyqto8vEWZlTwcvl23NfevbYUV5YLMwSrd05iUKDtcSboqddoiROOnQN/y8ZIdGaCQ2vEy6oo84NMWKjvzDIyvNdLDthh/Za6j4QuF2ky+GVk/h3SdjA+n3nQZVWGh8c9N9Mx3ATZOc+tg6CnBLfOD8sJv74NM20s1LOhsmfTqpVf28d+7hVXanVG3UCP7q2MPxDdN8Cq0mSE/+XIksPaSX2SSaq/MjKg+Oer5yUFh7/1TMmowgZAu3LsWIVWNgbuN1yM5AGJ9xoP00WBPL1k1qf2R+29jNyH84F3sNMqOob1H7ferbeqtLgpahYoPK9MKfhvWqisdZWswGVvk0exVzXKNeKFdM3G0RJr7jILBgKFGCe/lESwcYw0FNzpo2BcZM+JIfDSv4yhs0yte0oeYGNg/xQGl4yGkM4beMlPQG/OtimNQ4z5tD6SHQKM54lrEHNypMNK8FWyOjAfi+nmx5knDi1trC/eJz1RXBfXh+NUUS4qqLeJ5uP1qK2fCtxiVsjnU07cXfA4niwcqhHSjdZjamo3fpXIf53/sEalv/+DyUU8h7fJ74YQ3xWGDunPLHBTdjnPTbOHf4znmlPlkDVpUa1OTQMcFp86T2VKNUw4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Every pv_ops.mmu.tlb_remove_table call ends up calling tlb_remove_table. Get rid of the indirection by simply calling tlb_remove_table directly, and not going through the paravirt function pointers. Signed-off-by: Rik van Riel Suggested-by: Qi Zheng Tested-by: Manali Shukla Tested-by: Brendan Jackman Tested-by: Michael Kelley --- arch/x86/hyperv/mmu.c | 1 - arch/x86/include/asm/paravirt.h | 5 ----- arch/x86/include/asm/paravirt_types.h | 2 -- arch/x86/kernel/kvm.c | 1 - arch/x86/kernel/paravirt.c | 1 - arch/x86/xen/mmu_pv.c | 1 - 6 files changed, 11 deletions(-) diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c index cc8c3bd0e7c2..1f7c3082a36d 100644 --- a/arch/x86/hyperv/mmu.c +++ b/arch/x86/hyperv/mmu.c @@ -239,5 +239,4 @@ void hyperv_setup_mmu_ops(void) pr_info("Using hypercall for remote TLB flush\n"); pv_ops.mmu.flush_tlb_multi = hyperv_flush_tlb_multi; - pv_ops.mmu.tlb_remove_table = tlb_remove_table; } diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 041aff51eb50..38a632a282d4 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -91,11 +91,6 @@ static inline void __flush_tlb_multi(const struct cpumask *cpumask, PVOP_VCALL2(mmu.flush_tlb_multi, cpumask, info); } -static inline void paravirt_tlb_remove_table(struct mmu_gather *tlb, void *table) -{ - PVOP_VCALL2(mmu.tlb_remove_table, tlb, table); -} - static inline void paravirt_arch_exit_mmap(struct mm_struct *mm) { PVOP_VCALL1(mmu.exit_mmap, mm); diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index fea56b04f436..e26633c00455 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -134,8 +134,6 @@ struct pv_mmu_ops { void (*flush_tlb_multi)(const struct cpumask *cpus, const struct flush_tlb_info *info); - void (*tlb_remove_table)(struct mmu_gather *tlb, void *table); - /* Hook for intercepting the destruction of an mm_struct. */ void (*exit_mmap)(struct mm_struct *mm); void (*notify_page_enc_status_changed)(unsigned long pfn, int npages, bool enc); diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 7a422a6c5983..3be9b3342c67 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -838,7 +838,6 @@ static void __init kvm_guest_init(void) #ifdef CONFIG_SMP if (pv_tlb_flush_supported()) { pv_ops.mmu.flush_tlb_multi = kvm_flush_tlb_multi; - pv_ops.mmu.tlb_remove_table = tlb_remove_table; pr_info("KVM setup pv remote TLB flush\n"); } diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 527f5605aa3e..2aa251d0b308 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -180,7 +180,6 @@ struct paravirt_patch_template pv_ops = { .mmu.flush_tlb_kernel = native_flush_tlb_global, .mmu.flush_tlb_one_user = native_flush_tlb_one_user, .mmu.flush_tlb_multi = native_flush_tlb_multi, - .mmu.tlb_remove_table = tlb_remove_table, .mmu.exit_mmap = paravirt_nop, .mmu.notify_page_enc_status_changed = paravirt_nop, diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c index 2c70cd35e72c..a0b371557125 100644 --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -2141,7 +2141,6 @@ static const typeof(pv_ops) xen_mmu_ops __initconst = { .flush_tlb_kernel = xen_flush_tlb, .flush_tlb_one_user = xen_flush_tlb_one_user, .flush_tlb_multi = xen_flush_tlb_multi, - .tlb_remove_table = tlb_remove_table, .pgd_alloc = xen_pgd_alloc, .pgd_free = xen_pgd_free,