public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Woody Zhang <woodylab@foxmail.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: reserve DTB before possible memblock allocation
Date: Sat, 10 Jun 2023 16:41:17 +0100	[thread overview]
Message-ID: <20230610-ability-mockup-f6aa71bad6a1@spud> (raw)
In-Reply-To: <CAHVXubggydGfNu3OzcxWXREJbB+G9dmr9sFD7vXhVxbG-N58Pg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1748 bytes --]

On Thu, Jun 08, 2023 at 09:49:44AM +0200, Alexandre Ghiti wrote:
> On Wed, Jun 7, 2023 at 8:17 PM Conor Dooley <conor@kernel.org> wrote:
> >
> > +CC Alex, you should take a look at this patch.
> >
> > On Wed, Jun 07, 2023 at 09:35:19PM +0800, Woody Zhang wrote:
> > > It's possible that early_init_fdt_scan_reserved_mem() allocates memory
> > > from memblock for dynamic reserved memory in `/reserved-memory` node.
> > > Any fixed reservation must be done before that to avoid potential
> > > conflicts.
> > >
> > > Reserve the DTB in memblock just after early scanning it.
> >
> > The rationale makes sense to me, I am just wondering what compelling
> > reason there is to move it away from the memblock_reserve()s for the
> > initd and vmlinux? Moving it above early_init_fdt_scan_reserved_mem()
> > should be the sufficient minimum & would keep things together.

> Thanks Conor.
> 
> So the patch looks good to me.
> 
> But I find this fragile:
> 
> - we do not check memblock_reserve() return value to make sure the
> reservation really happened (and quickly looking at the code, I'm not
> even sure it returns an error if the region was already allocated).
> - we have to make sure no memblock allocation happens before setup_bootmem().
> - we also have to check that no fixed memblock_reserve() happens after.
> 
> The last 2 points may sound natural, but we'll have to take great care
> when adding some code around here. I'm working on an "early boot
> document" and I'll add something about that, but a runtime thing would
> be way better IMO.
> 
> You can add:
> 
> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>

btw Alex/Woody, what is the appropriate Fixes tag here?

Cheers,
Conor.

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

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2023-06-10 15:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07 13:35 [PATCH] riscv: reserve DTB before possible memblock allocation Woody Zhang
2023-06-07 18:17 ` Conor Dooley
2023-06-07 22:17   ` Woody Zhang
2023-06-07 22:23     ` Conor Dooley
2023-11-27 14:29       ` Conor Dooley
2023-06-08  7:49   ` Alexandre Ghiti
2023-06-10 15:41     ` Conor Dooley [this message]
2023-06-10 23:27       ` Woody Zhang
2023-06-12  6:57         ` Alexandre Ghiti

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=20230610-ability-mockup-f6aa71bad6a1@spud \
    --to=conor@kernel.org \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=woodylab@foxmail.com \
    /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