bhyve: allow read/write to full CRB buffer

For some reason, we've incorrectly calculated the size of the CRB data buffer
register. There's no need to divide the CRB data buffer size by 4. We should
allow access to the whole buffer instead.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Pull Request:		https://github.com/freebsd/freebsd-src/pull/2169
This commit is contained in:
Corvin Köhne
2026-04-02 08:36:40 +02:00
parent 713b4ce8ef
commit 75909086a4
+1 -1
View File
@@ -414,7 +414,7 @@ tpm_crb_mem_handler(struct vcpu *vcpu __unused, const int dir,
4:
case offsetof(struct tpm_crb_regs,
data_buffer) ... offsetof(struct tpm_crb_regs, data_buffer) +
TPM_CRB_DATA_BUFFER_SIZE / 4:
sizeof(((struct tpm_crb_regs *)NULL)->data_buffer) - 1:
/*
* Those fields are used to execute a TPM command. The
* crb_thread will access them. For that reason, we have