[SLOF] [PATCH v2] boot: do not use catpad to concatenate strings
segher at kernel.crashing.org
Thu Dec 7 22:44:22 AEDT 2017
On Thu, Dec 07, 2017 at 09:36:44PM +1100, David Gibson wrote:
> > >> VARIABLE state-valid false state-valid !
> > >> CREATE go-args 2 cells allot go-args 2 cells erase
> > >>
> > >> +4000 CONSTANT BOOT_DEV_SIZE
> > >> +CREATE bootdev-buf BOOT_DEV_SIZE allot
> > >
> > > I somehow dislike the idea that we statically reserve such big arrays
> > > ... would it be feasible to do this with alloc-mem on the fly instead?
> > Let me try that out
> Don't try too hard. I mean, sure a large static array is kinda ugly, but
> when it comes down it the whole guest's memory is there with nothing
> else to use it for until SLOF's done.
Sure, 16kB is nothing. But 16kB is not enough in general, or are there
any guarantees? Arbitrary (and undocumented, and not checked for!) limits
tend to be broken, and such things are hard to debug.
(Just adding a check would make things much nicer already:
( size) dup bootdev-size > ABORT" bootdev size too big!"
More information about the SLOF