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 15EE6C54E58 for ; Tue, 12 Mar 2024 06:48:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 854DD8D0018; Tue, 12 Mar 2024 02:48:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 803D98D0017; Tue, 12 Mar 2024 02:48:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CBFA8D0018; Tue, 12 Mar 2024 02:48:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5B31B8D0017 for ; Tue, 12 Mar 2024 02:48:45 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1EDD3140F83 for ; Tue, 12 Mar 2024 06:48:45 +0000 (UTC) X-FDA: 81887459010.09.E1BECC6 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by imf23.hostedemail.com (Postfix) with ESMTP id 4A21014000A for ; Tue, 12 Mar 2024 06:48:43 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=sifive.com header.s=google header.b=eTkyrJWw; dmarc=pass (policy=reject) header.from=sifive.com; spf=pass (imf23.hostedemail.com: domain of nylon.chen@sifive.com designates 209.85.128.180 as permitted sender) smtp.mailfrom=nylon.chen@sifive.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710226123; 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=YkQyXBt8cc9gCSbMJduWsjQiEDwVv0KA3piVD2J6QZs=; b=ZJYxkffKwlxDufz7k9BUN5nwOyfSZI5shJSvrdLRwOiwBf/BcYJc82Vk37T8ub9GlCifgc LEuumIh2SOKp5XnaesdsiBwY9oefS32NPxtBeCJ8tFtr765NAt0VHQxyRqALxRc4w3dDGg zi9W3/IBguFEWkaLnqES/2ynQXeBrfk= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=sifive.com header.s=google header.b=eTkyrJWw; dmarc=pass (policy=reject) header.from=sifive.com; spf=pass (imf23.hostedemail.com: domain of nylon.chen@sifive.com designates 209.85.128.180 as permitted sender) smtp.mailfrom=nylon.chen@sifive.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710226123; a=rsa-sha256; cv=none; b=URbW+Rl6argiB43STfZjRG0TM7f5e1vhqDNLCSqrQt7UFG+wyrjWfMmyg6UndwQT/Iak6N Z6i/lCjj3G27/iZAsJysGgvteqHb93dHTDyBh85x/HGEZ3QWY93ZXhRkNqrXytSKZ1mqXv kOYtKBVGfD2fXggBwSXu3gZvi7iQ2ec= Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-609fd5fbe50so47862587b3.0 for ; Mon, 11 Mar 2024 23:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1710226122; x=1710830922; 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=YkQyXBt8cc9gCSbMJduWsjQiEDwVv0KA3piVD2J6QZs=; b=eTkyrJWwgJzN5e6D615M0ldexfcPdp3xaydQmqGUZajpa14ChscOQceJIhCibs6OLs SWpQC1+0tIdHTuCnv4orzixMBs1JhyShLmPCrjYrF7kEpQGHUCOqhpRPL1m/K3z5za+7 J34cyn7wPk2kQTKGwVvMb/iL3Wz/OdmpQ9Lfe3ZHjrIaHrsgJVOwwBqHebcIxe8tBnUx k8G/3jwGKXL008rMVsliQaU+4W2cV/Bi+ETLhdpii1KgmRp89QUnJ3cNWbKJgfGz4YKD OzfzpcEjKYDTb4KV7TR0ync4HtppBMFOlG7YDtmwvoAgw6ZxEInptur1btixbC/OSTIR /ABg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710226122; x=1710830922; 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=YkQyXBt8cc9gCSbMJduWsjQiEDwVv0KA3piVD2J6QZs=; b=Sfff4Vc8h7S3efgWK9stdlULzUglcr8ecYI8epzxy2VkPC4d9QLA1zCGo2I+1S8GtM GAiAF5MiT3DdzU87a784XmtLQBPw67HfPlXq81YOU2VISghsF7bt7VSD1ogaYsXjbHNQ SOTp1mgoMwmYFjk9eCfNnvx7LpkZwYsEaSTbsfBaDVe+4Vx2gVPKwyQnXNlSnHZKXkVK EgIiVA5Slc9DRblUPuJj6sBIKnFndI+6r3mZoOxybWwepNq9R3r3J9aE7DLvh+s/3L8s JWuhaTl8Gb2DQTnSkaYRD1is2DP6bvUuhQm/wyeMGtHrT9Jhq7okCOaiDc2M69/VTFY1 Om9Q== X-Forwarded-Encrypted: i=1; AJvYcCWAclt0Ulh011ETtSCbwzvWET5JEYjbickmvJYbUvBXK5lhgdTdnjPx0eXmRrF+bYEIiBtzXUzTHQWQuX9P1TaADAw= X-Gm-Message-State: AOJu0YwJObNjtgDmZktQhSl8vlhAWYaecjl5+/Gsqaq49Ta1Q3z4uBHT LXATCdl0xTCspG2PNrZ1Euk4YFnsr9Kb+1AqphqMZ7GVwH6K9pQ8HP4y3wOBtRicw+y+z+GlECD SH+ePfVSGhxxtuaLO91yzshUup/zAJoIFgTxdvQ== X-Google-Smtp-Source: AGHT+IHR+U7F2n0c/KGQxjGQRDSMRPibcokXyodYfTK2034eRWrmjzdLKQ9iq2FB4V6igzx+tIs45dHL/NwVzyFxjD4= X-Received: by 2002:a81:9e43:0:b0:609:f4d5:2fc5 with SMTP id n3-20020a819e43000000b00609f4d52fc5mr2804732ywj.15.1710226122218; Mon, 11 Mar 2024 23:48:42 -0700 (PDT) MIME-Version: 1.0 References: <20230316131711.1284451-1-alexghiti@rivosinc.com> <20240118082346.GB31078@hsinchu15> In-Reply-To: From: Nylon Chen Date: Tue, 12 Mar 2024 14:48:30 +0800 Message-ID: Subject: Re: Fwd: [PATCH v8 0/4] riscv: Use PUD/P4D/PGD pages for the linear mapping To: Alexandre Ghiti 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-Queue-Id: 4A21014000A X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: h5dqqbh4hrgm8r47ntzk9n3ja7y5akfs X-HE-Tag: 1710226123-99906 X-HE-Meta: U2FsdGVkX18b5IjjheYOlnFVtNOY8OuxGkiG+PpZSWKlsoaFQFnioimrUkKPQFUt5aQ/Hn3Lz62kiL+p0lNdIBn8DodIHG058Pkdrx7IuEHBy/qU7bGB+0z9HHtXtx/Qz4XFbfNKKkNsGDPhNsOFe16fmY31FIOi4j+O2WiaSXXaUWIB9wGwecIY6E2sJ3Joxv4bL+QdY0nyCtZiLoW4UAvaeiKNgLNnoLVaWcQD/bh2B8URurVLItfRfB2esRMm1axxoK1GP7E6pFQqad/Q/SFLpYsi4JxaXJIvaUtt3ex1eSNGF8KVb8uYYChzJwg7EHm7Op5RWM+/7npgtvQKIeb4i26xJijCiYX12F2ZxqmLv7hn2UVNlRWVxrRsi3ArZu3hqu1Gcoh99dRtV3DnVEy+c8o4U42px4/wq3itIlniRwyo8FY0RGzDEa7p7qjrBBnZylvDdn90G2oQeWJRt29KT8k4h0pfWAeJf/nrdccNvEQDSBigz2tw1mIwUl3F9KrdrrI9U3cI7tT5uYL3OwEp57bHRjGQxVDG7s918nAypRKkCighYSDhgkRsCjsD6iMSSkTrAQlmTevVjZJIIZsmutx22sLGlkHd0z69fjK9nGUpeogwVGPOrvohL4GhNe4EZ3ol6LUghImsqj5uz9HSlmgaHJPnfryHBw7TvzDCoJU6ttXplKfeb+4MrRMNHfHiDG6MuNwjfu8PBvdK3tE85gKsQjpDh49GmWTc0xteiLqbzHpK6rb29HRiPrCUYtC6g6pKZZq5PrHirigmyYWLSR4tUv/y5dbI22FXfx3zrR9s+L2xQdXdGVmBPWry+Dn0BICqUG4KOcVx7Uzj1RDhE1G3mmMHWPlxsVKv0ZxTWRfapzi2GPvevjX2WONJV2PWc4E3DDanQsF7SbC8M+K17uh1huY+SZ+Q+t3CZRQpQUkblzrMSretlL228LcS0Ff7C3wH0M5UoWbdkgT fxLr4l7l Vqw/yf2i1VDKqOnpZD6mpjdNWPOSoZxgfAO2CisuS4M28GCW1Vafud4i3yh5+pMDuxiKhmf5gkDRP4tfBrVkf8jHkGBP23FcMJ2c0QYhYa8aotn6XmEBBAQfAJxt0nImjoN7T+3VRaxGYMU7ki0+MCD8fOMSLhib6WmtUr1+ZUEY1Vv3PaJBEB7Gegrd1niKtgMv83W2ePxoKn/EIS2n4NZJrG2J3Yf84FvZKleeZa7cw8eoxvKMyEZJJpt9g4hL2dezjZPusOP2D9b6LwsAZCAPtQ/juKqjdBa7fKIxJol0pMn2IXK3YMgr9kzCSmIOteK36j4MqZwFc2n4NLqk1PivFtNqYEuP+fzbQgaJLoPqQvv8Pru6vrGYfPvYlIaOJu3XglUIh2VA720i0bMWPeYc1KZZeAcAQsqcECvYbZD702YkKDUmk38Q9x8/y13usiSCnWpGRKq7MhBlShZjcbh4D0x/DHj6WQCKumrzoaNzgfmvpqpCbTwHpwrw1AZ9NYymGIC9QfDLjH2K3rDmDGp/N8S4Z75db3WlG4fO7Yfxc/aR0QW+cQ3M+AB8Eu5AZv20OR7oHoJMijGUm3bI0CNCB5Jo+0saF2zFRyWqCMwrL1hCybLeIcBF84w== 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: 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 wrote: > > > > > > >>>> This patchset intends to improve tlb utilization by using = hugepages for > > > > > > >>>> the linear mapping. > > > > > > >>>> > > > > > > >>>> As reported by Anup in v6, when STRICT_KERNEL_RWX is enabl= ed, we must > > > > > > >>>> take care of isolating the kernel text and rodata so that = they are not > > > > > > >>>> mapped with a PUD mapping which would then assign wrong pe= rmissions to > > > > > > >>>> the whole region: it is achieved by introducing a new memb= lock API. > > > > > > >>>> > > > > > > >>>> Another patch makes use of this new API in arm64 which use= d some sort of > > > > > > >>>> hack to solve this issue: it was built/boot tested success= fully. > > > > > > >>>> > > > > > > >>>> 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 arm64 = reviewers, but > > > > > > >>>> this patch can easily be dropped if they do not want it= . > > > > > > >>>> > > > > > > >>>> v7: > > > > > > >>>> - Fix Anup bug report by introducing memblock_isolate_memo= ry which > > > > > > >>>> allows us to split the memblock mappings and then avoid= 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 unsi= gned long > > > > > > >>>> > > > > > > >>>> v5: > > > > > > >>>> - Fix nommu builds by getting rid of riscv_pfn_base in pat= ch 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 t= hat 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 initrd= _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 line= ar mapping > > > > > > >>>> riscv: Use PUD/P4D/PGD pages for the linear mapping > > > > > > >>> Kernel boot fine on RV64 but there is a failure which is st= ill not > > > > > > >>> addressed. You can see this failure as following message in > > > > > > >>> kernel boot log: > > > > > > >>> 0.000000] Failed to add a System RAM resource at 80200= 000 > > > > > > >> Hmmm I don't get that in any of my test configs, would you m= ind > > > > > > >> 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 -kerne= l > > > > > > > ./build-riscv64/arch/riscv/boot/Image -append "root=3D/dev/ra= m rw > > > > > > > console=3DttyS0 earlycon" -initrd ./rootfs_riscv64.img -smp 4 > > > > > > > > > > > > > > > > > > So splitting memblock.memory is the culprit, it "confuses" the = 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 encounter= the > > > > > error again. > > > > > > > > > > What I have observed so far is > > > > > > > > > > - before your patch > > > > > When merging consecutive memblocks, if the memblock types are dif= ferent, > > > > > they will be merged into reserved > > > > > - after your patch > > > > > When consecutive memblocks are merged, if the memblock types are > > > > > different, they will be merged into memory. > > > > > > > > > > Such a result will cause the memory location of OpenSBI to be cha= nged > > > > > 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 region > > > > being reserved: > > > > > > > > reserved[0x0] [0x0000000080000000-0x000000008007ffff], > > > > 0x0000000000080000 bytes flags: 0x0 > > > > > > > > Can you elaborate a bit more about "When consecutive memblocks are > > > > merged, if the memblock types are different, they will be merged in= to > > > > memory"? Where/when does this merge happen? Can you give me a confi= g > > > > 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 modify= OpenSBI > > > > > > [ lib/sbi/sbi_domain.c ] > > > +#define TEST_SIZE 0x200000 > > > > > > - (scratch->fw_size - scratch->fw_rw_= offset), > > > + (TEST_SIZE - scratch->fw_rw_offset)= , > > > > > > In addition, you can insert checks in the kernel merged function > > > [ mm/memblock.c ] > > > static void __init_memblock memblock_merge_regions(struct memblock_ty= pe *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)) * sizeo= f(*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%llx,= 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_si= ze =3D 0x1628501 > > > [ 0.000000] Region 0: base =3D 0x80000000, size =3D 0x1600000, typ= e =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_si= ze =3D 0x180c42e > > > [ 0.000000] Region 0: base =3D 0x80000000, size =3D 0x1800000, typ= e =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: 200000-= -- > [ 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 m= emory > ... > [ 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 membloc= k? > > Thanks, > Nylon > > > > So to me, this is normal and we are safe. Let me know if I made a mista= ke. > > > > 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 an= d that > > > > > > the simplest solution is to re-merge the memblock regions after= wards > > > > > > (which is done by memblock_clear_nomap), I'll drop the new API = and the > > > > > > arm64 patch to use the nomap API like arm64: I'll take advantag= e of that > > > > > > to clean setup_vm_final which I have wanted to do for a long ti= me. > > > > > > > > > > > > @Mike Thanks for you reviews! > > > > > > > > > > > > @Anup Thanks for all your bug reports on this patchset, I have = 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