hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
....@@ -43,7 +43,6 @@
4343 * SOFTWARE.
4444 */
4545
46
-#include <asm/inst.h>
4746 #include <linux/linkage.h>
4847 #include <asm/nospec-branch.h>
4948
....@@ -74,8 +73,8 @@
7473 # unsigned int crc_pcl(u8 *buffer, int len, unsigned int crc_init);
7574
7675 .text
77
-ENTRY(crc_pcl)
78
-#define bufp %rdi
76
+SYM_FUNC_START(crc_pcl)
77
+#define bufp rdi
7978 #define bufp_dw %edi
8079 #define bufp_w %di
8180 #define bufp_b %dil
....@@ -105,9 +104,9 @@
105104 ## 1) ALIGN:
106105 ################################################################
107106
108
- mov bufp, bufptmp # rdi = *buf
109
- neg bufp
110
- and $7, bufp # calculate the unalignment amount of
107
+ mov %bufp, bufptmp # rdi = *buf
108
+ neg %bufp
109
+ and $7, %bufp # calculate the unalignment amount of
111110 # the address
112111 je proc_block # Skip if aligned
113112
....@@ -123,13 +122,13 @@
123122 do_align:
124123 #### Calculate CRC of unaligned bytes of the buffer (if any)
125124 movq (bufptmp), tmp # load a quadward from the buffer
126
- add bufp, bufptmp # align buffer pointer for quadword
125
+ add %bufp, bufptmp # align buffer pointer for quadword
127126 # processing
128
- sub bufp, len # update buffer length
127
+ sub %bufp, len # update buffer length
129128 align_loop:
130129 crc32b %bl, crc_init_dw # compute crc32 of 1-byte
131130 shr $8, tmp # get next byte
132
- dec bufp
131
+ dec %bufp
133132 jne align_loop
134133
135134 proc_block:
....@@ -169,10 +168,10 @@
169168 xor crc2, crc2
170169
171170 ## branch into array
172
- lea jump_table(%rip), bufp
173
- movzwq (bufp, %rax, 2), len
174
- lea crc_array(%rip), bufp
175
- lea (bufp, len, 1), bufp
171
+ lea jump_table(%rip), %bufp
172
+ movzwq (%bufp, %rax, 2), len
173
+ lea crc_array(%rip), %bufp
174
+ lea (%bufp, len, 1), %bufp
176175 JMP_NOSPEC bufp
177176
178177 ################################################################
....@@ -218,17 +217,17 @@
218217 ## 4) Combine three results:
219218 ################################################################
220219
221
- lea (K_table-8)(%rip), bufp # first entry is for idx 1
220
+ lea (K_table-8)(%rip), %bufp # first entry is for idx 1
222221 shlq $3, %rax # rax *= 8
223
- pmovzxdq (bufp,%rax), %xmm0 # 2 consts: K1:K2
222
+ pmovzxdq (%bufp,%rax), %xmm0 # 2 consts: K1:K2
224223 leal (%eax,%eax,2), %eax # rax *= 3 (total *24)
225224 subq %rax, tmp # tmp -= rax*24
226225
227226 movq crc_init, %xmm1 # CRC for block 1
228
- PCLMULQDQ 0x00,%xmm0,%xmm1 # Multiply by K2
227
+ pclmulqdq $0x00, %xmm0, %xmm1 # Multiply by K2
229228
230229 movq crc1, %xmm2 # CRC for block 2
231
- PCLMULQDQ 0x10, %xmm0, %xmm2 # Multiply by K1
230
+ pclmulqdq $0x10, %xmm0, %xmm2 # Multiply by K1
232231
233232 pxor %xmm2,%xmm1
234233 movq %xmm1, %rax
....@@ -310,8 +309,8 @@
310309 popq %rsi
311310 popq %rdi
312311 popq %rbx
313
- ret
314
-ENDPROC(crc_pcl)
312
+ RET
313
+SYM_FUNC_END(crc_pcl)
315314
316315 .section .rodata, "a", @progbits
317316 ################################################################