Page MenuHomeFreeBSD

bhyve: introduce acpi_device_emul struct
ClosedPublic

Authored by corvink on Mar 29 2023, 1:24 PM.
Tags
None
Referenced Files
F102032797: D39319.diff
Wed, Nov 6, 6:30 PM
Unknown Object (File)
Tue, Nov 5, 2:15 PM
Unknown Object (File)
Mon, Oct 28, 11:03 PM
Unknown Object (File)
Mon, Oct 28, 6:00 PM
Unknown Object (File)
Thu, Oct 17, 5:07 AM
Unknown Object (File)
Wed, Oct 16, 2:32 AM
Unknown Object (File)
Tue, Oct 15, 10:02 PM
Unknown Object (File)
Tue, Oct 15, 6:09 AM

Details

Summary

It'll be easier to add new properties to the ACPI device emulation if we
have a struct which holds all device specific properties. In some future
commits the acpi_device_emul struct will be expanded to include some
device specific functions to build ACPI tables.

Diff Detail

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

Event Timeline

so I assume some ACPI devices will have different emulation than others?

and that the different types of emulation will have emulation specific functions? as opposed to device specific?

usr.sbin/bhyve/acpi_device.c
51–54

should these be asserts?

63–64

does this code compile? looks like deadcode

88–89

also looks like deadcode

usr.sbin/bhyve/qemu_fwcfg.c
386

did fwcfg_sc actually get renamed to sc?

  • remove dead code
  • make use of asserts
  • fix compiling errors
In D39319#895908, @rew wrote:

so I assume some ACPI devices will have different emulation than others?

and that the different types of emulation will have emulation specific functions? as opposed to device specific?

This commit prepares the acpi_device struct to hold some device specific functions. E.g. bhyve has to build a TPM2 table if a TPM is present. IMHO, it's cleaner if we have a device specific function in the acpi_device struct (see D39320) than code like if (vm_has_tpm()) { build_tpm2(); } if (vm_has_xy()) { build_xy(); }. Especially, the content of the ACPI table depends on the TPM interface (like CRB of FIFO). The creating of emulation dependent ACPI tables will be easier with this solution.

This revision is now accepted and ready to land.Apr 3 2023, 6:04 PM
usr.sbin/bhyve/acpi_device.c
41

This comment needs to be updated.

This revision was automatically updated to reflect the committed changes.