Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp15950ima; Thu, 31 Jan 2019 11:37:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN4fd4jyNHdoVeuY75sumlfcugwOWdmHu767nqxXXZ3JUYhbhimuuFZrSWJQmPvZgI2h3ZiD X-Received: by 2002:a62:28c9:: with SMTP id o192mr36804281pfo.57.1548963423026; Thu, 31 Jan 2019 11:37:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548963422; cv=none; d=google.com; s=arc-20160816; b=AIyJ5XUvtDPxE0KXRS0naVYKxXcUE/tFdWxSGDyZiZzJ1ieOhy8CGB2uAtNhRH0WxE 2kCKgybIEddHe0MELMuSiB8fFuJ6JA7l6jxPqXOAU3U8KOQQTxiO+5JdvznkGPCWXvNx ekhLDP3NmcEOekVn8eHKTegRqF+xdBPUTXEJY1QBaIeuYjk3tzdklaZdj6GXYTT9lf1O czuJc7kdV4qo8cniBb/er/OZe/EDn30Jkt7DM+pqMfu4mvzFOoymN4FXXh3h9U/Y305b 41fzegMfTUTU/Z8Y7h7S5TYWb4nGaztQ/Ju5wTUAsxuqOAWRKF5+GfcuZusx/pe4HG7k EchA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :dkim-signature; bh=aQhJWwaN99PD5WVxlF6MWDssLL3WHA0NK46/37sosQM=; b=B1AyXJvf5UdeVBkN3c6ujWInITj3bXF+9RbmDmfjRXwageUI/eS+Op4I3eatiLRZX8 h+MPiadyh1sWOr2xJgTt11k8HWiqRgoulbyEuuUff0PR8zMydaoNhizJmLdv9R1H45fI D0Cj946DUz+zgHewtXetrLxv9ch6bOsNDbrbgD9W9JlJ9hitGJPU9K8tiuseXXmazHAs xM5o03jmMjEZc0FHbZC8fzrzFaXGGZhQ3l0HeztPyfmRKwsZuJy+xYMIxBOsTQhf9EFs CkECALzPUEPcaJJYa/PhSpeqWmf+n7WCzucgFp9m9SEZlTQnKlvlmV9/oIbAKtp5wdzd sXtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=NoI8HzZQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k20si5262470pfb.215.2019.01.31.11.36.46; Thu, 31 Jan 2019 11:37:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=NoI8HzZQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729348AbfAaT2y (ORCPT + 99 others); Thu, 31 Jan 2019 14:28:54 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:16559 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729317AbfAaT2w (ORCPT ); Thu, 31 Jan 2019 14:28:52 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43r9Jf259sz9vBJX; Thu, 31 Jan 2019 20:28:50 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=NoI8HzZQ; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id aKAkTvAvNTuy; Thu, 31 Jan 2019 20:28:50 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 43r9Jf0wyVz9vBJT; Thu, 31 Jan 2019 20:28:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1548962930; bh=aQhJWwaN99PD5WVxlF6MWDssLL3WHA0NK46/37sosQM=; h=From:Subject:To:Cc:Date:From; b=NoI8HzZQz9zT/vPJqWhubnJ0MpROUmj/grZtPXcd9CUhWkj5MHEwKkKyrge0snUQu iDJd7lFVFW4qnWGkFJu+5Vi/QhDTDJhfjSYb3aSe/TInYLwtDu6Ym9poNk/4Yb4Qri 0q0aV6g8P6IkXLxEa/ph5q/+lmGyy718FxQjShh4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2A6E78B842; Thu, 31 Jan 2019 20:28:50 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ODhGuRms3wTm; Thu, 31 Jan 2019 20:28:50 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id ED3B48B835; Thu, 31 Jan 2019 20:28:49 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id EE85F72E25; Thu, 31 Jan 2019 19:28:49 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH] powerpc: drop page_is_ram() and walk_system_ram_range() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 31 Jan 2019 19:28:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit c40dd2f76644 ("powerpc: Add System RAM to /proc/iomem") it is possible to use the generic walk_system_ram_range() and the generic page_is_ram(). Fixes: c40dd2f76644 ("powerpc: Add System RAM to /proc/iomem") Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 3 --- arch/powerpc/include/asm/page.h | 1 - arch/powerpc/mm/mem.c | 33 --------------------------------- 3 files changed, 37 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 0a26e0075ce5..0006ca6a7664 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -479,9 +479,6 @@ config ARCH_CPU_PROBE_RELEASE config ARCH_ENABLE_MEMORY_HOTPLUG def_bool y -config ARCH_HAS_WALK_MEMORY - def_bool y - config ARCH_ENABLE_MEMORY_HOTREMOVE def_bool y diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index 5c5ea2413413..aa4497175bd3 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h @@ -326,7 +326,6 @@ struct page; extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg); extern void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *p); -extern int page_is_ram(unsigned long pfn); extern int devmem_is_allowed(unsigned long pfn); #ifdef CONFIG_PPC_SMLPAR diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 33cc6f676fa6..fa9916c2c662 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -80,11 +80,6 @@ static inline pte_t *virt_to_kpte(unsigned long vaddr) #define TOP_ZONE ZONE_NORMAL #endif -int page_is_ram(unsigned long pfn) -{ - return memblock_is_memory(__pfn_to_phys(pfn)); -} - pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, unsigned long size, pgprot_t vma_prot) { @@ -176,34 +171,6 @@ int __meminit arch_remove_memory(int nid, u64 start, u64 size, #endif #endif /* CONFIG_MEMORY_HOTPLUG */ -/* - * walk_memory_resource() needs to make sure there is no holes in a given - * memory range. PPC64 does not maintain the memory layout in /proc/iomem. - * Instead it maintains it in memblock.memory structures. Walk through the - * memory regions, find holes and callback for contiguous regions. - */ -int -walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, - void *arg, int (*func)(unsigned long, unsigned long, void *)) -{ - struct memblock_region *reg; - unsigned long end_pfn = start_pfn + nr_pages; - unsigned long tstart, tend; - int ret = -1; - - for_each_memblock(memory, reg) { - tstart = max(start_pfn, memblock_region_memory_base_pfn(reg)); - tend = min(end_pfn, memblock_region_memory_end_pfn(reg)); - if (tstart >= tend) - continue; - ret = (*func)(tstart, tend - tstart, arg); - if (ret) - break; - } - return ret; -} -EXPORT_SYMBOL_GPL(walk_system_ram_range); - #ifndef CONFIG_NEED_MULTIPLE_NODES void __init mem_topology_setup(void) { -- 2.13.3