Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157026791
D40453.id122920.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
890 B
Referenced Files
None
Subscribers
None
D40453.id122920.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D40453: bhyve: register TPM device as ACPI device
Attached
Detach File
Event Timeline
Log In to Comment