Testing on a bare-metal Intel TDX machine and encountered issues while attempting to use TPM passthrough for a guest OS.
Environment Details:
• Hardware: Bare-metal Intel TDX machine.
• Software: Using QEMU with Intel TDX-enabled support.
• Documentation: Followed the Intel TDX documentation provided.
• Objective: Test TPM passthrough and use tpm2-tools to read and update PCR values.
Steps Taken:
• Created an Intel TDX guest OS and used the run_td.sh script to launch it.
• Successfully created and logged into the Guest VM.
• Attempted to run tpm2-tools (e.g., tpm2_pcrread) inside the Guest OS but encountered the following error:
ERROR:tcti:src/tss2-tcti/tcti-device.c:451:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tpmrm0: No such file or directory
Updated the run_td.sh script to modify the qemu-system-x86_64 command with TPM passthrough options:
Issue:
• After updating the QEMU command for TPM passthrough:
• The VM was created, but I could no longer connect to it.
• Logs showed the following errors:
Expected Behavior:
• The TPM device should be successfully passed through to the Guest OS.
• The Guest OS should be able to detect /dev/tpmrm0 or /dev/tpm0 and allow tpm2-tools to execute.
Additional Information:
• The /dev/tpm0 device is present on the host machine and functional.
• No issues observed when running tpm2-tools directly on the host machine.
Request:
1. Assistance in debugging the “KVM run failed” error when using the TPM passthrough configuration.
2. Guidance on ensuring /dev/tpm0 and /dev/tpmrm0 are successfully passed to the Guest OS and accessible.
3. Suggestions for any missing configurations or updates required for Intel TDX environments.
● qgsd.service - Intel(R) TD Quoting Generation Service
Loaded: loaded (/usr/lib/systemd/system/qgsd.service; enabled; preset: enabled)
Active: active (running) since Thu 2024-10-17 06:15:53 UTC; 4 weeks 1 day ago
Main PID: 45891 (qgs)
Tasks: 5 (limit: 617857)
Memory: 640.0K (peak: 3.1M)
CPU: 43ms
CGroup: /system.slice/qgsd.service
└─45891 /usr/bin/qgs
Oct 17 06:15:53 b49691f5dc3c qgsd[45891]: Added signal handler
Oct 17 06:15:53 b49691f5dc3c qgsd[45891]: About to create QgsServer with num_thread = 4
Oct 17 06:15:53 b49691f5dc3c qgsd[45891]: About to start main loop
Oct 17 06:15:53 b49691f5dc3c systemd[1]: Started qgsd.service - Intel(R) TD Quoting Generation Service.
PCCS service status
● pccs.service - Provisioning Certificate Caching Service (PCCS)
Loaded: loaded (/usr/lib/systemd/system/pccs.service; enabled; preset: enabled)
Active: active (running) since Thu 2024-10-17 06:15:53 UTC; 4 weeks 1 day ago
Docs: https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/master/QuoteGeneration/pccs/README.md
Main PID: 45805 (node)
Tasks: 15 (limit: 617857)
Memory: 56.9M (peak: 61.8M)
CPU: 12.451s
CGroup: /system.slice/pccs.service
└─45805 /usr/bin/node /opt/intel/sgx-dcap-pccs/pccs_server.js
Nov 14 01:00:01 b49691f5dc3c node[45805]: 2024-11-14 01:00:01.095 [info]: Request-ID is : d44fcdd3c6834f54b1a2cc14732dc86c
Nov 14 01:00:01 b49691f5dc3c node[45805]: 2024-11-14 01:00:01.477 [info]: Request-ID is : 4b485b76770b490cb280b80b83ffc723
Nov 14 01:00:01 b49691f5dc3c node[45805]: 2024-11-14 01:00:01.812 [info]: Request-ID is : a1ed0b57e14d4b87b44fcf67473dd7b2
Nov 14 01:00:01 b49691f5dc3c node[45805]: 2024-11-14 01:00:01.908 [info]: Scheduled cache refresh is completed successfully.
Nov 15 01:00:00 b49691f5dc3c node[45805]: 2024-11-15 01:00:00.403 [info]: Request-ID is : f681bb56a7cd472f9e978f2a9adac2cf
Nov 15 01:00:00 b49691f5dc3c node[45805]: 2024-11-15 01:00:00.715 [info]: Request-ID is : ac32a3f45be2433889baacc438357da1
Nov 15 01:00:01 b49691f5dc3c node[45805]: 2024-11-15 01:00:01.056 [info]: Request-ID is : ac32d8c9c95d4b79b4f1a62edf3bd45a
Nov 15 01:00:01 b49691f5dc3c node[45805]: 2024-11-15 01:00:01.381 [info]: Request-ID is : 96ae4554523f4f1482881dc28915b0f7
Nov 15 01:00:01 b49691f5dc3c node[45805]: 2024-11-15 01:00:01.736 [info]: Request-ID is : 3c186bc6266d41b48ee5004bf642cb63
Nov 15 01:00:01 b49691f5dc3c node[45805]: 2024-11-15 01:00:01.826 [info]: Scheduled cache refresh is completed successfully.
MPA registration logs (last 30 lines)
[15-08-2024 08:08:58] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 08:08:58] INFO: Finished Registration Agent Flow.
[15-08-2024 08:14:42] INFO: SGX Registration Agent version: 1.20.100.2
[15-08-2024 08:14:42] INFO: Starts Registration Agent Flow.
[15-08-2024 08:14:42] INFO: SGX MP Server configuration flag indicates that Registration Server won't save encrypted platform keys.
[15-08-2024 08:14:42] INFO: Platform registration request (PLATFORM_MANIFEST) won't be send to Registration Server.
[15-08-2024 08:14:42] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 08:14:42] INFO: Finished Registration Agent Flow.
[15-08-2024 09:00:04] INFO: SGX Registration Agent version: 1.20.100.2
[15-08-2024 09:00:04] INFO: Starts Registration Agent Flow.
[15-08-2024 09:00:04] INFO: SGX MP Server configuration flag indicates that Registration Server won't save encrypted platform keys.
[15-08-2024 09:00:04] INFO: Platform registration request (PLATFORM_MANIFEST) won't be send to Registration Server.
[15-08-2024 09:00:04] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 09:00:04] INFO: Finished Registration Agent Flow.
[15-08-2024 09:11:42] INFO: SGX Registration Agent version: 1.20.100.2
[15-08-2024 09:11:42] INFO: Starts Registration Agent Flow.
[15-08-2024 09:11:42] INFO: SGX MP Server configuration flag indicates that Registration Server won't save encrypted platform keys.
[15-08-2024 09:11:42] INFO: Platform registration request (PLATFORM_MANIFEST) won't be send to Registration Server.
[15-08-2024 09:11:42] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 09:11:42] INFO: Finished Registration Agent Flow.
[15-08-2024 09:17:51] INFO: SGX Registration Agent version: 1.20.100.2
[15-08-2024 09:17:51] INFO: Starts Registration Agent Flow.
[15-08-2024 09:17:51] INFO: SGX MP Server configuration flag indicates that Registration Server won't save encrypted platform keys.
[15-08-2024 09:17:51] INFO: Platform registration request (PLATFORM_MANIFEST) won't be send to Registration Server.
[15-08-2024 09:17:51] INFO: Please use management tool or PCKCertIDRetrievalTool to read PLATFORM_MANIFEST.
[15-08-2024 09:17:51] INFO: Finished Registration Agent Flow.
[16-10-2024 02:56:33] INFO: SGX Registration Agent version: 1.20.100.2
[16-10-2024 02:56:33] INFO: Starts Registration Agent Flow.
[16-10-2024 02:56:59] INFO: Registration Flow - PLATFORM_ESTABLISHMENT or TCB_RECOVERY passed successfully.
[16-10-2024 02:56:59] INFO: Finished Registration Agent Flow.
Testing on a bare-metal Intel TDX machine and encountered issues while attempting to use TPM passthrough for a guest OS.
ERROR:tcti:src/tss2-tcti/tcti-device.c:451:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file /dev/tpmrm0: No such file or directory
Updated the run_td.sh script to modify the qemu-system-x86_64 command with TPM passthrough options:
-tpmdev passthrough,id=tpm0,path=/dev/tpm0,cancel-path=/dev/tpmrm0 -device tpm-tis,tpmdev=tpm0
error: kvm run failed Bad address EAX=00000000 EBX=00000000 ECX=00000000 EDX=000806f8 ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000 EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0000 00000000 0000ffff 00009300 CS =f000 ffff0000 0000ffff 00009b00 SS =0000 00000000 0000ffff 00009300 DS =0000 00000000 0000ffff 00009300 FS =0000 00000000 0000ffff 00009300 GS =0000 00000000 0000ffff 00009300 LDT=0000 00000000 0000ffff 00008200 TR =0000 00000000 0000ffff 00008b00 GDT= 00000000 0000ffff IDT= 00000000 0000ffff CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400 EFER=0000000000000000 Code=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??
Request:
System-Report:
Git ref
Operating system details
Kernel version
TDX kernel logs
TDX CPU instruction support
Model specific registers (MSRs)
CPU details
QEMU package details
Libvirt package details
OVMF package details
sgx-dcap-pccs package details
tdx-qgs package details
sgx-ra-service package details
sgx-pck-id-retrieval-tool package details
QGSD service status
PCCS service status
MPA registration logs (last 30 lines)