lkml.org 
[lkml]   [2021]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] Crypto Fixes for 5.15
On Thu, Oct 28, 2021 at 9:14 PM Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> This push fixes a build-time warning in x86/sm4.

Hmm..

> Tianjia Zhang (1):
> crypto: x86/sm4 - Fix invalid section entry size

So I do wonder why the crypto code asm tends to use such complex
".section" directives.

Almost everythign else in the kernel just uses

.section <name>,"a"

for data (and "ax" for text).

The crypto code uses that very subtle "M" flag which allows the linker
to merge data, but how much of a win is that added complexity? Now you
need to get the sizes exactly right, and you hit tooling issues.

Plus, I get the feeling that some people have just copied-and-pasted
those things, and don't necessarily realize just _how_ subtle 'M'
sections are.

How much of a data savings is it to have this complexity? Particularly
since I suspect most of the time these things end up being individual
modules, and never actually get linked together at all?

So I get this very strong feeling that the crypto code is doing
complicated and fragile things that cause tooling issues - and does so
for no good reason and no actual real-life upside.

I've pulled this, but I do suspect that all the fancy

.section .rodata.xyz, "aM", @progbits, abc

could just as well be

.section .rodata, "a"

instead, and you guys are only causing problems for yourself by trying
to be clever in pointless ways.

Linus

\
 
 \ /
  Last update: 2021-10-29 19:41    [W:0.289 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site