Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1030030pxb; Thu, 4 Mar 2021 01:06:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9fDLe4veXesU4xoDRtFimNbmUKRtQmqS9cZ7K4/nVLRoMLCDEKMK35eQNIOi20Vu0ZXHK X-Received: by 2002:a17:906:6095:: with SMTP id t21mr3113896ejj.384.1614848768383; Thu, 04 Mar 2021 01:06:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614848768; cv=none; d=google.com; s=arc-20160816; b=xhfnGhf6PCFQLHjdbIFjBMwgZwabOolOSLlG190yB89mLPxAkFHXXmnk+8x7REz8pM gHmmXH/ZMeqor7Jd9dFD1w9UM0N2A8QZdHOGxQkPZEtc294g4lVOHYJ2C9jhYq3h6GLM Dn1Ja3kTVoPEkFUHEzyhAh6S+YHbyVtGE0zqq85R+a8rQmCPOVgfNX3tqeFb9Rg7TCFP wdjNzL85CJezHPUa/w+XzuFGXfGBy1F8UGFP3o7ynVVoY0bQHXllnRYAwLxSKGJWSmV6 Y6J9cKBEjCGckFQ2DzX2BlLsFOyz/hrhTUlX7ater3bDWsiSRpCd/zxfAGNf4TOD9+5L rxrg== 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=vAPHmVyuTzel+3NVy42aaFr/UMERBECOpJZcFrKZ/58=; b=WpLLo6BK40Va5PQtfV4yTAd/yfJwNmxccjf1hdSTx58oOTjkltdScYvdGyWWqaNm8q ZrM7MC0LaxdjfbPpzdrO671jkm1jCAIc138m1dYkL0E5IGyDIP4HRefykaQZkst/SMDv opRfAzPZ8THzplJgyUHAVfCHrfgWhma8d1GCqrUF/sS7YDkUFjKakAwTQY50+P2gE0oT 5qnxpz/66nOWDUkdRMYSIa25bxuEu5TOJqRupBTfD6bdldgHb5280FPG03A0i6DS+7wO zxVnZ/mBbgOrGUHxMNc2yrzQ9rS4+HS1hLLYIKpxodFpAIFKlzMUnuaXwsRdaUomjcm8 SVIw== 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 c11si19706859ejz.595.2021.03.04.01.05.46; Thu, 04 Mar 2021 01:06:08 -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 S241986AbhCCNcF (ORCPT + 99 others); Wed, 3 Mar 2021 08:32:05 -0500 Received: from bin-mail-out-05.binero.net ([195.74.38.228]:49169 "EHLO bin-mail-out-05.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380621AbhCCIV2 (ORCPT ); Wed, 3 Mar 2021 03:21:28 -0500 X-Halon-ID: 56e20dc8-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 56e20dc8-7bf9-11eb-b73f-0050569116f7; Wed, 03 Mar 2021 09:20:45 +0100 (CET) Subject: Re: [PATCH AUTOSEL 4.9 05/10] 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: <20210302115921.63636-1-sashal@kernel.org> <20210302115921.63636-5-sashal@kernel.org> From: Andreas Larsson Message-ID: <0b1dc8c7-2594-00ef-c117-a111e56f9c61@gaisler.com> Date: Wed, 3 Mar 2021 09:20:39 +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: <20210302115921.63636-5-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.9, and will not compile, as the problem it fixes was introduced in 4.19. -- Andreas Larsson