From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: Corey Bryant <coreyb@linux.vnet.ibm.com>
Cc: mst@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws,
andreas.niederl@iaik.tugraz.at
Subject: Re: [Qemu-devel] [PATCH V19 5/7] Add a TPM Passthrough backend driver implementation
Date: Wed, 24 Oct 2012 15:07:18 -0400 [thread overview]
Message-ID: <50883C66.9090505@linux.vnet.ibm.com> (raw)
In-Reply-To: <50646287.9000107@linux.vnet.ibm.com>
On 09/27/2012 10:28 AM, Corey Bryant wrote:
>
>
> On 06/04/2012 03:37 PM, Stefan Berger wrote:
>> +
>> +/* borrowed from qemu-char.c */
>> +static int tpm_passthrough_unix_write(int fd, const uint8_t *buf,
>> uint32_t len)
>> +{
>> + return send_all(fd, buf, len);
>> +}
>> +
>> +static int tpm_passthrough_unix_read(int fd, uint8_t *buf, uint32_t
>> len)
>
> It would probably be useful to other parts of QEMU if you defined this
> function as recv_all() and put it in qemu-char.c (to correspond with
> send_all()).
>
Ok. I'd keep this patch to qemu-char.c inside of this patch, though,
unless someone opposes.
>> +
>> +static int tpm_passthrough_startup_tpm(TPMBackend *tb)
>> +{
>> + TPMPassthruState *tpm_pt = tb->s.tpm_pt;
>> + int rc;
>> +
>> + rc = tpm_passthrough_do_startup_tpm(tb);
>> + if (rc) {
>> + tpm_pt->had_startup_error = true;
>
> tpm_passthrough_do_startup_tpm() always returns zero, so
> had_startup_error will never be set to true.
>
I am consolidating the code into tpm_passthrough_startup_tpm() but let
that return an int considering that other backend drivers may return an
error code.
>> +static void tpm_passthrough_reset(TPMBackend *tb)
>> +{
>> + TPMPassthruState *tpm_pt = tb->s.tpm_pt;
>> +
>> + dprintf("tpm_passthrough: CALL TO TPM_RESET!\n");
>> +
>> + tpm_backend_thread_end(&tpm_pt->tbt);
>
> Should the thread be restarted here?
>
No. If the backend needs to be restarted, the frontend will invoke the
startup_tpm function.
>> +static bool tpm_passthrough_get_tpm_established_flag(TPMBackend *tb)
>> +{
>> + return false;
>
> Can a T/OS never be established with the passthrough backend?
>
Following the specs, this bit is set when locality 5 is used and a hash
operation is started. See part 2 of the TPM specs.
The establishment bit could be read from the hardware TPM's permanent
flags. The question is what it means to show this bit inside the VM. I
wasn't sure, so I hardcoded it to always return false.
Stefan
next prev parent reply other threads:[~2012-10-24 19:09 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 19:37 [Qemu-devel] [PATCH V19 0/7] Qemu Trusted Platform Module (TPM) integration Stefan Berger
2012-06-04 19:37 ` [Qemu-devel] [PATCH V19 1/7] Support for TPM command line options Stefan Berger
2012-09-27 14:12 ` Corey Bryant
2012-10-24 19:06 ` Stefan Berger
2012-11-08 15:52 ` Corey Bryant
2012-11-12 13:04 ` Stefan Berger
2012-06-04 19:37 ` [Qemu-devel] [PATCH V19 2/7] Add TPM (frontend) hardware interface (TPM TIS) to Qemu Stefan Berger
2012-09-27 14:22 ` Corey Bryant
2012-10-24 18:46 ` Stefan Berger
2012-11-08 15:39 ` Corey Bryant
2012-11-12 13:16 ` Stefan Berger
2012-11-12 18:48 ` Corey Bryant
2012-10-03 18:35 ` Corey Bryant
2012-06-04 19:37 ` [Qemu-devel] [PATCH V19 3/7] Add a debug register Stefan Berger
2012-09-27 14:23 ` Corey Bryant
2012-06-04 19:37 ` [Qemu-devel] [PATCH V19 4/7] Build the TPM frontend code Stefan Berger
2012-09-27 14:24 ` Corey Bryant
2012-06-04 19:37 ` [Qemu-devel] [PATCH V19 5/7] Add a TPM Passthrough backend driver implementation Stefan Berger
2012-09-27 14:28 ` Corey Bryant
2012-10-24 19:07 ` Stefan Berger [this message]
2012-06-04 19:37 ` [Qemu-devel] [PATCH V19 6/7] Introduce --enable-tpm-passthrough configure option Stefan Berger
2012-09-27 14:29 ` Corey Bryant
2012-06-04 19:37 ` [Qemu-devel] [PATCH V19 7/7] Add fd parameter for TPM passthrough driver Stefan Berger
2012-09-27 14:35 ` Corey Bryant
2012-10-03 18:46 ` Corey Bryant
2012-10-24 19:06 ` Stefan Berger
2012-06-04 19:56 ` [Qemu-devel] [PATCH V19 0/7] Qemu Trusted Platform Module (TPM) integration Stefan Weil
2012-06-04 23:08 ` Anthony Liguori
2012-09-27 14:59 ` Corey Bryant
2012-09-28 22:43 ` Stefan Berger
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=50883C66.9090505@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=andreas.niederl@iaik.tugraz.at \
--cc=anthony@codemonkey.ws \
--cc=coreyb@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.