Page MenuHomeFreeBSD

bhyve: introduce acpi_device_emul struct
ClosedPublic

Authored by corvink on Mar 29 2023, 1:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 3, 12:29 PM
Unknown Object (File)
Jan 3 2024, 1:02 AM
Unknown Object (File)
Dec 20 2023, 7:56 AM
Unknown Object (File)
Aug 2 2023, 5:19 PM
Unknown Object (File)
Jun 24 2023, 7:26 AM
Unknown Object (File)
Jun 24 2023, 3:42 AM
Unknown Object (File)
Jun 16 2023, 3:50 AM
Unknown Object (File)
Jun 3 2023, 5:08 PM

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.