summary refs log tree commit diff stats
path: root/hw/tpm
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2017-11-10 22:07:35 -0500
committerStefan Berger <Stefan Berger stefanb@linux.vnet.ibm.com>2017-11-15 06:47:35 -0500
commitad4aca69bbd40663ca93a3eb1d8042c023b9b407 (patch)
tree03d43489d3c2afe503de706c76a8e139d58f7b61 /hw/tpm
parent17b1af773ed81a9167abfa09749ab92bd05740b0 (diff)
downloadfocaccia-qemu-ad4aca69bbd40663ca93a3eb1d8042c023b9b407.tar.gz
focaccia-qemu-ad4aca69bbd40663ca93a3eb1d8042c023b9b407.zip
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')
-rw-r--r--hw/tpm/tpm_tis.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 7402528b25..fec2fc617a 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);
 }