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)
Nov 25 2024, 6:54 PM
Unknown Object (File)
Nov 18 2024, 2:41 PM
Unknown Object (File)
Nov 18 2024, 2:41 PM
Unknown Object (File)
Nov 18 2024, 2:41 PM
Unknown Object (File)
Nov 18 2024, 2:41 PM
Unknown Object (File)
Nov 18 2024, 1:41 PM
Unknown Object (File)
Oct 2 2024, 7:57 AM
Unknown Object (File)
Sep 27 2024, 9:15 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.