On Fri, Nov 10, 2017 at 3:11 PM, Stefan Berger
<address@hidden> wrote:
Introduce a lock and a condition to notify anyone waiting for the completion
of the execution of a TPM command by the backend (thread). The backend
uses the condition to signal anyone waiting for command completion.
We need to place the condition in two locations: one is invoked by the
backend thread, the other by the bottom half thread.
We will use the signaling to wait for command completion before VM
suspend.
Signed-off-by: Stefan Berger <address@hidden>
---
hw/tpm/tpm_tis.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 035c6ef..86e9a92 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -80,6 +80,9 @@ typedef struct TPMState {
TPMVersion be_tpm_version;
size_t be_buffer_size;
+
+ QemuMutex state_lock;
+ QemuCond cmd_complete;
Looks like the cond is unused in the following patches.