Skip to content

Commit

Permalink
sparc64: fix fault handling in NGbzero.S and GENbzero.S
Browse files Browse the repository at this point in the history
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

Signed-off-by: Dave Aldridge <david.j.aldridge@oracle.com>
Reviewed-by: Rob Gardner <rob.gardner@oracle.com>
Reviewed-by: Babu Moger <babu.moger@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dave Aldridge authored and David S. Miller committed May 9, 2017
1 parent aed74ea commit 3c7f622
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions arch/sparc/kernel/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion arch/sparc/lib/GENbzero.S
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/lib/NGbzero.S
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3c7f622

Please sign in to comment.