1 /* Written 2003 by Andi Kleen, based on a kernel by Evandro Menezes */
3 #include <linux/linkage.h>
4 #include <asm/cpufeature.h>
5 #include <asm/alternative-asm.h>
8 * Some CPUs run faster using the string copy instructions (sane microcode).
9 * It is also a lot simpler. Use this when possible. But, don't use streaming
10 * copy unless the CPU indicates X86_FEATURE_REP_GOOD. Could vary the
11 * prefetch distance based on SMP/UP.
15 ALTERNATIVE "jmp copy_page_regs", "", X86_FEATURE_REP_GOOD
26 movl $(4096/64)-5, %ecx
30 movq 0x8*0(%rsi), %rax
31 movq 0x8*1(%rsi), %rbx
32 movq 0x8*2(%rsi), %rdx
35 movq 0x8*5(%rsi), %r10
36 movq 0x8*6(%rsi), %r11
37 movq 0x8*7(%rsi), %r12
41 movq %rax, 0x8*0(%rdi)
42 movq %rbx, 0x8*1(%rdi)
43 movq %rdx, 0x8*2(%rdi)
46 movq %r10, 0x8*5(%rdi)
47 movq %r11, 0x8*6(%rdi)
48 movq %r12, 0x8*7(%rdi)
60 movq 0x8*0(%rsi), %rax
61 movq 0x8*1(%rsi), %rbx
62 movq 0x8*2(%rsi), %rdx
65 movq 0x8*5(%rsi), %r10
66 movq 0x8*6(%rsi), %r11
67 movq 0x8*7(%rsi), %r12
69 movq %rax, 0x8*0(%rdi)
70 movq %rbx, 0x8*1(%rdi)
71 movq %rdx, 0x8*2(%rdi)
74 movq %r10, 0x8*5(%rdi)
75 movq %r11, 0x8*6(%rdi)
76 movq %r12, 0x8*7(%rdi)
86 ENDPROC(copy_page_regs)