[coreboot] suspend/resume in v3

Kevin O'Connor kevin at koconnor.net
Tue Sep 9 04:27:42 CEST 2008

Hi Carl-Daniel,

On Tue, Sep 09, 2008 at 04:10:54AM +0200, Carl-Daniel Hailfinger wrote:
> On 09.09.2008 03:49, Kevin O'Connor wrote:
> > On Tue, Sep 09, 2008 at 03:22:38AM +0200, Carl-Daniel Hailfinger wrote:
> >> Yes, and it won't work because there can't be global variables in stage1
> >> because there's no place to store them.
> >
> > We can't access memory after initram completes?  Global variables are
> > just memory addresses.  One clearly can not access them before memory
> > is available - but why can't we access them after memory is up?
> For that we have stage2 global variables.

But, aesthetics aside, do you agree we can write to global variables
in stage1 if we are sure not to use them prior to initram?

> > Okay - can you elaborate on what those dependencies are?  Is there a
> > phase where we can access CAR but not main memory?
> >   
> Well, switching off CAR is processor specific. After switching off CAR,
> your old stack will be invalid, so you must switch stacks before that.

Right - that was what my sample code did.  It switches to a new stack
prior to calling disable_car().

> However, you can't switch the stack in the middle of a function


>and you
> must avoid cache eviction of the old stack before you have the new stack
> running.

I don't understand this point.  The memory accesses for the new stack
shouldn't evict the CAR area because the memory is still marked as

>That pretty much forces you to have stack switch and CAR
> disabling as one giant block of asm.

As I stated before I think doing that is probably the fastest and most
flexible design.

I don't see why it is mandatory though - perhaps you could elaborate
on what I'm missing.


More information about the coreboot mailing list