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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 F01EFC433E0 for ; Wed, 3 Mar 2021 13:52:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE64664EE8 for ; Wed, 3 Mar 2021 13:52:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1445660AbhCCNrb (ORCPT ); Wed, 3 Mar 2021 08:47:31 -0500 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:39535 "EHLO vsp-unauthed02.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344550AbhCCK7z (ORCPT ); Wed, 3 Mar 2021 05:59:55 -0500 X-Halon-ID: 3290c9d2-7bf9-11eb-b73f-0050569116f7 Authorized-sender: andreas@gaisler.com Received: from andreas.got.gaisler.com (h-98-128-223-123.na.cust.bahnhof.se [98.128.223.123]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 3290c9d2-7bf9-11eb-b73f-0050569116f7; Wed, 03 Mar 2021 09:19:49 +0100 (CET) Subject: Re: [PATCH AUTOSEL 4.14 06/13] sparc32: Limit memblock allocation to low memory To: Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mike Rapoport , "David S . Miller" , sparclinux@vger.kernel.org References: <20210302115903.63458-1-sashal@kernel.org> <20210302115903.63458-6-sashal@kernel.org> From: Andreas Larsson Message-ID: Date: Wed, 3 Mar 2021 09:19:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210302115903.63458-6-sashal@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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. -- Andreas Larsson