Message ID | 20180608171216.26521-7-jarkko.sakkinen@linux.intel.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Herbert Xu |
Headers | show |
On 06/08/2018 10:09 AM, Jarkko Sakkinen wrote: > --- a/arch/x86/crypto/aesni-intel_asm.S > +++ b/arch/x86/crypto/aesni-intel_asm.S > @@ -45,6 +45,8 @@ > #define MOVADQ movaps > #define MOVUDQ movups > > +#ifndef AESNI_INTEL_MINIMAL > + > #ifdef __x86_64__ > > # constants in mergeable sections, linker can reorder and merge > @@ -133,6 +135,8 @@ ALL_F: .octa 0xffffffffffffffffffffffffffffffff > #define keysize 2*15*16(%arg1) > #endif > > +#endif /* AESNI_INTEL_MINIMAL */ > + I'd really prefer that these get moved into a separate file rather than a scattered set of #ifdefs. This just seem fragile to me. Can we have a "aesni-intel_asm-minimal.S"? Or, at least bunch the minimal set of things *together*?
On Fri, 2018-06-08 at 10:27 -0700, Dave Hansen wrote: > On 06/08/2018 10:09 AM, Jarkko Sakkinen wrote: > > > > --- a/arch/x86/crypto/aesni-intel_asm.S > > +++ b/arch/x86/crypto/aesni-intel_asm.S > > @@ -45,6 +45,8 @@ > > #define MOVADQ movaps > > #define MOVUDQ movups > > > > +#ifndef AESNI_INTEL_MINIMAL > > + > > #ifdef __x86_64__ > > > > # constants in mergeable sections, linker can reorder and merge > > @@ -133,6 +135,8 @@ ALL_F: .octa 0xffffffffffffffffffffffffffffffff > > #define keysize 2*15*16(%arg1) > > #endif > > > > +#endif /* AESNI_INTEL_MINIMAL */ > > + > I'd really prefer that these get moved into a separate file rather than > a scattered set of #ifdefs. This just seem fragile to me. > > Can we have a "aesni-intel_asm-minimal.S"? Or, at least bunch the > minimal set of things *together*? A separate file doesn't seem appropriate because there is no criteria for including code in the "minimal" build beyond "this code happens to be needed by SGX". I considered having SGX somewhere in the define but opted for AESNI_INTEL_MINIMAL on the off chance that the minimal build was useful for something other than SGX. I'm not opposed to bunching the minimal stuff together, my intent was simply to disturb the code as little as possible.
diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S index e762ef417562..5a0a487466d5 100644 --- a/arch/x86/crypto/aesni-intel_asm.S +++ b/arch/x86/crypto/aesni-intel_asm.S @@ -45,6 +45,8 @@ #define MOVADQ movaps #define MOVUDQ movups +#ifndef AESNI_INTEL_MINIMAL + #ifdef __x86_64__ # constants in mergeable sections, linker can reorder and merge @@ -133,6 +135,8 @@ ALL_F: .octa 0xffffffffffffffffffffffffffffffff #define keysize 2*15*16(%arg1) #endif +#endif /* AESNI_INTEL_MINIMAL */ + #define STATE1 %xmm0 #define STATE2 %xmm4 @@ -506,6 +510,8 @@ _T_16_\@: _return_T_done_\@: .endm +#ifndef AESNI_INTEL_MINIMAL + #ifdef __x86_64__ /* GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0) * @@ -1760,6 +1766,7 @@ ENDPROC(aesni_gcm_finalize) #endif +#endif /* AESNI_INTEL_MINIMAL */ .align 4 _key_expansion_128: @@ -2031,6 +2038,8 @@ _aesni_enc1: ret ENDPROC(_aesni_enc1) +#ifndef AESNI_INTEL_MINIMAL + /* * _aesni_enc4: internal ABI * input: @@ -2840,3 +2849,5 @@ ENTRY(aesni_xts_crypt8) ENDPROC(aesni_xts_crypt8) #endif + +#endif /* AESNI_INTEL_MINIMAL */