Page MenuHomeFreeBSD

Remove unused basemem calculation
Changes PlannedPublic

Authored by emaste on Sep 11 2014, 2:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 19 2023, 11:40 PM
Unknown Object (File)
Dec 7 2023, 5:50 PM
Unknown Object (File)
Sep 20 2023, 12:26 PM
Unknown Object (File)
Sep 17 2023, 12:29 PM
Unknown Object (File)
Aug 15 2023, 3:30 PM
Unknown Object (File)
Dec 17 2016, 8:20 AM
Unknown Object (File)
Dec 16 2016, 3:57 PM
Unknown Object (File)
Apr 26 2016, 9:52 AM
Subscribers
None

Details

Reviewers
jhb
Summary

It seems basemem isn't used in amd64 startup at all.

UEFI may not put a usable memory range at physaddr 0 which leads to a panic when basemem == 0, but the AP startup trampoline is put in a hole carved out of the first usable segment and it seems like it should be fine regardless of whether that starts at physaddr 0 or not.

We'll still have problems if the first range is too small, or starts at a physaddr address too high, but we would have panicked in that case anyway. I can revisit adding an explicit check for that later.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to Remove unused basemem calculation.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added a reviewer: jhb.

kib pointed out that mptable.c needs basemem; it's not in GENERIC but may be used in some cases.

basemem is implicitly rooted at zero, so you can't just pick any segment with memory below 1M, though you could possibly cheat that way. You could probably rewrite mptable to use physmap[] directly and look for its table in segements that match the specs requirements.