From patchwork Fri Feb 21 00:53:01 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: 13984688 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 CD082C021B4 for ; Fri, 21 Feb 2025 00:55:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2E24280013; Thu, 20 Feb 2025 19:55:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EB7B5280014; Thu, 20 Feb 2025 19:55:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D0429280013; Thu, 20 Feb 2025 19:55:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8CF6428000B for ; Thu, 20 Feb 2025 19:55:27 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5225E1A020B for ; Fri, 21 Feb 2025 00:55:27 +0000 (UTC) X-FDA: 83142133494.03.AA78D71 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf27.hostedemail.com (Postfix) with ESMTP id CA94D40007 for ; Fri, 21 Feb 2025 00:55:25 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.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=1740099325; 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=flOAIwzRZ+P39Ka4be5J1crN9rOlWpXg7znPDmrFSm7DSrrHl88iJ9Irylcq1wkA+b6VSb 1RWNlkTidyzznZ5mN3zYSh140Ud6c+y2ptjEDdANTzW3g8+T2jtMcfRnfXwWTNEampTaAu 7CjQlG2tGSVA90PvNlDjtQS0fFYbG6o= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.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=1740099325; a=rsa-sha256; cv=none; b=YJ5EXO914xX/y6GHvMoW5yhb2Pm0LoADtsHAD6KFUN08vhsBT8k6TPDDEtJj3bTDp90i5U bBe8c192wjYa2SEHf3c7Fy9XSGB6FI+SPcBCtr0qWdCNsVs5I7VVqIsQSO9qgsVwBeKFi0 YP/SByKWmzc26bYTIqC7EjSChZd4NTA= 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 1tlHIZ-000000003Qf-0hJF; Thu, 20 Feb 2025 19:53:47 -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, Manali.Shukla@amd.com, Rik van Riel Subject: [PATCH v12 02/16] x86/mm: remove pv_ops.mmu.tlb_remove_table call Date: Thu, 20 Feb 2025 19:53:01 -0500 Message-ID: <20250221005345.2156760-3-riel@surriel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250221005345.2156760-1-riel@surriel.com> References: <20250221005345.2156760-1-riel@surriel.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: CA94D40007 X-Stat-Signature: xbkbs3iurmj1jyeo4ahs8c3m7h8esde9 X-HE-Tag: 1740099325-511050 X-HE-Meta: U2FsdGVkX182WzRETgVTsPpTD6SefNy4obzP5O/MOtLpEnJR46lXD/r9fXiT2v9JtHkwk+2bdNMAhNSDVYjlGJXnb0khGmF8efQx3r5/qTZcH6UGqLgvD2bPkRusaW6q3nR6VBny6BncAfdVLzU4AkfC7CMxibJR+HFmYYrngr8MfKtKfDRUGp96fY1KAIm4FkcS1N8MzZT3FQvFGA3CJlliQ2wMA/fuqhWED/CgIxFk7U3Y1MASyjUzrhAOLL7XzTEd7dISKzUBS/huiOCDlqS6VXddf7rzC0XapdsuKBD9AZ5/XrLPJhV8uD2T1GIZtsHHEn/hClkjwmKNcoULsS7o3I3Ke6QjthnYY/oDrprH/Jne2vmoO2ct+INrqNdXB8qtLLOT4ojqQ15VRPfe2TqGfLrlbg2Vgd/OUE+6y7o+JS47XDQkYotAJlHb17Wq7d/03p76ouHQJT/pR50c8oKBHZFpkc3SHpNchv3d9yJ9jDvKkyDf0MSu+ymndpQsxOCNaeYUvfnNdCFPxobBLSbcdc4jKe515TUYaD7CYacW7sUYdsDb5klc3XEWq6/2Qo1+P88FCVTKl6s5iHKgGfdBu+l14a/+/ul9ToJTGOKhoKrFhJtSDIDvFYd6noTT1AOEJIG8zC78AsJLvBrZ/Rd6ODWKVsqLO8J7z6BTxTEbENVsI1hzoOSZOd4j0dmCTl/pnINOUwDr4NLwVvf91IVFIsmJw6/xsqv9bTJTUfK+xDyXxC/wEc3luLr+pbz1DD7QiuQoKUpXZd9tqIz4OxTM/oGzDIJ1mbuLZhEKQZ6/glYCMukAh0k2lo5bXw+VD9IPCw5qjBNAGK5fuUaotyGS1vgv6RnG+XrYsoVVHhL815rIqxWMmH9wwgaZTv/D/pMRnnmgY525M330miTcFBaBg40Ll150r7l1E2l1lQ7PoPly9wmbBU6SOMl2jkXCExANOffKs4CLmNxlIBT n4q79yke zKZ64z1z9xOR4J4WJwZFtjVL1HjHlE0sjLairiLIXD0B0thA/euRsBhOxM49wINe3pobpXS+gbkHvLDzHTPH+ApJCuooD+epgDHwoBPAcbwS77X1y3AUo1s8JxSZNNLiQNv5pwPXkuc0A3mvnWM8P2SNgLswglY2lTBRSxfaTWXxWCjPQaeGj15T7CVDaWOfLoeKLnsJo/WAzIswXPNFTOrnG8Hr3WM05Fiwwuw3pT7uWU/ZTQLT372FqOH8jwj3ldcg/uxSX+IsbQJtOg9l/zb/lxAtt89h00DBs1TQGLZPLihkqzUTjrXMLwGJOihXuKDgltO5EDnOA+0X+mdKVMw0lSJseG/7PG83JKeOAIvUgZOQAlsL6nM6gLhN/YZzUdM871+7jxxpi8zUSwkWc8uAcBnMi7RZI67lHOc8VG961360shLc9dcd/j4+stUv7OusK3LWoSU7WoNETYzerUlsM+G4TCELt/8iWYvF1yB/wSxik4lrjTCWu2kQsVOQQHA1LbQ0ZuGZ/NZcaVvIG94T2TA== 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,