]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: fix fault handling in NGbzero.S and GENbzero.S
authorDave Aldridge <david.j.aldridge@oracle.com>
Thu, 27 Apr 2017 09:20:18 +0000 (03:20 -0600)
committerShannon Nelson <shannon.nelson@oracle.com>
Wed, 31 May 2017 23:43:47 +0000 (16:43 -0700)
When any of the functions contained in NGbzero.S and GENbzero.S
are being run, 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: Allen Pais <allen.pais@oracle.com>
arch/sparc/kernel/head_64.S
arch/sparc/lib/GENbzero.S
arch/sparc/lib/NGbzero.S

index 61748cdd959b5ca2b68816267ccdc4ef60a6d818..2f572a2e9a7779be085303118500a68732f4319a 100644 (file)
@@ -1003,7 +1003,6 @@ prom_tba: .xword  0
 tlb_type:      .word   0       /* Must NOT end up in BSS */
        .section        ".fixup",#alloc,#execinstr
 
-       .globl  __ret_efault, __retl_efault, __ret_one, __retl_one
 ENTRY(__ret_efault)
        ret
         restore %g0, -EFAULT, %o0
@@ -1048,3 +1047,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)
index 8e7a843ddd88366411de59480377798033d4c0a9..2fbf6297d57cfca68cebbf3da2ac9c62eba837b0 100644 (file)
@@ -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;
 
index beab29bf419b606ae23a7c1e8151e2527bc0943c..33053bdf3766b35ee4396c04403931f37965c5d8 100644 (file)
@@ -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;