Re: [PATCH 4/7] RISC-V: Update page tables to cover the whole linear mapping

From: Logan Gunthorpe
Date: Thu Mar 28 2019 - 14:24:47 EST




On 2019-03-28 4:03 a.m., Anup Patel wrote:
> I understand that this patch is inline with your virtual memory layout cleanup
> but the way we map virtual memory in swapper_pg_dir is bound to change.
>
> We should not be mapping complete virtual memory in swapper_pd_dir()
> rather we should only map based on amount of RAM available.
>
> Refer, https://www.lkml.org/lkml/2019/3/24/3
>
> The setup_vm() should only map vmlinux_start to vmlinux_end plus the
> FDT. Complete virtual memory mapping should be done after we have
> done early parsing of FDT when we know available memory banks in
> setup_vm_final() (called from paging_init())

That makes sense, but I think a lot of it sounds a out of the scope of
what I'm doing in this patch set.

I could attempt to update my patchset so instead of expanding the linear
region on boot, we add the page tables in arch_add_memory. That would
make more sense when considering the direction you want to head with
setup_vm.

Logan