diff options
author | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2017-11-10 22:07:35 -0500 |
---|---|---|
committer | Stefan Berger <Stefan Berger stefanb@linux.vnet.ibm.com> | 2017-11-15 06:47:35 -0500 |
commit | ad4aca69bbd40663ca93a3eb1d8042c023b9b407 (patch) | |
tree | 03d43489d3c2afe503de706c76a8e139d58f7b61 /hw/tpm/tpm_tis.c | |
parent | 17b1af773ed81a9167abfa09749ab92bd05740b0 (diff) | |
download | qemu-ad4aca69bbd40663ca93a3eb1d8042c023b9b407.zip qemu-ad4aca69bbd40663ca93a3eb1d8042c023b9b407.tar.gz qemu-ad4aca69bbd40663ca93a3eb1d8042c023b9b407.tar.bz2 |
tpm_tis: Return TPM_VERSION_UNSPEC in case of BE failure
In case the backend has a failure, such as the tpm_emulator's CMD_INIT
failing, the TIS goes into failure mode and does not respond to reads
or writes to MMIO registers. In this case we need to prevent the ACPI
table from being added and the straight-forward way is to indicate that
there's no known TPM version being used.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'hw/tpm/tpm_tis.c')
-rw-r--r-- | hw/tpm/tpm_tis.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 7402528..fec2fc6 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -1008,6 +1008,10 @@ TPMVersion tpm_tis_get_tpm_version(Object *obj) { TPMState *s = TPM(obj); + if (tpm_backend_had_startup_error(s->be_driver)) { + return TPM_VERSION_UNSPEC; + } + return tpm_backend_get_tpm_version(s->be_driver); } |