diff options
author | David S. Miller <davem@davemloft.net> | 2012-05-10 14:00:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-10 14:00:46 -0400 |
commit | a5a737e090e25981e99d69f01400e3a80356581c (patch) | |
tree | 800716c007575b1c316299300e3316d0d94ed243 /arch | |
parent | bc46f9375a286d05f84a9464efc2b7f1f5614ff4 (diff) |
sparc64: Do not clobber %g2 in xcall_fetch_glob_regs().
%g2 is meant to hold the CPUID number throughout this routine, since
at the very beginning, and at the very end, we use %g2 to calculate
indexes into per-cpu arrays.
However we erroneously clobber it in order to hold the %cwp register
value mid-stream.
Fix this code to use %g3 for the %cwp read and related calulcations
instead.
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/kernel/central.c | 2 | ||||
-rw-r--r-- | arch/sparc/mm/ultra.S | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c index 38d48a59879c..9708851a8b9f 100644 --- a/arch/sparc/kernel/central.c +++ b/arch/sparc/kernel/central.c | |||
@@ -269,4 +269,4 @@ static int __init sunfire_init(void) | |||
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | 271 | ||
272 | subsys_initcall(sunfire_init); | 272 | fs_initcall(sunfire_init); |
diff --git a/arch/sparc/mm/ultra.S b/arch/sparc/mm/ultra.S index b57a5942ba64..874162a11ceb 100644 --- a/arch/sparc/mm/ultra.S +++ b/arch/sparc/mm/ultra.S | |||
@@ -495,11 +495,11 @@ xcall_fetch_glob_regs: | |||
495 | stx %o7, [%g1 + GR_SNAP_O7] | 495 | stx %o7, [%g1 + GR_SNAP_O7] |
496 | stx %i7, [%g1 + GR_SNAP_I7] | 496 | stx %i7, [%g1 + GR_SNAP_I7] |
497 | /* Don't try this at home kids... */ | 497 | /* Don't try this at home kids... */ |
498 | rdpr %cwp, %g2 | 498 | rdpr %cwp, %g3 |
499 | sub %g2, 1, %g7 | 499 | sub %g3, 1, %g7 |
500 | wrpr %g7, %cwp | 500 | wrpr %g7, %cwp |
501 | mov %i7, %g7 | 501 | mov %i7, %g7 |
502 | wrpr %g2, %cwp | 502 | wrpr %g3, %cwp |
503 | stx %g7, [%g1 + GR_SNAP_RPC] | 503 | stx %g7, [%g1 + GR_SNAP_RPC] |
504 | sethi %hi(trap_block), %g7 | 504 | sethi %hi(trap_block), %g7 |
505 | or %g7, %lo(trap_block), %g7 | 505 | or %g7, %lo(trap_block), %g7 |