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)
Sun, May 26, 12:19 AM
Unknown Object (File)
Sun, May 26, 12:19 AM
Unknown Object (File)
Sun, May 26, 12:19 AM
Unknown Object (File)
Sun, May 26, 12:19 AM
Unknown Object (File)
Sun, May 26, 12:19 AM
Unknown Object (File)
Fri, May 24, 4:05 AM
Unknown Object (File)
Wed, May 22, 11:00 AM
Unknown Object (File)
Sat, May 4, 9:33 PM
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 49474
Build 46364: arc lint + arc unit

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.