Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3068007pxv; Sun, 27 Jun 2021 17:58:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlUtgRVvh6VUxRIplX0fK0/oSKKDoiyz9I3KYannkZal3Xbvx/gb7MSy5kYcXmIFIonwVm X-Received: by 2002:a17:906:1c45:: with SMTP id l5mr18661688ejg.392.1624841885868; Sun, 27 Jun 2021 17:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624841885; cv=none; d=google.com; s=arc-20160816; b=oZKzrwMU0Vv4qr2sBD/M48M7EiNEtJ/SHUgWWdDU687FRAhylabXMtWgQVz/mfO+lC SZQAzSybyH0m57JM0pbWupoziXKc4httfvKhvrUilWcRLrtEPC/LL5awT4x9Q7lYUwRg AfvsI4zkz/DVv3cfxDT72adth0v+b30RIMb/CF30v8AguMHR4cV3433z4LG6hJ0+m3P9 lGPGw6+9ikHJyiX2XIoAgry3AUf5eNuYKvYFQ1kPQKaLRKhfubB0i8aKyvUV33Jpcwqs jR8pCPFlYzA+4XQIe1gdvEoj9fvYe1cLffh71AIe4RpQNjTqHL1Gh600LNfyMagbFcei VhhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=dnK+S9kohHC0o9iX+VmkGDoBz+qehnlf23Zocb2g/v8=; b=xrgi20TffvrCZt+wHMIJBHE74N5rWwbk1b5OWkuts+mY7+zv3j2KSVDdbLHingExwN vSbmcpzvBvXZbH7NXADciEBITeyESWGJzhgGFGD2TvynCl7rNzZ5CXkwcNRI8C+k4WXw gfvVkuTnJtXyS6WDA8PEauPqLxSofzPUpa87+Npm67LvIp2oegY6idXxrQkkMqcs/wTE NQIsjcopesZZzVZ7gN36ugyQtW/aKJdj0WX9o8f/xTE6WrwFgZY7As/A37r/kA9ZHrxb VeMX1mdTWo1KPt9U4hj9nCdl3/rGnDMDrSCi8E6r6TR4X962V62nuFSsE1r2qa2f/O2Q LigQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si12246582edv.30.2021.06.27.17.57.42; Sun, 27 Jun 2021 17:58:05 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231825AbhF1Azn (ORCPT + 99 others); Sun, 27 Jun 2021 20:55:43 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5800 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231709AbhF1Azn (ORCPT ); Sun, 27 Jun 2021 20:55:43 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GCpqh412zzXlsd; Mon, 28 Jun 2021 08:48:00 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 28 Jun 2021 08:53:17 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 28 Jun 2021 08:53:16 +0800 Subject: Re: [PATCH] riscv: Fix 32-bit RISC-V boot failure To: Bin Meng , Palmer Dabbelt , Atish Patra , , CC: References: <20210627135117.28641-1-bmeng.cn@gmail.com> From: Kefeng Wang Message-ID: <11706f7e-a53a-5640-d713-bc4562db71fa@huawei.com> Date: Mon, 28 Jun 2021 08:53:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20210627135117.28641-1-bmeng.cn@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, sorry for the mistake,the bug is fixed by https://lore.kernel.org/linux-riscv/20210602085517.127481-2-wangkefeng.wang@huawei.com/ On 2021/6/27 21:51, Bin Meng wrote: > Commit dd2d082b5760 ("riscv: Cleanup setup_bootmem()") adjusted > the calling sequence in setup_bootmem(), which invalidates the fix > commit de043da0b9e7 ("RISC-V: Fix usage of memblock_enforce_memory_limit") > did for 32-bit RISC-V unfortunately. > > So now 32-bit RISC-V does not boot again when testing booting kernel > on QEMU 'virt' with '-m 2G', which was exactly what the original > commit de043da0b9e7 ("RISC-V: Fix usage of memblock_enforce_memory_limit") > tried to fix. > > Fixes: dd2d082b5760 ("riscv: Cleanup setup_bootmem()") > Cc: stable@vger.kernel.org # v5.12+ > Signed-off-by: Bin Meng > --- > > arch/riscv/mm/init.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index 4c4c92ce0bb8..9b23b95c50cf 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -123,7 +123,7 @@ void __init setup_bootmem(void) > { > phys_addr_t vmlinux_end = __pa_symbol(&_end); > phys_addr_t vmlinux_start = __pa_symbol(&_start); > - phys_addr_t dram_end = memblock_end_of_DRAM(); > + phys_addr_t dram_end; > phys_addr_t max_mapped_addr = __pa(~(ulong)0); > > #ifdef CONFIG_XIP_KERNEL > @@ -146,6 +146,8 @@ void __init setup_bootmem(void) > #endif > memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start); > > + dram_end = memblock_end_of_DRAM(); > + > /* > * memblock allocator is not aware of the fact that last 4K bytes of > * the addressable memory can not be mapped because of IS_ERR_VALUE