Page MenuHomeFreeBSD

D40453.id122920.diff
No OneTemporary

D40453.id122920.diff

diff --git a/usr.sbin/bhyve/tpm_device.c b/usr.sbin/bhyve/tpm_device.c
--- a/usr.sbin/bhyve/tpm_device.c
+++ b/usr.sbin/bhyve/tpm_device.c
@@ -13,11 +13,21 @@
#include <string.h>
#include <vmmapi.h>
+#include "acpi_device.h"
#include "config.h"
#include "tpm_device.h"
+#define TPM_ACPI_DEVICE_NAME "TPM"
+#define TPM_ACPI_HARDWARE_ID "MSFT0101"
+
struct tpm_device {
struct vmctx *vm_ctx;
+ struct acpi_device *acpi_dev;
+};
+
+static const struct acpi_device_emul tpm_acpi_device_emul = {
+ .name = TPM_ACPI_DEVICE_NAME,
+ .hid = TPM_ACPI_HARDWARE_ID,
};
void
@@ -26,6 +36,7 @@
if (dev == NULL)
return;
+ acpi_device_destroy(dev->acpi_dev);
free(dev);
}
@@ -57,6 +68,11 @@
dev->vm_ctx = vm_ctx;
+ error = acpi_device_create(&dev->acpi_dev, dev, dev->vm_ctx,
+ &tpm_acpi_device_emul);
+ if (error)
+ goto err_out;
+
*new_dev = dev;
return (0);

File Metadata

Mime Type
text/plain
Expires
Tue, May 19, 12:44 AM (15 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33280565
Default Alt Text
D40453.id122920.diff (890 B)

Event Timeline