aboutsummaryrefslogtreecommitdiff
path: root/hw/tpm/tpm_crb.c
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2018-03-20 16:31:50 -0400
committerStefan Berger <stefanb@linux.vnet.ibm.com>2018-03-21 08:01:03 -0400
commitffbf24bdb223914d5805fef15bfe9c4489868fad (patch)
treeb5ca5c8a2652d9277dc30611b0c8c77609c105f7 /hw/tpm/tpm_crb.c
parentde4a22d0fa775543b340181e496728471382d8fe (diff)
tpm: CRB: query backend for TPM established flag
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_crb.c')
-rw-r--r--hw/tpm/tpm_crb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
index e8c42f6e3d..ef8b80e9aa 100644
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -84,6 +84,12 @@ static uint64_t tpm_crb_mmio_read(void *opaque, hwaddr addr,
unsigned offset = addr & 3;
uint32_t val = *(uint32_t *)regs >> (8 * offset);
+ switch (addr) {
+ case A_CRB_LOC_STATE:
+ val |= !tpm_backend_get_tpm_established_flag(s->tpmbe);
+ break;
+ }
+
trace_tpm_crb_mmio_read(addr, size, val);
return val;