History log of /freebsd-current/stand/common/misc.c
Revision Date Author Comments
# 3e15b01d 22-Feb-2024 Warner Losh <imp@FreeBSD.org>

libsa: Remove redundant sys/cdefs.h

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# ad70f2e2 11-Jan-2023 Warner Losh <imp@FreeBSD.org>

stand: create common set_currdev

Pull together the nearly identical copies of set_currdev in i386,
userboot and efi. Other boot loaders have variances that might be fine
to use the common routine, or not. Since they are harder to test for me,
and ofw and uboot do handle these setting differently, leave them be for
now.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38005


# bf020787 11-Jan-2023 Warner Losh <imp@FreeBSD.org>

stand: Move dev_cleanup into libsa

Since dev_cleanup() walks through all the devsw devices with dv_cleanup
rotuines, move it into libsa rather than having it in
'common'. Logically, it operates only on things that are in libsa, and
would never be different for different loaders: either people would call
it as is, or they'd do the loop themselves with 'special' things inline
between calls to cleanup (not that I think that will ever be needed
though).

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38004


# 1c1783d6 11-Jan-2023 Warner Losh <imp@FreeBSD.org>

stand: Create common gen_setcurrdev and replace code

Replace 4 identical copies of *_setcurrdev with gen_setcurrdev to avoid
having to create a 5th copy. uboot_setcurrdev is actually different and
needs to remain separate (even though it's quite similar).

Sponsored by: Netflix
Reviewed by: fuz@fuz.su, kevans
Differential Revision: https://reviews.freebsd.org/D38003


# b4cb3fe0 11-Aug-2021 Toomas Soome <tsoome@FreeBSD.org>

loader: implement mount/unmount rootfs

We want to keep our root file system open to preserve bcache segment
between file accesses, thus reducing physical disk IO.

Reviewed by: imp, allanjude, kevans (previous version)
Differential Revision: https://reviews.freebsd.org/D30848
MFC after: 1 month


# ed19b7c5 29-Aug-2020 Simon J. Gerraty <sjg@FreeBSD.org>

zalloc_malloc:Free hexdump preceeding buffer when we detect overflow

Move hexdump from stand/common/misc.c to stand/libsa/hexdump.c
(svn cp)
Disable use of pager - causes linking issue for boot1
can be re-enabled by defining HEXDUMP_PAGER.

Reviewed by: stevek, imp
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D26235


# afc571b1 08-Mar-2020 Simon J. Gerraty <sjg@FreeBSD.org>

veloader use vectx API for kernel and modules

The vectx API, computes the hash for verifying a file as it is read.
This avoids the overhead of reading files twice - once to verify, then
again to load.

For doing an install via loader, avoiding the need to rewind
large files is critical.

This API is only used for modules, kernel and mdimage as these are the
biggest files read by the loader.
The reduction in boot time depends on how expensive the I/O is
on any given platform. On a fast VM we see 6% improvement.

For install via loader the first file to be verified is likely to be the
kernel, so some of the prep work (finding manifest etc) done by
verify_file() needs to be factored so it can be reused for
vectx_open().

For missing or unrecognized fingerprint entries, we fail
in vectx_open() unless verifying is disabled.

Otherwise fingerprint check happens in vectx_close() and
since this API is only used for files which must be verified
(VE_MUST) we panic if we get an incorrect hash.

Reviewed by: imp,tsoome
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D23827


# 91e69716 23-Feb-2020 Toomas Soome <tsoome@FreeBSD.org>

loader: alloc_pread() should set errno if malloc fails

We may want to find out why alloc_pread() failed.


# 56e53cb8 13-Mar-2018 Warner Losh <imp@FreeBSD.org>

Prefer uintXX_t to u_intXX_t

A foolish consistency is the hobgoblin of little minds, adored by
little statesmen and philosophers and divines. With consistency a
great soul has simply nothing to do. -- Ralph Waldo Emerson


# f9a20b8f 23-Jan-2018 Warner Losh <imp@FreeBSD.org>

There's no tainted data here, tag it as such to avoid the slew of
false positives. The files the boot loader reads are assumed to be
good.

CID: 1006663,1006665,1265013, 1265014 (possibly more)
Sponsored by: Netflix


# ca987d46 14-Nov-2017 Warner Losh <imp@FreeBSD.org>

Move sys/boot to stand. Fix all references to new location

Sponsored by: Netflix