GoogleGit

commit54e181e073fc1415e41917d725ebdbd7de956455[log][tgz]
authorHelge Deller <deller@gmx.de>Sat Oct 26 23:19:25 2013 +0200
committerHelge Deller <deller@gmx.de>Sun Oct 27 15:58:44 2013 +0100
tree64c66c586e9667b2218758139cd8dc0348a75bd3
parent20582e34c8c1364bce15d776bce3c9c0f108132f[diff]
parisc: Do not crash 64bit SMP kernels on machines with >= 4GB RAM

Since the beginning of the parisc-linux port, sometimes 64bit SMP kernels were
not able to bring up other CPUs than the monarch CPU and instead crashed the
kernel.  The reason was unclear, esp. since it involved various machines (e.g.
J5600, J6750 and SuperDome). Testing showed, that those crashes didn't happened
when less than 4GB were installed, or if a 32bit Linux kernel was booted.

In the end, the fix for those SMP problems is trivial:
During the early phase of the initialization of the CPUs, including the monarch
CPU, the PDC_PSW firmware function to enable WIDE (=64bit) mode is called.
It's documented that this firmware function may clobber various registers, and
one one of those possibly clobbered registers is %cr30 which holds the task
thread info pointer.

Now, if %cr30 would always have been clobbered, then this bug would have been
detected much earlier. But lots of testing finally showed, that - at least for
%cr30 - on some machines only the upper 32bits of the 64bit register suddenly
turned zero after the firmware call.

So, after finding the root cause, the explanation for the various crashes
became clear:
- On 32bit SMP Linux kernels all upper 32bit were zero, so we didn't faced this
  problem.
- Monarch CPUs in 64bit mode always booted sucessfully, because the inital task
  thread info pointer was below 4GB.
- Secondary CPUs booted sucessfully on machines with less than 4GB RAM because
  the upper 32bit were zero anyay.
- Secondary CPus failed to boot if we had more than 4GB RAM and the task thread
  info pointer was located above the 4GB boundary.

Finally, the patch to fix this problem is trivial by saving the %cr30 register
before the firmware call and restoring it afterwards.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: <stable@vger.kernel.org> # 2.6.12+
Signed-off-by: Helge Deller <deller@gmx.de>
1 file changed
tree: 64c66c586e9667b2218758139cd8dc0348a75bd3
  1. .gitignore
  2. .mailmap
  3. COPYING
  4. CREDITS
  5. Documentation/
  6. Kbuild
  7. Kconfig
  8. MAINTAINERS
  9. Makefile
  10. README
  11. REPORTING-BUGS
  12. arch/
  13. block/
  14. crypto/
  15. drivers/
  16. firmware/
  17. fs/
  18. include/
  19. init/
  20. ipc/
  21. kernel/
  22. lib/
  23. mm/
  24. net/
  25. samples/
  26. scripts/
  27. security/
  28. sound/
  29. tools/
  30. usr/
  31. virt/