From patchwork Wed Jan 25 19:07:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 4523 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp439729wrn; Wed, 25 Jan 2023 11:10:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXtgQ2Nd9pY33Af8Edf5RWsfubi/7QvdflCayd7XXcqOKQo2IIzXaLNB2IPgLyEFHOU90J7X X-Received: by 2002:a17:902:ce8f:b0:195:f3e6:ab9f with SMTP id f15-20020a170902ce8f00b00195f3e6ab9fmr23822253plg.51.1674673833644; Wed, 25 Jan 2023 11:10:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674673833; cv=none; d=google.com; s=arc-20160816; b=rMbcXo1dnRMEBBLUFciNHg5k7IBRXlqLw5qULFT9a09W9X93SPkXBhgIV4QhPk9Hm5 jWiH+F9r9dWt4QEHDDtMEucZAE5jEjeM+yWGEjN3RHMdr1oFbG6J+sSicn3AyDGG7g6S SiPTdWlagWE+/R8/epSohEDj+Q8Js9kOwwsxkhqNe7dybm7ucvgLI9+fzvXyWD97EeQU 6xDkan7rMJIs2WHcWIpCCw/4ikWo1vplblovdvlR1850FE6OLenSsPA+6wsg6jIOG7ZO Fdkzo2BsxhMH42IcD0YqKhBvRrN451NLTxDgwvRG+QCM0qy8CauG8vxT2/Fft7AAsq5E yIOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=U0RykTArBv3LIiqu3Hqh/+b0fFWCYpQ/4DmC4tyv0Wg=; b=CEWqIpuk4xkME598LFwDOa3xC56iYLMv885r3Zdn3i7f3cTRm17OjkbumG+4CzCoGy lF129PGLmMvFeUVX7n2YNkD03ApBhmI5v6mxbK7f4qxB+BJBTf9hGjrdBNAP6HcGJznQ 1a6DLy7zF0+s3qsF4c6ioaqfyEejxUltcJbzkfeEBCzR0Xw8oBPtrxV+unza7kWOEuWb agGB5mplRZfAgvTwxrNYcz+RrWmPd3PRkh9NMjiyigj/bt3oH72xk8PRFV1APf5GTpgt zS5/ZGlF/cTwoOhnYwClhIKgdE1ZYYMUj/3JZkuw0zo/Q1Fw8oRCVl80sjCuWPWBsdJI ixgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YEcaLAiW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m126-20020a625884000000b005726ac39d2esi6333849pfb.30.2023.01.25.11.10.22; Wed, 25 Jan 2023 11:10:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YEcaLAiW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236062AbjAYTIZ (ORCPT + 99 others); Wed, 25 Jan 2023 14:08:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235772AbjAYTIX (ORCPT ); Wed, 25 Jan 2023 14:08:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14056358B; Wed, 25 Jan 2023 11:08:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B8221B81B97; Wed, 25 Jan 2023 19:08:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A964C433D2; Wed, 25 Jan 2023 19:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674673699; bh=qBn35DQSqUXJuSRxeDRwfpJWNfuE/0crpJYRHd83v4o=; h=From:To:Cc:Subject:Date:From; b=YEcaLAiW8LOEsQEOizhwah/DgYdk0Sj0EasElxRkmwC22UeVxExd/uj6NUQmANgP4 jAVzwBza/ip8qzByaan6itTOheGqmGzh/hD5E5BgZdD+9/3Ftzb0GYHM6hdAJnWG8c +0dGrFu7IRI1vv+/xNF7SyJwcJ060FgtAE8tFhY0qs9BSVQGxK9kiiDi+9Al/inQ5y QgjBkIDWnjNcjAsez+fQtgv2zY2/zSGOHn2szZ/WwbSgKX3evSa6IUTI2vOHlKyjnc FhqKk/BuoBaxEuVWyr0QicxLbVmc8narKWe5G38G00CIXLChnK8wks51ggl7FZlFcj PHJVAXzE1TuvQ== From: Mike Rapoport To: Andrew Morton Cc: 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 , Stafford Horne , 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, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, x86@kernel.org, "Mike Rapoport (IBM)" Subject: [PATCH 0/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM Date: Wed, 25 Jan 2023 21:07:54 +0200 Message-Id: <20230125190757.22555-1-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756022790096021019?= X-GMAIL-MSGID: =?utf-8?q?1756022790096021019?= From: "Mike Rapoport (IBM)" Hi, 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 Mike Rapoport (IBM) (3): m68k: use asm-generic/memory_model.h for both MMU and !MMU mips: drop definition of pfn_valid() for DISCONTIGMEM mm, arch: add generic implementation of pfn_valid() for FLATMEM 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.h | 6 +----- arch/m68k/include/asm/page_mm.h | 1 - arch/m68k/include/asm/page_no.h | 4 ---- arch/microblaze/include/asm/page.h | 1 - arch/mips/include/asm/page.h | 28 ---------------------------- 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 -- 24 files changed, 13 insertions(+), 109 deletions(-) base-commit: 2241ab53cbb5cdb08a6b2d4688feb13971058f65