Commit d7866e50 authored by Uros Bizjak's avatar Uros Bizjak Committed by Herbert Xu
Browse files

crypto: x86 - Remove include/asm/inst.h



Current minimum required version of binutils is 2.23,
which supports PSHUFB, PCLMULQDQ, PEXTRD, AESKEYGENASSIST,
AESIMC, AESENC, AESENCLAST, AESDEC, AESDECLAST and MOVQ
instruction mnemonics.

Substitute macros from include/asm/inst.h with a proper
instruction mnemonics in various assmbly files from
x86/crypto directory, and remove now unneeded file.

The patch was tested by calculating and comparing sha256sum
hashes of stripped object files before and after the patch,
to be sure that executable code didn't change.

Signed-off-by: default avatarUros Bizjak <ubizjak@gmail.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: "David S. Miller" <davem@davemloft.net>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Ingo Molnar <mingo@redhat.com>
CC: Borislav Petkov <bp@alien8.de>
CC: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 2c2e1836
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@
 */

#include <linux/linkage.h>
#include <asm/inst.h>

#define VMOVDQ		vmovdqu

+366 −367

File changed.

Preview size limit exceeded, changes collapsed.

+0 −1
Original line number Diff line number Diff line
@@ -120,7 +120,6 @@
##

#include <linux/linkage.h>
#include <asm/inst.h>

# constants in mergeable sections, linker can reorder and merge
.section	.rodata.cst16.POLY, "aM", @progbits, 16
+23 −24
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@
 */

#include <linux/linkage.h>
#include <asm/inst.h>


.section .rodata
@@ -129,17 +128,17 @@ loop_64:/* 64 bytes Full cache line folding */
#ifdef __x86_64__
	movdqa  %xmm4, %xmm8
#endif
	PCLMULQDQ 00, CONSTANT, %xmm1
	PCLMULQDQ 00, CONSTANT, %xmm2
	PCLMULQDQ 00, CONSTANT, %xmm3
	pclmulqdq $0x00, CONSTANT, %xmm1
	pclmulqdq $0x00, CONSTANT, %xmm2
	pclmulqdq $0x00, CONSTANT, %xmm3
#ifdef __x86_64__
	PCLMULQDQ 00, CONSTANT, %xmm4
	pclmulqdq $0x00, CONSTANT, %xmm4
#endif
	PCLMULQDQ 0x11, CONSTANT, %xmm5
	PCLMULQDQ 0x11, CONSTANT, %xmm6
	PCLMULQDQ 0x11, CONSTANT, %xmm7
	pclmulqdq $0x11, CONSTANT, %xmm5
	pclmulqdq $0x11, CONSTANT, %xmm6
	pclmulqdq $0x11, CONSTANT, %xmm7
#ifdef __x86_64__
	PCLMULQDQ 0x11, CONSTANT, %xmm8
	pclmulqdq $0x11, CONSTANT, %xmm8
#endif
	pxor    %xmm5, %xmm1
	pxor    %xmm6, %xmm2
@@ -149,8 +148,8 @@ loop_64:/* 64 bytes Full cache line folding */
#else
	/* xmm8 unsupported for x32 */
	movdqa  %xmm4, %xmm5
	PCLMULQDQ 00, CONSTANT, %xmm4
	PCLMULQDQ 0x11, CONSTANT, %xmm5
	pclmulqdq $0x00, CONSTANT, %xmm4
	pclmulqdq $0x11, CONSTANT, %xmm5
	pxor    %xmm5, %xmm4
#endif

