public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor.dooley@microchip.com>
To: Alexandre Ghiti <alex@ghiti.fr>
Cc: Mike Rapoport <rppt@kernel.org>, Conor Dooley <conor@kernel.org>,
	<palmer@dabbelt.com>, <linux-riscv@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<frowand.list@gmail.com>, <robh+dt@kernel.org>,
	<mick@ics.forth.gr>, <paul.walmsley@sifive.com>,
	<aou@eecs.berkeley.edu>,
	<Valentina.FernandezAlanis@microchip.com>,
	<Daire.McNamara@microchip.com>
Subject: Re: RISC-V reserved memory problems
Date: Thu, 9 Mar 2023 12:51:59 +0000	[thread overview]
Message-ID: <b797bd15-ef3d-4d28-9aad-ffe0a32aa0b0@spud> (raw)
In-Reply-To: <8abfb680-e1dd-8d1f-dd10-0a8bf086f5c3@ghiti.fr>

[-- Attachment #1: Type: text/plain, Size: 1829 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-03-09 12:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8e10bf15-9fa9-fe90-1656-35bf3e87e7f8@microchip.com>
2022-08-16 20:41 ` RISC-V reserved memory problems Conor.Dooley
2022-08-18 14:32   ` Heinrich Schuchardt
2022-08-23  9:36     ` Conor.Dooley
2022-11-03 11:46   ` Evgenii Shatokhin
2022-11-03 12:07     ` Conor Dooley
2023-02-02 22:01   ` Conor Dooley
2023-03-07 11:35     ` Mike Rapoport
2023-03-09  9:14       ` Conor Dooley
2023-03-09 12:45       ` Alexandre Ghiti
2023-03-09 12:51         ` Conor Dooley [this message]
2023-03-09 15:12           ` Alexandre Ghiti
2023-03-20 12:11             ` Conor Dooley
2023-03-09 10:30   ` Alexandre Ghiti
2023-03-09 12:31     ` Alexandre Ghiti
2023-03-09 12:32     ` Conor Dooley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b797bd15-ef3d-4d28-9aad-ffe0a32aa0b0@spud \
    --to=conor.dooley@microchip.com \
    --cc=Daire.McNamara@microchip.com \
    --cc=Valentina.FernandezAlanis@microchip.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mick@ics.forth.gr \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh+dt@kernel.org \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox