sparc64: fix fault handling in NGbzero.S and GENbzero.S
PATCH 1/1 sparc64: fix fault handling in NGbzero.S and GENbzero.S
When any of the functions contained in NGbzero.S and GENbzero.S vector through *bzero_from_clear_user, we may end up taking a fault when executing one of the store alternate address space instructions. If this happens, the exception handler does not restore the %asi register.
This commit fixes the issue by introducing a new exception handler that ensures the %asi register is restored when a fault is handled.
Orabug: 25577560
--- arch/sparc/kernel/head_64.S | 6 ++++++ arch/sparc/lib/GENbzero.S | 2 +- arch/sparc/lib/NGbzero.S | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-)
arch/sparc/kernel/head_64.S +6 -0
@@ -939,3 +939,9 @@ ENTRY(__retl_o1) retl mov %o1, %o0 ENDPROC(__retl_o1) + +ENTRY(__retl_o1_asi) + wr %o5, 0x0, %asi + retl + mov %o1, %o0 +ENDPROC(__retl_o1_asi)
arch/sparc/lib/GENbzero.S +1 -1
@@ -8,7 +8,7 @@ 98: x,y; \ .section __ex_table,"a";\ .align 4; \ - .word 98b, __retl_o1; \ + .word 98b, __retl_o1_asi;\ .text; \ .align 4;
arch/sparc/lib/NGbzero.S +1 -1
@@ -8,7 +8,7 @@ 98: x,y; \ .section __ex_table,"a";\ .align 4; \ - .word 98b, __retl_o1; \ + .word 98b, __retl_o1_asi;\ .text; \ .align 4;
Signature · 1 line
1.7.1
David Miller
maintainerFrom: Dave Aldridge <[email protected]>
Date: Tue, 9 May 2017 02:57:35 -0600
Quoted 10 lines
When any of the functions contained in
NGbzero.SandGENbzero.Svector through*bzero_from_clear_user, we may end up taking a fault when executing one of the store alternate address space instructions. If this happens, the exception handler does not restore the %asi register.This commit fixes the issue by introducing a new exception handler that ensures the %asi register is restored when a fault is handled.
Quoted 5 lines
Orabug: 25577560
Signed-off-by Dave Aldridge <[email protected]>Reviewed-by Rob Gardner <[email protected]>Reviewed-by Babu Moger <[email protected]>
Applied and queued up for -stable, thanks Dave.