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)
Sat, May 25, 2:28 PM
Unknown Object (File)
Sat, May 25, 5:10 AM
Unknown Object (File)
Wed, May 22, 7:24 PM
Unknown Object (File)
Tue, May 21, 9:32 PM
Unknown Object (File)
Tue, May 21, 9:32 PM
Unknown Object (File)
Tue, May 21, 9:31 PM
Unknown Object (File)
Tue, May 21, 9:31 PM
Unknown Object (File)
Tue, May 21, 9:14 PM
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.