diff options
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/code-patching.c | 2 | ||||
-rw-r--r-- | arch/powerpc/lib/copyuser_power7.S | 35 | ||||
-rw-r--r-- | arch/powerpc/lib/memcpy_power7.S | 4 |
3 files changed, 5 insertions, 36 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index dd223b3eb333..17e5b2364312 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c | |||
@@ -20,7 +20,7 @@ int patch_instruction(unsigned int *addr, unsigned int instr) | |||
20 | { | 20 | { |
21 | int err; | 21 | int err; |
22 | 22 | ||
23 | err = __put_user(instr, addr); | 23 | __put_user_size(instr, addr, 4, err); |
24 | if (err) | 24 | if (err) |
25 | return err; | 25 | return err; |
26 | asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); | 26 | asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); |
diff --git a/arch/powerpc/lib/copyuser_power7.S b/arch/powerpc/lib/copyuser_power7.S index f9ede7c6606e..0d24ff15f5f6 100644 --- a/arch/powerpc/lib/copyuser_power7.S +++ b/arch/powerpc/lib/copyuser_power7.S | |||
@@ -288,7 +288,7 @@ err1; stb r0,0(r3) | |||
288 | std r0,16(r1) | 288 | std r0,16(r1) |
289 | stdu r1,-STACKFRAMESIZE(r1) | 289 | stdu r1,-STACKFRAMESIZE(r1) |
290 | bl .enter_vmx_usercopy | 290 | bl .enter_vmx_usercopy |
291 | cmpwi r3,0 | 291 | cmpwi cr1,r3,0 |
292 | ld r0,STACKFRAMESIZE+16(r1) | 292 | ld r0,STACKFRAMESIZE+16(r1) |
293 | ld r3,STACKFRAMESIZE+48(r1) | 293 | ld r3,STACKFRAMESIZE+48(r1) |
294 | ld r4,STACKFRAMESIZE+56(r1) | 294 | ld r4,STACKFRAMESIZE+56(r1) |
@@ -326,38 +326,7 @@ err1; stb r0,0(r3) | |||
326 | dcbt r0,r8,0b01010 /* GO */ | 326 | dcbt r0,r8,0b01010 /* GO */ |
327 | .machine pop | 327 | .machine pop |
328 | 328 | ||
329 | /* | 329 | beq cr1,.Lunwind_stack_nonvmx_copy |
330 | * We prefetch both the source and destination using enhanced touch | ||
331 | * instructions. We use a stream ID of 0 for the load side and | ||
332 | * 1 for the store side. | ||
333 | */ | ||
334 | clrrdi r6,r4,7 | ||
335 | clrrdi r9,r3,7 | ||
336 | ori r9,r9,1 /* stream=1 */ | ||
337 | |||
338 | srdi r7,r5,7 /* length in cachelines, capped at 0x3FF */ | ||
339 | cmpldi cr1,r7,0x3FF | ||
340 | ble cr1,1f | ||
341 | li r7,0x3FF | ||
342 | 1: lis r0,0x0E00 /* depth=7 */ | ||
343 | sldi r7,r7,7 | ||
344 | or r7,r7,r0 | ||
345 | ori r10,r7,1 /* stream=1 */ | ||
346 | |||
347 | lis r8,0x8000 /* GO=1 */ | ||
348 | clrldi r8,r8,32 | ||
349 | |||
350 | .machine push | ||
351 | .machine "power4" | ||
352 | dcbt r0,r6,0b01000 | ||
353 | dcbt r0,r7,0b01010 | ||
354 | dcbtst r0,r9,0b01000 | ||
355 | dcbtst r0,r10,0b01010 | ||
356 | eieio | ||
357 | dcbt r0,r8,0b01010 /* GO */ | ||
358 | .machine pop | ||
359 | |||
360 | beq .Lunwind_stack_nonvmx_copy | ||
361 | 330 | ||
362 | /* | 331 | /* |
363 | * If source and destination are not relatively aligned we use a | 332 | * If source and destination are not relatively aligned we use a |
diff --git a/arch/powerpc/lib/memcpy_power7.S b/arch/powerpc/lib/memcpy_power7.S index 0efdc51bc716..7ba6c96de778 100644 --- a/arch/powerpc/lib/memcpy_power7.S +++ b/arch/powerpc/lib/memcpy_power7.S | |||
@@ -222,7 +222,7 @@ _GLOBAL(memcpy_power7) | |||
222 | std r0,16(r1) | 222 | std r0,16(r1) |
223 | stdu r1,-STACKFRAMESIZE(r1) | 223 | stdu r1,-STACKFRAMESIZE(r1) |
224 | bl .enter_vmx_copy | 224 | bl .enter_vmx_copy |
225 | cmpwi r3,0 | 225 | cmpwi cr1,r3,0 |
226 | ld r0,STACKFRAMESIZE+16(r1) | 226 | ld r0,STACKFRAMESIZE+16(r1) |
227 | ld r3,STACKFRAMESIZE+48(r1) | 227 | ld r3,STACKFRAMESIZE+48(r1) |
228 | ld r4,STACKFRAMESIZE+56(r1) | 228 | ld r4,STACKFRAMESIZE+56(r1) |
@@ -260,7 +260,7 @@ _GLOBAL(memcpy_power7) | |||
260 | dcbt r0,r8,0b01010 /* GO */ | 260 | dcbt r0,r8,0b01010 /* GO */ |
261 | .machine pop | 261 | .machine pop |
262 | 262 | ||
263 | beq .Lunwind_stack_nonvmx_copy | 263 | beq cr1,.Lunwind_stack_nonvmx_copy |
264 | 264 | ||
265 | /* | 265 | /* |
266 | * If source and destination are not relatively aligned we use a | 266 | * If source and destination are not relatively aligned we use a |