Commit fdb2726f authored by Michael Davidson's avatar Michael Davidson Committed by Herbert Xu

crypto, x86: aesni - fix token pasting for clang

aes_ctrby8_avx-x86_64.S uses the C preprocessor for token pasting
of character sequences that are not valid preprocessor tokens.
While this is allowed when preprocessing assembler files it exposes
an incompatibilty between the clang and gcc preprocessors where
clang does not strip leading white space from macro parameters,
leading to the CONCAT(%xmm, i) macro expansion on line 96 resulting
in a token with a space character embedded in it.

While this could be resolved by deleting the offending space character,
the assembler is perfectly capable of doing the token pasting correctly
for itself so we can just get rid of the preprocessor macros.
Signed-off-by: default avatarMichael Davidson <md@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 36cf515b
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/inst.h> #include <asm/inst.h>
#define CONCAT(a,b) a##b
#define VMOVDQ vmovdqu #define VMOVDQ vmovdqu
#define xdata0 %xmm0 #define xdata0 %xmm0
...@@ -92,8 +91,6 @@ ...@@ -92,8 +91,6 @@
#define num_bytes %r8 #define num_bytes %r8
#define tmp %r10 #define tmp %r10
#define DDQ(i) CONCAT(ddq_add_,i)
#define XMM(i) CONCAT(%xmm, i)
#define DDQ_DATA 0 #define DDQ_DATA 0
#define XDATA 1 #define XDATA 1
#define KEY_128 1 #define KEY_128 1
...@@ -131,12 +128,12 @@ ddq_add_8: ...@@ -131,12 +128,12 @@ ddq_add_8:
/* generate a unique variable for ddq_add_x */ /* generate a unique variable for ddq_add_x */
.macro setddq n .macro setddq n
var_ddq_add = DDQ(\n) var_ddq_add = ddq_add_\n
.endm .endm
/* generate a unique variable for xmm register */ /* generate a unique variable for xmm register */
.macro setxdata n .macro setxdata n
var_xdata = XMM(\n) var_xdata = %xmm\n
.endm .endm
/* club the numeric 'id' to the symbol 'name' */ /* club the numeric 'id' to the symbol 'name' */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment