Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1573802pxb; Thu, 4 Mar 2021 15:14:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQO26aYqWu45M106bSGvuZctVktM3ogR38tiglz+Ckjw7ryDPj12jQHEOA61Pq5khsmNoL X-Received: by 2002:a05:6e02:b2e:: with SMTP id e14mr5809973ilu.164.1614899651833; Thu, 04 Mar 2021 15:14:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614899651; cv=none; d=google.com; s=arc-20160816; b=EfMaYFdbxD6ScSw7RczDSb5IRPyyTCOByLnBczlpvK1KBjC29Q4Zcl2bLgLlu3W5dg WdqHy8UWUM2SXYtm7dIPJEwZZXRdKCd2I0eCUgiQgDGeb4C6V2zQi6PK+TZk/sNL9UCw 4H8fGxps8E/KhDk4/6KsGArMUVtqJqEuxN/k1+m4KnZvjPd+mF6QuHsEvUJpO+CS2mvX D9CZ++Arr0hfIvxXxmRBWXL+ewqJS/3Sy3yr965d048Hzjwl4Igu2IFfshjuekrmqMf7 w9hb4EeWYL5clkfyCXHIBsLQ/AzNk8Znh4j0S9N4kl06p6EqjvmtmNBLaBKKEvOb0rFi DTCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:authorized-sender; bh=AU8vVqO7FyUuJmDv/RnxRqXCzkr/kNZ52iXOPxfIy3I=; b=LaWGz9tfTqC/PDVGTFc8mE7UzGO9ECEMzSri2wWe8lCr6WZVYyjtvcbQKcu96L0xrY GJ6s16XvvyY4i0nAwHHJ7LQ2OciQ08++o8KwXQpUAifxXPzD38uLVjL6h/Herg0cwAYH cnzW6lInTcyTa3dnAEb4jiOkw2LnEU1FQwnoKGoefzqNLfjC09p05IVLAlRnbvU4vAK9 j2G3HPDZ0Gywdpw3dhSvvFQdAxzqYd73GUBcY+Wji4KS4jSOr9TsBE770atbJQ4yFXQE eSethCEwekgIkoPuUmBH6ztSxBlNvgyiV81SYChPuC4AXLzuKx9OQ/kOD7ebIefGF5yt 0Iww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si682925ioj.36.2021.03.04.15.13.58; Thu, 04 Mar 2021 15:14:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1452527AbhCCPvp (ORCPT + 99 others); Wed, 3 Mar 2021 10:51:45 -0500 Received: from bin-mail-out-06.binero.net ([195.74.38.229]:47621 "EHLO bin-mail-out-06.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350020AbhCCLA0 (ORCPT ); Wed, 3 Mar 2021 06:00:26 -0500 X-Halon-ID: 745b473b-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 745b473b-7bf9-11eb-b73f-0050569116f7; Wed, 03 Mar 2021 09:21:34 +0100 (CET) Subject: Re: [PATCH AUTOSEL 4.4 4/8] 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: <20210302115935.63777-1-sashal@kernel.org> <20210302115935.63777-4-sashal@kernel.org> From: Andreas Larsson Message-ID: Date: Wed, 3 Mar 2021 09:21:28 +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: <20210302115935.63777-4-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: linux-kernel@vger.kernel.org On 2021-03-02 12:59, 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 3b7092d9ea8f..4abe4bf08377 100644 > --- a/arch/sparc/mm/init_32.c > +++ b/arch/sparc/mm/init_32.c > @@ -240,6 +240,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.4, and will not compile, as the problem it fixes was introduced in 4.19. -- Andreas Larsson