Go to file
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
bin sh: fix typo in comment 2022-02-08 20:39:59 +00:00
common zlib: Fix a bug that can crash deflate on some input when using Z_FIXED. 2022-03-24 10:13:01 +00:00
compat remove obsolete files. 2021-06-18 06:34:00 +00:00
crypto merge OpenSSL-1.1.1m and OpenSSL-1.1.1n 2022-03-15 20:51:12 +00:00
dist/pf Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889. 2021-07-24 21:31:31 +00:00
distrib Remove floppy installation instructions from sparc documentation. 2022-04-01 21:53:35 +00:00
doc zlib-1.2.12 out 2022-03-29 22:09:58 +00:00
etc add named plugins directory. 2022-03-06 17:51:42 +00:00
external Add link our policy. 2022-03-30 16:34:27 +00:00
extsrc
games cgram: define a word as a sequence of letters, not non-whitespace 2022-03-28 20:00:29 +00:00
include err.h: dead once is dead enough 2022-01-06 00:16:47 +00:00
lib popen.3: revert s/null-/nul-/ change, this is subject to debate 2022-03-27 00:32:15 +00:00
libexec _rtld_map_object(): no need to mmap an empty bss segment. 2022-03-30 08:26:45 +00:00
regress introduce a SOL_LOCAL for unix-domain socket level socket options 2021-08-08 20:54:48 +00:00
rescue smb is no more. 2020-04-04 17:57:16 +00:00
sbin Change error code to ENOBUFS on lack of buffer memory 2022-03-31 01:53:22 +00:00
share Update documentation to clean up obsolete settings and add new ones. 2022-04-01 06:32:10 +00:00
sys cgd(4): Omit technically-correct-but-broken adiantum dependency again. 2022-04-02 09:53:20 +00:00
tests lint: add type details to message about 'sizeof(function)' 2022-04-01 23:16:31 +00:00
tools tools: allow tools to use C99 2022-02-03 20:32:38 +00:00
usr.bin lint: add type details to message about 'sizeof(function)' 2022-04-01 23:16:31 +00:00
usr.sbin fix few typos for word "previous(ly)" in comments. 2022-03-23 13:06:06 +00:00
BUILDING Rename: 2021-12-20 20:33:20 +00:00
Makefile Makefile: fix location of postinstall program for MAKEVERBOSE > 2 2022-03-19 14:35:13 +00:00
Makefile.inc
README.md README: use https for man.NetBSD.org 2021-09-05 12:45:44 +00:00
UPDATING s/dissallow/disallow/ 2021-12-07 21:45:31 +00:00
build.sh Don't try to install netbsd-CONFIG.debug files build with kernel= 2021-12-31 15:43:35 +00:00

README.md

NetBSD

NetBSD is a free, fast, secure, and highly portable Unix-like Open Source operating system. It is available for a wide range of platforms, from large-scale servers and powerful desktop systems to handheld and embedded devices.

Building

You can cross-build NetBSD from most UNIX-like operating systems. To build for amd64 (x86_64), in the src directory:

./build.sh -U -u -j4 -m amd64 -O ~/obj release

Additional build information available in the BUILDING file.

Binaries

Testing

On a running NetBSD system:

cd /usr/tests; atf-run | atf-report

Troubleshooting

Latest sources

To fetch the main CVS repository:

cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P src

To work in the Git mirror, which is updated every few hours from CVS:

git clone https://github.com/NetBSD/src.git