Page MenuHomeFreeBSD

veloader use vectx API for kernel and modules
ClosedPublic

Authored by sjg on Feb 25 2020, 1:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 23, 10:48 AM
Unknown Object (File)
Sun, Apr 14, 2:38 PM
Unknown Object (File)
Mon, Apr 8, 6:28 AM
Unknown Object (File)
Sun, Apr 7, 7:47 AM
Unknown Object (File)
Sun, Apr 7, 5:06 AM
Unknown Object (File)
Sat, Apr 6, 11:47 PM
Unknown Object (File)
Jan 18 2024, 8:55 AM
Unknown Object (File)
Jan 13 2024, 11:15 AM

Details

Reviewers
imp
stevek
tsoome
manu
Group Reviewers
bhyve
Summary

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().

Since vectx API is only used for files which must be verified
(VE_MUST) we panic if we get an incorrect hash.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29767
Build 27605: arc lint + arc unit

Event Timeline

Add readin.h to define READIN_HANDLE_T

Add readin.h to define READIN_HANDLE_T

This looks decent, imho, but I wonder why you're using #defines instead of more language appropriate features.

stand/common/readin.h
34–41

Why are the types #defines?
Why are the vectx_read and vectx_lseek not function pointers?

stand/common/readin.h
34–41

Good question.
typedefs should be possible.
function pointers need to be stored somewhere...

Use typedef for readin_handle_t

Seems reasonable. This could be a lot more intrusive

This revision is now accepted and ready to land.Mar 4 2020, 3:34 AM