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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 864B5C54E66 for ; Tue, 12 Mar 2024 09:33:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 01EA36B01F5; Tue, 12 Mar 2024 05:33:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F110D8D000D; Tue, 12 Mar 2024 05:33:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB1466B01F7; Tue, 12 Mar 2024 05:33:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C5CCB6B01F5 for ; Tue, 12 Mar 2024 05:33:55 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 53BF6A0DB3 for ; Tue, 12 Mar 2024 09:33:55 +0000 (UTC) X-FDA: 81887875230.12.1C6185C Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by imf14.hostedemail.com (Postfix) with ESMTP id 54DAB100008 for ; Tue, 12 Mar 2024 09:33:52 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=BYEOWOid; dmarc=none; spf=pass (imf14.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710236032; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=edYt7eTkFwnywkr5Q7EpnbvnaXY/0YnNw5lx2MxT+ts=; b=UEwk4ZMfZGJgcNlRQnVPCZnlPuvZ9Dsmgzg0wlgrv2+VwFCffbgkRBcyip4JILptQjXCOn P0+OjEkzqXsgQ8qnPjXI21pEDkGCbHUx5UuQ2u5ViIec6Shp4JK36xcLSJ55e71YSCNt3b +GsPujuex+/rUX1LyB4R8pzNHdKBZ8Q= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=BYEOWOid; dmarc=none; spf=pass (imf14.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710236032; a=rsa-sha256; cv=none; b=eG/kKGars9PMxTGHZr2csl9h7lu7W2h0+mghJ9UbeWVoD+G7czLRVdyIOpiXqkHtQr8trC 8r5UwpKsJ/upYEBdoNLJ1RyoRIvuaPzPEPzqeOJSy+NJY4pPndW+6wjisYm6gnKFe4VDgS bar/nmY7QFN3Vm7xwaoXPwFlqniDRE0= Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-55a5e7fa471so4822523a12.1 for ; Tue, 12 Mar 2024 02:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1710236031; x=1710840831; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=edYt7eTkFwnywkr5Q7EpnbvnaXY/0YnNw5lx2MxT+ts=; b=BYEOWOidEu6rvIp2B3BFpR9Km0ULOlTzvNMLaMWG68Vnlz1GUJPXLGFxzkVnX/bgEN t7jjxsh2wsN27PdTgSbMgR+rH0nPkLD8kqxQf2yTMTZ16ySx8TERrdrcTbmM/PXi//uc HJ5UI8yMToSACHmlRMR9A63Pr1Mc3yOOd3kqD0AGP8cgYs7/RSM0V4v1oAQiA5kKruvu efIP8zcyBE+35a1uoHwVfqrSnmpVSRMq7fzVsAEb+BBiHtG3iCPKACQqUgt5c6ic4d7V zwfuj4s5Rrb9Y8HHj3OhXII7vmtK8WqJcfri9ogQqUSeceN8TChSC/571ynFcQNGhU28 M5zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710236031; x=1710840831; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=edYt7eTkFwnywkr5Q7EpnbvnaXY/0YnNw5lx2MxT+ts=; b=PGx23/WgZbE1vz+FmZzbUl8dZq9J9f7pEgJNvwiSeVa1raU/bN3Nzm4yudLoqa3Zoc gBlZgQu9+UYKPiirK3p+an4mi5OUVOZV3S9nibSn7iXkGKJGW2JR45IbQU7TSTpjghlL FEbtfqM2O4wb+OMzv/zng0/aUurI4ZQAZrRjwzYBUamhL3AsrSViNydUHcwBrGeSUYpq cUnrx2kkoR0QU1b77jdOdpcalb0LYYIrNoQIY1J8DrA21N2VA/M4bf9dfGd6DbEb+7g7 75+tl5B3ri5C3t+qugCxT1lZOYQOCq/2GnVl3Hh3TWiSt2wWJYMWBVJQT9p8CkN2AXdD N7NQ== X-Forwarded-Encrypted: i=1; AJvYcCWItuRJI0J0+VWyJhh2D5s8XBMo2dDqXSqS9oL7R9EUZIPcMuQB2/fnttM5ZH3K7KZmqeT1sC4JwN7Ydr13ICZtq0U= X-Gm-Message-State: AOJu0YzFNVdCrfvy3ZT5XqbqBaHiHiF4Ye6kjsOUs0jDfqyDI+kG0j7J P1d4agC7k6kD/vKnpYkCasHjHvymQLcIQzatV7Sin6EVf3P2C4QGswDfbqBbx/FvBHwAMOxtwAA oV/8rqVnt3TSj+rxeulTPV2NdY2S5+XGYyUygxw== X-Google-Smtp-Source: AGHT+IFRqUszW/kj1uE8+lb4vev7mNik2H4TNy+JGy1x8BOgenTSqcR/hD9G759Kvffua+PwHyLpkzyjPqYGmAOrSWY= X-Received: by 2002:a17:906:a845:b0:a45:fb01:cef with SMTP id dx5-20020a170906a84500b00a45fb010cefmr5716597ejb.50.1710236030556; Tue, 12 Mar 2024 02:33:50 -0700 (PDT) MIME-Version: 1.0 References: <20230316131711.1284451-1-alexghiti@rivosinc.com> <20240118082346.GB31078@hsinchu15> In-Reply-To: From: Alexandre Ghiti Date: Tue, 12 Mar 2024 10:33:39 +0100 Message-ID: Subject: Re: Fwd: [PATCH v8 0/4] riscv: Use PUD/P4D/PGD pages for the linear mapping To: Nylon Chen Cc: alex@ghiti.fr, apatel@ventanamicro.com, catalin.marinas@arm.com, will@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, robh+dt@kernel.org, frowand.list@gmail.com, rppt@kernel.org, akpm@linux-foundation.org, anup@brainfault.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-mm@kvack.org, zong.li@sifive.com, nylon7717@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 54DAB100008 X-Stat-Signature: 35nisnnxwe3egxbcei1e9179bj6osygu X-Rspam-User: X-HE-Tag: 1710236032-515368 X-HE-Meta: U2FsdGVkX1+nWLsfFFLECxqkvN8o+plMyj2yVajP1JPzgGdQp1ijkjaINIoyDdu8KOoU7+PSGLQScBNktxr259cublnhHeN1q6x8nBE24jkuyTNs1yQiNzVecksIDNqg8twpLo5TZSYex7KKauF+I6Qn/wDbgKoTU79lyOl3ZiZL/T7Uba/Oez9e2K4w6CWBu0LEpDSZ1G1Bx9BY+Pa9tJ+09tbE+7ZffxxY/P/gztKlF7C2zzCKhntwtVM0KYmX0uSOMGvDTskjb6lg7BblEmTMjjdedZMtDXi1JpFLLXlMb6SRPc4s7Rxw704Vw8l3l7dgMYSClYH8rF+FnpjIidXgoD0BfBPnNp1yt/Nd2DpmC2EMCUVqutzj5g1Ldh+Uxux0XwQaCMjjmzXCbhbyjzoz8XQkQ1qgkh992syTNMZxzM46uHWmgiqPv+P6GfssIzeKsYtB5ctMfybD2m/bx6J1A8Zb45wdEyqnZrv9pQs2lMFDGCY2P2W9ggZMYGGg8sJn/e8JgL5wmYwGfq0/IPKQYeTefN8/xnJ3OY4ffyN4ikfpOEr8M3SQ7yi26mXt8cRXg3EN8jX5IUTleBRUY3FOkR08HcgqdZ/9CMX/FomOUCkcglJ8UX+EIadASL1Qa71LGV24SURAy7M2gcW7OqQ+MlJSAl7auXXUfBHbyBv6H6LtGVaniiIt05k4Ns/FGfLAmRRxKfU+4HibyyIahD3Jw4CSUi8pxLiTl7zSfrIvJC+QvcsbfCFLJaOtDrh6HS5I8mDrQxeugQKTlTz4DBW+1mTC6N9dYUJ9eCtZ022BZroC7U4flZqpwRJSR4ZHtI4quLiSE+MZhHFfeMJJhjTRcIIXOPApuhIg24fVac50xVTR6Kf5vs5s9xRBais2JLTUiUgijs3JDJxuUGhiuAhNxYhlYXxuLT/mZr+WB/K52w6w84MiJCDtkOTEFbTeDSKhjlIQywZA++dbHpl wsrx66hR 8LVzXWrdcCHoUWhXG8Mak4syIjUmipA55fJ91bhuaDP60V92LvsPMsSSkD6pdQr6333puZUlRCeM5M4v7qb4TF+7PLlBKImDFQy9mQ1umlj7U/sBHUE52Ggu845MWdInXpl4tHvBrnBtIm//ruLF9ss0jAGfSS57BbBrc9TqgROv2NHT+DPgKQi4ea68dUeBFmRRVtEyru9YO1+64dukp91VxwFQm6LAs4D1mPKArA6FyYFLzrF5KiB40PLgjb25out6yGOLJy2SM5VuqXNqsnV7hBCvVADUfoF7AwXa2QQ6c6ZJx0xl6QL99MJjnnrNh0F8ilxvBbTe7ZU9cxplPLUf0R44e+nexZlWv9Wjk2gNEJ5i3j1F1ps26aaQ/Xrqx3mxBUTgJdvr1uqhzniZQ0hQ1kttMhMRFkyLIwFuMHEz5RaV3Fzoipc0xeaIPFnLmbhji/C2KdeOv4CYoDy5RIGLvR4gtb904jMDyx37rWvgREEzkuQ8F2saA2NgQlXVpFPoRnBcswkgKac1TPN+Wn9q49J2BNuJKIQEeB40oqAVQvJ8RrkV/YtB9hrUTgM6N0iCctK443bsO/vLRMT42TYNowSCQovWqtX1uBHndsxVDZ74+wFDvCjogaHJDR0wxeJ0WPdS0/MmDpCuTdC6fCAvUP8dIqpObqnmW X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Nylon, On Tue, Mar 12, 2024 at 7:48=E2=80=AFAM Nylon Chen = wrote: > > Nylon Chen =E6=96=BC 2024=E5=B9=B43=E6=9C=8812=E6= =97=A5 =E9=80=B1=E4=BA=8C =E4=B8=8B=E5=8D=882:40=E5=AF=AB=E9=81=93=EF=BC=9A > > > > Alexandre Ghiti =E6=96=BC 2024=E5=B9=B42=E6=9C= =885=E6=97=A5 =E9=80=B1=E4=B8=80 =E4=B8=8B=E5=8D=885:32=E5=AF=AB=E9=81=93= =EF=BC=9A > > > > > > Hi Nylon, > > > > > > On Fri, Jan 19, 2024 at 10:27=E2=80=AFAM Nylon Chen wrote: > > > > > > > > Alexandre Ghiti =E6=96=BC 2024=E5=B9=B41= =E6=9C=8818=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8B=E5=8D=889:01=E5=AF=AB=E9= =81=93=EF=BC=9A > > > > > > > > > > Hi Nylon, > > > > Hi Alexandre, thanks for your feedback, > > > > > > > > > > On Thu, Jan 18, 2024 at 9:23=E2=80=AFAM Nylon Chen wrote: > > > > > > > > > > > > > On 3/23/23 15:55, Anup Patel wrote: > > > > > > > > On Thu, Mar 23, 2023 at 6:24=E2=80=AFPM Alexandre Ghiti wrote: > > > > > > > >> Hi Anup, > > > > > > > >> > > > > > > > >> On Thu, Mar 23, 2023 at 1:18=E2=80=AFPM Anup Patel wrote: > > > > > > > >>> Hi Alex, > > > > > > > >>> > > > > > > > >>> On Thu, Mar 16, 2023 at 6:48=E2=80=AFPM Alexandre Ghiti <= alexghiti@rivosinc.com> wrote: > > > > > > > >>>> This patchset intends to improve tlb utilization by usin= g hugepages for > > > > > > > >>>> the linear mapping. > > > > > > > >>>> > > > > > > > >>>> As reported by Anup in v6, when STRICT_KERNEL_RWX is ena= bled, we must > > > > > > > >>>> take care of isolating the kernel text and rodata so tha= t they are not > > > > > > > >>>> mapped with a PUD mapping which would then assign wrong = permissions to > > > > > > > >>>> the whole region: it is achieved by introducing a new me= mblock API. > > > > > > > >>>> > > > > > > > >>>> Another patch makes use of this new API in arm64 which u= sed some sort of > > > > > > > >>>> hack to solve this issue: it was built/boot tested succe= ssfully. > > > > > > > >>>> > > > > > > > >>>> base-commit-tag: v6.3-rc1 > > > > > > > >>>> > > > > > > > >>>> v8: > > > > > > > >>>> - Fix rv32, as reported by Anup > > > > > > > >>>> - Do not modify memblock_isolate_range and fixes comment= , as suggested by Mike > > > > > > > >>>> - Use the new memblock API for crash kernel too in arm64= , as suggested by Andrew > > > > > > > >>>> - Fix arm64 double mapping (which to me did not work in = v7), but ends up not > > > > > > > >>>> being pretty at all, will wait for comments from arm6= 4 reviewers, but > > > > > > > >>>> this patch can easily be dropped if they do not want = it. > > > > > > > >>>> > > > > > > > >>>> v7: > > > > > > > >>>> - Fix Anup bug report by introducing memblock_isolate_me= mory which > > > > > > > >>>> allows us to split the memblock mappings and then avo= id to map the > > > > > > > >>>> the PUD which contains the kernel as read only > > > > > > > >>>> - Add a patch to arm64 to use this newly introduced API > > > > > > > >>>> > > > > > > > >>>> v6: > > > > > > > >>>> - quiet LLVM warning by casting phys_ram_base into an un= signed long > > > > > > > >>>> > > > > > > > >>>> v5: > > > > > > > >>>> - Fix nommu builds by getting rid of riscv_pfn_base in p= atch 1, thanks > > > > > > > >>>> Conor > > > > > > > >>>> - Add RB from Andrew > > > > > > > >>>> > > > > > > > >>>> v4: > > > > > > > >>>> - Rebase on top of v6.2-rc3, as noted by Conor > > > > > > > >>>> - Add Acked-by Rob > > > > > > > >>>> > > > > > > > >>>> v3: > > > > > > > >>>> - Change the comment about initrd_start VA conversion so= that it fits > > > > > > > >>>> ARM64 and RISCV64 (and others in the future if needed= ), as suggested > > > > > > > >>>> by Rob > > > > > > > >>>> > > > > > > > >>>> v2: > > > > > > > >>>> - Add a comment on why RISCV64 does not need to set init= rd_start/end that > > > > > > > >>>> early in the boot process, as asked by Rob > > > > > > > >>>> > > > > > > > >>>> Alexandre Ghiti (4): > > > > > > > >>>> riscv: Get rid of riscv_pfn_base variable > > > > > > > >>>> mm: Introduce memblock_isolate_memory > > > > > > > >>>> arm64: Make use of memblock_isolate_memory for the li= near mapping > > > > > > > >>>> riscv: Use PUD/P4D/PGD pages for the linear mapping > > > > > > > >>> Kernel boot fine on RV64 but there is a failure which is = still not > > > > > > > >>> addressed. You can see this failure as following message = in > > > > > > > >>> kernel boot log: > > > > > > > >>> 0.000000] Failed to add a System RAM resource at 802= 00000 > > > > > > > >> Hmmm I don't get that in any of my test configs, would you= mind > > > > > > > >> sharing yours and your qemu command line? > > > > > > > > Try alexghiti_test branch at > > > > > > > > https://github.com/avpatel/linux.git > > > > > > > > > > > > > > > > I am building the kernel using defconfig and my rootfs is > > > > > > > > based on busybox. > > > > > > > > > > > > > > > > My QEMU command is: > > > > > > > > qemu-system-riscv64 -M virt -m 512M -nographic -bios > > > > > > > > opensbi/build/platform/generic/firmware/fw_dynamic.bin -ker= nel > > > > > > > > ./build-riscv64/arch/riscv/boot/Image -append "root=3D/dev/= ram rw > > > > > > > > console=3DttyS0 earlycon" -initrd ./rootfs_riscv64.img -smp= 4 > > > > > > > > > > > > > > > > > > > > > So splitting memblock.memory is the culprit, it "confuses" th= e resources > > > > > > > addition and I can only find hacky ways to fix that... > > > > > > Hi Alexandre, > > > > > > > > > > > > We encountered the same error as Anup. After adding your patch > > > > > > (3335068f87217ea59d08f462187dc856652eea15), we will not encount= er the > > > > > > error again. > > > > > > > > > > > > What I have observed so far is > > > > > > > > > > > > - before your patch > > > > > > When merging consecutive memblocks, if the memblock types are d= ifferent, > > > > > > they will be merged into reserved > > > > > > - after your patch > > > > > > When consecutive memblocks are merged, if the memblock types ar= e > > > > > > different, they will be merged into memory. > > > > > > > > > > > > Such a result will cause the memory location of OpenSBI to be c= hanged > > > > > > from reserved to memory. Will this have any side effects? > > > > > > > > > > I guess it will end up in the memory pool and pages from openSBI > > > > > region will be allocated, so we should see very quickly bad stuff > > > > > happening (either PMP violation or M-mode ecall never > > > > > returning/trapping/etc). > > > > > > > > > > But I don't observe the same thing, I always see the openSBI regi= on > > > > > being reserved: > > > > > > > > > > reserved[0x0] [0x0000000080000000-0x000000008007ffff], > > > > > 0x0000000000080000 bytes flags: 0x0 > > > > > > > > > > Can you elaborate a bit more about "When consecutive memblocks ar= e > > > > > merged, if the memblock types are different, they will be merged = into > > > > > memory"? Where/when does this merge happen? Can you give me a con= fig > > > > > file and a kernel revision so that I can take a look? > > > > Ok, If you want to reproduce the same results you just need to modi= fy OpenSBI > > > > > > > > [ lib/sbi/sbi_domain.c ] > > > > +#define TEST_SIZE 0x200000 > > > > > > > > - (scratch->fw_size - scratch->fw_r= w_offset), > > > > + (TEST_SIZE - scratch->fw_rw_offse= t), > > > > > > > > In addition, you can insert checks in the kernel merged function > > > > [ mm/memblock.c ] > > > > static void __init_memblock memblock_merge_regions(struct memblock_= type *type) > > > > while (i < type->cnt - 1) { > > > > ... > > > > /* move forward from next + 1, index of which is i = + 2 */ > > > > memmove(next, next + 1, (type->cnt - (i + 2)) * siz= eof(*next)); > > > > type->cnt--; > > > > } > > > > + pr_info("Merged memblock_type: cnt =3D %lu, max =3D %lu, > > > > total_size =3D 0x%llx\n",type->cnt, type->max, type->total_size); > > > > + for (i =3D 0; i < type->cnt; i++) { > > > > + const char *region_type =3D > > > > memblock_is_memory(type->regions[i].base) ? "memory" : "reserve"; > > > > + pr_info("Region %d: base =3D 0x%llx, size =3D 0x%ll= x, type > > > > =3D %s\n", i, type->regions[i].base, type->regions[i].size, > > > > region_type); > > > > + } > > > > } > > > > This is kernel boot log > > > > - before your patch > > > > ... > > > > [ 0.000000] OF: fdt: Reserving memory: base =3D 0x80000000, size= =3D 0x200000 > > > > [ 0.000000] Merged memblock_type: cnt =3D 4, max =3D 128, total_= size =3D 0x1628501 > > > > [ 0.000000] Region 0: base =3D 0x80000000, size =3D 0x1600000, t= ype =3D reserve > > > > ... > > > > > > > > - after your patch > > > > ... > > > > [ 0.000000] OF: fdt: Reserving memory: base =3D 0x80000000, size= =3D 0x200000 > > > > [ 0.000000] Merged memblock_type: cnt =3D 4, max =3D 128, total_= size =3D 0x180c42e > > > > [ 0.000000] Region 0: base =3D 0x80000000, size =3D 0x1800000, t= ype =3D memory > > > > > Hi Alex, thanks for your feedback. > > > So the openSBI region is marked as memory, and not reserved because > > > this region is now described as nomap, and memblock_mark_nomap() does > > > not move this region into the reserved memblock list, but keep it in > > > the memory list with the nomap flag > > > (https://elixir.bootlin.com/linux/latest/source/drivers/of/fdt.c#L479= ). > > > But as stated in the description of memblock_mark_nomap() > > > (https://elixir.bootlin.com/linux/latest/source/mm/memblock.c#L969), > > > the pages associated with the region will be marked as PageReserved > > > and the region will not be covered in the linear mapping. > > I traced it via GDB, and indeed, it enters > > early_init_dt_reserve_memory() and calls memblock_reserve to reserve > > this block of memory. > > > > [before your patch] > > [ 0.000000] OF: fdt: check nomap Reserving memory: base =3D > > 0x80000000, size =3D 0x200000 > > [ 0.000000] --- Reserved memory: Base address: 80000000, Size: > > 200000--- > > [ 0.000000] Merged memblock_type: cnt =3D 4, max =3D 128, total_size= =3D > > 0x1e28501 > > [ 0.000000] Region 0: base =3D 0x80000000, size =3D 0x1e00000, type = =3D > > reserve > > [ 0.000000] Region 1: base =3D 0xbfe00000, size =3D 0x6002, type =3D > > memory > > .... > > [ 0.000000] OF: fdt: Reserved memory: reserved region for node > > 'mmode_resv0@80000000': base 0x0000000080000000, size 2 MiB > > [ 0.000000] OF: reserved mem: > > 0x0000000080000000..0x00000000801fffff (2048 KiB) map non-reusable > > mmode_resv0@80000000 > > > > [after your patch] > > [ 0.000000] OF: fdt: check nomap Reserving memory: base =3D > > 0x80000000, size =3D 0x200000 > > [ 0.000000] --- Reserved memory: Base address: 80000000, Size: 20000= 0--- > > [ 0.000000] Merged memblock_type: cnt =3D 4, max =3D 128, total_size= =3D 0x1e25501 > > [ 0.000000] Region 0: base =3D 0x80000000, size =3D 0x1e00000, type = =3D memory > > [ 0.000000] Region 1: base =3D 0xbfe00000, size =3D 0x6002, type =3D= memory > > ... > > [ 0.000000] OF: fdt: Reserved memory: reserved region for node > > 'mmode_resv0@80000000': base 0x0000000080000000, size 2 MiB > > [ 0.000000] OF: reserved mem: > > 0x0000000080000000..0x00000000801fffff (2048 KiB) map non-reusable > > mmode_resv0@80000000 > > > > At the moment, it can be confirmed that there is no need to worry > > about this block of memory being used. > > > > But I still have a question I'd like to ask, which is why this > > location is flagged as 'reserve' instead of 'memory' in the memblock > Sorry, I asked the wrong question. > > Why is this location marked as "memory" instead of "reserve" in the membl= ock? No idea, let's see if @Mike Rapoport can answer this :) > > > > Thanks, > > Nylon > > > > > > So to me, this is normal and we are safe. Let me know if I made a mis= take. > > > > > > And sorry for the long delay, that slipped my mind! > > > > > > Thanks, > > > > > > Alex > > > > > > > ... > > > > [ 0.000000] Failed to add a system RAM resource at 80200000 > > > > ... > > > > > > > > > > Thanks, > > > > > > > > > > Alex > > > > > > > > > > > > > > > > > > > So given that the arm64 patch with the new API is not pretty = and that > > > > > > > the simplest solution is to re-merge the memblock regions aft= erwards > > > > > > > (which is done by memblock_clear_nomap), I'll drop the new AP= I and the > > > > > > > arm64 patch to use the nomap API like arm64: I'll take advant= age of that > > > > > > > to clean setup_vm_final which I have wanted to do for a long = time. > > > > > > > > > > > > > > @Mike Thanks for you reviews! > > > > > > > > > > > > > > @Anup Thanks for all your bug reports on this patchset, I hav= e to > > > > > > > improve my test flow (it is in the work :)). > > > > > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > Anup > > > > > > > > > > > > > > > >> Thanks > > > > > > > >> > > > > > > > >>> Regards, > > > > > > > >>> Anup > > > > > > > >>> > > > > > > > >>>> arch/arm64/mm/mmu.c | 25 +++++++++++------ > > > > > > > >>>> arch/riscv/include/asm/page.h | 19 +++++++++++-- > > > > > > > >>>> arch/riscv/mm/init.c | 53 +++++++++++++++++++= +++++++++------- > > > > > > > >>>> arch/riscv/mm/physaddr.c | 16 +++++++++++ > > > > > > > >>>> drivers/of/fdt.c | 11 ++++---- > > > > > > > >>>> include/linux/memblock.h | 1 + > > > > > > > >>>> mm/memblock.c | 20 +++++++++++++ > > > > > > > >>>> 7 files changed, 119 insertions(+), 26 deletions(-) > > > > > > > >>>> > > > > > > > >>>> -- > > > > > > > >>>> 2.37.2 > > > > > > > >>>> > > > > > > > > _______________________________________________ > > > > > > > > linux-riscv mailing list > > > > > > > > linux-riscv@lists.infradead.org > > > > > > > > http://lists.infradead.org/mailman/listinfo/linux-riscv > > > > > > > > > > > > > > _______________________________________________ > > > > > > > linux-riscv mailing list > > > > > > > linux-riscv@lists.infradead.org > > > > > > > http://lists.infradead.org/mailman/listinfo/linux-riscv