Page MenuHomeFreeBSD

kboot: Update amd64 to use enumerate_memory_arch()
ClosedPublic

Authored by imp on Jan 29 2023, 3:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 8:31 PM
Unknown Object (File)
Tue, Nov 19, 10:16 PM
Unknown Object (File)
Tue, Nov 19, 1:00 PM
Unknown Object (File)
Thu, Nov 14, 9:52 AM
Unknown Object (File)
Thu, Nov 14, 6:10 AM
Unknown Object (File)
Thu, Nov 14, 12:32 AM
Unknown Object (File)
Tue, Nov 12, 9:27 AM
Unknown Object (File)
Mon, Nov 11, 11:38 AM
Subscribers

Details

Summary

Move memory enumeration to the enumerate_memory_arch(), tweak the code a
bit to make that fit into that framework.

Also fix a bug in the name of the end location. The old code never found
memory (though amd64 doesn't yet work, this lead to using fallback
addresses that were good enough for QEMU...).

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rebase / refactor / redo

kevans added inline comments.
stand/kboot/arch/amd64/load_addr.c
102–104

Now that it's a static 16 upper bound, this should probably be converted to a for loop for readability.

119

A DPRINTF or something might be nice, but this is still early enough stage that I don't think we really care; presumably this won't live too much longer.

This revision is now accepted and ready to land.Feb 2 2023, 3:25 AM
stand/kboot/arch/amd64/load_addr.c
102–104

fair point. This is a static array, but we need to do something akin to what I've done in the aarch64 case with the code that's now living in seg.c. I should just use the 'avail' interface I think here. The limits are arbitrary, though this is the only way to snag the table, so I may need to have aux data the table that avail builds won't need... So I need to think about this feedback... But maybe the real answer is I need a dynamic array of what will become the UEFI table we need to ship into the kernel... I don't plan on supporting kboot from anything other than a UEFI booted kernel...

119

Yea, perhaps you are right... Though I think the 'avail' interface might largely obsolete this code.

update per review...

Make this a for loop, expand the number, and drop a comment it should be dynamic

This revision now requires review to proceed.Feb 2 2023, 4:15 AM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 3 2023, 3:52 PM
This revision was automatically updated to reflect the committed changes.