From patchwork Thu Jan 23 04:23:21 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: 13947927 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 A60C0C0218B for ; Thu, 23 Jan 2025 04:26:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 18DB66B0085; Wed, 22 Jan 2025 23:26:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 118586B0089; Wed, 22 Jan 2025 23:26:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED314280004; Wed, 22 Jan 2025 23:26:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CA3466B0085 for ; Wed, 22 Jan 2025 23:26:11 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 29D43140B2D for ; Thu, 23 Jan 2025 04:26:11 +0000 (UTC) X-FDA: 83037429342.09.FDD267E Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf17.hostedemail.com (Postfix) with ESMTP id 9A65840013 for ; Thu, 23 Jan 2025 04:26:09 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf17.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=1737606369; 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=PnCoYmo7xgeaCQDZxRDZUVSl9IxMjo0b1OkBBli6rlw=; b=rS356gi+xjzMsetIeuUvYS6nF0mex4T06sXvUUH1Az+vd8ZEFRYaSKoPr1RPlCTIrlGjxP D3jB1o61PtuEgzSzo9JRboMu6391GFRGRgU15iGC1xUWnKFivPo3aamNZwIZpjShnRQHcY pwm8SyPg45tU2Es+t19VDn9lwNRYDE0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf17.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=1737606369; a=rsa-sha256; cv=none; b=TY05/FJaAU3M67TvcSU9/QOLHQSBKxpAgxjI0em6fSnCmpBYaLBGRpARPUfYvFPC+UOkVX ocy05hedpK5bg12RW615ko/RaBhtkTxpYW/ww9vb5NMdnFU4z/9a9PVxc63/D4SqF0C2bT z/ULlm1QPmff8nB9YztyvQjiRo2eCAM= 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 1taols-000000005uH-2ab2; Wed, 22 Jan 2025 23:24:48 -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, jannh@google.com, mhklinux@outlook.com, andrew.cooper3@citrix.com, Rik van Riel Subject: [PATCH v7 02/12] x86/mm: remove pv_ops.mmu.tlb_remove_table call Date: Wed, 22 Jan 2025 23:23:21 -0500 Message-ID: <20250123042447.2259648-3-riel@surriel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250123042447.2259648-1-riel@surriel.com> References: <20250123042447.2259648-1-riel@surriel.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9A65840013 X-Stat-Signature: eukt9dms1xsw15mmbekxodoyhe7i6o4x X-Rspam-User: X-HE-Tag: 1737606369-333463 X-HE-Meta: U2FsdGVkX19zyFdkUTn9Redl2zyF1IyhI0zV3NrKFLIW28ud6i8HjRmMGp/vxNZTaZit60RNjL5BEGa4r0fpm4LDI2oD0p9DuY1k9Bay5NI9lD6pGL2B8DT7XaMU9reill5JD6DUPqCYntvXSTWIT65EH/9uCo6CLAeQC7Pia7O21/rgmwhv7xsfKYfZ55tdUjU24S4B90JxtgVEB144ZUSPj4fZdFF+Y5Afgaoqboz9L+fNeNEp0z6Tlj66uSAs2lA8FuEOBM+IgTwKzJsvUkhzU64QHRPHZRaeSm9pzh6xGjikwKR4uDj3RTwuZ/0e++WLR9jBdF4gMhnr6MLlSqz8Mc2C+ihUEsDgVVS7017DqWi/UKSJGDdsf4BVQltfsYYGdd2j0oSrOpkjjoK8LXTYj7MBO3RG80ctIBBPgeC0okN+JQAAe2461M04ii+h2NZSVralfdVpItcg1O2WqrnVAkgvw2xrCV24J2a0FhbiNoSzSjIVKBTqSsUjP2Qarv3TFXZqjnUXGPFzobCf6Eu4S/llWMbKd3rpxDVOmD91qGWhpQxZTMpyjC3K8vCIIV9yX6yTaEeAtPMwC171ctyOFQHetWG1PshSaZ5o/l9VYQGiTTGNh/inUT5fjpADuBdQhDxxcZpTplPlALI/0hnoD2rrQUwfEa+m1nn4TVisOWntD9kZYiv6YMgqVDKYFMrNB74X0bDIwBM2pSEQmLPrZnLlpgX886ZLIs4C9sj5UVarOdlA/P3vdxFJUkcORubRaFwCwrVAZRpr2LCUhmLtFcAD68b1FPPfU8es1fX+TPJfYpJiTaqZ0yx8c1ZeUjoYbY9+WHJ8X9JdaHOKCIk5D5cFIE2Z/XsqYr3jBr+yYbfHH4cjiNe/8NUKZKmO534knrFF3O6w9x6303s8eXliZ3i3umVmBUhBbFR0INUQmRi2+ZbtkNla4RKCa7WauN910ybfyQXUkerPpb7 3e6sSpnW tf9PKQ7OL+WUcjh86jfJhxl+EMgnrMy5GWzjTgOEBe8yNlKti/7oGN52ZgEu8NPLQlGBu0WdljXiDBjTWjI9leY5Ez74d/aCR4YRYWo82gj1NAzPh87xr1qc3FDVEASd13vC5JWRUaX8H1tsdcybZKuyYunuvbULMqsl5N/BWMN4qybWCfqYKlKyT3hcsqjLiAk1IrPtO7PfIDsxs5M4fSqHo3U0T4lIuhNc3TA4WTTjSSH+J0A0aPG1OD90VsZJVhNxd1N2092fz1AWhp0Fe3vw8QE1F+ypopxbpC9QNB6uQUX3PmKZjHeUiWv+gbcq9rM5t7WwPu6swdzZX+cuqCm/hA0wblfcJxaEoGCjIyUYY4aY4Xd7urDz1yQH/VkCKkOa6WpRRC3sBMhZ/jhp9N5tLQGQ/B4y4iLGtlEJdwZu4fby1y4AIBUQGVpOvoroND07EYSo/JXyRznU= 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 --- 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 1cc113200ff5..cbe6c71e17c1 100644 --- a/arch/x86/hyperv/mmu.c +++ b/arch/x86/hyperv/mmu.c @@ -240,5 +240,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 d4eb9e1d61b8..794ba3647c6c 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 8d4fbe1be489..13405959e4db 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -136,8 +136,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 2b78a6b466ed..c019771e0123 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -186,7 +186,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 55a4996d0c04..041e17282af0 100644 --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -2137,7 +2137,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,