All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kouichi Yasaki <yasaki.kouichi@jp.fujitsu.com>
To: Stefan Berger <stefanb@us.ibm.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH][BIOS]Fix TPMD and QEMU connection
Date: Thu, 20 Dec 2007 12:12:51 +0900	[thread overview]
Message-ID: <4769DDB3.7050804@jp.fujitsu.com> (raw)
In-Reply-To: <OF32654215.919BF0AD-ON852573B7.000C6FFA-852573B7.000CDEEC@us.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]

Hi Stefan-san,

Thank you for correcting my patch.
I also think that it should not try to connect endlessly in a busy loop.

attached file is the corrected patch.

Thanks
   Kouichi YASAKI

> 
> xen-devel-bounces@lists.xensource.com wrote on 12/19/2007 07:53:11 PM:
> 
>  > Hi,
>  >
>  > In HVM domain, MA_Transmit function in tcgbios sometimes become an error
>  > (TCG_NO_RESPONSE). The cause of the error is not to make connection of
>  > QEMU and TPMD instance within a timeout of MA_Transmit function.
>  >
>  > Before the MA_Transmit function was called, the attached patch 
> corrected so
>  > that connection of QEMU and TPMD might be completed.
>  >
>  > Signed-off-by: Kouichi YASAKI <yasaki.kouichi@jp.fujitsu.com>
>  >
>  > Thanks
>  >   Kouichi YASAKI
>  >
>  > diff -r d9ab9eb2bfee tools/ioemu/hw/tpm_tis.c
>  > --- a/tools/ioemu/hw/tpm_tis.c   Sat Dec 15 18:29:27 2007 +0000
>  > +++ b/tools/ioemu/hw/tpm_tis.c   Mon Dec 17 19:46:42 2007 +0900
>  > @@ -904,6 +904,10 @@ void tpm_tis_init(SetIRQFunc *set_irq, v
>  >      memset(s->buffer.buf,0,sizeof(s->buffer.buf));
>  >  
>  >      register_savevm("tpm-tis", 0, 1, tpm_save, tpm_load, s);
>  > +
>  > +    while(!IS_COMM_WITH_VTPM(s)){
>  > +       open_vtpm_channel(s);
>  > +    }
>  >  }
> 
> I'll have a look at this. The problem probably stems from the vTPM 
> manager starting the vTPM up too late while qemu is already up and 
> running, so it's a timing problem between the two processes. I don't 
> think it should try to connect endlessly in a busy loop. At least there 
> should be a counter that tries this for maybe 5 times followed by a 
> [u]sleep() in the loop.
> 
>     int ctr = 0;
>     while(!IS_COMM_WITH_VTPM(s) && ctr < 5){
>       open_vtpm_channel(s);
>        ctr ++;
>        sleep(1);
>    }
> 
> 
>    Stefan
> 
>  >  
>  >  
>  > 
> /****************************************************************************/
>  > _______________________________________________
>  > Xen-devel mailing list
>  > Xen-devel@lists.xensource.com
>  > http://lists.xensource.com/xen-devel

[-- Attachment #2: tpm_tis_fix.diff --]
[-- Type: text/x-patch, Size: 569 bytes --]

diff -r 966a6d3b7408 tools/ioemu/hw/tpm_tis.c
--- a/tools/ioemu/hw/tpm_tis.c	Fri Dec 14 11:50:24 2007 +0000
+++ b/tools/ioemu/hw/tpm_tis.c	Thu Dec 20 11:56:24 2007 +0900
@@ -904,6 +904,13 @@ void tpm_tis_init(SetIRQFunc *set_irq, v
     memset(s->buffer.buf,0,sizeof(s->buffer.buf));
 
     register_savevm("tpm-tis", 0, 1, tpm_save, tpm_load, s);
+
+    int ctr = 0;
+    while(!IS_COMM_WITH_VTPM(s) && ctr < 5){
+       open_vtpm_channel(s);
+       ctr++;
+       sleep(1);
+    }
 }
 
 /****************************************************************************/

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

      reply	other threads:[~2007-12-20  3:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18  0:04 [PATCH][VTPM] re-send:Fix vTPM function in HVM domain Kouichi Yasaki
2007-12-20  0:53 ` [PATCH][BIOS]Fix TPMD and QEMU connection Kouichi Yasaki
2007-12-20  2:20   ` Stefan Berger
2007-12-20  3:12     ` Kouichi Yasaki [this message]

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=4769DDB3.7050804@jp.fujitsu.com \
    --to=yasaki.kouichi@jp.fujitsu.com \
    --cc=stefanb@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /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.