Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1253081pxb; Thu, 4 Feb 2021 08:26:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9Fu3IarbogJh2ZdRX5S+oNWjql+utTOkCj6fR2JQIMl+Ria/4bzwmPpSAaTfeAeT96JPW X-Received: by 2002:aa7:c7d8:: with SMTP id o24mr8886085eds.328.1612456014270; Thu, 04 Feb 2021 08:26:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612456014; cv=none; d=google.com; s=arc-20160816; b=sLLjHZeWriUcBpsaaTvpou2213YQRV7iiSK1XyZRKVN0qA4Q+fFjkLe3CvBnEqqK7Y ZJc+a9MmNA81+fwUfPiyfMy60zmQ7ZMRRWXEsPRwq2UH0Cr+Vurp7wrwu0eBDKpq+eGs 5Uwr02lSKarfaanxf1kO6C6C6KadRFNMzUTmMGU6wFnRIeSeyBrtp2pddZY0zRdhB1qz IvSHDkHMRJSiGucCA2+qp6N8N2xs9rc+sBTlp7cU4CIbr9OUuf6dXdpADXrBU7Xl/eLT fqN9vu13ZYSTM5ADWC4jPz71DvqDHK/MknXxwYAW1e8CAZmJNi3lO0IHIwuXDvwGu2Qg XGtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :authorized-sender; bh=Yi4mFlMKqJ5xbdTjffeoX9uH7UdJOTJgMP5Bmgy9S8E=; b=CdOQTEdNP+rqybKwoZ+1GQnPNxuekBvRXuRz+2kuELa3k5MtFFSZ7ENsi+RexOP8hN +NlsCttzHH6p+P8EJI2w3GIZaHn1QJQwwguLgzIQ/X4lgMVHg5Nvb/I8bSCtpPyQjt8f CKZH19Nv7lYbS+CyTXbFVu3lCs0VRN7opNd7SbOjVO3FZT7wh43sJ+TIPGbweDOBm5Wu zguK0W9KRXU+DSMrUR19WfqKzQSdVvzBroY/NnAQBtTFDBkz0dyLBLjNS02v+vo3zX+K TgCQ6aUSmHRT8pFMlvFh3vZvcbMHXeXX+wErnl6HipGtUKDq330azvF1OK69JpCSfygE ujxg== 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 rl11si4017134ejb.560.2021.02.04.08.26.29; Thu, 04 Feb 2021 08:26:54 -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 S237983AbhBDQWa (ORCPT + 99 others); Thu, 4 Feb 2021 11:22:30 -0500 Received: from bin-mail-out-06.binero.net ([195.74.38.229]:36902 "EHLO bin-mail-out-06.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237938AbhBDQVz (ORCPT ); Thu, 4 Feb 2021 11:21:55 -0500 X-Halon-ID: fae01693-6704-11eb-a076-005056917f90 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-02.atm.binero.net (Halon) with ESMTPA id fae01693-6704-11eb-a076-005056917f90; Thu, 04 Feb 2021 17:21:09 +0100 (CET) From: Andreas Larsson To: David Miller , sparclinux@vger.kernel.org Cc: Mike Rapoport , Sam Ravnborg , linux-kernel@vger.kernel.org, software@gaisler.com Subject: [PATCH] sparc32: Limit memblock allocation to low memory Date: Thu, 4 Feb 2021 17:20:53 +0100 Message-Id: <20210204162053.3954-1-andreas@gaisler.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit cca079ef8ac29a7c02192d2bad2ffe4c0c5ffdd0 changed sparc32 to use memblocks instead of bootmem, but also made high memory available via memblock allocation which does work together with e.g. phys_to_virt and leads to crashes. This changes back to only low memory being allocatable in the early stages, now using memblock allocation. Signed-off-by: Andreas Larsson --- 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 eb2946b1df8a..6139c5700ccc 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c @@ -197,6 +197,9 @@ unsigned long __init bootmem_init(unsigned long *pages_avail) size = memblock_phys_mem_size() - memblock_reserved_size(); *pages_avail = (size >> PAGE_SHIFT) - high_pages; + /* Only allow low memory to be allocated via memblock allocation */ + memblock_set_current_limit(max_low_pfn << PAGE_SHIFT); + return max_pfn; } -- 2.17.1