Page MenuHomeFreeBSD

kboot: Create segment handling code at main level
ClosedPublic

Authored by imp on Feb 1 2023, 6:22 AM.
Tags
None
Referenced Files
F106179837: D38308.diff
Thu, Dec 26, 5:15 PM
Unknown Object (File)
Sat, Dec 14, 11:18 AM
Unknown Object (File)
Nov 25 2024, 4:06 AM
Unknown Object (File)
Nov 21 2024, 7:48 AM
Unknown Object (File)
Nov 21 2024, 7:48 AM
Unknown Object (File)
Nov 21 2024, 7:48 AM
Unknown Object (File)
Nov 21 2024, 7:48 AM
Unknown Object (File)
Nov 21 2024, 7:48 AM
Subscribers

Details

Summary

Create segment handling code up to the top level. Move it all into
seg.c, and make necessary adjustments for it being in a new file,
including inventing print_avail() and first_avail() to print the array
and find the first large enough memory hole.aarch64 will use this,
and I'll refactor the other platforms to use it as I make them work.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49482
Build 46372: arc lint + arc unit

Event Timeline

imp requested review of this revision.Feb 1 2023, 6:22 AM
imp retitled this revision from kboot: Move segment handling code to main level to kboot: Create segment handling code at main level.

rebase / refactor / redo

I somewhat wish we could reuse sys/kern/subr_physmem here just to have one less memory range segment manager to audit; it's not quite flexible enough for kboot's needs, though.

stand/kboot/seg.c
24

Should probably error check this malloc and below realloc; failure's probably unlikely, I'm guessing just panic so we can detect that particular problem a bit earlier rather than when we try to dereference it?

177

panic on no mem, update comment

stand/kboot/seg.c
24

agreed.

I somewhat wish we could reuse sys/kern/subr_physmem here just to have one less memory range segment manager to audit; it's not quite flexible enough for kboot's needs, though.

I wish we could as well... but we both add new memory areas, as well as remove areas from inside of those added areas, which subr_physmem doesn't do.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 3 2023, 3:51 PM
This revision was automatically updated to reflect the committed changes.