Page MenuHomeFreeBSD

bhyve: add common memory holes to E820 table
ClosedPublic

Authored by corvink on Apr 13 2023, 7:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
May 12 2024, 7:18 PM
Unknown Object (File)
May 11 2024, 7:23 AM
Unknown Object (File)
May 11 2024, 7:23 AM
Unknown Object (File)
May 11 2024, 7:23 AM
Unknown Object (File)
May 10 2024, 5:43 PM
Unknown Object (File)
Apr 23 2024, 4:33 PM
Unknown Object (File)
Apr 23 2024, 4:33 PM
Unknown Object (File)
Apr 23 2024, 4:33 PM
Subscribers

Details

Summary

The VGA and the ROM memory ranges can't be used as system memory. For
that reason, remove them from the E820 table.

Diff Detail

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

Event Timeline

usr.sbin/bhyve/e820.c
275
279

I think the code would benefit from a helper routine:

static struct e820_element *
e820_element_alloc(uint64_t base, uint64_t end, enum e820_memory type type)
{
    struct e820_element *elem;

    elem = calloc(1, sizeof(*elem));
    if (elem != NULL) {
        elem->base = base;
        elem->end = end;
        elem->type = type;
    }
    return (elem);
}

since this code is duplicated several times now.

  • make use of helper for e820_element allocations
This revision is now accepted and ready to land.Apr 24 2023, 3:16 PM
This revision was automatically updated to reflect the committed changes.