From nobody Thu Nov 27 14:30:58 2025 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dHJl10VsHz6JYG7 for ; Thu, 27 Nov 2025 14:31:09 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.netfence.it (mailserver.netfence.it [78.134.96.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailserver.netfence.it", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dHJkz6K4Yz3hL7 for ; Thu, 27 Nov 2025 14:31:07 +0000 (UTC) (envelope-from ml@netfence.it) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=netfence.it; spf=pass (mx1.freebsd.org: domain of ml@netfence.it designates 78.134.96.152 as permitted sender) smtp.mailfrom=ml@netfence.it Received: from [10.1.2.18] (alamar.local.netfence.it [10.1.2.18]) (authenticated bits=0) by soth.netfence.it (8.18.1/8.17.2) with ESMTPSA id 5AREUwRO063634 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO) for ; Thu, 27 Nov 2025 15:30:58 +0100 (CET) (envelope-from ml@netfence.it) X-Authentication-Warning: soth.netfence.it: Host alamar.local.netfence.it [10.1.2.18] claimed to be [10.1.2.18] Message-ID: <031fe2e6-eae6-4d4a-8bce-cd7eadd0b5a6@netfence.it> Date: Thu, 27 Nov 2025 15:30:58 +0100 List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Andrea Venturoli Subject: bhyve + swtpm + W11 To: freebsd-virtualization@FreeBSD.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Bar: - X-Spamd-Result: default: False [-1.18 / 15.00]; NEURAL_SPAM_LONG(1.00)[1.000]; NEURAL_HAM_MEDIUM(-0.86)[-0.862]; NEURAL_HAM_SHORT(-0.52)[-0.519]; DMARC_POLICY_ALLOW(-0.50)[netfence.it,none]; R_SPF_ALLOW(-0.20)[+ip4:78.134.96.152]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:35612, ipnet:78.134.0.0/17, country:IT]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; RCVD_TLS_ALL(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-virtualization@FreeBSD.org]; FROM_HAS_DN(0.00)[]; HAS_XAW(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 4dHJkz6K4Yz3hL7 Hello. I'm hitting my head on this, but cannot make it work. Is it expected to work or am I just wasting my time? FreeBSD 14.3/amd64 edk2-bhyve-g202308_5 vm-bhyve-1.6.2_1 bye & Thanks av. P.S. In case someone is interested in the details: vmbhyve starts bhyve with: > bhyve options: -c 3,sockets=1,cores=3,threads=1 -m 4G -AHPw -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -l tpm,swtpm,/var/run/swtpm/tpm -k > /zroot/vm/eserver/bhyve.conf -U f753439f-bffa-11e8-b279-a4bf0142162f] > bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/dev/zvol/zroot/vm/eserver/disk0,sectorsize=512 -s 5:0,virtio-net,tap0,mac=58:9c:fc:00:11:65 > -s 6:0,fbuf,tcp=192.168.XXX.1:25900 -s 7:0,xhci,tablet] Windows sees the TPM device but says it cannot be started (code 10) due to a protocol error. In bhyve.log I see: > /tmp/bhyve.z4HOkg5 873: OperationRegion(TPP1, SystemMemory, Add(0xfed45000, Arg0), One) > Remark 2173 - ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_S > B.TPM.TPFN) > > /tmp/bhyve.z4HOkg5 895: Method(_DSM, 4, Serialized) > Warning 3115 - ^ Not all control paths return a value (\_SB.TPM._DSM) > > /tmp/bhyve.z4HOkg5 895: Method(_DSM, 4, Serialized) > Warning 3107 - ^ Reserved method must return a value (Integer/String/Buffer/Package/Reference required for _DSM) > > /tmp/bhyve.z4HOkg5 985: If(LEqual(Arg0, ToUUID("376054ED-CC13-4675-901C-4756D7F2D45D"))) /* UUID */ > Remark 2184 - Unknown UUID string ^ > > bhyve: tpm_swtpm_execute_cmd: rsp read failed (bytes read: 4 / 3968): No error: 0 > bhyve: tpm_crb_mem_handler: cancelling a TPM command is not implemented yet > bhyve: tpm_swtpm_execute_cmd: rsp read failed (bytes read: 4 / 3968): No error: 0 > bhyve: tpm_crb_mem_handler: cancelling a TPM command is not implemented yet > bhyve: tpm_swtpm_execute_cmd: rsp read failed (bytes read: 4 / 3968): No error: 0 In swtpm logs: > Ctrl Cmd: length 12 > 80 01 00 00 00 0C 00 00 01 44 00 00 > Error: Unknown command: 0x80010000 > Ctrl Rsp: length 4 > 00 00 00 0A > Ctrl Cmd: length 22 > 80 01 00 00 00 16 00 00 01 7A 00 00 00 06 00 00 > 01 00 00 00 00 2A > Error: Unknown command: 0x80010000 > Ctrl Rsp: length 4 > 00 00 00 0A > Ctrl Cmd: length 22 > 80 01 00 00 00 16 00 00 01 7A 00 00 00 06 00 00 > 01 00 00 00 00 2A > Error: Unknown command: 0x80010000 > Ctrl Rsp: length 4 > 00 00 00 0A This looks possibly like: > https://github.com/stefanberger/swtpm/issues/1069 That's for a different platform however and I have no idea how to "port" those info to bhyve. I have no previous experiences with swtpm (and I find it hard to get a good howto/tutorial); TPM passthrough works for me (but obviously not on machines without TPM).