Page MenuHomeFreeBSD

bhyve: add basic E820 implementation
ClosedPublic

Authored by corvink on Apr 13 2023, 7:08 AM.
Tags
None
Referenced Files
F102924034: D39545.diff
Mon, Nov 18, 7:30 PM
Unknown Object (File)
Sun, Nov 17, 9:58 AM
Unknown Object (File)
Sat, Nov 16, 8:40 AM
Unknown Object (File)
Wed, Nov 13, 7:30 AM
Unknown Object (File)
Sun, Nov 10, 12:15 AM
Unknown Object (File)
Thu, Nov 7, 1:41 PM
Unknown Object (File)
Wed, Nov 6, 2:26 PM
Unknown Object (File)
Mon, Nov 4, 11:27 AM
Subscribers

Details

Summary

There are some use cases where bhyve has to prepare some special memory
regions. E.g. GPU passthrough for Intel integrated graphic devices needs
to reserve some memory for the graphic device. So, bhyve has to inform
the guest about those memory regions. This information can be passed by
the qemu fwcfg interface. As qemu creates an E820 table, we can reuse
the existing fwcfg item "etc/e820".

This commit is the first one of a series. It only adds a basic
implementation for the creation of the E820 table. Some subsequent
commits will add more items to the E820 table and register it as fwcfg
item.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 50956
Build 47847: arc lint + arc unit

Event Timeline

usr.sbin/bhyve/e820.c
3

I think we're supposed to stop specifying BSD-2-Clause-FreeBSD in new code. It can just be BSD-2-Clause.

45

int would be a more natural type to use here.

80
95
104
129

Should this be an errno value? Or even an assertion instead?

186
usr.sbin/bhyve/e820.h
22

It is nicer (IMO) and much more common to use the __packed attribute.

  • fix style issues
  • add helper to allocate a e820_element
This revision is now accepted and ready to land.Apr 24 2023, 3:15 PM
This revision was automatically updated to reflect the committed changes.