Page MenuHomeFreeBSD

bhyve: add basic E820 implementation
ClosedPublic

Authored by corvink on Apr 13 2023, 7:08 AM.
Tags
None
Referenced Files
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
Unknown Object (File)
Mar 21 2024, 4:44 AM
Unknown Object (File)
Jan 26 2024, 6:58 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 Not Applicable
Unit
Tests Not Applicable

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.