Page MenuHomeFreeBSD

bhyve(8): Add bootrom allocation abstraction
ClosedPublic

Authored by cem on Apr 14 2020, 6:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 12:06 AM
Unknown Object (File)
Dec 14 2023, 4:15 AM
Unknown Object (File)
Nov 12 2023, 7:59 AM
Unknown Object (File)
Nov 10 2023, 8:04 AM
Unknown Object (File)
Nov 8 2023, 1:44 PM
Unknown Object (File)
Oct 9 2023, 6:58 AM
Unknown Object (File)
Oct 7 2023, 12:39 PM
Unknown Object (File)
Aug 20 2023, 3:00 AM
Subscribers

Details

Summary

To allow more general use of the bootrom region, separate initialization from
allocation, and allocation from loading a file.

The bootrom segment is the high 16MB of the low 4GB region.

Each allocation in the segment creates a new mapping with specified protection.
By default, allocation begins at the low end of the range. However, the
BOOTROM_ALLOC_TOP flag is provided to locate a provided bootrom in the high
region it is expected to be in.

The existing ROM-file loading code is refactored to use the new interface.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

grehan added inline comments.
usr.sbin/bhyve/bootrom.c
59 ↗(On Diff #70569)

The exception to first-come is the actual boot rom, which must go into the area containing the power-on reset vector. Maybe a bool parameter to request this type of allocation ? Fine for now.

This revision is now accepted and ready to land.Apr 14 2020, 8:56 PM
usr.sbin/bhyve/bootrom.c
59 ↗(On Diff #70569)

I think I’ve placed it in the identical region as it was before this change. I agree a flag to allocate top vs bottom would help guarantee this regardless of the order of requests.

cem marked an inline comment as done.
  • Add a flag to allocate top, and default to bottom
  • Use top flag in actual bootrom logic
  • Fix the allocation logic to actually update the free region, which was previously absent. Oops.
This revision now requires review to proceed.Apr 14 2020, 10:49 PM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 15 2020, 1:59 AM
This revision was automatically updated to reflect the committed changes.