Re: [PATCH v11 06/13] crypto: aesni: add minimal build option for SGX LE
From: Sean Christopherson
Date: Mon Jun 11 2018 - 11:24:48 EST
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.