~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/lib/copy_page_64.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /* Written 2003 by Andi Kleen, based on a kernel by Evandro Menezes */
  3 
  4 #include <linux/export.h>
  5 #include <linux/linkage.h>
  6 #include <asm/cpufeatures.h>
  7 #include <asm/alternative.h>
  8 
  9 /*
 10  * Some CPUs run faster using the string copy instructions (sane microcode).
 11  * It is also a lot simpler. Use this when possible. But, don't use streaming
 12  * copy unless the CPU indicates X86_FEATURE_REP_GOOD. Could vary the
 13  * prefetch distance based on SMP/UP.
 14  */
 15         ALIGN
 16 SYM_FUNC_START(copy_page)
 17         ALTERNATIVE "jmp copy_page_regs", "", X86_FEATURE_REP_GOOD
 18         movl    $4096/8, %ecx
 19         rep     movsq
 20         RET
 21 SYM_FUNC_END(copy_page)
 22 EXPORT_SYMBOL(copy_page)
 23 
 24 SYM_FUNC_START_LOCAL(copy_page_regs)
 25         subq    $2*8,   %rsp
 26         movq    %rbx,   (%rsp)
 27         movq    %r12,   1*8(%rsp)
 28 
 29         movl    $(4096/64)-5,   %ecx
 30         .p2align 4
 31 .Loop64:
 32         dec     %rcx
 33         movq    0x8*0(%rsi), %rax
 34         movq    0x8*1(%rsi), %rbx
 35         movq    0x8*2(%rsi), %rdx
 36         movq    0x8*3(%rsi), %r8
 37         movq    0x8*4(%rsi), %r9
 38         movq    0x8*5(%rsi), %r10
 39         movq    0x8*6(%rsi), %r11
 40         movq    0x8*7(%rsi), %r12
 41 
 42         prefetcht0 5*64(%rsi)
 43 
 44         movq    %rax, 0x8*0(%rdi)
 45         movq    %rbx, 0x8*1(%rdi)
 46         movq    %rdx, 0x8*2(%rdi)
 47         movq    %r8,  0x8*3(%rdi)
 48         movq    %r9,  0x8*4(%rdi)
 49         movq    %r10, 0x8*5(%rdi)
 50         movq    %r11, 0x8*6(%rdi)
 51         movq    %r12, 0x8*7(%rdi)
 52 
 53         leaq    64 (%rsi), %rsi
 54         leaq    64 (%rdi), %rdi
 55 
 56         jnz     .Loop64
 57 
 58         movl    $5, %ecx
 59         .p2align 4
 60 .Loop2:
 61         decl    %ecx
 62 
 63         movq    0x8*0(%rsi), %rax
 64         movq    0x8*1(%rsi), %rbx
 65         movq    0x8*2(%rsi), %rdx
 66         movq    0x8*3(%rsi), %r8
 67         movq    0x8*4(%rsi), %r9
 68         movq    0x8*5(%rsi), %r10
 69         movq    0x8*6(%rsi), %r11
 70         movq    0x8*7(%rsi), %r12
 71 
 72         movq    %rax, 0x8*0(%rdi)
 73         movq    %rbx, 0x8*1(%rdi)
 74         movq    %rdx, 0x8*2(%rdi)
 75         movq    %r8,  0x8*3(%rdi)
 76         movq    %r9,  0x8*4(%rdi)
 77         movq    %r10, 0x8*5(%rdi)
 78         movq    %r11, 0x8*6(%rdi)
 79         movq    %r12, 0x8*7(%rdi)
 80 
 81         leaq    64(%rdi), %rdi
 82         leaq    64(%rsi), %rsi
 83         jnz     .Loop2
 84 
 85         movq    (%rsp), %rbx
 86         movq    1*8(%rsp), %r12
 87         addq    $2*8, %rsp
 88         RET
 89 SYM_FUNC_END(copy_page_regs)

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php