From: Eric Biggers <ebiggers@kernel.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
linux-crypto@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Clang-Built-Linux ML <clang-built-linux@googlegroups.com>,
Fangrui Song <maskray@google.com>,
Peter Smith <peter.smith@linaro.org>
Subject: Re: crypto: x86/crct10dif-pcl - cleanup and optimizations
Date: Mon, 17 Jun 2019 11:22:57 -0700 [thread overview]
Message-ID: <20190617182256.GB92263@gmail.com> (raw)
In-Reply-To: <CAKwvOdn8Za1Dy4QgdDZu1My5oYLJJzyRqYsq+XkpRpnViC6aKQ@mail.gmail.com>
On Mon, Jun 17, 2019 at 11:06:21AM -0700, Nick Desaulniers wrote:
> On Mon, Jun 17, 2019 at 6:35 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >
> > Hi,
> >
> > while digging through a ClangBuiltLinux issue when linking with LLD
> > linker on x86-64 I checked the settings for...
> >
> > .rodata.cst16 and .rodata.cst32
> >
> > ...in crypto tree and fell over this change in...
> >
> > commit "crypto: x86/crct10dif-pcl - cleanup and optimizations":
> >
> > -.section .rodata.cst16.SHUF_MASK, "aM", @progbits, 16
> > +.section .rodata.cst32.byteshift_table, "aM", @progbits, 32
> > .align 16
> >
> > Is that a typo?
> > I would have expected...
> > .rodata.cst32.XXX -> .align 32
> > or
> > rodata.cst16.XXX -> .align 16
> >
> > But I might be wrong as I am no expert for crypto and x86/asm.
> >
> > Thanks in advance.
> >
> > Regards,
> > - Sedat -
> >
> > [1] https://github.com/ClangBuiltLinux/linux/issues/431
> > [2] https://bugs.llvm.org/show_bug.cgi?id=42289
>
> > [3] https://git.kernel.org/linus/0974037fc55c
>
> + Peter, Fangrui (who have looked at this, and started looking into
> this from LLD's perspective)
>
> In fact, looking closer at that diff, the section in question
> previously had 32b alignment. Eric, was that change intentional? It
> seems funny to have a 32b entity size but a 16b alignment.
>
> PDF page 81 / printed page 67 of this doc:
> https://web.eecs.umich.edu/~prabal/teaching/resources/eecs373/Assembler.pdf
> says:
>
> "The linker may remove duplicates within sections with the
> same name, same entity size and same flags. "
>
> So for us, LLD is NOT merging these sections due to differing
> alignments, which is producing warnings when loading such kernel
> modules that link against these object files.
> --
> Thanks,
> ~Nick Desaulniers
It was an intentional change since actually no alignment is required for this.
It's an array of 32 bytes and the code loads 16 bytes starting from some byte
offset in the range 1...16, so it has to use movdqu anyway.
There's no problem with changing it back to 32, but I don't fully understand
what's going on here. Where is it documented how alignment specifiers interact
with the section merging? Also, there are already other mergeable sections in
the x86 crypto code with alignment smaller than their entity size, e.g.
.rodata.cst16.aegis128_const
.rodata.cst16.aegis128l_const
.rodata.cst16.aegis256_const
.rodata.cst16.morus640_const
.rodata.cst256.K256
Do those need to be changed too?
- Eric
next prev parent reply other threads:[~2019-06-17 18:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 13:35 crypto: x86/crct10dif-pcl - cleanup and optimizations Sedat Dilek
2019-06-17 18:06 ` Nick Desaulniers
2019-06-17 18:07 ` Nick Desaulniers
2019-06-17 18:22 ` Eric Biggers [this message]
2019-07-03 15:16 ` Sedat Dilek
2019-07-03 16:14 ` Eric Biggers
2019-07-03 18:52 ` Nick Desaulniers
2019-07-04 7:38 ` Sedat Dilek
2019-07-08 18:19 ` Nick Desaulniers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190617182256.GB92263@gmail.com \
--to=ebiggers@kernel.org \
--cc=ard.biesheuvel@linaro.org \
--cc=clang-built-linux@googlegroups.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=maskray@google.com \
--cc=ndesaulniers@google.com \
--cc=peter.smith@linaro.org \
--cc=sedat.dilek@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).