Re: [PATCH 1/1] Revert "crypto: run initcalls for generic implementations earlier"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 30, 2025 at 10:21:59AM +0800, Herbert Xu wrote:
> On Tue, Apr 29, 2025 at 09:41:00AM -0700, Eric Biggers wrote:
> >
> > arch/*/lib/ should be kept at arch_initcall.  It makes sense (it's arch/ code);
> > it's library code with no dependencies on any other initcalls; and it can be
> 
> There aren't any direct dependencies but if you end up executing
> the code protected by those static branches things may well break.
> 
> For example, fpu_state_size_dynamic() is only initialised at
> arch_initcall.  So if you enable these lib/crypto static branches,
> *and* someone actually calls them early enough during arch_initcall,
> they may end up hitting the FPU code before it's been properly
> initialised.
> 
> I think it's prudent to delay the initialisation of these static
> keys until later in the boot process, unless there is a demonstrated
> need for accessing them early.
> 
> > use arch_initcall.  (And FWIW I'll keep doing that arch/*/lib/crc*.c, even if
> > you decide to mess up arch/*/lib/crypto/.)
> 
> I'm not going to touch the crc stuff.

If arch is really too early for arch/*/lib/, then subsys should be used instead.
The point is that putting different algorithms at different levels would be
confusing.

- Eric




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux