-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various Problems of TPM Simulation on QEMU #354
Comments
Documentation:
Apparently the TPM was not detected because the hardware was never initialized. I patched the source code of coreboot to select the LPC_TPM driver for Q35 board in coreboot, and enabled TPM and measured boot. But the TPM still fails to work.
Any tip on how to initialize the TPM? |
Logs from swtpm.
It looks like coreboot never initialized the TPM but tried to send measurements to the TPM and fails. Do I need to change the devicetree? |
Adding the TPM device to the devicetree doesn't work. Now it's clear that TPM relies on ACPI for autodetection, but coreboot only has an incomplete, almost-nonexistance implementation for QEMU, causing the Linux kernel to disable ACPI therefore TPM is not detected. SeaBIOS implemented most the these ACPI functionality on QEMU so it works. Booting the kernel with I'll continue to debug the problem on the next weekend. |
So it turned out, that the tpm_tis interface simulated by QEMU was identified by Linux kernel, and the kernel even called |
Making TPM working with full coreboot + QEMU emulation seems to be a waste of time, meanwhile one can just run the HEADS image w/o coreboot...
Now the kernel successfully finds /dev/tpm0, but most TPM commands and tpm-reset script doesn't work, because the TPM was in the weird state. It looks like the source of the issue is some serious problems in swtpm. |
It's probably the time to collect some data and report it to stefanberger/swtpm... |
@biergaizi : have you came across this? |
@tlaurion No, I was building swtpm and QEMU by myself, manually, without this automation. But I think this script does the same thing, and it's unlikely to have a difference. |
@biergaizi : that was coreboot < 4.8, right? |
@tlaurion Without coreboot at all, because it doesn't work with coreboot. Instead, it partially works by just booting straight into the HEADS filesystem image with SeaBIOS, Linux kernel can detect TPM without problem, but it is still unusable - somehow, the TPM was being put in a strange state, as I reported. My conclusion was: only a swtpm developer has the knowledge to investigate it. |
@biergaizi Were you successful in your investigation? |
@Thrilleratplay, I think this is what you are looking for |
@biergaizi important breakthrough in code on the safeboot side: |
@tlaurion Perfect. I'll retest it on the new code base and close the bug report if the TPM works. |
Since QEMU 2.11, TPM-related code has been merged and it's now possible to simulate a TPM hardware with swtpm and QEMU.
On SeaBIOS, the TPM is detected and usable under Linux-based system, with kernel module
tpm_tis
, shown as/dev/tpm0
.However, for mysterious reasons, the TPM is only detectable on SeaBIOS, but not HEADS. There's no TPM device under
/dev
, nor any TPM-related information in dmesg. We need to investigate the cause of the issue is an incomplete TPM implemenation in QEMU/swtpm or something else.Having a working TPM-simulation would ease the development significantly.
The text was updated successfully, but these errors were encountered: