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)
Sep 27 2024, 7:51 PM
Unknown Object (File)
Sep 23 2024, 11:26 AM
Unknown Object (File)
Sep 16 2024, 9:46 AM
Unknown Object (File)
Sep 14 2024, 8:31 PM
Unknown Object (File)
Sep 14 2024, 11:53 AM
Unknown Object (File)
Sep 9 2024, 8:29 PM
Unknown Object (File)
Sep 5 2024, 6:50 PM
Unknown Object (File)
Sep 5 2024, 10:23 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 49292
Build 46182: arc lint + arc unit

Event Timeline

rebase / refactor / redo

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

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

121

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
104–106

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...

121

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.