[coreboot] the eternal pre-post car debate in v3

Kevin O'Connor kevin at koconnor.net
Fri Sep 12 14:10:35 CEST 2008


On Thu, Sep 11, 2008 at 08:42:44AM -0700, ron minnich wrote:
[...]
> Given these rules, here is how disable_car can work on core 2 and
> others that don't back CAR with RAM.
> 1. compute a new stack area. The minimum size is the size of the
> stack. Note that stack contains sysinfo (at its base).
>    It is acceptable to copy only the "active" stack; it is acceptable
> to copy all of CAR. It is acceptable
>   to copy more data than the "active" stack and less data than all of
> CAR. This flexibility makes
>   writing disable_car easier.
> 2. copy the data to the new stack area in ram
> 3. disable CAR
> 4. adjust the return address on stack if needed (unlikely, since we're
> executing from ROM, but who knows what the future may bring)
>     and then return.

Thanks Ron.  This write up was very useful to me.

Your proposal involves moving the stack with additional documentation
to help prevent misuses.  The idea of moving a stack makes my head
hurt though - for example, it isn't immediately clear to me if gcc
might take a pointer to a stack variable in some situations.

I'm wondering what you felt was lacking in your previous idea of
passing a new stack location/execution address into disable_car()?

Also, in an earlier email I suggested the possibility of switching the
stack before calling disable_car:

http://www.coreboot.org/pipermail/coreboot/2008-September/038611.html

do you know why that would not work?

Thanks,
-Kevin




More information about the coreboot mailing list