qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] tpm: Split off tpm_crb_reset function
Date: Thu, 1 Feb 2018 19:59:39 -0500	[thread overview]
Message-ID: <b3ca57bf-5e45-cb82-4de1-1e49ec888df7@linux.vnet.ibm.com> (raw)
In-Reply-To: <1517527416-31328-2-git-send-email-stefanb@linux.vnet.ibm.com>

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 <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;


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	other threads:[~2018-02-02  1:18 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 ` [Qemu-devel] [PATCH 1/2] tpm: Split off tpm_crb_reset function Stefan Berger
2018-02-02  0:59   ` Stefan Berger [this message]
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=b3ca57bf-5e45-cb82-4de1-1e49ec888df7@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).