RISC-V reserved memory problems

Conor Dooley conor.dooley at microchip.com
Thu Mar 9 04:51:59 PST 2023


On Thu, Mar 09, 2023 at 01:45:05PM +0100, Alexandre Ghiti wrote:
> 
> On 3/7/23 12:35, Mike Rapoport wrote:
> > Hi Conor,
> > 
> > Sorry for the delay, somehow this slipped between the cracks.
> > 
> > On Thu, Feb 02, 2023 at 10:01:26PM +0000, Conor Dooley wrote:
> > > Hullo Palmer, Mike & whoever else may read this,
> > > 
> > > Just reviving this thread from a little while ago as I have been in the
> > > area again recently...
> > TBH, I didn't really dig deep into the issues, but the thought I had was
> > what if DT was mapped via fixmap until the setup_vm_final() and then it
> > would be possible to call DT methods early.
> > 
> > Could be I'm shooting in the dark :)
> 
> 
> I think I understand the issue now, it's because In riscv, we establish 2
> different virtual mappings and we map the device tree at 2 different virtual
> addresses, which is the problem.
> 
> So to me, the solution is:
> 
> - to revert your previous fix, that is calling
> early_init_fdt_scan_reserved_mem() before any call to memblock_alloc()
> (which could result in an allocation in the area you want to reserve)
> 
> - to map the device tree at the same virtual address, because
> early_init_fdt_scan_reserved_mem() initializes reserved_mem with the dtb
> mapping established in setup_vm() and uses reserved_mem with the new mapping
> from setup_vm_final (which is what Mike proposes, we should use the fixmap
> region to have the same virtual addresses)
> 
> Hope that makes sense: I'll come up with something this afternoon for you to
> test!

Sounds good. Please give me some ELI5 commit messages if you can,
explanations for this stuff (which I found took a lot of archaeology to
understand) would be very welcome next time we need to go back looking
at this stuff.

Thanks Alex!
Conor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230309/21b83fbf/attachment.sig>


More information about the linux-riscv mailing list