From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>,
qemu-devel@nongnu.org, anthony@codemonkey.ws, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH V27 1/7] Support for TPM command line options
Date: Fri, 15 Mar 2013 09:29:05 -0400 [thread overview]
Message-ID: <51432221.3050609@linux.vnet.ibm.com> (raw)
In-Reply-To: <87obel867v.fsf@blackfin.pond.sub.org>
On 03/15/2013 03:36 AM, Markus Armbruster wrote:
> I missed this one, because it wasn't cc'ed to QMP maintainers, the
> subject mentions only command line, not QMP, and even the body talks
> only about the human monitor command, not QMP. Noticed it only when
> git-pull touched qapi-schema.json. Please try harder to help Luiz and
> me keep track of QMP changes.
I apologize for that.
>
> I gave the QMP interface and its documentation a look-over now. It's
> just a look-over, because passthrough requires a box with TPM enabled,
> which I don't have handy, so I can't test anything.
>
> A few comments inline.
>
> Stefan Berger <stefanb@linux.vnet.ibm.com> writes:
> +
> +@item -tpmdev @var{backend} ,id=@var{id} [,@var{options}]
> +@findex -tpmdev
> +Backend type must be:
> +
> +The specific backend type will determine the applicable options.
> +The @code{-tpmdev} option requires a @code{-device} option.
> You mean -tpmdev creates just a backend, so for a usable device you also
> need to create a frontend with -device?
Yes, just like any other device.
{
+ .name = "query-tpm",
+ .args_type = "",
+ .mhandler.cmd_new = qmp_marshal_input_query_tpm,
+ },
+
+ {
+ .name = "query-tpm-models",
+ .args_type = "",
+ .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
+ },
+
+ {
+ .name = "query-tpm-types",
+ .args_type = "",
+ .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
+ },
+
+ {
.name = "chardev-add",
.args_type = "id:s,backend:q",
.mhandler.cmd_new = qmp_marshal_input_chardev_add,
> You imitated the bad examples that lack documentation instead the good
> ones that have it. Please fix that in a followup patch.
Will do by sending it to the list and cc'ing you.
+{
+ if (qemu_opts_foreach(qemu_find_opts("tpmdev"),
+ tpm_init_tpmdev, NULL, 1) != 0) {
+ return -1;
+ }
+
+ atexit(tpm_cleanup);
> Routine atexit() question: what happens when the program terminates
> abnormally? atext() callbacks don't run then. Impact of not doing
> cleanup on the system?
In case the TPM is currently not operating on a command there will be no
impact. In case the TPM is operating on a command, it will hold the
thread inside /dev/tpm0 until the command has finished. The solution
here is to write a byte into sysfs file to terminate the TPM from
further executing the command and return; this code exists and is being
invoked in all other cases than abnormal termination obviously.
What other choices do we have? Do we need a signal handler that runs on
SIGSEGV and provide a registration function for those functions that
need to run on abnormal termination?
Stefan
next prev parent reply other threads:[~2013-03-15 13:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1361987275-26289-1-git-send-email-stefanb@linux.vnet.ibm.com>
2013-03-12 21:44 ` [Qemu-devel] [PATCH V27 0/7] QEMU Trusted Platform Module (TPM) integration Anthony Liguori
[not found] ` <1361987275-26289-2-git-send-email-stefanb@linux.vnet.ibm.com>
2013-03-15 7:36 ` [Qemu-devel] [PATCH V27 1/7] Support for TPM command line options Markus Armbruster
2013-03-15 13:29 ` Stefan Berger [this message]
2013-03-18 13:10 ` Markus Armbruster
2013-03-18 13:44 ` Stefan Berger
2013-03-19 7:45 ` Markus Armbruster
2013-03-19 10:27 ` Stefan Berger
2013-03-19 14:28 ` Markus Armbruster
2013-03-19 14:49 ` Stefan Berger
2013-03-15 15:49 ` Corey Bryant
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=51432221.3050609@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=anthony@codemonkey.ws \
--cc=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mst@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).