crypto: aesni - fix build on x86 (32bit)
Subsystems (2)
PATCH 1/1 crypto: aesni - fix build on x86 (32bit)
It seems commit d764593a "crypto: aesni - AVX and AVX2 version of AESNI-GCM encode and decode" breaks a build on x86_32 since it's designed only for x86_64. This patch makes a compilation unit conditional to CONFIG_64BIT and functions usage to CONFIG_X86_64.
--- arch/x86/crypto/Makefile | 3 ++- arch/x86/crypto/aesni-intel_glue.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-)
arch/x86/crypto/Makefile +2 -1
@@ -75,7 +75,8 @@ ifeq ($(avx2_supported),yes) serpent-avx2-y := serpent-avx2-asm_64.o serpent_avx2_glue.o endif -aesni-intel-y := aesni-intel_asm.o aesni-intel_avx.o aesni-intel_glue.o fpu.o +aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o +aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx.o ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o crc32c-intel-y := crc32c-intel_glue.o
arch/x86/crypto/aesni-intel_glue.c +2 -0
@@ -1473,6 +1473,7 @@ static int __init aesni_init(void)if (!x86_match_cpu (aesni_cpu_id))return -ENODEV ; +#ifdef CONFIG_X86_64 #ifdef CONFIG_AS_AVX2 if (boot_cpu_has(X86_FEATURE_AVX2)) { pr_info("AVX2 version of gcm_enc/dec engaged.\n");
@@ -1492,6 +1493,7 @@ static int __init aesni_init(void) aesni_gcm_enc_tfm = aesni_gcm_enc; aesni_gcm_dec_tfm = aesni_gcm_dec; } +#endif err =crypto_fpu_init ();if (err)
Signature · 1 line
1.8.5.2
Herbert Xu
maintainerQuoted 6 lines · Andy Shevchenko
It seems commit
d764593a"crypto: aesni - AVX and AVX2 version of AESNI-GCM encode and decode" breaks a build onx86_32since it's designed only forx86_64. This patch makes a compilation unit conditional toCONFIG_64BITand functions usage toCONFIG_X86_64.Signed-off-by Andy Shevchenko <[email protected]>
Patch applied. Thanks a lot!
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 4 lines · Andy Shevchenko
It seems commit
d764593a"crypto: aesni - AVX and AVX2 version of AESNI-GCM encode and decode" breaks a build onx86_32since it's designed only forx86_64. This patch makes a compilation unit conditional toCONFIG_64BITand functions usage toCONFIG_X86_64.
Thanks for catching and fixing it.
Tim
Quoted 2 lines
Signed-off-by Andy Shevchenko <[email protected]>
H. Peter Anvin
reviewerCan the code be adjusted to compile for 32 bit x86 or is that pointless?
Quoted 16 lines · Tim Chen
Quoted 1 line · Andy Shevchenko
It seems commit
d764593a"crypto: aesni - AVX and AVX2 version ofAESNI-GCM
Quoted 1 line
encode and decode" breaks a build on
x86_32since it's designed onlyfor
Quoted 1 line
x86_64. This patch makes a compilation unit conditional to
CONFIG_64BITandQuoted 1 line
functions usage to
CONFIG_X86_64.Thanks for catching and fixing it.
Tim
Quoted 2 lines
Signed-off-by Andy Shevchenko <[email protected]>
Signature · 1 line
Sent from my mobile phone. Please pardon brevity and lack of formatting.
Quoted 2 lines · H. Peter Anvin
Can the code be adjusted to compile for 32 bit x86 or is that pointless?
Code was optimized for wide registers. So it is only meant for x86_64.
Tim
Quoted 18 lines
Quoted 16 lines · Tim Chen
Quoted 1 line · Andy Shevchenko
It seems commit
d764593a"crypto: aesni - AVX and AVX2 version ofAESNI-GCM
Quoted 1 line
encode and decode" breaks a build on
x86_32since it's designed onlyfor
Quoted 1 line
x86_64. This patch makes a compilation unit conditional to
CONFIG_64BITandQuoted 1 line
functions usage to
CONFIG_X86_64.Thanks for catching and fixing it.
Tim
Quoted 2 lines
Signed-off-by Andy Shevchenko <[email protected]>
H. Peter Anvin
reviewerQuoted 6 lines · Tim Chen
Quoted 2 lines · H. Peter Anvin
Can the code be adjusted to compile for 32 bit x86 or is that pointless?
Code was optimized for wide registers. So it is only meant for
x86_64.
Aren't the "wide registers" the vector registers? Or are you also relying on 64-bit integer registers (in which case we should just rename the file to make it clear it is x86-64 only.)
-hpa
Quoted 5 lines · H. Peter Anvin
Quoted 4 lines · Tim Chen
Quoted 2 lines · H. Peter Anvin
Can the code be adjusted to compile for 32 bit x86 or is that pointless?
Quoted 10 lines
Quoted 2 lines
Code was optimized for wide registers. So it is only meant for
x86_64.Aren't the "wide registers" the vector registers? Or are you also relying on 64-bit integer registers (in which case we should just rename the file to make it clear it is x86-64 only.)
-hpa
Yes, the code is in the file named aesni_intel_avx.S. So it should be clear that the code is meant for x86_64.
Tim
Borislav Petkov
maintainerQuoted 2 lines · Tim Chen
Yes, the code is in the file named
aesni_intel_avx.S. So it should be clear that the code is meant forx86_64.
How do you deduce aesni_intel_avx.S is meant for x86_64 only from the name?
Shouldn't it be called aesni_intel_avx-x86_64.S, as is the naming convention in arch/x86/crypto/
?
Signature · 5 lines
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--H. Peter Anvin
reviewerQuoted 10 lines · Borislav Petkov
Quoted 2 lines · Tim Chen
Yes, the code is in the file named
aesni_intel_avx.S. So it should be clear that the code is meant forx86_64.How do you deduce
aesni_intel_avx.Sis meant forx86_64only from the name?Shouldn't it be called
aesni_intel_avx-x86_64.S, as is the naming convention inarch/x86/crypto/
Quite.
-hpa
Quoted 8 lines · H. Peter Anvin
Quoted 7 lines · Borislav Petkov
Quoted 2 lines · Tim Chen
Yes, the code is in the file named
aesni_intel_avx.S. So it should be clear that the code is meant forx86_64.How do you deduce
aesni_intel_avx.Sis meant forx86_64only from the name?
Quoted 9 lines
Quoted 3 lines
Shouldn't it be called
aesni_intel_avx-x86_64.S, as is the naming convention inarch/x86/crypto/Quite.
-hpa
Will renaming the file to aesni_intel_avx-x86_64.S make things clearer now?
Tim
---cut---here---
Quoted 1 line
From
41656afcbd63ccb92357d4937a75629499f4fd4fMon Sep 17 00:00:00 2001
From: Tim Chen <[email protected]>
Date: Mon, 6 Jan 2014 07:23:52 -0800
Subject: [PATCH] crypto: Rename aesni-intel_avx.S to indicate it only
supports x86_64
To: Herbert Xu <[email protected]>, H. Peter Anvin <[email protected]>
Cc: Borislav Petkov <[email protected]>, Andy Shevchenko <[email protected]>, [email protected]
We rename aesni-intel_avx.S to aesni-intel_avx-x86_64.S to indicate that it is only used by x86_64 architecture.
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/{aesni-intel_avx.S => aesni-intel_avx-x86_64.S} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename arch/x86/crypto/{aesni-intel_avx.S => aesni-intel_avx-x86_64.S} (100%)arch/x86/crypto/Makefile +1 -1
@@ -76,7 +76,7 @@ ifeq ($(avx2_supported),yes) endif aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o -aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx.o +aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx-x86_64.o ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o crc32c-intel-y := crc32c-intel_glue.o
arch/x86/crypto/aesni-intel_avx-x86_64.S renamed from arch/x86/crypto/aesni-intel_avx.S +0 -0
Signature · 1 line
1.7.11.7
Quoted 5 lines · Tim Chen
Will renaming the file to
aesni_intel_avx-x86_64.Smake things clearer now?Tim
Yes.
Herbert, can you pick it up?
-hpa
Herbert Xu
maintainerQuoted 5 lines · H. Peter Anvin
Quoted 4 lines · Tim Chen
Will renaming the file to
aesni_intel_avx-x86_64.Smake things clearer now?
Quoted 7 lines
Quoted 1 line
Tim
Yes.
Acked-by H. Peter Anvin <[email protected]>Herbert, can you pick it up?
Sure I'll apply this patch.
Thanks!
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Herbert Xu
maintainerQuoted 34 lines · Tim Chen
Quoted 8 lines · H. Peter Anvin
Quoted 7 lines · Borislav Petkov
Quoted 2 lines · Tim Chen
Yes, the code is in the file named
aesni_intel_avx.S. So it should be clear that the code is meant forx86_64.How do you deduce
aesni_intel_avx.Sis meant forx86_64only from the name?Quoted 9 lines
Quoted 3 lines
Shouldn't it be called
aesni_intel_avx-x86_64.S, as is the naming convention inarch/x86/crypto/Quite.
-hpa
Will renaming the file to
aesni_intel_avx-x86_64.Smake things clearer now?Tim
---cut---here---
Quoted 1 line
From
41656afcbd63ccb92357d4937a75629499f4fd4fMon Sep 17 00:00:00 2001From: Tim Chen <[email protected]>
Date: Mon, 6 Jan 2014 07:23:52 -0800
Subject: [PATCH] crypto: Renameaesni-intel_avx.Sto indicate it only
supportsx86_64
To: Herbert Xu <[email protected]>, H. Peter Anvin <[email protected]>
Cc: Borislav Petkov <[email protected]>, Andy Shevchenko <[email protected]>, [email protected]
Quoted 2 lines
We rename
aesni-intel_avx.Stoaesni-intel_avx-x86_64.Sto indicate that it is only used byx86_64architecture.
Hmm, where is the signed-off-by line? Please resend. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 35 lines · Herbert Xu
Quoted 34 lines · Tim Chen
Quoted 8 lines · H. Peter Anvin
Quoted 7 lines · Borislav Petkov
Quoted 2 lines · Tim Chen
Yes, the code is in the file named
aesni_intel_avx.S. So it should be clear that the code is meant forx86_64.How do you deduce
aesni_intel_avx.Sis meant forx86_64only from the name?Quoted 9 lines
Quoted 3 lines
Shouldn't it be called
aesni_intel_avx-x86_64.S, as is the naming convention inarch/x86/crypto/Quite.
-hpa
Will renaming the file to
aesni_intel_avx-x86_64.Smake things clearer now?Tim
---cut---here---
Quoted 1 line
From
41656afcbd63ccb92357d4937a75629499f4fd4fMon Sep 17 00:00:00 2001From: Tim Chen <[email protected]>
Date: Mon, 6 Jan 2014 07:23:52 -0800
Subject: [PATCH] crypto: Renameaesni-intel_avx.Sto indicate it only
supportsx86_64
To: Herbert Xu <[email protected]>, H. Peter Anvin <[email protected]>
Cc: Borislav Petkov <[email protected]>, Andy Shevchenko <[email protected]>, [email protected]
Quoted 4 lines
Quoted 2 lines
We rename
aesni-intel_avx.Stoaesni-intel_avx-x86_64.Sto indicate that it is only used byx86_64architecture.Hmm, where is the signed-off-by line? Please resend. Thanks.
Oops, here it is again.
Tim
---cut---here---
Quoted 1 line
From
41656afcbd63ccb92357d4937a75629499f4fd4fMon Sep 17 00:00:00 2001
From: Tim Chen <[email protected]>
Date: Mon, 6 Jan 2014 07:23:52 -0800
Subject: [PATCH] crypto: Rename aesni-intel_avx.S to indicate it only
supports x86_64
To: Herbert Xu <[email protected]>, H. Peter Anvin <[email protected]>
Cc: Borislav Petkov <[email protected]>, Andy Shevchenko <[email protected]>, [email protected]
We rename aesni-intel_avx.S to aesni-intel_avx-x86_64.S to indicate that it is only used by x86_64 architecture.
---
arch/x86/crypto/Makefile | 2 +-
arch/x86/crypto/{aesni-intel_avx.S => aesni-intel_avx-x86_64.S} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename arch/x86/crypto/{aesni-intel_avx.S => aesni-intel_avx-x86_64.S} (100%)---
arch/x86/crypto/Makefile +1 -1
@@ -76,7 +76,7 @@ ifeq ($(avx2_supported),yes) endif aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o -aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx.o +aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx-x86_64.o ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o crc32c-intel-y := crc32c-intel_glue.o
arch/x86/crypto/aesni-intel_avx-x86_64.S renamed from arch/x86/crypto/aesni-intel_avx.S +0 -0
Signature · 1 line
1.7.11.7
Herbert Xu
maintainerQuoted 11 lines · Tim Chen
Quoted 2 lines
From
41656afcbd63ccb92357d4937a75629499f4fd4fMon Sep 17 00:00:00 2001From: Tim Chen <[email protected]>
Date: Mon, 6 Jan 2014 07:23:52 -0800
Subject: [PATCH] crypto: Renameaesni-intel_avx.Sto indicate it only
supportsx86_64
To: Herbert Xu <[email protected]>, H. Peter Anvin <[email protected]>
Cc: Borislav Petkov <[email protected]>, Andy Shevchenko <[email protected]>, [email protected]We rename
aesni-intel_avx.Stoaesni-intel_avx-x86_64.Sto indicate that it is only used byx86_64architecture.
Quoted 7 lines
--- arch/x86/crypto/Makefile | 2 +- arch/x86/crypto/{aesni-intel_avx.S => aesni-intel_avx-x86_64.S} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename arch/x86/crypto/{aesni-intel_avx.S => aesni-intel_avx-x86_64.S} (100%)Signed-off-by Tim Chen <[email protected]>
Patch applied.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt