2012-06-13 16:11:01

by Randy Dunlap

[permalink] [raw]
Subject: Re: linux-next: Tree for Jun 13 (crypto)

On 06/12/2012 10:54 PM, Stephen Rothwell wrote:

> Hi all,
>
> Changes since 20120612:
>



on x86_64:

arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_xts_decrypt':
(.text+0x856c): multiple definition of `serpent_xts_decrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xae8): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_xts_encrypt':
(.text+0x84f7): multiple definition of `serpent_xts_encrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xa73): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_ablk_decrypt':
(.text+0x86ab): multiple definition of `serpent_ablk_decrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xc27): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_ablk_set_key':
(.text+0x85e1): multiple definition of `serpent_ablk_set_key'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xb5d): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_dec_blk_8way':
(.text+0x3d70): multiple definition of `serpent_dec_blk_8way'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0x57d8): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_ecb_encrypt':
(.text+0x8083): multiple definition of `serpent_ecb_encrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0x5ff): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_lrw_encrypt':
(.text+0x83ba): multiple definition of `serpent_lrw_encrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0x936): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_xts_setkey':
(.text+0x84a3): multiple definition of `serpent_xts_setkey'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xa1f): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_cbc_encrypt':
(.text+0x80c6): multiple definition of `serpent_cbc_encrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0x642): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_lrw_exit_tfm':
(.text+0x8494): multiple definition of `serpent_lrw_exit_tfm'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xa10): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `__serpent_enc_blk_8way':
(.text+0x0): multiple definition of `__serpent_enc_blk_8way'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xd10): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_ablk_exit':
(.text+0x8728): multiple definition of `serpent_ablk_exit'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xca4): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_lrw_decrypt':
(.text+0x8427): multiple definition of `serpent_lrw_decrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0x9a3): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_lrw_setkey':
(.text+0x8376): multiple definition of `serpent_lrw_setkey'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0x8f2): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `__serpent_ablk_encrypt':
(.text+0x861c): multiple definition of `__serpent_ablk_encrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xb98): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_ctr_crypt':
(.text+0x8265): multiple definition of `serpent_ctr_crypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0x7e1): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_ablk_encrypt':
(.text+0x8661): multiple definition of `serpent_ablk_encrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xbdd): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_ecb_decrypt':
(.text+0x80a6): multiple definition of `serpent_ecb_decrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0x622): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_cbc_decrypt':
(.text+0x81d8): multiple definition of `serpent_cbc_decrypt'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0x754): first defined here
arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_ablk_init':
(.text+0x8737): multiple definition of `serpent_ablk_init'
arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xcb3): first defined here


Full randconfig file is attached.

--
~Randy


Attachments:
config-r6202 (46.99 kB)

2012-06-13 17:03:17

by Jussi Kivilinna

[permalink] [raw]
Subject: Re: linux-next: Tree for Jun 13 (crypto)

Quoting Randy Dunlap <[email protected]>:

> On 06/12/2012 10:54 PM, Stephen Rothwell wrote:
>
>> Hi all,
>>
>> Changes since 20120612:
>>
>
>
>
> on x86_64:
>
> arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_xts_decrypt':
> (.text+0x856c): multiple definition of `serpent_xts_decrypt'
> arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xae8): first defined here

Reverting commit e2f4d85d5b2049a90859aa10de914ed31a4f17a4, "crypto:
serpent - add common glue code for avx and sse2 implementation",
should help for most.

> arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_dec_blk_8way':
> (.text+0x3d70): multiple definition of `serpent_dec_blk_8way'
> arch/x86/crypto/serpent-avx-x86_64.o: In function `__serpent_enc_blk_8way':
> (.text+0x0): multiple definition of `__serpent_enc_blk_8way'

Attached patch should solve these (patch depends on above revert).

-Jussi


Attachments:
(No filename) (893.00 B)
01-serpent-sse2-avx-allow-both-to-be-built-into-kernel.patch (7.24 kB)
Download all attachments

2012-06-13 19:05:40

by Johannes Goetzfried

[permalink] [raw]
Subject: Re: linux-next: Tree for Jun 13 (crypto)

On Wed, Jun 13, 2012 at 08:03:17PM +0300, Jussi Kivilinna wrote:
> >arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_xts_decrypt':
> >(.text+0x856c): multiple definition of `serpent_xts_decrypt'
> >arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xae8): first defined here
>
> Reverting commit e2f4d85d5b2049a90859aa10de914ed31a4f17a4, "crypto:
> serpent - add common glue code for avx and sse2 implementation",
> should help for most.
>
> >arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_dec_blk_8way':
> >(.text+0x3d70): multiple definition of `serpent_dec_blk_8way'
> >arch/x86/crypto/serpent-avx-x86_64.o: In function `__serpent_enc_blk_8way':
> >(.text+0x0): multiple definition of `__serpent_enc_blk_8way'
>
> Attached patch should solve these (patch depends on above revert).

