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
- rG541696f2a1d0: bhyve: remove empty E820 entries
rGf325f81f4ab9: bhyve: remove empty E820 entries
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 58046 Build 54934: arc lint + arc unit
Event Timeline
| usr.sbin/bhyve/amd64/e820.c | ||
|---|---|---|
| 229 | ||
| 232 | 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 {
...
} | |