[coreboot] Strange corruption with printk

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Tue Mar 9 01:07:21 CET 2010

On 09.03.2010 00:18, Myles Watson wrote:
> I divided the CAR copy into pieces to debug memory corruption that I'm
> seeing.  It seems to fit a pattern, but I'm not sure what would be causing
> it.  Any ideas would be appreciated.

To be honest, if post_cache_as_ram() works at all on K8, it is mostly
luck. The memory copy is not inline asm (will lead to subtle
corruption), the memory copy and the stack switching are not in one
inline asm block (gcc is free to insert arbitrary code in between), and
the stack is switched in the middle of a function (gcc may use some
non-clobbered regs to access the old stack, or simply die).

Throwing out the complete v2 K8 CAR disabling code and replacing it with
the v3 code is one of the possible fixes. I will do that probably this
May. By the way, the global variable infrastructure in v3 is one of the
reasons why stack switching in v3 is much less painful.


"I do consider assignment statements and pointer variables to be among
computer science's most valuable treasures."
-- Donald E. Knuth

More information about the coreboot mailing list