From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Stefan Berger <stefanb@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PULL v1 4/4] tpm: CRB: query backend for TPM established flag
Date: Wed, 21 Mar 2018 08:07:51 -0400 [thread overview]
Message-ID: <1521634071-16519-5-git-send-email-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <1521634071-16519-1-git-send-email-stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/tpm/tpm_crb.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
index e8c42f6..ef8b80e 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;
--
2.5.5
next prev parent reply other threads:[~2018-03-21 12:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-21 12:07 [Qemu-devel] [PULL v1 0/4] Merge tpm 2018/03/21 Stefan Berger
2018-03-21 12:07 ` [Qemu-devel] [PULL v1 1/4] tpm: CRB: Set tpmRegValidSts flag to '1' in device reset Stefan Berger
2018-03-21 12:07 ` [Qemu-devel] [PULL v1 2/4] tpm: CRB: set registers to 0 by default Stefan Berger
2018-03-21 12:07 ` [Qemu-devel] [PULL v1 3/4] tpm: CRB: reset locAssigned upon relinquishing locality Stefan Berger
2018-03-21 12:07 ` Stefan Berger [this message]
2018-03-22 13:15 ` [Qemu-devel] [PULL v1 0/4] Merge tpm 2018/03/21 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521634071-16519-5-git-send-email-stefanb@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).