From 75909086a45da3c5aeaff8152728111cf798c6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corvin=20K=C3=B6hne?= Date: Thu, 2 Apr 2026 08:36:40 +0200 Subject: [PATCH] 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 --- usr.sbin/bhyve/tpm_intf_crb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/tpm_intf_crb.c b/usr.sbin/bhyve/tpm_intf_crb.c index 9b44d1d133b..d571e89bb5a 100644 --- a/usr.sbin/bhyve/tpm_intf_crb.c +++ b/usr.sbin/bhyve/tpm_intf_crb.c @@ -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