[coreboot] v3 challenge: global variables

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Mon Feb 4 20:40:17 CET 2008


On 04.02.2008 19:46, ron minnich wrote:
> I think we're making this too hard.
>
> Given a CAR address space, starting at CARBASE and ending at CAREND, we
> partition it as follows:
> bottom 1/2: stack
> top 1/2: defined by the Linux log buffer struct.
>   

Are you using "top" and "bottom" in the sense of memory addresses or
their place on the stack?

> All done.
>   

Generally speaking, the concept is intriguing. However, I fear we want
to increase log buffer size once RAM is enabled. For targets with 4k of
CAR, that means we restrict the buffer to 2k and the stack to 2k. While
this may be sufficient during CAR stage, once RAM is enabled we may have
deep call chains which eat more than 2k (total) of stack, which will
cause silent stack corruption when the log buffer reaches its wraparound
point.
If we push a pointer to the log buffer struct as first element on the
stack, we can move the log buffer easily once RAM is enabled, while at
the same time making sure nothing will interfere with the regular stack.


Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the coreboot mailing list