mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: RISC-V: erizo: large gap between bss and stack regions
Date: Wed, 14 Apr 2021 14:58:56 +0200	[thread overview]
Message-ID: <20210414125856.GW19819@pengutronix.de> (raw)
In-Reply-To: <20210414155443.f6f4c5b2c125a6581a7b5f75@gmail.com>

On Wed, Apr 14, 2021 at 03:54:43PM +0300, Antony Pavlov wrote:
> On Wed, 14 Apr 2021 13:20:44 +0200
> Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> 
> > On 14.04.21 13:07, Antony Pavlov wrote:
> > > On Wed, 14 Apr 2021 11:54:27 +0200
> > > Sascha Hauer <sha@pengutronix.de> wrote:
> > > 
> > >> On Wed, Apr 14, 2021 at 08:54:22AM +0300, Antony Pavlov wrote:
> > >>> Hi Ahmad!
> > >>>
> > >>> Here is the iomem command output on erizo:
> > >>>
> > >>> barebox:/ iomem
> > >>> 0x00000000 - 0xffffffff (size 0x00000000) iomem
> > >>>   0x80000000 - 0x807fffff (size 0x00800000) ram0
> > >>>     0x804ffd00 - 0x805ffcff (size 0x00100000) malloc space
> > >>>     0x805ffd00 - 0x805fffe6 (size 0x000002e7) board data
> > >>>     0x80600000 - 0x80636b1f (size 0x00036b20) barebox
> > >>>     0x80636b20 - 0x8063ec9b (size 0x0000817c) barebox data
> > >>>     0x8063ec9c - 0x80643147 (size 0x000044ac) bss
> > >>>     0x807e0000 - 0x807fffff (size 0x00020000) stack
> > >>>   0x90000000 - 0x9000001f (size 0x00000020) 90000000.uart@90000000.of
> > >>>   0x91000000 - 0x91000003 (size 0x00000004) 91000000.gpio@91000000.of
> > >>>   0x91000004 - 0x91000007 (size 0x00000004) 91000000.gpio@91000000.of
> > >>>
> > >>> I see large unused region between bss and stack regions (>1600 Kbytes).
> > >>
> > >> That's normal. The compressed barebox knows the size of the uncompressed
> > >> barebox, but it doesn't know the size of the bss segment above it. For
> > >> that reason we have a very pessimistic estimate of:
> > >>
> > >> #define MAX_BSS_SIZE SZ_1M
> > >>
> > >> The barebox binary itself is then aligned to the previous 1MiB
> > >> boundary, so barebox usually starts at 2MiB below the end of SDRAM.
> > >> That's a bit wasteful for boards with very little memory like the erizo,
> > >> but that's how things are at the moment.
> > > 
> > > Can we make it configurable via Kconfig?
> > 
> > Or even better: Could we easily add to the piggy data the size of bss
> > it contains?
> > 
> 
> On MIPS we already have:
> 
>    bss_len = (unsigned long)&__bss_stop - (unsigned long)__bss_start;

When running in the decompressor that gives you the bss size of the
decompressor binary, but we need the bss size of barebox proper.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-04-14 13:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  5:54 Antony Pavlov
2021-04-14  9:54 ` Sascha Hauer
2021-04-14 11:07   ` Antony Pavlov
2021-04-14 11:20     ` Ahmad Fatoum
2021-04-14 12:54       ` Antony Pavlov
2021-04-14 12:58         ` Sascha Hauer [this message]
2021-04-15  7:54       ` Sascha Hauer

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=20210414125856.GW19819@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.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