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 X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B2D3C433E6 for ; Fri, 12 Mar 2021 22:13:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C260F64FC2 for ; Fri, 12 Mar 2021 22:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235514AbhCLWN1 (ORCPT ); Fri, 12 Mar 2021 17:13:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:51196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235515AbhCLWNP (ORCPT ); Fri, 12 Mar 2021 17:13:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 15E7964F29; Fri, 12 Mar 2021 22:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615587195; bh=Nvw3iIumAKVNU+iGCXI9SbvQkjQr0AFRAf4higcMOEw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UVT0V14xkHdol443H9g22gFldOK0zPvS37wYHYZ1Hh+0aAQHGjJe/UwAJ1PUpTu4m JufMuT9outYElg7HBo46A1EhRuCvvlo+d+LW6Zr5e540Ax/92ueFqkAFeVqJBMNtwk t/I2x88L7wcx4pmieEPVFSpI+1Yw8AqoV+GBq0B2SX1//sZ47G4JMByZ+fatna0mIa rmO5V9zVwoDDr/XLgppLRdYCjqpQkP+y/gXck9vuLudh6YS6nTQCyBYv/+k0gzTbuR 4XVV0//CghhrcqWTaDNiWDQsSFINXsnreryJ6qiAQM9GRKLiCVoeC1IeRpyKLA8ViM vPypirL48ifpQ== Date: Fri, 12 Mar 2021 17:13:14 -0500 From: Sasha Levin To: Andreas Larsson Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Mike Rapoport , "David S . Miller" , sparclinux@vger.kernel.org Subject: Re: [PATCH AUTOSEL 4.14 06/13] sparc32: Limit memblock allocation to low memory Message-ID: References: <20210302115903.63458-1-sashal@kernel.org> <20210302115903.63458-6-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 03, 2021 at 09:19:38AM +0100, Andreas Larsson wrote: >On 2021-03-02 12:58, Sasha Levin wrote: >>From: Andreas Larsson >> >>[ Upstream commit bda166930c37604ffa93f2425426af6921ec575a ] >> >>Commit cca079ef8ac29a7c02192d2bad2ffe4c0c5ffdd0 changed sparc32 to use >>memblocks instead of bootmem, but also made high memory available via >>memblock allocation which does not work together with e.g. phys_to_virt >>and can lead to kernel panic. >> >>This changes back to only low memory being allocatable in the early >>stages, now using memblock allocation. >> >>Signed-off-by: Andreas Larsson >>Acked-by: Mike Rapoport >>Signed-off-by: David S. Miller >>Signed-off-by: Sasha Levin >>--- >> arch/sparc/mm/init_32.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >>diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c >>index 95fe4f081ba3..372a4f08ddf8 100644 >>--- a/arch/sparc/mm/init_32.c >>+++ b/arch/sparc/mm/init_32.c >>@@ -230,6 +230,9 @@ unsigned long __init bootmem_init(unsigned long *pages_avail) >> reserve_bootmem((bootmap_pfn << PAGE_SHIFT), size, BOOTMEM_DEFAULT); >> *pages_avail -= PAGE_ALIGN(size) >> PAGE_SHIFT; >>+ /* Only allow low memory to be allocated via memblock allocation */ >>+ memblock_set_current_limit(max_low_pfn << PAGE_SHIFT); >>+ >> return max_pfn; >> } >> > >This is not needed for 4.14, and will not compile, as the problem it >fixes was introduced in 4.19. I'll drop it, thanks! -- Thanks, Sasha