From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C7B42BEC3F for ; Mon, 23 Mar 2026 16:34:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774283645; cv=none; b=ecw7h6XnWAbWGwoQgwJ+npYWG3Vr8j+D9S1q+t00eTuM4rCkMrKDwz+vHyqBFRfhu938jcgKi5tHvUzybFi2lnwfHTenB8VdKjHJ67XRHUgKO//8HwxRGQ/NoxoL+LZ8B0uD+eEfRsM/AhcW8g/eWZwEHDXhIVgyTfooHSH9Ki8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774283645; c=relaxed/simple; bh=tVhFdnif88pL3/1o5nN1Lj07iE1igspGsloimepkwbo=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=Cb+2AuUUunNLYw9Qo124RtjTumG0RB+3QwKvvkQP8mmkrG3EXbAbxxFUJAOUyz1PkzAu4XOEDw5Rbo0GbbEKgR2UUL/DZXSOGbK+wlXddhvkJ0YXQ59s55Py11s7aGt1eJwThJ8t3iO0FQc74u1JAhELfIuSlQSkoXB6R6EBElo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=LqwVeIst; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="LqwVeIst" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E52FC4CEF7; Mon, 23 Mar 2026 16:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1774283644; bh=tVhFdnif88pL3/1o5nN1Lj07iE1igspGsloimepkwbo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LqwVeIstThWnSWZs5/7IiXp0BeQ3jii+jHusHFQhmCxbDkumptDevNL9itvh55FQT ZESCfGx/feUcoPVVArWQ0RURwBbnq1XNGvx64sOxsPLqLl4nPyVg8T8sifR6hxfyq5 g9V1ZiyKuFTwtdi0DddbIlb0Iwk3v+by1+ckLUq4= Date: Mon, 23 Mar 2026 09:34:03 -0700 From: Andrew Morton To: Vivian Wang Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , "Mike Rapoport (Microsoft)" , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas =?ISO-8859-1?Q?Wei=DFschuh?= Subject: Re: [PATCH] riscv: patch: Avoid early page_to_phys() Message-Id: <20260323093403.2ad50dced749e13cd98f01d1@linux-foundation.org> In-Reply-To: <347c918e-6682-455c-ba08-096d9b7b89e4@iscas.ac.cn> References: <20260310-riscv-sparsemem-alternatives-fix-v1-1-659d5dd257e2@iscas.ac.cn> <6ec5d4d4-f171-d41b-2705-a051bcb794e9@kernel.org> <347c918e-6682-455c-ba08-096d9b7b89e4@iscas.ac.cn> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, 23 Mar 2026 09:58:05 +0800 Vivian Wang wr= ote: > On 3/19/26 01:42, Paul Walmsley wrote: > > On Tue, 10 Mar 2026, Vivian Wang wrote: > > > >> Similarly to commit 8d09e2d569f6 ("arm64: patching: avoid early > >> page_to_phys()"), avoid using phys_to_page() for the kernel address ca= se > >> in patch_map(). > >> > >> Since this is called from apply_boot_alternatives() in setup_arch(), a= nd > >> commit 4267739cabb8 ("arch, mm: consolidate initialization of SPARSE > >> memory model") has moved sparse_init() to after setup_arch(), > >> phys_to_page() is not available there yet, and it panics on boot with > >> SPARSEMEM on RV32, which does not use SPARSEMEM_VMEMMAP. > >> > >> Reported-by: Thomas Wei=DFschuh > >> Closes: https://lore.kernel.org/r/20260223144108-dcace0b9-02e8-4b67-a7= ce-f263bed36f26@linutronix.de/ > >> Fixes: 4267739cabb8 ("arch, mm: consolidate initialization of SPARSE m= emory model") > >> Suggested-by: Mike Rapoport > >> Signed-off-by: Vivian Wang > > Thanks, queued for v7.0-rc. >=20 > I have only just noticed that this patch was commited to both > mm-hotfixes-stable [1] by Andrew and riscv fixes [2] by Paul. Is this > intended? It happens - better both than neither! I'll drop the mm.git copy.