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 34A23C636CC for ; Tue, 31 Jan 2023 18:56:25 +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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NyarXbbzf89pTkUxnnUDJc+KaQoVMZyM8wr2JAd4znY=; b=Inxvk7BspSymoUY+AuD40i/0Xm cERc5iiWHet0nAb65pP6EyNpZlfyz8PrAXjEWwffmu7p73qOFdK/Xz5bE0fWGmUUvJTZPPEvDIur8 UuB+cabqmTXvQWShqKoQNodOfvm47rnmj8q1nE9/mem0O7dAsvaMKAi31yOUSS9tGNeWMDa7egrqN xRxQ2+Pz4f6vq2kzCY8kiqsSQEA77sQW66Hpi97GyXqOjLnxrSII76N34nrYbFhy8IcD6Pv8tukxT CZnDFvPPGkdrehW1LFFEFKEUExZlrDijpS5Vf35PKOHVW04/NOUg8J3PFXBUWTk+SJYqtFnxhPdxf cfdILuwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMvmv-0092Kd-DG; Tue, 31 Jan 2023 18:55:25 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMvmr-0092Ig-KX; Tue, 31 Jan 2023 18:55:23 +0000 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 B440CB81E69; Tue, 31 Jan 2023 18:55:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 249B8C433EF; Tue, 31 Jan 2023 18:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675191318; bh=bIDjyyvdysd52cz3wo+R2FqIpQuhXwaSP+2JinM77Zs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p4r9YCVihzZrIRlizFq96lF4LsuRcYuXyit+cVXFPxJSxGfL99cms2/SSKpvkF2Pp NgIawOhOvw555KfS+LAiMfG5/YT2a/THCQd4ucSFldwug8pgOxrs80vH+lCVDLHIZh fh6CSOEpoCrswZLqAXRWz9pZ9CFIa58ZjTeMXFlgy8V6KmgUqFk322AZ/O2du+jfxI cQP8VEptS2HT9jSp8zZqLDDlrzS+XSn+HUeeyHjnm0LO863o/QOiqT647VANwYetka 9TpahVOYB0s8YL82xibnQ7Ggye7lO/va5K0QbIxfYIjwKYESn8Y2//JUV74+mpgZ7e krHdpZB95Rbtg== Date: Tue, 31 Jan 2023 18:55:07 +0000 From: Conor Dooley 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 , Russell King , Stafford Horne , Thomas Bogendoerfer , Vineet Gupta , WANG Xuerui , Yoshinori Sato , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.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-mm@kvack.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, Huacai Chen Subject: Re: [PATCH v2 4/4] mm, arch: add generic implementation of pfn_valid() for FLATMEM Message-ID: References: <20230129124235.209895-1-rppt@kernel.org> <20230129124235.209895-5-rppt@kernel.org> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230131_105521_978144_88AD2986 X-CRM114-Status: GOOD ( 29.58 ) X-BeenThere: linux-arm-kernel@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: multipart/mixed; boundary="===============7758574116285525719==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7758574116285525719== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hiaCFsst32mLBZni" Content-Disposition: inline --hiaCFsst32mLBZni Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Mike, On Tue, Jan 31, 2023 at 08:41:49PM +0200, Mike Rapoport wrote: > On Tue, Jan 31, 2023 at 05:47:24PM +0000, Conor Dooley wrote: > > On Sun, Jan 29, 2023 at 02:42:35PM +0200, Mike Rapoport wrote: > > > From: "Mike Rapoport (IBM)" > > >=20 > > > Every architecture that supports FLATMEM memory model defines its own > > > version of pfn_valid() that essentially compares a pfn to max_mapnr. > > >=20 > > > Use mips/powerpc version implemented as static inline as a generic > > > implementation of pfn_valid() and drop its per-architecture definitio= ns. > > >=20 > > > Signed-off-by: Mike Rapoport (IBM) > > > Acked-by: Arnd Bergmann > > > Acked-by: Guo Ren # csky > > > Acked-by: Huacai Chen # LoongArch > > > Acked-by: Stafford Horne # OpenRISC > >=20 > > Hmm, so this landed in linux-next today and I bisected a boot failure in > > my CI to it. However, I am not really sure if it is a real issue worth > > worrying about as the platform it triggered on is supposed to be using > > SPARSEMEM, but isn't. > > I had thought that my CI was using a config with SPARSEMEM since that > > became required for riscv defconfig builds to boot in v6.1-rc1, but I > > must have just forgotten to add it to my $platform_defconfig builds too. > > However, those $platform_defconfig builds continued booting without > > SPARSEMEM enabled until today. >=20 > The issue seems to be that the generic pfn_valid() does not take into > account pfn_offset when it compares it with max_mapnr. > Can you please test with the patch below? >=20 > diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/mem= ory_model.h > index 13d2a844d928..6796abe1900e 100644 > --- a/include/asm-generic/memory_model.h > +++ b/include/asm-generic/memory_model.h > @@ -26,7 +26,7 @@ static inline int pfn_valid(unsigned long pfn) > extern unsigned long max_mapnr; > unsigned long pfn_offset =3D ARCH_PFN_OFFSET; > =20 > - return pfn >=3D pfn_offset && pfn < max_mapnr; > + return pfn >=3D pfn_offset && (pfn - pfn_offset) < max_mapnr; > } > #define pfn_valid pfn_valid > #endif Gave that a go, board is booting properly again! Feel free to add a: Tested-by: Conor Dooley Thanks for the prompt fix! --hiaCFsst32mLBZni Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCY9lkCwAKCRB4tDGHoIJi 0pIDAP9nc8RsXGyfp84b29PfLE6bd1djEIZ71+YYWPrhRbOT0QEAs5hvd2Aq0mES TzWIEs2xL7+wjwVIWLwPjr1kP0shHA0= =AQg2 -----END PGP SIGNATURE----- --hiaCFsst32mLBZni-- --===============7758574116285525719== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7758574116285525719==--