I'm really sorry about this, it shouldn't have happened. The most easiest
solution to this problem would be to make the choice between
CRYPTO_SERPENT_SSE2_X86_64 and CRYPTO_SERPENT_AVX_X86_64 an exclusive-or choice
in crypto/Kconfig. I don't think there is an use-case, where somebody would
want to link both implementations into the same kernel image or even load both
implementations as module. This would avoid duplicating the glue-code again.

Another possibility would be to add a serpent-common-x86_64 module, but this
wouldn't be a trivial change and imo a little bit too much just to avoid
duplicating this code.

- Johannes

2012-06-13 19:14:58

by Jussi Kivilinna

[permalink] [raw]
Subject: Re: linux-next: Tree for Jun 13 (crypto)

Quoting Johannes Goetzfried
<[email protected]>:

> On Wed, Jun 13, 2012 at 08:03:17PM +0300, Jussi Kivilinna wrote:
>> >arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_xts_decrypt':
>> >(.text+0x856c): multiple definition of `serpent_xts_decrypt'
>> >arch/x86/crypto/serpent-sse2-x86_64.o:(.text+0xae8): first defined here
>>
>> Reverting commit e2f4d85d5b2049a90859aa10de914ed31a4f17a4, "crypto:
>> serpent - add common glue code for avx and sse2 implementation",
>> should help for most.
>>
>> >arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_dec_blk_8way':
>> >(.text+0x3d70): multiple definition of `serpent_dec_blk_8way'
>> >arch/x86/crypto/serpent-avx-x86_64.o: In function `__serpent_enc_blk_8way':
>> >(.text+0x0): multiple definition of `__serpent_enc_blk_8way'
>>
>> Attached patch should solve these (patch depends on above revert).
>
> I'm really sorry about this, it shouldn't have happened. The most easiest
> solution to this problem would be to make the choice between
> CRYPTO_SERPENT_SSE2_X86_64 and CRYPTO_SERPENT_AVX_X86_64 an
> exclusive-or choice
> in crypto/Kconfig. I don't think there is an use-case, where somebody would
> want to link both implementations into the same kernel image or even
> load both
> implementations as module. This would avoid duplicating the glue-code again.

I'd think that most common use-case is distro-kernel, where all and
everything is enabled by default.

>
> Another possibility would be to add a serpent-common-x86_64 module, but this
> wouldn't be a trivial change and imo a little bit too much just to avoid
> duplicating this code.

I'm working on patch-set that takes common glue code from
serpent-sse2, serpent-avx, twofish-3way, twofish-avx and
camellia-x86_64, to shared ablk_helper and glue_helper modules.

-Jussi

2012-06-14 02:16:12

by Herbert Xu

[permalink] [raw]
Subject: Re: linux-next: Tree for Jun 13 (crypto)

On Wed, Jun 13, 2012 at 08:03:17PM +0300, Jussi Kivilinna wrote:
>
> Reverting commit e2f4d85d5b2049a90859aa10de914ed31a4f17a4, "crypto:
> serpent - add common glue code for avx and sse2 implementation",
> should help for most.
>
> >arch/x86/crypto/serpent-avx-x86_64.o: In function `serpent_dec_blk_8way':
> >(.text+0x3d70): multiple definition of `serpent_dec_blk_8way'
> >arch/x86/crypto/serpent-avx-x86_64.o: In function `__serpent_enc_blk_8way':
> >(.text+0x0): multiple definition of `__serpent_enc_blk_8way'
>
> Attached patch should solve these (patch depends on above revert).
>
> -Jussi

> crypto: serpent-sse2/avx - allow both to be built into kernel
>
> From: Jussi Kivilinna <[email protected]>
>
> Rename serpent-avx assembler functions so that they do not collide with
> serpent-sse2 assembler functions when linking both versions in to same
> kernel image.
>
> Reported-by: Randy Dunlap <[email protected]>
> Cc: Johannes Goetzfried <[email protected]>
> Signed-off-by: Jussi Kivilinna <[email protected]>

OK I have reverted e2f4d85d and applied your patch. In the process
I have rebased all patches on top of the original one so watch out if
you're pulling my tree.

Thanks!
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt