1 #include <linux/linkage.h>
2 #include <asm/dwarf2.h>
3 #include <asm/alternative-asm.h>
25 ENDPROC(clear_page_c_e)
34 #define PUT(x) movq %rax,x*8(%rdi)
52 * Some CPUs support enhanced REP MOVSB/STOSB instructions.
53 * It is recommended to use this when possible.
54 * If enhanced REP MOVSB/STOSB is not available, try to use fast string.
55 * Otherwise, use original function.
59 #include <asm/cpufeature.h>
61 .section .altinstr_replacement,"ax"
62 1: .byte 0xeb /* jmp <disp8> */
63 .byte (clear_page_c - clear_page) - (2f - 1b) /* offset */
64 2: .byte 0xeb /* jmp <disp8> */
65 .byte (clear_page_c_e - clear_page) - (3f - 2b) /* offset */
68 .section .altinstructions,"a"
69 altinstruction_entry clear_page,1b,X86_FEATURE_REP_GOOD,\
70 .Lclear_page_end-clear_page, 2b-1b
71 altinstruction_entry clear_page,2b,X86_FEATURE_ERMS, \
72 .Lclear_page_end-clear_page,3b-2b