Page MenuHomeFreeBSD

bhyve: add basic E820 implementation
ClosedPublic

Authored by corvink on Apr 13 2023, 7:08 AM.
Tags
None
Referenced Files
F86905381: D39545.id120459.diff
Thu, Jun 27, 7:24 AM
Unknown Object (File)
Thu, Jun 20, 11:32 AM
Unknown Object (File)
Apr 29 2024, 2:24 AM
Unknown Object (File)
Apr 23 2024, 4:35 PM
Unknown Object (File)
Apr 23 2024, 4:34 PM
Unknown Object (File)
Apr 23 2024, 4:34 PM
Unknown Object (File)
Apr 23 2024, 4:34 PM
Unknown Object (File)
Apr 23 2024, 4:16 PM
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 50874
Build 47765: arc lint + arc unit

Event Timeline

usr.sbin/bhyve/e820.c
2

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

44

int would be a more natural type to use here.

79
94
103
128

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

185
usr.sbin/bhyve/e820.h
21

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.