diff options
author | David S. Miller <davem@davemloft.net> | 2006-01-31 21:34:51 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:11:29 -0500 |
commit | 86b818687d4894063ecd1190e54717a0cce8c009 (patch) | |
tree | d2951295358502c88f7fe0c02517d729cff4eb9a /arch/sparc64/kernel/winfixup.S | |
parent | 9954863975910a1b9372b7d5006a6cba43bdd288 (diff) |
[SPARC64]: Fix race in LOAD_PER_CPU_BASE()
Since we use %g5 itself as a temporary, it can get clobbered
if we take an interrupt mid-stream and thus cause end up with
the final %g5 value too early as a result of rtrap processing.
Set %g5 at the very end, atomically, to avoid this problem.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/winfixup.S')
-rw-r--r-- | arch/sparc64/kernel/winfixup.S | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sparc64/kernel/winfixup.S b/arch/sparc64/kernel/winfixup.S index c0545d089c96..ade991b7d079 100644 --- a/arch/sparc64/kernel/winfixup.S +++ b/arch/sparc64/kernel/winfixup.S | |||
@@ -86,7 +86,7 @@ fill_fixup: | |||
86 | wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate | 86 | wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate |
87 | mov %o7, %g6 | 87 | mov %o7, %g6 |
88 | ldx [%g6 + TI_TASK], %g4 | 88 | ldx [%g6 + TI_TASK], %g4 |
89 | LOAD_PER_CPU_BASE(%g1, %g2) | 89 | LOAD_PER_CPU_BASE(%g1, %g2, %g3) |
90 | 90 | ||
91 | /* This is the same as below, except we handle this a bit special | 91 | /* This is the same as below, except we handle this a bit special |
92 | * since we must preserve %l5 and %l6, see comment above. | 92 | * since we must preserve %l5 and %l6, see comment above. |
@@ -209,7 +209,7 @@ fill_fixup_mna: | |||
209 | wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate | 209 | wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate |
210 | mov %o7, %g6 ! Get current back. | 210 | mov %o7, %g6 ! Get current back. |
211 | ldx [%g6 + TI_TASK], %g4 ! Finish it. | 211 | ldx [%g6 + TI_TASK], %g4 ! Finish it. |
212 | LOAD_PER_CPU_BASE(%g1, %g2) | 212 | LOAD_PER_CPU_BASE(%g1, %g2, %g3) |
213 | call mem_address_unaligned | 213 | call mem_address_unaligned |
214 | add %sp, PTREGS_OFF, %o0 | 214 | add %sp, PTREGS_OFF, %o0 |
215 | 215 | ||
@@ -312,7 +312,7 @@ fill_fixup_dax: | |||
312 | wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate | 312 | wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate |
313 | mov %o7, %g6 ! Get current back. | 313 | mov %o7, %g6 ! Get current back. |
314 | ldx [%g6 + TI_TASK], %g4 ! Finish it. | 314 | ldx [%g6 + TI_TASK], %g4 ! Finish it. |
315 | LOAD_PER_CPU_BASE(%g1, %g2) | 315 | LOAD_PER_CPU_BASE(%g1, %g2, %g3) |
316 | call spitfire_data_access_exception | 316 | call spitfire_data_access_exception |
317 | add %sp, PTREGS_OFF, %o0 | 317 | add %sp, PTREGS_OFF, %o0 |
318 | 318 | ||