Commit Graph

7 Commits

Author SHA1 Message Date
Corvin Köhne
0daf5f02cf
bhyve/tpm: create crb thread for sending tpm commands
Commands send to a tpm are very slow. They can take up to several
seconds for completion. For that reason, create a thread which issues
the commands to the tpm device.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40458
2023-06-20 10:59:00 +02:00
Corvin Köhne
5ea98d3268
bhyve/tpm: build TPM2 table by tpm interface
Each tpm has a device specific table. Which table a tpm uses depends on
the tpm interface.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40457
2023-06-20 10:58:55 +02:00
Corvin Köhne
0917f925b4
bhyve: add basic CRB interface for TPM devices
Add a basic emulation for the command and response buffer interface of
TPM devices. This commit only implements some CRB register and resets
them.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40456
2023-06-16 08:22:53 +02:00
Corvin Köhne
e097785758
bhyve: add basic TPM emulation struct
This struct will be used to implement various TPM emulations like a TPM
passthrough or a virtual TPM.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40454
2023-06-16 08:18:39 +02:00
Corvin Köhne
b3564c2337
bhyve: use assert for missing TPM version
The TPM version config node should always be set. If it's not set,
there's a bug in our code. An assertion is the correct way to check for
this.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40558
2023-06-16 08:18:08 +02:00
Corvin Köhne
dece4f2d87
bhyve: register TPM device as ACPI device
The TPM device is an ACPI device with some custom ACPI tables.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40453
2023-06-12 13:04:37 +02:00
Corvin Köhne
d5edf13d01
bhyve: add basic TPM device
Add an empty TPM device struct which will be used for TPM emulation in
subsequent commits.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40452
2023-06-12 13:04:35 +02:00