Page MenuHomeFreeBSD

bhyve: merge adjacent E820 entries
ClosedPublic

Authored by corvink on May 24 2024, 11:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 7:42 PM
Unknown Object (File)
Tue, Oct 22, 12:27 PM
Unknown Object (File)
Thu, Oct 17, 5:44 AM
Unknown Object (File)
Tue, Oct 15, 8:55 PM
Unknown Object (File)
Tue, Oct 15, 10:16 AM
Unknown Object (File)
Tue, Oct 15, 10:15 AM
Unknown Object (File)
Sun, Oct 13, 11:34 PM
Unknown Object (File)
Oct 9 2024, 2:38 AM
Subscribers

Details

Summary

EDKII can allocate adjacent E820 entries only if they are at a page boundary.
For some unknown and probably strange reasons, Intel puts it's OpRegion at an
offset of 0x18 bytes. If the VBT lays directly behind the OpRegion, we're going
to try allocating two adjacent E820 sharing the same page. This causes EDKII to
do not properly allocate those entries. A Linux guest then isn't able to map
the VBT and those fails to find it.

Diff Detail

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

Event Timeline

Suppose there are two E820 entries with a hole in the middle, and then a new entry fills that hole. Then we could potentially merge the new entry with both the predecessor and successor. Do we need to handle that case?

usr.sbin/bhyve/amd64/e820.c
253
  • merge entries with predecessor and successor if possible
  • avoid code duplication by moving the code below element insertion
This revision is now accepted and ready to land.Sep 27 2024, 11:06 AM
This revision was automatically updated to reflect the committed changes.