1f1c83
--- ceph-15.2.2/src/common/crc32c_intel_fast_zero_asm.s.orig	2020-05-26 08:34:32.226201974 -0400
1f1c83
+++ ceph-15.2.2/src/common/crc32c_intel_fast_zero_asm.s	2020-05-26 17:19:32.497201974 -0400
1f1c83
@@ -1,5 +1,5 @@
1f1c83
 ;
1f1c83
-; Copyright 2012-2013 Intel Corporation All Rights Reserved.
1f1c83
+; Copyright 2012-2015 Intel Corporation All Rights Reserved.
1f1c83
 ; All rights reserved.
1f1c83
 ;
1f1c83
 ; http://opensource.org/licenses/BSD-3-Clause
1f1c83
@@ -59,6 +59,19 @@
1f1c83
 	xor     rbx, rbx                ;; rbx = crc1 = 0;
1f1c83
 	xor     r10, r10                ;; r10 = crc2 = 0;
1f1c83
 
1f1c83
+	cmp	len, %%bSize*3*2
1f1c83
+	jbe	%%non_prefetch
1f1c83
+
1f1c83
+ %assign i 0
1f1c83
+ %rep %%bSize/8 - 1
1f1c83
+	crc32   rax, bufptmp  ;; update crc0
1f1c83
+	crc32   rbx, bufptmp  ;; update crc1
1f1c83
+	crc32   r10, bufptmp  ;; update crc2
1f1c83
+	%assign i (i+8)
1f1c83
+ %endrep
1f1c83
+	jmp %%next %+ %1
1f1c83
+
1f1c83
+%%non_prefetch:
1f1c83
  %assign i 0
1f1c83
  %rep %%bSize/8 - 1
1f1c83
 	crc32   rax, bufptmp  ;; update crc0
1f1c83
@@ -66,6 +79,8 @@
1f1c83
 	crc32   r10, bufptmp  ;; update crc2
1f1c83
 	%assign i (i+8)
1f1c83
  %endrep
1f1c83
+
1f1c83
+%%next %+ %1:
1f1c83
 	crc32   rax, bufptmp  ;; update crc0
1f1c83
 	crc32   rbx, bufptmp  ;; update crc1
1f1c83
 ; SKIP  ;crc32  r10, bufptmp  ;; update crc2
1f1c83
@@ -180,12 +195,15 @@
1f1c83
 %define crc_init_dw     r8d
1f1c83
 %endif
1f1c83
 
1f1c83
-
1f1c83
+	endbranch
1f1c83
 	push    rdi
1f1c83
 	push    rbx
1f1c83
 
1f1c83
 	mov     rax, crc_init           ;; rax = crc_init;
1f1c83
 
1f1c83
+	cmp	len, 8
1f1c83
+	jb	less_than_8
1f1c83
+
1f1c83
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1f1c83
 ;; 1) ALIGN: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1f1c83