Skip to content

Various Problems of TPM Simulation on QEMU #354

@biergaizi

Description

@biergaizi

Since QEMU 2.11, TPM-related code has been merged and it's now possible to simulate a TPM hardware with swtpm and QEMU.

swtpm socket --tpmstate dir=/tmp/mytpm1 \
             --ctrl type=unixio,path=/tmp/mytpm1/swtpm-sock  \
             --log level=20 &

qemu-system-x86_64  -machine q35 -display sdl \
                    -bios bios-256k.bin -boot menu=on \
                    -chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock \
                    -tpmdev emulator,id=tpm0,chardev=chrtpm \
                    -device tpm-tis,tpmdev=tpm0 \
                    alpine-standard-3.7.0-x86_64.iso

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions