1 /* Written 2003 by Andi Kleen, based on a kernel by Evandro Menezes */
3 #include <linux/linkage.h>
4 #include <asm/dwarf2.h>
5 #include <asm/cpufeature.h>
6 #include <asm/alternative-asm.h>
9 * Some CPUs run faster using the string copy instructions (sane microcode).
10 * It is also a lot simpler. Use this when possible. But, don't use streaming
11 * copy unless the CPU indicates X86_FEATURE_REP_GOOD. Could vary the
12 * prefetch distance based on SMP/UP.
17 ALTERNATIVE "jmp copy_page_regs", "", X86_FEATURE_REP_GOOD
27 CFI_ADJUST_CFA_OFFSET 2*8
31 CFI_REL_OFFSET r12, 1*8
33 movl $(4096/64)-5, %ecx
37 movq 0x8*0(%rsi), %rax
38 movq 0x8*1(%rsi), %rbx
39 movq 0x8*2(%rsi), %rdx
42 movq 0x8*5(%rsi), %r10
43 movq 0x8*6(%rsi), %r11
44 movq 0x8*7(%rsi), %r12
48 movq %rax, 0x8*0(%rdi)
49 movq %rbx, 0x8*1(%rdi)
50 movq %rdx, 0x8*2(%rdi)
53 movq %r10, 0x8*5(%rdi)
54 movq %r11, 0x8*6(%rdi)
55 movq %r12, 0x8*7(%rdi)
67 movq 0x8*0(%rsi), %rax
68 movq 0x8*1(%rsi), %rbx
69 movq 0x8*2(%rsi), %rdx
72 movq 0x8*5(%rsi), %r10
73 movq 0x8*6(%rsi), %r11
74 movq 0x8*7(%rsi), %r12
76 movq %rax, 0x8*0(%rdi)
77 movq %rbx, 0x8*1(%rdi)
78 movq %rdx, 0x8*2(%rdi)
81 movq %r10, 0x8*5(%rdi)
82 movq %r11, 0x8*6(%rdi)
83 movq %r12, 0x8*7(%rdi)
94 CFI_ADJUST_CFA_OFFSET -2*8
97 ENDPROC(copy_page_regs)