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
Unknown Object (File)
Thu, Mar 14, 10:06 PM
Unknown Object (File)
Thu, Mar 14, 10:06 PM
Unknown Object (File)
Thu, Mar 14, 10:03 PM
Unknown Object (File)
Thu, Mar 14, 10:03 PM
Unknown Object (File)
Thu, Mar 14, 10:02 PM
Unknown Object (File)
Thu, Mar 14, 10:02 PM
Unknown Object (File)
Mar 11 2024, 7:19 AM
Unknown Object (File)
Jan 29 2024, 10:12 PM
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 Not Applicable
Unit
Tests Not Applicable

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.