diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-18 12:30:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-18 12:30:41 -0400 |
commit | ffd8221bc348f8c282d1271883dbe629ea8ae289 (patch) | |
tree | 186cf97088b471362257bfecbe2c6495781fd594 /arch/sparc | |
parent | e0a9272c616838109fc5988ab154dc10670eb15e (diff) | |
parent | f4da3628dc7c32a59d1fb7116bb042e6f436d611 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull Sparc bugfix from David Miller:
"Sparc64 AES ctr mode bug fix"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
sparc64: Fix FPU register corruption with AES crypto offload.
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/visasm.h | 8 | ||||
-rw-r--r-- | arch/sparc/lib/NG4memcpy.S | 14 |
2 files changed, 21 insertions, 1 deletions
diff --git a/arch/sparc/include/asm/visasm.h b/arch/sparc/include/asm/visasm.h index b26673759283..1f0aa2024e94 100644 --- a/arch/sparc/include/asm/visasm.h +++ b/arch/sparc/include/asm/visasm.h | |||
@@ -39,6 +39,14 @@ | |||
39 | 297: wr %o5, FPRS_FEF, %fprs; \ | 39 | 297: wr %o5, FPRS_FEF, %fprs; \ |
40 | 298: | 40 | 298: |
41 | 41 | ||
42 | #define VISEntryHalfFast(fail_label) \ | ||
43 | rd %fprs, %o5; \ | ||
44 | andcc %o5, FPRS_FEF, %g0; \ | ||
45 | be,pt %icc, 297f; \ | ||
46 | nop; \ | ||
47 | ba,a,pt %xcc, fail_label; \ | ||
48 | 297: wr %o5, FPRS_FEF, %fprs; | ||
49 | |||
42 | #define VISExitHalf \ | 50 | #define VISExitHalf \ |
43 | wr %o5, 0, %fprs; | 51 | wr %o5, 0, %fprs; |
44 | 52 | ||
diff --git a/arch/sparc/lib/NG4memcpy.S b/arch/sparc/lib/NG4memcpy.S index 9cf2ee01cee3..140527a20e7d 100644 --- a/arch/sparc/lib/NG4memcpy.S +++ b/arch/sparc/lib/NG4memcpy.S | |||
@@ -41,6 +41,10 @@ | |||
41 | #endif | 41 | #endif |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | #if !defined(EX_LD) && !defined(EX_ST) | ||
45 | #define NON_USER_COPY | ||
46 | #endif | ||
47 | |||
44 | #ifndef EX_LD | 48 | #ifndef EX_LD |
45 | #define EX_LD(x) x | 49 | #define EX_LD(x) x |
46 | #endif | 50 | #endif |
@@ -197,9 +201,13 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ | |||
197 | mov EX_RETVAL(%o3), %o0 | 201 | mov EX_RETVAL(%o3), %o0 |
198 | 202 | ||
199 | .Llarge_src_unaligned: | 203 | .Llarge_src_unaligned: |
204 | #ifdef NON_USER_COPY | ||
205 | VISEntryHalfFast(.Lmedium_vis_entry_fail) | ||
206 | #else | ||
207 | VISEntryHalf | ||
208 | #endif | ||
200 | andn %o2, 0x3f, %o4 | 209 | andn %o2, 0x3f, %o4 |
201 | sub %o2, %o4, %o2 | 210 | sub %o2, %o4, %o2 |
202 | VISEntryHalf | ||
203 | alignaddr %o1, %g0, %g1 | 211 | alignaddr %o1, %g0, %g1 |
204 | add %o1, %o4, %o1 | 212 | add %o1, %o4, %o1 |
205 | EX_LD(LOAD(ldd, %g1 + 0x00, %f0)) | 213 | EX_LD(LOAD(ldd, %g1 + 0x00, %f0)) |
@@ -240,6 +248,10 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ | |||
240 | nop | 248 | nop |
241 | ba,a,pt %icc, .Lmedium_unaligned | 249 | ba,a,pt %icc, .Lmedium_unaligned |
242 | 250 | ||
251 | #ifdef NON_USER_COPY | ||
252 | .Lmedium_vis_entry_fail: | ||
253 | or %o0, %o1, %g2 | ||
254 | #endif | ||
243 | .Lmedium: | 255 | .Lmedium: |
244 | LOAD(prefetch, %o1 + 0x40, #n_reads_strong) | 256 | LOAD(prefetch, %o1 + 0x40, #n_reads_strong) |
245 | andcc %g2, 0x7, %g0 | 257 | andcc %g2, 0x7, %g0 |