All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fangsuo Wu <tiger20081015@gmail.com>
To: u-boot@lists.denx.de
Subject: Possiable memory conflict with fdt memory region
Date: Mon, 27 Dec 2021 19:10:56 +0800	[thread overview]
Message-ID: <CAMDn9+SxqB2QUsgaN9P5_pBMRSzGQJpCvCs72OR1OTQzLvQ-Jw@mail.gmail.com> (raw)

Hi,  in image_setup_linux(),
stage 1: Boot_fdt_add_mem_rsv_regions() is called first to add the mem
reserve regions which prevents u-boot from using them to store the
initrd or the fdt blob;
stage 2: Then boot_relocate_fdt() is called to reserve or alloc fdt
blob from the avaiable lmb region.

But it seems  at stage 1 it doesn't cover up all mem reserve regions.
For example, if CMD_PSTORE is configured,  fdt_fixup_pstore(blob) will
add pstore to reserved-memory node in fdt in image_setup_libfdt()
after stage 2 , which may conflict with fdt memory region and can't be
detected since fdt_fixup_pstore doesn't call lmb_reserve(lmb, pstrore
addr, pstore len).

In image_setup_libfdt, there are also other functions like
ft_board_setup which may change existing reserved memory node's size
and lead to the same issue.

Do you think  a common function is needed before
boot_fdt_add_mem_rsv_regions() in stage 1? The function can be used to
fix-up or add new reserved memory nodes. Thanks.

             reply	other threads:[~2021-12-27 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27 11:10 Fangsuo Wu [this message]
2022-01-27 15:06 ` Possiable memory conflict with fdt memory region Simon Glass

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=CAMDn9+SxqB2QUsgaN9P5_pBMRSzGQJpCvCs72OR1OTQzLvQ-Jw@mail.gmail.com \
    --to=tiger20081015@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.