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)
Tue, Oct 22, 5:47 PM
Unknown Object (File)
Tue, Oct 22, 4:33 PM
Unknown Object (File)
Mon, Oct 21, 8:21 PM
Unknown Object (File)
Mon, Oct 21, 8:09 AM
Unknown Object (File)
Sat, Oct 19, 12:38 PM
Unknown Object (File)
Sat, Oct 19, 12:38 PM
Unknown Object (File)
Sat, Oct 19, 12:38 PM
Unknown Object (File)
Sat, Oct 19, 12:38 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 49477
Build 46367: 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.