HomeFreeBSD

kenv: assert that an empty static buffer passed in is "empty"

Description

kenv: assert that an empty static buffer passed in is "empty"

Garbage in the passed-in buffer can cause problems if any attempts to read
the kenv are inadvertently made between init_static_kenv and the first
kern_setenv -- assuming there is one.

This is cheap and easy, so do it. This also helps rule out some class of
bugs as one tries to debug; tunables fetch from the static environment up
until SI_SUB_KMEM + 1, and many of these buffers are global ~4k buffers that
rely on BSS clearing while others just grab a page of free memory and use it
(e.g. xen).

Details

Provenance
kevansAuthored on
Parents
rS352243: ig4(4): Fix SDA HOLD time set too low on Skylake controllers
Branches
Unknown
Tags
Unknown