NetBSD/sys
riastradh 7c69fd1390 cgd(4): Omit technically-correct-but-broken adiantum dependency again.
It is true that cgd_crypto.c depends on sys/crypto/adiantum now, and
transitively on sys/crypto/aes.

However, there's a problem with the cgd module having a formal
(transitive) module dependency on the aes module.

Yesterday I thought the problem with this was that fpu_kern_enter was
artificially restricted while cold -- to detect, and noisily crash
on, reentrance, it raises the IPL to IPL_VM, asserts that the IPL is
not _higher_ (so it can't be re-entered by an IPL_SCHED or IPL_HIGH
interrupt), and asserts that it's not currently in use on the current
CPU.

Early at boot, the IPL is at IPL_HIGH, and no interrupts are possible
anyway, so the assertions tripped for artificial reasons, which I
fixed in:

https://mail-index.netbsd.org/source-changes/2022/04/01/msg137840.html

However, I had forgotten that there's a deeper problem for the cgd
module dependency on aes.  The ordering of events is:

1. Initialize builtin MODULE_CLASS_DRIVER modules -- including cgd.

2. Run configure -- including detecting CPUs, which on aarch64 is
   where the decision of which AES (and ChaCha) implementation to use
   based on supported CPU features.

3. Initialize builtin MODULE_CLASS_MISC modules -- including aes,
   _if_ there are no driver-class modules that depend on it.

There's a tangle of ordering dependencies here:

- MODULE_CLASS_DRIVER modules providing _autoconf_ drivers generally
  have to be initialized _before_ configure, because you need the
  driver to be initialized before configure can attach its devices.

- configure must run _before_ aes is initialized because the decision
  of which AES implementation to choose depends on CPU features
  detected in configure, and the prospect of dynamically changing the
  AES implementation is too painful to contemplate (it may change the
  key schedule, so it would invalidate any existing key schedules
  precomputed by callers like uvm_swap or configured cgd devices,
  which raises a host of painful concurrency issues to invalidate
  these cached key schedules on all CPUs in all subsystems using
  them).

- cgd doesn't figure into the configure stage of autoconf, but it
  nevertheless has to be MODULE_CLASS_DRIVER because specfs autoloads
  MODULE_CLASS_DRIVER modules in case they provide _devsw_ drivers
  (i.e., /dev nodes), as cgd does.  And we don't have a mechanism for
  identifying `autoconf driver modules' separately from `devsw driver
  modules' because some modules provide both and each module can have
  only one class.

For now, this is breaking boot on several tier I architectures so
let's nix the cgd->adiantum->aes module dependency as a stop-gap
measure.
2022-04-02 09:53:20 +00:00
..
altq fix few typos in comments, mainly in word "parameter". 2021-12-31 20:22:48 +00:00
arch x86, arm: Allow fpu_kern_enter/leave while cold. 2022-04-01 19:57:22 +00:00
coda specfs: Let spec_node_lookup_by_dev wait for reclaim to finish. 2022-03-28 12:37:46 +00:00
compat compat_30: Fix thinko in previous. 2022-03-12 20:46:03 +00:00
conf Add initial support for Intel GPIO chips 2022-03-24 02:24:24 +00:00
crypto s/folllowing/following/ 2021-12-05 04:48:35 +00:00
ddb sys: Split struct device into a private device_impl.h. 2022-03-28 12:38:57 +00:00
dev cgd(4): Omit technically-correct-but-broken adiantum dependency again. 2022-04-02 09:53:20 +00:00
dist/pf driver(9): devsw_detach never fails. Make it return void. 2022-03-28 12:33:20 +00:00
dtb Hook in riscv dtb build 2021-11-13 10:13:42 +00:00
external driver(9): devsw_detach never fails. Make it return void. 2022-03-28 12:33:20 +00:00
fs Fix malformed DPRINTF() macro 2022-04-01 08:26:27 +00:00
gdbscripts
kern thmap(9): Handle memory allocation failure in root_try_put. 2022-04-01 00:16:40 +00:00
lib fix typos, mainly s/comand/command/ 2022-01-05 16:01:54 +00:00
miscfs driver(9): New devsw d_cancel op to interrupt I/O before close. 2022-03-28 12:39:10 +00:00
modules Create a loaable adiantum module, and make cgd require it. 2022-04-01 21:09:24 +00:00
net lagg(4): reimplement add and delete port 2022-04-01 07:26:51 +00:00
net80211 net80211: Use getticks(), not hardclock_ticks. 2022-03-18 23:32:24 +00:00
netatalk don't opencode kauth_cred_get() 2021-09-21 14:59:14 +00:00
netbt s/hander/handler/ and s/hader/header/ in comments and documentation. 2022-03-13 17:50:54 +00:00
netcan sys: Use if_ioctl wrapper function. 2021-12-31 14:24:50 +00:00
netinet fix few typos in comments, mainly s/paramenters/parameters/. 2022-03-23 11:08:27 +00:00
netinet6 fix various typos in comments, mainly immediatly/immediately/, 2022-02-23 21:54:40 +00:00
netipsec fix few typos in comments and log message. 2022-02-13 22:20:08 +00:00
netmpls
nfs restructure so we abort/unlock properly on failure. 2022-03-30 10:52:59 +00:00
opencrypto For device modules that provide both auto-config and /dev/xxx 2022-03-31 19:30:15 +00:00
rump For device modules that provide both auto-config and /dev/xxx 2022-03-31 19:30:15 +00:00
secmodel isroot should be bool... 2022-03-29 22:29:29 +00:00
stand efiboot: Add support for 'userconf' command. 2022-03-25 21:23:00 +00:00
sys tty(9): New ttycancel function. 2022-03-28 12:39:28 +00:00
ufs add a kauth vnode check for creating links 2022-03-27 16:24:57 +00:00
uvm driver(9): New types dev_*_t for device driver devsw operations. 2022-03-28 12:39:18 +00:00
Makefile