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)
Tue, Dec 3, 9:01 AM
Unknown Object (File)
Tue, Dec 3, 9:01 AM
Unknown Object (File)
Tue, Dec 3, 9:00 AM
Unknown Object (File)
Tue, Dec 3, 9:00 AM
Unknown Object (File)
Fri, Nov 29, 2:22 PM
Unknown Object (File)
Fri, Nov 29, 2:05 PM
Unknown Object (File)
Nov 23 2024, 11:23 PM
Unknown Object (File)
Nov 22 2024, 8:52 PM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 58972
Build 55859: arc lint + arc unit

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.