Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp114681ybj; Fri, 8 May 2020 07:44:51 -0700 (PDT) X-Google-Smtp-Source: APiQypLkS9Z0h+fZqAIkdv/TqQSnhs2TxYcnqZ0xojLh7k62QTP3fhL9ilt2wynwOX/nmusYkmFB X-Received: by 2002:aa7:cd01:: with SMTP id b1mr2400048edw.163.1588949091053; Fri, 08 May 2020 07:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588949091; cv=none; d=google.com; s=arc-20160816; b=UQmgE97zbAvluyO1nSJC9Y8siDIKDvv3F3fpUK1hx2zEFFPDpUB9ZWRb2+2qdg8AXQ iJEYdpmTsNzbEMCvtqUQclaTHhjhMLvXPK5qxRvWDzRoTygys8GD5KwG73KaM/vkMbv/ d3pgpxI6Mmp9yHkrNRvIotewIQZUERbaQ7bLBQaJmS/Fq1SgcX0Zn5XDBJA0eCXFPSUq xeocjNnDJTJ4Ip73APNO/sPSNq/xfmvkFrpcsn02SeWPVbrgDZDnoI265O9Cf72mkC15 Dy/F2UvE9ms1UURey8Zb/gXVO9XaxeS7Yl/uWJNSTeyNG6MnI+0ocsYzz0m1mN4zrqRX ZVFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=tm/qQ4R+EHjXhdaKt0vMuOWOnxazHnEb0PBzlM8njGI=; b=kpjlb3SW+e9zUDi1h85Hf5T2wwaFcXIR3WHyREo3misJ3EHuzEV+mc+9xGzSlXTEVB QaOow9C4sfy/malJgwHWKMY+MZGxS9DQ5Gx9+dECkfFOOh1CqBxMPrN7/6xLyAwQuvyi QIdCTF1rTjQ5fEM9MeBpqNxb2VLK6yzwSYT4VFeh7CzJtxXPwJHYtnA9ukRAREBTcnQF FIzEUMNT1Vr3bHYnySOosWv9lKRZ1kBS7iYVLpDXGr3+82euBCUJbz+RtxNLpLeCc8xA 5/XkR0qHi9i62vpyd1/lz/C5qCXRnbUvf1D5+DOQHj5M1IItuXWXRH4gn+9/Ryeb4YU3 RVDw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch13si1082599ejb.338.2020.05.08.07.44.28; Fri, 08 May 2020 07:44:51 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728174AbgEHOlO (ORCPT + 99 others); Fri, 8 May 2020 10:41:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728135AbgEHOky (ORCPT ); Fri, 8 May 2020 10:40:54 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4644EC05BD0A for ; Fri, 8 May 2020 07:40:54 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 6C5F34F2; Fri, 8 May 2020 16:40:51 +0200 (CEST) From: Joerg Roedel To: x86@kernel.org Cc: hpa@zytor.com, Dave Hansen , Andy Lutomirski , Peter Zijlstra , rjw@rjwysocki.net, Arnd Bergmann , Andrew Morton , Steven Rostedt , Vlastimil Babka , Michal Hocko , Joerg Roedel , joro@8bytes.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 6/7] mm: Remove vmalloc_sync_(un)mappings() Date: Fri, 8 May 2020 16:40:42 +0200 Message-Id: <20200508144043.13893-7-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508144043.13893-1-joro@8bytes.org> References: <20200508144043.13893-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel These functions are not needed anymore because the vmalloc and ioremap mappings are now synchronized when they are created or teared down. Remove all callers and function definitions. Signed-off-by: Joerg Roedel --- arch/x86/mm/fault.c | 37 ------------------------------------- drivers/acpi/apei/ghes.c | 6 ------ include/linux/vmalloc.h | 2 -- kernel/notifier.c | 1 - mm/nommu.c | 12 ------------ mm/vmalloc.c | 21 --------------------- 6 files changed, 79 deletions(-) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index edeb2adaf31f..255fc631b042 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -214,26 +214,6 @@ void arch_sync_kernel_mappings(unsigned long start, unsigned long end) } } -static void vmalloc_sync(void) -{ - unsigned long address; - - if (SHARED_KERNEL_PMD) - return; - - arch_sync_kernel_mappings(VMALLOC_START, VMALLOC_END); -} - -void vmalloc_sync_mappings(void) -{ - vmalloc_sync(); -} - -void vmalloc_sync_unmappings(void) -{ - vmalloc_sync(); -} - /* * 32-bit: * @@ -336,23 +316,6 @@ static void dump_pagetable(unsigned long address) #else /* CONFIG_X86_64: */ -void vmalloc_sync_mappings(void) -{ - /* - * 64-bit mappings might allocate new p4d/pud pages - * that need to be propagated to all tasks' PGDs. - */ - sync_global_pgds(VMALLOC_START & PGDIR_MASK, VMALLOC_END); -} - -void vmalloc_sync_unmappings(void) -{ - /* - * Unmappings never allocate or free p4d/pud pages. - * No work is required here. - */ -} - /* * 64-bit: * diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 24c9642e8fc7..aabe9c5ee515 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -167,12 +167,6 @@ int ghes_estatus_pool_init(int num_ghes) if (!addr) goto err_pool_alloc; - /* - * New allocation must be visible in all pgd before it can be found by - * an NMI allocating from the pool. - */ - vmalloc_sync_mappings(); - rc = gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1); if (rc) goto err_pool_add; diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index eb364000cb03..9063cdeb15bb 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -141,8 +141,6 @@ extern int remap_vmalloc_range_partial(struct vm_area_struct *vma, extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, unsigned long pgoff); -void vmalloc_sync_mappings(void); -void vmalloc_sync_unmappings(void); /* * Architectures can set this mask to a combination of PGTBL_P?D_MODIFIED values diff --git a/kernel/notifier.c b/kernel/notifier.c index 5989bbb93039..84c987dfbe03 100644 --- a/kernel/notifier.c +++ b/kernel/notifier.c @@ -519,7 +519,6 @@ NOKPROBE_SYMBOL(notify_die); int register_die_notifier(struct notifier_block *nb) { - vmalloc_sync_mappings(); return atomic_notifier_chain_register(&die_chain, nb); } EXPORT_SYMBOL_GPL(register_die_notifier); diff --git a/mm/nommu.c b/mm/nommu.c index 318df4e236c9..b4267e1471f3 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -369,18 +369,6 @@ void vm_unmap_aliases(void) } EXPORT_SYMBOL_GPL(vm_unmap_aliases); -/* - * Implement a stub for vmalloc_sync_[un]mapping() if the architecture - * chose not to have one. - */ -void __weak vmalloc_sync_mappings(void) -{ -} - -void __weak vmalloc_sync_unmappings(void) -{ -} - struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes) { BUG(); diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 184f5a556cf7..901540e4773b 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1332,12 +1332,6 @@ static bool __purge_vmap_area_lazy(unsigned long start, unsigned long end) if (unlikely(valist == NULL)) return false; - /* - * First make sure the mappings are removed from all page-tables - * before they are freed. - */ - vmalloc_sync_unmappings(); - /* * TODO: to calculate a flush range without looping. * The list can be up to lazy_max_pages() elements. @@ -3177,21 +3171,6 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, } EXPORT_SYMBOL(remap_vmalloc_range); -/* - * Implement stubs for vmalloc_sync_[un]mappings () if the architecture chose - * not to have one. - * - * The purpose of this function is to make sure the vmalloc area - * mappings are identical in all page-tables in the system. - */ -void __weak vmalloc_sync_mappings(void) -{ -} - -void __weak vmalloc_sync_unmappings(void) -{ -} - static int f(pte_t *pte, unsigned long addr, void *data) { pte_t ***p = data; -- 2.17.1