qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] tpm: Split off tpm_crb_reset function


From: Stefan Berger
Subject: Re: [Qemu-devel] [PATCH 1/2] tpm: Split off tpm_crb_reset function
Date: Thu, 1 Feb 2018 19:59:39 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 02/01/2018 06:23 PM, Stefan Berger wrote:
Split off the tpm_crb_reset function part from tpm_crb_realize
that we need to run every time the machine resets.

Signed-off-by: Stefan Berger <address@hidden>
---
  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 687d255..624e2e9 100644
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -232,6 +232,11 @@ static void tpm_crb_realize(DeviceState *dev, Error **errp)
          TPM_CRB_ADDR_BASE, &s->mmio);
      memory_region_add_subregion(get_system_memory(),
          TPM_CRB_ADDR_BASE + sizeof(s->regs), &s->cmdmem);
+}
+
+static void tpm_crb_reset(DeviceState *dev)
+{
+    CRBState *s = CRB(dev);

      tpm_backend_reset(s->tpmbe);

@@ -274,6 +279,7 @@ static void tpm_crb_class_init(ObjectClass *klass, void 
*data)

      dc->realize = tpm_crb_realize;
      dc->props = tpm_crb_properties;
+    dc->reset = tpm_crb_reset;
      dc->vmsd  = &vmstate_tpm_crb;
      dc->user_creatable = true;
      tc->model = TPM_MODEL_TPM_CRB;


So this splt-off unfortunately causes the tpm-crb-test to fail since the reset function is not called. I wonder how to trigger that? Do we need to call tpm_crb_reset now from tpm_crb_realize just to make the tests work ? Or is there a function we can call in the test case to trigger the device reset ?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]