When reserving a block with the same size of a RAM segement, we can end up with
an empty RAM segmenet. Avoid that by removing this empty segment from the E820
table.
Details
Details
- Reviewers
jhb markj - Group Reviewers
bhyve - Commits
- rGf325f81f4ab9: bhyve: remove empty E820 entries
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
usr.sbin/bhyve/amd64/e820.c | ||
---|---|---|
241 | ||
244 | I suggest making the code match the comments by tweaking it as so: TAILQ_INSERT_BEFORE(element, new_element, chain); element->base = end; /* * (New comment here) */ if (end == element->end) { TAILQ_REMOVE(...); free(element); } Or even alternatively, make this a new top-level case: if (base == element->base && end == element->end) { /* The new entry replaces an existing entry. */ TAILQ_INSERT_BEFORE(element, new_element, chain); TAILQ_REMOVE(&e820_table, element, chain); free(element); } else if (base == element->base) { /* Existing code */ } else if (end == element->end) { ... } else { ... } |