From nobody Wed Nov 26 13:56:17 2025 X-Original-To: emulation@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 4dGh1Z3CpCz6J5wF for ; Wed, 26 Nov 2025 13:56:34 +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 4dGh1X6LVKz4Q0M for ; Wed, 26 Nov 2025 13:56:32 +0000 (UTC) (envelope-from ml@netfence.it) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netfence.it header.s=202510 header.b=FyRMbEIT; 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 [192.168.134.78] (mailserver.fabbrievecchi.it [151.78.240.82]) (authenticated bits=0) by soth.netfence.it (8.18.1/8.17.2) with ESMTPSA id 5AQDuHpi032363 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO) for ; Wed, 26 Nov 2025 14:56:18 +0100 (CET) (envelope-from ml@netfence.it) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfence.it; s=202510; t=1764165384; bh=ec6SUFo7C+STSjHg1TDhk7kpunUfgmxRSmlnQK/gUos=; h=Date:To:From:Subject; b=FyRMbEITxL2oSYDNPy/hMixBDCStbjciJAzyj2BaGqseAkeUvdAcGepDrDdbV1YOA vW/qbrqbl59eJdCnApz3pVmYLscQAuHTa3U9H8FzU8V3zr7aRhwaEl4rIU46ro8/+B u+hq54Q8HtxiR8/CtjQ+TDfF3btB+3ddmuJvZBms= X-Authentication-Warning: soth.netfence.it: Host mailserver.fabbrievecchi.it [151.78.240.82] claimed to be [192.168.134.78] Message-ID: <7151174b-3df4-46a2-94bb-fa58bd291a01@netfence.it> Date: Wed, 26 Nov 2025 14:56:17 +0100 List-Id: Development of Emulators of other operating systems List-Archive: https://lists.freebsd.org/archives/freebsd-emulation List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-emulation@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: emulation@FreeBSD.org From: Andrea Venturoli Subject: bhyve + swtpm + W11 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.86 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.16 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[netfence.it,none]; R_DKIM_ALLOW(-0.20)[netfence.it:s=202510]; R_SPF_ALLOW(-0.20)[+ip4:78.134.96.152]; NEURAL_HAM_SHORT(-0.16)[-0.158]; MIME_GOOD(-0.10)[text/plain]; DKIM_TRACE(0.00)[netfence.it:+]; HAS_XAW(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_ONE(0.00)[1]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:35612, ipnet:78.134.0.0/17, country:IT]; TO_DN_NONE(0.00)[]; MLMMJ_DEST(0.00)[emulation@FreeBSD.org]; PREVIOUSLY_DELIVERED(0.00)[emulation@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: 4dGh1X6LVKz4Q0M 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).