Commit Graph

6 Commits

Author SHA1 Message Date
Corvin Köhne
28dc1aa733
bhyve: add emulation for CRB register of TPM devices
Trap accesses to the CRB MMIO range and emulate them properly.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40459
2023-08-10 09:23:33 +02:00
Corvin Köhne
f0124ab111
bhyve: do not hold CRB mutex when executing TPM commands
TPM commands can take up to several seconds to execute. If we hold the
CRB mutex while executing the command, MMIO accesses could be blocked
for a long time. Therefore, just copy all required values and work on
the copied values.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40724
2023-07-25 08:50:23 +02:00
Warner Losh
ccfc9600ce Replace BSD-2-Clause-FreeBSD with BSD-2-Clause
Sponsored by:		Netflix
2023-06-22 20:51:22 -06:00
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