Re: [PATCH v2 3/5] RISC-V: Allow booting kernel from any 4KB aligned address

From: Christoph Hellwig
Date: Sat Mar 23 2019 - 13:24:25 EST

On Sat, Mar 23, 2019 at 05:40:12PM +0200, Mike Rapoport wrote:
> I have no general objection, but I presume the patch will be significantly
> simplified if the addition of 4K pages support will follow the removal of
> the trampoline_pd_dir.
> That said, I didn't look into the details, since they will change
> substantially, only some comments on the Kconfig part.
> On the high level, have you considered using large pages in setup_vm() and
> the remapping everything with 4K pages in setup_vm_final()? This might
> save you the whole ops-> churn.

That would be a great start. That being said the current tiny memory
RISC-V devices don't even have a MMU, so the kernel pagetable mapping
isn't even relevant for them. I'm just not sure adding more complexity
in the early boot path for a borderline case (MMU and tiny memory
with a tiny kernel image) is reall worth all the complexity.