From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stafford Horne Subject: Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM Date: Sat, 28 Jan 2023 18:02:13 +0900 Message-ID: References: <20230125190757.22555-1-rppt@kernel.org> <20230125190757.22555-4-rppt@kernel.org> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=aqbRojTHRCVjzGUAj7OwNNFidQtZRaRDHHmAjBWeAFhAl4EP6lU/HQ+DT3lz3ORLRs krDbFNMyaAoPDNNbr2Us4LfdqxvtQoKw/VqPFwWdtmeZaX2Yr/xMNSAvUp0bHiLiSOj3 SN1iYBMZrJW6Tuoe05d5ixjoXDQyxOx+hHgkYRdk2YredIT5D868vyI7+JtGnCIwsINP AC8gyFLqm6XouHJKilNfBj6iNxK7cGu1Nhc9VlLOm0nqQCpyycdmijDtgityKjfCFibc kBECjMNCFbqcxj8dsEQrghcf75B90yP81hRDkvCSROQeKfuHc3hus0w8nNDlJyMcHou/ rQVg== Content-Disposition: inline In-Reply-To: <20230125190757.22555-4-rppt@kernel.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mike Rapoport Cc: Andrew Morton , Arnd Bergmann , Brian Cain , "David S. Miller" , Dinh Nguyen , Geert Uytterhoeven , Greg Ungerer , Guo Ren , Helge Deller , Huacai Chen , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Palmer Dabbelt , Rich Felker , Richard Weinberger , Thomas Bogendoerfer , Vineet Gupta , WANG Xuerui , Yoshinori Sato On Wed, Jan 25, 2023 at 09:07:57PM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Every architecture that supports FLATMEM memory model defines its own > version of pfn_valid() that essentially compares a pfn to max_mapnr. > > Use mips/powerpc version implemented as static inline as a generic > implementation of pfn_valid() and drop its per-architecture definitions > > Signed-off-by: Mike Rapoport (IBM) > --- > arch/alpha/include/asm/page.h | 4 ---- > arch/arc/include/asm/page.h | 1 - > arch/csky/include/asm/page.h | 1 - > arch/hexagon/include/asm/page.h | 1 - > arch/ia64/include/asm/page.h | 4 ---- > arch/loongarch/include/asm/page.h | 13 ------------- > arch/m68k/include/asm/page_no.h | 2 -- > arch/microblaze/include/asm/page.h | 1 - > arch/mips/include/asm/page.h | 13 ------------- > arch/nios2/include/asm/page.h | 9 --------- > arch/openrisc/include/asm/page.h | 2 -- > arch/parisc/include/asm/page.h | 4 ---- > arch/powerpc/include/asm/page.h | 9 --------- > arch/riscv/include/asm/page.h | 5 ----- > arch/sh/include/asm/page.h | 3 --- > arch/sparc/include/asm/page_32.h | 1 - > arch/um/include/asm/page.h | 1 - > arch/x86/include/asm/page_32.h | 4 ---- > arch/x86/include/asm/page_64.h | 4 ---- > arch/xtensa/include/asm/page.h | 2 -- > include/asm-generic/memory_model.h | 12 ++++++++++++ > include/asm-generic/page.h | 2 -- > 22 files changed, 12 insertions(+), 86 deletions(-) > [...] > diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h > index aab6e64d6db4..52b0d7e76446 100644 > --- a/arch/openrisc/include/asm/page.h > +++ b/arch/openrisc/include/asm/page.h > @@ -80,8 +80,6 @@ typedef struct page *pgtable_t; > > #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) > > -#define pfn_valid(pfn) ((pfn) < max_mapnr) > - > #define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) > > #endif /* __ASSEMBLY__ */ For OpenRISC Acked-by: Stafford Horne From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DE94C38142 for ; Sat, 28 Jan 2023 09:02:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233776AbjA1JCU (ORCPT ); Sat, 28 Jan 2023 04:02:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233575AbjA1JCT (ORCPT ); Sat, 28 Jan 2023 04:02:19 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A38EA6DFCF; Sat, 28 Jan 2023 01:02:16 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id j32-20020a05600c1c2000b003dc4fd6e61dso47524wms.5; Sat, 28 Jan 2023 01:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=aqbRojTHRCVjzGUAj7OwNNFidQtZRaRDHHmAjBWeAFhAl4EP6lU/HQ+DT3lz3ORLRs krDbFNMyaAoPDNNbr2Us4LfdqxvtQoKw/VqPFwWdtmeZaX2Yr/xMNSAvUp0bHiLiSOj3 SN1iYBMZrJW6Tuoe05d5ixjoXDQyxOx+hHgkYRdk2YredIT5D868vyI7+JtGnCIwsINP AC8gyFLqm6XouHJKilNfBj6iNxK7cGu1Nhc9VlLOm0nqQCpyycdmijDtgityKjfCFibc kBECjMNCFbqcxj8dsEQrghcf75B90yP81hRDkvCSROQeKfuHc3hus0w8nNDlJyMcHou/ rQVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=K/g0NVKqOEQIrhvafWdRvrjURipII3R7wZsomoncfvYxOaVsjxBB4GDtgjn1rX1MtO KnY0l5JrvoLJvI7FX5LmggUrjXSISAK7DhqusGl6ORvy1tgnHzaBtrzy/+5DLIG3uF8P lef2XfYvHcPw/UhMCNXBZF/FmVKfSZujzuKe+DvSSWACEhbvMhK9klK7GEp0ph2XKBUP FSRIeXTua9Fs6dy+8P49dTlLlb3I+Hlxpk5CylXLBf14ePJ7EAXAfsx3dOTsbkqT13W6 135KB/lW487LBZjy5pAqw4JyLZ1S2JICUGNRKrM2DbK6tzk5uKReWuLp3qwHAX0Xuqwz L8mg== X-Gm-Message-State: AFqh2koU+Pl3pQgtBSHxJ3WksDASjXOPbguqlLD3Odb34RoxJ7wn82bA xeVo3OD529xv6CQsEwfTAho= X-Google-Smtp-Source: AMrXdXshtli+OqZ9VwFCdRpOAvHTMs/09zG9TMwa0gaZMZJ8uG1JiJOtVlF/BhmQxoXBbhlR7WJAkg== X-Received: by 2002:a05:600c:5116:b0:3db:1a8:c041 with SMTP id o22-20020a05600c511600b003db01a8c041mr42453030wms.17.1674896535134; Sat, 28 Jan 2023 01:02:15 -0800 (PST) Received: from localhost (cpc1-brnt4-2-0-cust862.4-2.cable.virginm.net. [86.9.131.95]) by smtp.gmail.com with ESMTPSA id f28-20020a5d58fc000000b002be5401ef5fsm6212824wrd.39.2023.01.28.01.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 01:02:14 -0800 (PST) Date: Sat, 28 Jan 2023 18:02:13 +0900 From: Stafford Horne To: Mike Rapoport Cc: Andrew Morton , Arnd Bergmann , Brian Cain , "David S. Miller" , Dinh Nguyen , Geert Uytterhoeven , Greg Ungerer , Guo Ren , Helge Deller , Huacai Chen , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Palmer Dabbelt , Rich Felker , Richard Weinberger , Thomas Bogendoerfer , Vineet Gupta , WANG Xuerui , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux--csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM Message-ID: References: <20230125190757.22555-1-rppt@kernel.org> <20230125190757.22555-4-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230125190757.22555-4-rppt@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Wed, Jan 25, 2023 at 09:07:57PM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Every architecture that supports FLATMEM memory model defines its own > version of pfn_valid() that essentially compares a pfn to max_mapnr. > > Use mips/powerpc version implemented as static inline as a generic > implementation of pfn_valid() and drop its per-architecture definitions > > Signed-off-by: Mike Rapoport (IBM) > --- > arch/alpha/include/asm/page.h | 4 ---- > arch/arc/include/asm/page.h | 1 - > arch/csky/include/asm/page.h | 1 - > arch/hexagon/include/asm/page.h | 1 - > arch/ia64/include/asm/page.h | 4 ---- > arch/loongarch/include/asm/page.h | 13 ------------- > arch/m68k/include/asm/page_no.h | 2 -- > arch/microblaze/include/asm/page.h | 1 - > arch/mips/include/asm/page.h | 13 ------------- > arch/nios2/include/asm/page.h | 9 --------- > arch/openrisc/include/asm/page.h | 2 -- > arch/parisc/include/asm/page.h | 4 ---- > arch/powerpc/include/asm/page.h | 9 --------- > arch/riscv/include/asm/page.h | 5 ----- > arch/sh/include/asm/page.h | 3 --- > arch/sparc/include/asm/page_32.h | 1 - > arch/um/include/asm/page.h | 1 - > arch/x86/include/asm/page_32.h | 4 ---- > arch/x86/include/asm/page_64.h | 4 ---- > arch/xtensa/include/asm/page.h | 2 -- > include/asm-generic/memory_model.h | 12 ++++++++++++ > include/asm-generic/page.h | 2 -- > 22 files changed, 12 insertions(+), 86 deletions(-) > [...] > diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h > index aab6e64d6db4..52b0d7e76446 100644 > --- a/arch/openrisc/include/asm/page.h > +++ b/arch/openrisc/include/asm/page.h > @@ -80,8 +80,6 @@ typedef struct page *pgtable_t; > > #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) > > -#define pfn_valid(pfn) ((pfn) < max_mapnr) > - > #define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) > > #endif /* __ASSEMBLY__ */ For OpenRISC Acked-by: Stafford Horne From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stafford Horne Date: Sat, 28 Jan 2023 09:02:13 +0000 Subject: Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM Message-Id: List-Id: References: <20230125190757.22555-1-rppt@kernel.org> <20230125190757.22555-4-rppt@kernel.org> In-Reply-To: <20230125190757.22555-4-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mike Rapoport Cc: Andrew Morton , Arnd Bergmann , Brian Cain , "David S. Miller" , Dinh Nguyen , Geert Uytterhoeven , Greg Ungerer , Guo Ren , Helge Deller , Huacai Chen , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Palmer Dabbelt , Rich Felker , Richard Weinberger , Thomas Bogendoerfer , Vineet Gupta , WANG Xuerui , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux--csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org On Wed, Jan 25, 2023 at 09:07:57PM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Every architecture that supports FLATMEM memory model defines its own > version of pfn_valid() that essentially compares a pfn to max_mapnr. > > Use mips/powerpc version implemented as static inline as a generic > implementation of pfn_valid() and drop its per-architecture definitions > > Signed-off-by: Mike Rapoport (IBM) > --- > arch/alpha/include/asm/page.h | 4 ---- > arch/arc/include/asm/page.h | 1 - > arch/csky/include/asm/page.h | 1 - > arch/hexagon/include/asm/page.h | 1 - > arch/ia64/include/asm/page.h | 4 ---- > arch/loongarch/include/asm/page.h | 13 ------------- > arch/m68k/include/asm/page_no.h | 2 -- > arch/microblaze/include/asm/page.h | 1 - > arch/mips/include/asm/page.h | 13 ------------- > arch/nios2/include/asm/page.h | 9 --------- > arch/openrisc/include/asm/page.h | 2 -- > arch/parisc/include/asm/page.h | 4 ---- > arch/powerpc/include/asm/page.h | 9 --------- > arch/riscv/include/asm/page.h | 5 ----- > arch/sh/include/asm/page.h | 3 --- > arch/sparc/include/asm/page_32.h | 1 - > arch/um/include/asm/page.h | 1 - > arch/x86/include/asm/page_32.h | 4 ---- > arch/x86/include/asm/page_64.h | 4 ---- > arch/xtensa/include/asm/page.h | 2 -- > include/asm-generic/memory_model.h | 12 ++++++++++++ > include/asm-generic/page.h | 2 -- > 22 files changed, 12 insertions(+), 86 deletions(-) > [...] > diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h > index aab6e64d6db4..52b0d7e76446 100644 > --- a/arch/openrisc/include/asm/page.h > +++ b/arch/openrisc/include/asm/page.h > @@ -80,8 +80,6 @@ typedef struct page *pgtable_t; > > #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) > > -#define pfn_valid(pfn) ((pfn) < max_mapnr) > - > #define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) > > #endif /* __ASSEMBLY__ */ For OpenRISC Acked-by: Stafford Horne From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1E33C38142 for ; Sat, 28 Jan 2023 09:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xphRgMBqZ1daJnGdJxdMRN3GKCVw6QjUg58f3V79FgY=; b=zxIEurGyaihRCX 3nTSJ/y63OldATg57gJ3RQSwGEhGWqdMokbY4m8+I2yjv7KdXoyG513gBHismUr+O5vf8u9F7Sog1 sFIsCOoWs8g0qFPzRnVsin31mtlQgnkqCVELQAfYBFdXaVdj9m19JtSkdI8Sr3zPoZTMqHElIJuzB QMc6UyQk66ZSF2FyTn5a3kmKJC8cupIIaklzSag/BGY9oaR/CRhwcW0eaYpr4BHyxO8YO09pf1G85 JymkCzZBheqdH4a5gd6OaCg4OZ0fXnnJHL6k0W5Jv3eqBulXY1tvmoOqjIFNda/M9qSIrhqTjBPWw HA434LplXiPcQkDAggsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLh6M-00HVbe-KF; Sat, 28 Jan 2023 09:02:22 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLh6J-00HVaR-UX; Sat, 28 Jan 2023 09:02:21 +0000 Received: by mail-wm1-x32c.google.com with SMTP id j36-20020a05600c1c2400b003dc39cb9c33so2673682wms.1; Sat, 28 Jan 2023 01:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=aqbRojTHRCVjzGUAj7OwNNFidQtZRaRDHHmAjBWeAFhAl4EP6lU/HQ+DT3lz3ORLRs krDbFNMyaAoPDNNbr2Us4LfdqxvtQoKw/VqPFwWdtmeZaX2Yr/xMNSAvUp0bHiLiSOj3 SN1iYBMZrJW6Tuoe05d5ixjoXDQyxOx+hHgkYRdk2YredIT5D868vyI7+JtGnCIwsINP AC8gyFLqm6XouHJKilNfBj6iNxK7cGu1Nhc9VlLOm0nqQCpyycdmijDtgityKjfCFibc kBECjMNCFbqcxj8dsEQrghcf75B90yP81hRDkvCSROQeKfuHc3hus0w8nNDlJyMcHou/ rQVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=5vLXA5fiR5T1C+SXXRuaruasSHaE1fGp3jFv6nlg7/GLD3Akj/b2b0A4UdGx6ouDpq vwEYNMd3tt+andnDvBZvMn+BbMMxOdLFH9Qfpw7qTXrwMX1AVuKETQ0PrZitbqcyWAVD f6zLULp/84EMPM96VaI181lV0hwlJXxOYJd56Jb4HUutX9kMG/u5ccJZi5db7ggKQoeK ufeLBBFd3qK+nwLp4spSrPuDV7Ys1WCFeGISQhcfhid9a8SHTiSCalSMHR7gFF9vnvbF z63gd1UuUamQ5W4hqaEDNjDcLC5j4eG8ub86J9yppOStmqcltnTutNFo1NmPO3JgSmBY 0egQ== X-Gm-Message-State: AFqh2krOX+yCdVBTuLDvoMePUY4Ok4qswwbwkj88ziLbal4E/xbfK7cC cio9AMz4zmYiW1gG9MplDRE= X-Google-Smtp-Source: AMrXdXshtli+OqZ9VwFCdRpOAvHTMs/09zG9TMwa0gaZMZJ8uG1JiJOtVlF/BhmQxoXBbhlR7WJAkg== X-Received: by 2002:a05:600c:5116:b0:3db:1a8:c041 with SMTP id o22-20020a05600c511600b003db01a8c041mr42453030wms.17.1674896535134; Sat, 28 Jan 2023 01:02:15 -0800 (PST) Received: from localhost (cpc1-brnt4-2-0-cust862.4-2.cable.virginm.net. [86.9.131.95]) by smtp.gmail.com with ESMTPSA id f28-20020a5d58fc000000b002be5401ef5fsm6212824wrd.39.2023.01.28.01.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 01:02:14 -0800 (PST) Date: Sat, 28 Jan 2023 18:02:13 +0900 From: Stafford Horne To: Mike Rapoport Cc: Andrew Morton , Arnd Bergmann , Brian Cain , "David S. Miller" , Dinh Nguyen , Geert Uytterhoeven , Greg Ungerer , Guo Ren , Helge Deller , Huacai Chen , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Palmer Dabbelt , Rich Felker , Richard Weinberger , Thomas Bogendoerfer , Vineet Gupta , WANG Xuerui , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux--csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM Message-ID: References: <20230125190757.22555-1-rppt@kernel.org> <20230125190757.22555-4-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230125190757.22555-4-rppt@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230128_010220_009610_4BDB5A16 X-CRM114-Status: GOOD ( 15.52 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Jan 25, 2023 at 09:07:57PM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Every architecture that supports FLATMEM memory model defines its own > version of pfn_valid() that essentially compares a pfn to max_mapnr. > > Use mips/powerpc version implemented as static inline as a generic > implementation of pfn_valid() and drop its per-architecture definitions > > Signed-off-by: Mike Rapoport (IBM) > --- > arch/alpha/include/asm/page.h | 4 ---- > arch/arc/include/asm/page.h | 1 - > arch/csky/include/asm/page.h | 1 - > arch/hexagon/include/asm/page.h | 1 - > arch/ia64/include/asm/page.h | 4 ---- > arch/loongarch/include/asm/page.h | 13 ------------- > arch/m68k/include/asm/page_no.h | 2 -- > arch/microblaze/include/asm/page.h | 1 - > arch/mips/include/asm/page.h | 13 ------------- > arch/nios2/include/asm/page.h | 9 --------- > arch/openrisc/include/asm/page.h | 2 -- > arch/parisc/include/asm/page.h | 4 ---- > arch/powerpc/include/asm/page.h | 9 --------- > arch/riscv/include/asm/page.h | 5 ----- > arch/sh/include/asm/page.h | 3 --- > arch/sparc/include/asm/page_32.h | 1 - > arch/um/include/asm/page.h | 1 - > arch/x86/include/asm/page_32.h | 4 ---- > arch/x86/include/asm/page_64.h | 4 ---- > arch/xtensa/include/asm/page.h | 2 -- > include/asm-generic/memory_model.h | 12 ++++++++++++ > include/asm-generic/page.h | 2 -- > 22 files changed, 12 insertions(+), 86 deletions(-) > [...] > diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h > index aab6e64d6db4..52b0d7e76446 100644 > --- a/arch/openrisc/include/asm/page.h > +++ b/arch/openrisc/include/asm/page.h > @@ -80,8 +80,6 @@ typedef struct page *pgtable_t; > > #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) > > -#define pfn_valid(pfn) ((pfn) < max_mapnr) > - > #define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) > > #endif /* __ASSEMBLY__ */ For OpenRISC Acked-by: Stafford Horne _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E77AC38142 for ; Sat, 28 Jan 2023 09:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v+CoC44pTff3fxUQbUYGoNJfEgE9NnBjFpjX/MLe2U8=; b=PjZefyCjxHEPCL ofPyCmiG/hHWc2rhnJEK4Hn/o/jfM8O1OVyeG3ZCMqCniGXarqwT4GiGlcYMCy8NTb+GNReSp93YG BhIGheHPvcOBjDHjThaM80RKK9/9cN+vibBzdls0/y75qFD+90QMJPd8PH0fOA2E6yvbrFPALrli8 XTrR7O8/28poqxPAB7HTh5f0lig9hkTbDasU2sxJPJrB6OYL63pKOnxbflQ0fFeh0cRmXy4bhKWoc VxBul3qGLMWenCYr1zYH6VqQ9dIhUo/Pj7OMvnIqH0yCOLPj8j6E7irTgz8J9MbxIolUp1bgonIPC wBYaWoLVSGdsPfeO7zLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLh6N-00HVbv-Sw; Sat, 28 Jan 2023 09:02:23 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLh6J-00HVaR-UX; Sat, 28 Jan 2023 09:02:21 +0000 Received: by mail-wm1-x32c.google.com with SMTP id j36-20020a05600c1c2400b003dc39cb9c33so2673682wms.1; Sat, 28 Jan 2023 01:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=aqbRojTHRCVjzGUAj7OwNNFidQtZRaRDHHmAjBWeAFhAl4EP6lU/HQ+DT3lz3ORLRs krDbFNMyaAoPDNNbr2Us4LfdqxvtQoKw/VqPFwWdtmeZaX2Yr/xMNSAvUp0bHiLiSOj3 SN1iYBMZrJW6Tuoe05d5ixjoXDQyxOx+hHgkYRdk2YredIT5D868vyI7+JtGnCIwsINP AC8gyFLqm6XouHJKilNfBj6iNxK7cGu1Nhc9VlLOm0nqQCpyycdmijDtgityKjfCFibc kBECjMNCFbqcxj8dsEQrghcf75B90yP81hRDkvCSROQeKfuHc3hus0w8nNDlJyMcHou/ rQVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=5vLXA5fiR5T1C+SXXRuaruasSHaE1fGp3jFv6nlg7/GLD3Akj/b2b0A4UdGx6ouDpq vwEYNMd3tt+andnDvBZvMn+BbMMxOdLFH9Qfpw7qTXrwMX1AVuKETQ0PrZitbqcyWAVD f6zLULp/84EMPM96VaI181lV0hwlJXxOYJd56Jb4HUutX9kMG/u5ccJZi5db7ggKQoeK ufeLBBFd3qK+nwLp4spSrPuDV7Ys1WCFeGISQhcfhid9a8SHTiSCalSMHR7gFF9vnvbF z63gd1UuUamQ5W4hqaEDNjDcLC5j4eG8ub86J9yppOStmqcltnTutNFo1NmPO3JgSmBY 0egQ== X-Gm-Message-State: AFqh2krOX+yCdVBTuLDvoMePUY4Ok4qswwbwkj88ziLbal4E/xbfK7cC cio9AMz4zmYiW1gG9MplDRE= X-Google-Smtp-Source: AMrXdXshtli+OqZ9VwFCdRpOAvHTMs/09zG9TMwa0gaZMZJ8uG1JiJOtVlF/BhmQxoXBbhlR7WJAkg== X-Received: by 2002:a05:600c:5116:b0:3db:1a8:c041 with SMTP id o22-20020a05600c511600b003db01a8c041mr42453030wms.17.1674896535134; Sat, 28 Jan 2023 01:02:15 -0800 (PST) Received: from localhost (cpc1-brnt4-2-0-cust862.4-2.cable.virginm.net. [86.9.131.95]) by smtp.gmail.com with ESMTPSA id f28-20020a5d58fc000000b002be5401ef5fsm6212824wrd.39.2023.01.28.01.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 01:02:14 -0800 (PST) Date: Sat, 28 Jan 2023 18:02:13 +0900 From: Stafford Horne To: Mike Rapoport Cc: Andrew Morton , Arnd Bergmann , Brian Cain , "David S. Miller" , Dinh Nguyen , Geert Uytterhoeven , Greg Ungerer , Guo Ren , Helge Deller , Huacai Chen , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Palmer Dabbelt , Rich Felker , Richard Weinberger , Thomas Bogendoerfer , Vineet Gupta , WANG Xuerui , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux--csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM Message-ID: References: <20230125190757.22555-1-rppt@kernel.org> <20230125190757.22555-4-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230125190757.22555-4-rppt@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230128_010220_009610_4BDB5A16 X-CRM114-Status: GOOD ( 15.52 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Wed, Jan 25, 2023 at 09:07:57PM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Every architecture that supports FLATMEM memory model defines its own > version of pfn_valid() that essentially compares a pfn to max_mapnr. > > Use mips/powerpc version implemented as static inline as a generic > implementation of pfn_valid() and drop its per-architecture definitions > > Signed-off-by: Mike Rapoport (IBM) > --- > arch/alpha/include/asm/page.h | 4 ---- > arch/arc/include/asm/page.h | 1 - > arch/csky/include/asm/page.h | 1 - > arch/hexagon/include/asm/page.h | 1 - > arch/ia64/include/asm/page.h | 4 ---- > arch/loongarch/include/asm/page.h | 13 ------------- > arch/m68k/include/asm/page_no.h | 2 -- > arch/microblaze/include/asm/page.h | 1 - > arch/mips/include/asm/page.h | 13 ------------- > arch/nios2/include/asm/page.h | 9 --------- > arch/openrisc/include/asm/page.h | 2 -- > arch/parisc/include/asm/page.h | 4 ---- > arch/powerpc/include/asm/page.h | 9 --------- > arch/riscv/include/asm/page.h | 5 ----- > arch/sh/include/asm/page.h | 3 --- > arch/sparc/include/asm/page_32.h | 1 - > arch/um/include/asm/page.h | 1 - > arch/x86/include/asm/page_32.h | 4 ---- > arch/x86/include/asm/page_64.h | 4 ---- > arch/xtensa/include/asm/page.h | 2 -- > include/asm-generic/memory_model.h | 12 ++++++++++++ > include/asm-generic/page.h | 2 -- > 22 files changed, 12 insertions(+), 86 deletions(-) > [...] > diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h > index aab6e64d6db4..52b0d7e76446 100644 > --- a/arch/openrisc/include/asm/page.h > +++ b/arch/openrisc/include/asm/page.h > @@ -80,8 +80,6 @@ typedef struct page *pgtable_t; > > #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) > > -#define pfn_valid(pfn) ((pfn) < max_mapnr) > - > #define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) > > #endif /* __ASSEMBLY__ */ For OpenRISC Acked-by: Stafford Horne _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CF12C38142 for ; Sat, 28 Jan 2023 09:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vt3WbPpX3JytW//YRrcG60Rzc/PbFYVvxz9uUMfw9bI=; b=ooPpmuoVtv/9ju xBS6LHCly06swhOPYkXVZ1d3nRRxoJ4n5m3qmrIbxAsVQ4OA1J2efrSjoiCuSKWklouYUqBOIrwbc p5oa1AYo2XKqZaLeWjllRBplXXTGeQzNBWlqbQLwlUgFslAAbyDsI3W6KkJrXJzN/GHe6qrnIzmHr GLu1VN821f0uOsZUNPGJEO4gROvwfjTr+Il80Xt4+mSFtGY/vr+wmzRLSmlnsaLieZ+fY+FNZ1aop CiSR5PGzbHCfgQuRlGPzqsi2S5JbntvGztHVRD5PZK8EKGOyVOQlJ+tHKCTb/pVLjUnleOyIgCrpx IEQpuke7Fxp8wmgmnyDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLh6O-00HVbz-1H; Sat, 28 Jan 2023 09:02:24 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLh6J-00HVaR-UX; Sat, 28 Jan 2023 09:02:21 +0000 Received: by mail-wm1-x32c.google.com with SMTP id j36-20020a05600c1c2400b003dc39cb9c33so2673682wms.1; Sat, 28 Jan 2023 01:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=aqbRojTHRCVjzGUAj7OwNNFidQtZRaRDHHmAjBWeAFhAl4EP6lU/HQ+DT3lz3ORLRs krDbFNMyaAoPDNNbr2Us4LfdqxvtQoKw/VqPFwWdtmeZaX2Yr/xMNSAvUp0bHiLiSOj3 SN1iYBMZrJW6Tuoe05d5ixjoXDQyxOx+hHgkYRdk2YredIT5D868vyI7+JtGnCIwsINP AC8gyFLqm6XouHJKilNfBj6iNxK7cGu1Nhc9VlLOm0nqQCpyycdmijDtgityKjfCFibc kBECjMNCFbqcxj8dsEQrghcf75B90yP81hRDkvCSROQeKfuHc3hus0w8nNDlJyMcHou/ rQVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=5vLXA5fiR5T1C+SXXRuaruasSHaE1fGp3jFv6nlg7/GLD3Akj/b2b0A4UdGx6ouDpq vwEYNMd3tt+andnDvBZvMn+BbMMxOdLFH9Qfpw7qTXrwMX1AVuKETQ0PrZitbqcyWAVD f6zLULp/84EMPM96VaI181lV0hwlJXxOYJd56Jb4HUutX9kMG/u5ccJZi5db7ggKQoeK ufeLBBFd3qK+nwLp4spSrPuDV7Ys1WCFeGISQhcfhid9a8SHTiSCalSMHR7gFF9vnvbF z63gd1UuUamQ5W4hqaEDNjDcLC5j4eG8ub86J9yppOStmqcltnTutNFo1NmPO3JgSmBY 0egQ== X-Gm-Message-State: AFqh2krOX+yCdVBTuLDvoMePUY4Ok4qswwbwkj88ziLbal4E/xbfK7cC cio9AMz4zmYiW1gG9MplDRE= X-Google-Smtp-Source: AMrXdXshtli+OqZ9VwFCdRpOAvHTMs/09zG9TMwa0gaZMZJ8uG1JiJOtVlF/BhmQxoXBbhlR7WJAkg== X-Received: by 2002:a05:600c:5116:b0:3db:1a8:c041 with SMTP id o22-20020a05600c511600b003db01a8c041mr42453030wms.17.1674896535134; Sat, 28 Jan 2023 01:02:15 -0800 (PST) Received: from localhost (cpc1-brnt4-2-0-cust862.4-2.cable.virginm.net. [86.9.131.95]) by smtp.gmail.com with ESMTPSA id f28-20020a5d58fc000000b002be5401ef5fsm6212824wrd.39.2023.01.28.01.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 01:02:14 -0800 (PST) Date: Sat, 28 Jan 2023 18:02:13 +0900 From: Stafford Horne To: Mike Rapoport Cc: Andrew Morton , Arnd Bergmann , Brian Cain , "David S. Miller" , Dinh Nguyen , Geert Uytterhoeven , Greg Ungerer , Guo Ren , Helge Deller , Huacai Chen , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Palmer Dabbelt , Rich Felker , Richard Weinberger , Thomas Bogendoerfer , Vineet Gupta , WANG Xuerui , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux--csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM Message-ID: References: <20230125190757.22555-1-rppt@kernel.org> <20230125190757.22555-4-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230125190757.22555-4-rppt@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230128_010220_009610_4BDB5A16 X-CRM114-Status: GOOD ( 15.52 ) X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org On Wed, Jan 25, 2023 at 09:07:57PM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Every architecture that supports FLATMEM memory model defines its own > version of pfn_valid() that essentially compares a pfn to max_mapnr. > > Use mips/powerpc version implemented as static inline as a generic > implementation of pfn_valid() and drop its per-architecture definitions > > Signed-off-by: Mike Rapoport (IBM) > --- > arch/alpha/include/asm/page.h | 4 ---- > arch/arc/include/asm/page.h | 1 - > arch/csky/include/asm/page.h | 1 - > arch/hexagon/include/asm/page.h | 1 - > arch/ia64/include/asm/page.h | 4 ---- > arch/loongarch/include/asm/page.h | 13 ------------- > arch/m68k/include/asm/page_no.h | 2 -- > arch/microblaze/include/asm/page.h | 1 - > arch/mips/include/asm/page.h | 13 ------------- > arch/nios2/include/asm/page.h | 9 --------- > arch/openrisc/include/asm/page.h | 2 -- > arch/parisc/include/asm/page.h | 4 ---- > arch/powerpc/include/asm/page.h | 9 --------- > arch/riscv/include/asm/page.h | 5 ----- > arch/sh/include/asm/page.h | 3 --- > arch/sparc/include/asm/page_32.h | 1 - > arch/um/include/asm/page.h | 1 - > arch/x86/include/asm/page_32.h | 4 ---- > arch/x86/include/asm/page_64.h | 4 ---- > arch/xtensa/include/asm/page.h | 2 -- > include/asm-generic/memory_model.h | 12 ++++++++++++ > include/asm-generic/page.h | 2 -- > 22 files changed, 12 insertions(+), 86 deletions(-) > [...] > diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h > index aab6e64d6db4..52b0d7e76446 100644 > --- a/arch/openrisc/include/asm/page.h > +++ b/arch/openrisc/include/asm/page.h > @@ -80,8 +80,6 @@ typedef struct page *pgtable_t; > > #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) > > -#define pfn_valid(pfn) ((pfn) < max_mapnr) > - > #define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) > > #endif /* __ASSEMBLY__ */ For OpenRISC Acked-by: Stafford Horne _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A31DC38142 for ; Sat, 28 Jan 2023 09:03:22 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4P3pQ04SwYz3fKl for ; Sat, 28 Jan 2023 20:03:20 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=aqbRojTH; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::32c; helo=mail-wm1-x32c.google.com; envelope-from=shorne@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=aqbRojTH; dkim-atps=neutral Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4P3pNv6GNwz3bVP for ; Sat, 28 Jan 2023 20:02:21 +1100 (AEDT) Received: by mail-wm1-x32c.google.com with SMTP id d4-20020a05600c3ac400b003db1de2aef0so5051079wms.2 for ; Sat, 28 Jan 2023 01:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=aqbRojTHRCVjzGUAj7OwNNFidQtZRaRDHHmAjBWeAFhAl4EP6lU/HQ+DT3lz3ORLRs krDbFNMyaAoPDNNbr2Us4LfdqxvtQoKw/VqPFwWdtmeZaX2Yr/xMNSAvUp0bHiLiSOj3 SN1iYBMZrJW6Tuoe05d5ixjoXDQyxOx+hHgkYRdk2YredIT5D868vyI7+JtGnCIwsINP AC8gyFLqm6XouHJKilNfBj6iNxK7cGu1Nhc9VlLOm0nqQCpyycdmijDtgityKjfCFibc kBECjMNCFbqcxj8dsEQrghcf75B90yP81hRDkvCSROQeKfuHc3hus0w8nNDlJyMcHou/ rQVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=v7ARCz3cVaBFOjYkC77qL/HBEniL1qdQHS5E6K6GFOY=; b=zlbIimE7Fl4aahzn2RmRe0Z9qJkhPbyfXnqSaxnn2yx8PiXhklGiuPe9sAcweRnzGR xVy8hF9HETYvuwVbhUlbxyJcWWZseD72i+6ghj48JyHoaNnBwOmRuabeHF+SCw1B6nZ6 wwctCOy6cfofLWvYl9veQN9Kj20qClVgNBN51+3sneuLkxMT197L1fWCSmo3GA74BjNi BP/gIz8xllS09unJasxskGc83eKkZnxLTHato3VSCNh7y+en3u0EPc5ZWB/e/XvnsHVY CEK4GOgFb4mOWdCPpqcGnkUWCjJQNoTRGB8UlffshTaj4bwfzDb+kUrjU+091dFoMgj5 h68w== X-Gm-Message-State: AFqh2kptfcu0i+knzHTKmahOtJC6TI2LwW6qCUYkYEUmQ4k44kKUfZhJ 3L+CKPxvFYDaFCovhfgxIpA= X-Google-Smtp-Source: AMrXdXshtli+OqZ9VwFCdRpOAvHTMs/09zG9TMwa0gaZMZJ8uG1JiJOtVlF/BhmQxoXBbhlR7WJAkg== X-Received: by 2002:a05:600c:5116:b0:3db:1a8:c041 with SMTP id o22-20020a05600c511600b003db01a8c041mr42453030wms.17.1674896535134; Sat, 28 Jan 2023 01:02:15 -0800 (PST) Received: from localhost (cpc1-brnt4-2-0-cust862.4-2.cable.virginm.net. [86.9.131.95]) by smtp.gmail.com with ESMTPSA id f28-20020a5d58fc000000b002be5401ef5fsm6212824wrd.39.2023.01.28.01.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 01:02:14 -0800 (PST) Date: Sat, 28 Jan 2023 18:02:13 +0900 From: Stafford Horne To: Mike Rapoport Subject: Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM Message-ID: References: <20230125190757.22555-1-rppt@kernel.org> <20230125190757.22555-4-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230125190757.22555-4-rppt@kernel.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, x86@kernel.org, linux-mips@vger.kernel.org, Max Filippov , Guo Ren , sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, WANG Xuerui , Greg Ungerer , linux-arch@vger.kernel.org, Yoshinori Sato , Helge Deller , Huacai Chen , linux-riscv@lists.infradead.org, Geert Uytterhoeven , Vineet Gupta , Matt Turner , linux-snps-arc@lists.infradead.org, linux--csky@vger.kernel.org, Arnd Bergmann , linux-xtensa@linux-xtensa.org, linux-um@lists.infradead.org, Richard Weinberger , linux-m68k@lists.linux-m68k.org, loongarch@lists.linux.dev, Brian Cain , Michal Simek , Thomas Bogendoerfer , linux-parisc@vger.ker nel.org, linux-kernel@vger.kernel.org, Dinh Nguyen , Palmer Dabbelt , linux-alpha@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Jan 25, 2023 at 09:07:57PM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Every architecture that supports FLATMEM memory model defines its own > version of pfn_valid() that essentially compares a pfn to max_mapnr. > > Use mips/powerpc version implemented as static inline as a generic > implementation of pfn_valid() and drop its per-architecture definitions > > Signed-off-by: Mike Rapoport (IBM) > --- > arch/alpha/include/asm/page.h | 4 ---- > arch/arc/include/asm/page.h | 1 - > arch/csky/include/asm/page.h | 1 - > arch/hexagon/include/asm/page.h | 1 - > arch/ia64/include/asm/page.h | 4 ---- > arch/loongarch/include/asm/page.h | 13 ------------- > arch/m68k/include/asm/page_no.h | 2 -- > arch/microblaze/include/asm/page.h | 1 - > arch/mips/include/asm/page.h | 13 ------------- > arch/nios2/include/asm/page.h | 9 --------- > arch/openrisc/include/asm/page.h | 2 -- > arch/parisc/include/asm/page.h | 4 ---- > arch/powerpc/include/asm/page.h | 9 --------- > arch/riscv/include/asm/page.h | 5 ----- > arch/sh/include/asm/page.h | 3 --- > arch/sparc/include/asm/page_32.h | 1 - > arch/um/include/asm/page.h | 1 - > arch/x86/include/asm/page_32.h | 4 ---- > arch/x86/include/asm/page_64.h | 4 ---- > arch/xtensa/include/asm/page.h | 2 -- > include/asm-generic/memory_model.h | 12 ++++++++++++ > include/asm-generic/page.h | 2 -- > 22 files changed, 12 insertions(+), 86 deletions(-) > [...] > diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h > index aab6e64d6db4..52b0d7e76446 100644 > --- a/arch/openrisc/include/asm/page.h > +++ b/arch/openrisc/include/asm/page.h > @@ -80,8 +80,6 @@ typedef struct page *pgtable_t; > > #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) > > -#define pfn_valid(pfn) ((pfn) < max_mapnr) > - > #define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) > > #endif /* __ASSEMBLY__ */ For OpenRISC Acked-by: Stafford Horne