Преглед на файлове

[SPARC64]: Fix too early reference to %g6

%g6 is not necessarily set to current_thread_info()
at sparc64_realfault_common.  So store the fault
code and address after we invoke etrap and %g6 is
properly set up.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller преди 19 години
родител
ревизия
9bc657b28e
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 5 2
      arch/sparc64/kernel/tsb.S

+ 5 - 2
arch/sparc64/kernel/tsb.S

@@ -110,10 +110,13 @@ tsb_do_itlb_fault:
 
 
 	.globl	sparc64_realfault_common
 	.globl	sparc64_realfault_common
 sparc64_realfault_common:
 sparc64_realfault_common:
-	stb	%g4, [%g6 + TI_FAULT_CODE]	! Save fault code
-	stx	%g5, [%g6 + TI_FAULT_ADDR]	! Save fault address
+	/* fault code in %g4, fault address in %g5, etrap will
+	 * preserve these two values in %l4 and %l5 respectively
+	 */
 	ba,pt	%xcc, etrap			! Save trap state
 	ba,pt	%xcc, etrap			! Save trap state
 1:	 rd	%pc, %g7			! ...
 1:	 rd	%pc, %g7			! ...
+	stb	%l4, [%g6 + TI_FAULT_CODE]	! Save fault code
+	stx	%l5, [%g6 + TI_FAULT_ADDR]	! Save fault address
 	call	do_sparc64_fault		! Call fault handler
 	call	do_sparc64_fault		! Call fault handler
 	 add	%sp, PTREGS_OFF, %o0		! Compute pt_regs arg
 	 add	%sp, PTREGS_OFF, %o0		! Compute pt_regs arg
 	ba,pt	%xcc, rtrap_clr_l6		! Restore cpu state
 	ba,pt	%xcc, rtrap_clr_l6		! Restore cpu state