At present we have no mechanism to free pages that were used for
preloaded data. For example, if one unloads a kernel module that was
loaded by the loader, its memory is cannot be reused. For early
microcode updates, I would like to load all updates as a single file,
select the correct one, and free the rest of the memory. This
simplifies the distribution of microcode updates.
This change adds kmem_bootstrap_free(), which takes an address range in
the kernel map and frees the KVA and physical pages to the VM. For this
to work, platforms which support this mechanism must create a vm_phys
segment for the physical memory used to store the kernel and preloaded
data. Note that the initial population of the physical memory allocator
is done using phys_avail[] rather than vm_phy_segs[].
The change also fixes a minor bug; the kernel linker was calling
preload_delete_name() with the basename of the specified kernel module
rather than the full path, so no matches occurred and the calls were
nops.