Lines Matching full:tpm

2  *  Emulator TPM driver
44 #include "qapi/qapi-visit-tpm.h"
49 #define TYPE_TPM_EMULATOR "tpm-emulator"
56 /* blobs from the TPM; part of VM state when migrating */
75 uint32_t caps; /* capabilities of the TPM */
96 /* TPM 1.2 error codes */
107 /* TPM 2 error codes */
125 static int tpm_emulator_ctrlcmd(TPMEmulator *tpm, unsigned long cmd, void *msg, in tpm_emulator_ctrlcmd() argument
129 CharBackend *dev = &tpm->ctrl_chr; in tpm_emulator_ctrlcmd()
134 WITH_QEMU_LOCK_GUARD(&tpm->mutex) { in tpm_emulator_ctrlcmd()
228 error_setg(errp, "tpm-emulator: could not set locality : %s", in tpm_emulator_set_locality()
235 error_setg(errp, "tpm-emulator: TPM result for set locality : 0x%x", in tpm_emulator_set_locality()
267 error_report("tpm-emulator: probing failed : %s", strerror(errno)); in tpm_emulator_probe_caps()
281 const char *tpm = NULL; in tpm_emulator_check_caps() local
289 tpm = "1.2"; in tpm_emulator_check_caps()
295 tpm = "2"; in tpm_emulator_check_caps()
298 error_report("tpm-emulator: TPM version has not been set"); in tpm_emulator_check_caps()
303 error_report("tpm-emulator: TPM does not implement minimum set of " in tpm_emulator_check_caps()
304 "required capabilities for TPM %s (0x%x)", tpm, (int)caps); in tpm_emulator_check_caps()
318 error_report("tpm-emulator: Could not stop TPM: %s", in tpm_emulator_stop_tpm()
325 error_report("tpm-emulator: TPM result for CMD_STOP: 0x%x %s", res, in tpm_emulator_stop_tpm()
347 error_report("tpm-emulator: Could not lock storage within 3 seconds: " in tpm_emulator_lock_storage()
354 error_report("tpm-emulator: TPM result for CMD_LOCK_STORAGE: 0x%x %s", in tpm_emulator_lock_storage()
379 error_report("tpm-emulator: Could not set buffer size: %s", in tpm_emulator_set_buffer_size()
386 error_report("tpm-emulator: TPM result for set buffer size : 0x%x %s", in tpm_emulator_set_buffer_size()
427 error_report("tpm-emulator: could not send INIT: %s", in tpm_emulator_startup_tpm_resume()
434 error_report("tpm-emulator: TPM result for CMD_INIT: 0x%x %s", res, in tpm_emulator_startup_tpm_resume()
446 /* TPM startup will be done from post_load hook */ in tpm_emulator_startup_tpm()
470 error_report("tpm-emulator: Could not get the TPM established flag: %s", in tpm_emulator_get_tpm_established_flag()
489 /* only a TPM 2.0 will support this */ in tpm_emulator_reset_tpm_established_flag()
499 error_report("tpm-emulator: Could not reset the establishment bit: %s", in tpm_emulator_reset_tpm_established_flag()
507 "tpm-emulator: TPM result for rest established flag: 0x%x %s", in tpm_emulator_reset_tpm_established_flag()
530 error_report("tpm-emulator: Could not cancel command: %s", in tpm_emulator_cancel_cmd()
533 error_report("tpm-emulator: Failed to cancel TPM: 0x%x", in tpm_emulator_cancel_cmd()
564 "Migration disabled: TPM emulator does not support " in tpm_emulator_block_migration()
582 error_report("tpm-emulator: Failed to create socketpair"); in tpm_emulator_prepare_data_fd()
590 error_report("tpm-emulator: Failed to send CMD_SET_DATAFD: %s", in tpm_emulator_prepare_data_fd()
597 error_prepend(&err, "tpm-emulator: Failed to create io channel: "); in tpm_emulator_prepare_data_fd()
620 error_report("tpm-emulator: parameter 'chardev' is missing"); in tpm_emulator_handle_device_opts()
626 error_report("tpm-emulator: tpm chardev '%s' not found", value); in tpm_emulator_handle_device_opts()
631 error_prepend(&err, "tpm-emulator: No valid chardev found at '%s':", in tpm_emulator_handle_device_opts()
648 error_report("'%s' is not emulating TPM device. Error: %s", in tpm_emulator_handle_device_opts()
711 * Transfer a TPM state blob from the TPM into a provided buffer.
739 error_report("tpm-emulator: could not get state blob type %d : %s", in tpm_emulator_get_state_blob()
746 error_report("tpm-emulator: Getting the stateblob (type %d) failed " in tpm_emulator_get_state_blob()
747 "with a TPM error 0x%x %s", type, res, in tpm_emulator_get_state_blob()
755 error_report("tpm-emulator: Expecting to read %u bytes " in tpm_emulator_get_state_blob()
765 error_report("tpm-emulator: Out of memory allocating %u bytes", in tpm_emulator_get_state_blob()
772 error_report("tpm-emulator: Could not read stateblob (type %d); " in tpm_emulator_get_state_blob()
812 * Transfer a TPM state blob to the TPM emulator.
815 * @type: the type of TPM state blob to transfer
816 * @tsb: TPMSizedBuffer containing the TPM state blob
817 * @flags: Flags describing the (encryption) state of the TPM state blob
841 error_report("tpm-emulator: could not set state blob type %d : %s", in tpm_emulator_set_state_blob()
849 error_report("tpm-emulator: Writing the stateblob (type %d) " in tpm_emulator_set_state_blob()
859 error_report("tpm-emulator: Reading response from writing stateblob " in tpm_emulator_set_state_blob()
867 error_report("tpm-emulator: Setting the stateblob (type %d) failed " in tpm_emulator_set_state_blob()
868 "with a TPM error 0x%x %s", type, tpm_result, in tpm_emulator_set_state_blob()
879 * Set all the TPM state blobs.
891 trace_tpm_emulator_set_state_blobs_error("Could not stop TPM"); in tpm_emulator_set_state_blobs()
922 /* get the state blobs from the TPM */ in tpm_emulator_pre_save()
947 * Load the TPM state blobs into the TPM.
969 .name = "tpm-emulator",
1013 * Gracefully shut down the external TPM
1026 error_report("tpm-emulator: Could not cleanly shutdown the TPM: %s", in tpm_emulator_shutdown()
1029 error_report("tpm-emulator: TPM result for shutdown: 0x%x %s", in tpm_emulator_shutdown()
1065 tbc->desc = "TPM emulator backend driver"; in tpm_emulator_class_init()