@@ -172,20 +171,20 @@ less_64:/* Folding cache line into 128bit */
	prefetchnta     (BUF)

	movdqa  %xmm1, %xmm5
	PCLMULQDQ 0x00, CONSTANT, %xmm1
	PCLMULQDQ 0x11, CONSTANT, %xmm5
	pclmulqdq $0x00, CONSTANT, %xmm1
	pclmulqdq $0x11, CONSTANT, %xmm5
	pxor    %xmm5, %xmm1
	pxor    %xmm2, %xmm1

	movdqa  %xmm1, %xmm5
	PCLMULQDQ 0x00, CONSTANT, %xmm1
	PCLMULQDQ 0x11, CONSTANT, %xmm5
	pclmulqdq $0x00, CONSTANT, %xmm1
	pclmulqdq $0x11, CONSTANT, %xmm5
	pxor    %xmm5, %xmm1
	pxor    %xmm3, %xmm1

	movdqa  %xmm1, %xmm5
	PCLMULQDQ 0x00, CONSTANT, %xmm1
	PCLMULQDQ 0x11, CONSTANT, %xmm5
	pclmulqdq $0x00, CONSTANT, %xmm1
	pclmulqdq $0x11, CONSTANT, %xmm5
	pxor    %xmm5, %xmm1
	pxor    %xmm4, %xmm1

@@ -193,8 +192,8 @@ less_64:/* Folding cache line into 128bit */
	jb      fold_64
loop_16:/* Folding rest buffer into 128bit */
	movdqa  %xmm1, %xmm5
	PCLMULQDQ 0x00, CONSTANT, %xmm1
	PCLMULQDQ 0x11, CONSTANT, %xmm5
	pclmulqdq $0x00, CONSTANT, %xmm1
	pclmulqdq $0x11, CONSTANT, %xmm5
	pxor    %xmm5, %xmm1
	pxor    (BUF), %xmm1
	sub     $0x10, LEN
@@ -205,7 +204,7 @@ loop_16:/* Folding rest buffer into 128bit */
fold_64:
	/* perform the last 64 bit fold, also adds 32 zeroes
	 * to the input stream */
	PCLMULQDQ 0x01, %xmm1, CONSTANT /* R4 * xmm1.low */
	pclmulqdq $0x01, %xmm1, CONSTANT /* R4 * xmm1.low */
	psrldq  $0x08, %xmm1
	pxor    CONSTANT, %xmm1

@@ -220,7 +219,7 @@ fold_64:
#endif
	psrldq  $0x04, %xmm2
	pand    %xmm3, %xmm1
	PCLMULQDQ 0x00, CONSTANT, %xmm1
	pclmulqdq $0x00, CONSTANT, %xmm1
	pxor    %xmm2, %xmm1

	/* Finish up with the bit-reversed barrett reduction 64 ==> 32 bits */
@@ -231,11 +230,11 @@ fold_64:
#endif
	movdqa  %xmm1, %xmm2
	pand    %xmm3, %xmm1
	PCLMULQDQ 0x10, CONSTANT, %xmm1
	pclmulqdq $0x10, CONSTANT, %xmm1
	pand    %xmm3, %xmm1
	PCLMULQDQ 0x00, CONSTANT, %xmm1
	pclmulqdq $0x00, CONSTANT, %xmm1
	pxor    %xmm2, %xmm1
	PEXTRD  0x01, %xmm1, %eax
	pextrd  $0x01, %xmm1, %eax

	ret
SYM_FUNC_END(crc32_pclmul_le_16)
+2 −3
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@
 * SOFTWARE.
 */

#include <asm/inst.h>
#include <linux/linkage.h>
#include <asm/nospec-branch.h>

@@ -225,10 +224,10 @@ LABEL crc_ %i
	subq    %rax, tmp			# tmp -= rax*24

	movq    crc_init, %xmm1			# CRC for block 1
	PCLMULQDQ 0x00,%xmm0,%xmm1		# Multiply by K2
	pclmulqdq $0x00, %xmm0, %xmm1		# Multiply by K2

	movq    crc1, %xmm2			# CRC for block 2
	PCLMULQDQ 0x10, %xmm0, %xmm2		# Multiply by K1
	pclmulqdq $0x10, %xmm0, %xmm2		# Multiply by K1

	pxor    %xmm2,%xmm1
	movq    %xmm1, %rax
Loading