qemu/backends/tpm
Stefan Berger 99bdcd2cc2 tpm_emulator: Have swtpm relock storage upon migration fall-back
Swtpm may release the lock once the last one of its state blobs has been
migrated out. In case of VM migration failure QEMU now needs to notify
swtpm that it should again take the lock, which it can otherwise only do
once it has received the first TPM command from the VM.

Only try to send the lock command if swtpm supports it. It will not have
released the lock (and support shared storage setups) if it doesn't
support the locking command since the functionality of releasing the lock
upon state blob reception and the lock command were added to swtpm
'together'.

If QEMU sends the lock command and the storage has already been locked
no error is reported.

If swtpm does not receive the lock command (from older version of QEMU),
it will lock the storage once the first TPM command has been received. So
sending the lock command is an optimization.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20220912174741.1542330-3-stefanb@linux.ibm.com
2022-09-13 10:27:17 -04:00
..
Kconfig
meson.build configure, meson: move TPM check to meson 2022-02-21 10:35:53 +01:00
tpm_backend.c
tpm_emulator.c tpm_emulator: Have swtpm relock storage upon migration fall-back 2022-09-13 10:27:17 -04:00
tpm_int.h
tpm_ioctl.h tpm_emulator: Use latest tpm_ioctl.h from swtpm project 2022-09-13 10:27:17 -04:00
tpm_passthrough.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
tpm_util.c qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr() 2020-12-18 15:20:18 -05:00
trace-events tpm_emulator: Have swtpm relock storage upon migration fall-back 2022-09-13 10:27:17 -04:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00