From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: stefanb@linux.vnet.ibm.com, marcandre.lureau@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] tpm: Split off tpm_crb_reset function
Date: Thu, 1 Feb 2018 18:23:35 -0500 [thread overview]
Message-ID: <1517527416-31328-2-git-send-email-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <1517527416-31328-1-git-send-email-stefanb@linux.vnet.ibm.com>
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 <stefanb@linux.vnet.ibm.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 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;
--
2.5.5
next prev parent reply other threads:[~2018-02-01 23:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 23:23 [Qemu-devel] [PATCH 0/2] tpm: A fix and a cleanup Stefan Berger
2018-02-01 23:23 ` Stefan Berger [this message]
2018-02-02 0:59 ` [Qemu-devel] [PATCH 1/2] tpm: Split off tpm_crb_reset function Stefan Berger
2018-02-01 23:23 ` [Qemu-devel] [PATCH 2/2] tpm: wrap stX_be_p in tpm_cmd_set_XYZ functions Stefan Berger
2018-02-02 9:32 ` Marc-Andre Lureau
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=1517527416-31328-2-git-send-email-stefanb@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=marcandre.lureau@redhat.com \
--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).