linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* alignment bugs in prom_init
@ 2006-03-03 13:57 Olaf Hering
  2006-03-03 14:39 ` Andreas Schwab
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Olaf Hering @ 2006-03-03 13:57 UTC (permalink / raw)
  To: linuxppc-dev

Some G5 and pSeries models dont boot with recent kernels. The reason is
likely the casting of pointers of stack variables to u32. One example is
the prom_getprop() call in prom_init_stdout().

sp is 0x0023e784, val is at offset 120, which makes 0x0023e7fc. This
address is casted to u32, which changes it to 0x0023e7f8. The firmware
writes to the wrong addres and things go downhill very quick.

c00000000040baa8:       3b 21 00 78     addi    r25,r1,120
..
c00000000040baf4:       57 28 00 38     rlwinm  r8,r25,0,0,28
..
c00000000040bb10:       4b ff d3 3d     bl      c000000000408e4c <.call_prom>

If I remove the casts and pass the pointer as is, everything starts to
work as expected? Why is all this (u32)(unsigned long) casting in
arch/powerpc/kernel/prom_init.c required?

Does -Os vs -O2 make a difference here?

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-03-04  0:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-03 13:57 alignment bugs in prom_init Olaf Hering
2006-03-03 14:39 ` Andreas Schwab
2006-03-03 15:27   ` Olaf Hering
2006-03-03 15:50 ` Jerry Van Baren
2006-03-03 16:14 ` Jerry Van Baren
2006-03-03 17:24   ` Olaf Hering
2006-03-03 16:52 ` [PATCH] Workaround gcc bug #26549 which causes pointers to be truncated Olaf Hering
2006-03-03 19:16   ` [PATCH] force stackpointer alignment in 64bit kernel Olaf Hering
2006-03-03 19:23     ` Olaf Hering
2006-03-03 19:29     ` Segher Boessenkool
2006-03-03 19:32       ` Segher Boessenkool
2006-03-03 20:09       ` Olaf Hering
2006-03-03 20:40         ` Olaf Hering
2006-03-03 23:23       ` Olaf Hering
2006-03-03 23:45         ` Paul Nasrat
2006-03-04  0:09         ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).