<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hello Stefan,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I have my doubts. This will work fine as long as the toplevel function tpm_foo() in your example can be implemented to have a single API independent of the required
 support. If the API differs between the tpm 1.2 and tpm 2.0 case I think it will only be confusing things.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Given the differences between tpm 1.2 and 2.0 do you think you will be able to maintain this single API?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="NL" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">Best Regards,</span><span lang="NL" style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="NL" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">Wim Vervoorn<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="NL" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="NL" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">Eltan B.V.</span><span lang="NL" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="NL" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">Ambachtstraat 23<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">5481 SM Schijndel<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">The Netherlands<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">T : +31-(0)73-594 46 64</span><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">E : wvervoorn@eltan.com</span><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">W : http://www.eltan.com<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1F497D">"THIS MESSAGE CONTAINS CONFIDENTIAL INFORMATION. UNLESS YOU ARE THE INTENDED RECIPIENT OF THIS MESSAGE,
 ANY USE OF THIS MESSAGE IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE IMMEDIATELY NOTIFY THE SENDER BY TELEPHONE +31-(0)73-5944664 OR REPLY EMAIL, AND IMMEDIATELY DELETE THIS MESSAGE AND ALL COPIES." </span><span style="font-size:11.0pt;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Stefan Berger [mailto:stefanb@us.ibm.com]
<br>
<b>Sent:</b> Monday, December 21, 2015 5:50 PM<br>
<b>To:</b> Kevin O'Connor <kevin@koconnor.net><br>
<b>Cc:</b> seabios@seabios.org; Wim Vervoorn <wvervoorn@eltan.com><br>
<b>Subject:</b> Re: [SeaBIOS] SeaBIOS Digest, Vol 72, Issue 33<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><tt><span style="font-size:10.0pt">"Kevin O'Connor" <<a href="mailto:kevin@koconnor.net">kevin@koconnor.net</a>> wrote on 12/17/2015 05:22:56 PM:</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
<tt>> </tt><br>
<tt>> On Mon, Nov 30, 2015 at 11:32:05AM +0000, Wim Vervoorn wrote:</tt><br>
<tt>> > Hello,</tt><br>
<tt>> > </tt><br>
<tt>> > I noticed that a lot of work is going on for the TPM support in SeaBIOS.</tt><br>
<tt>> > </tt><br>
<tt>> > All of this work is TPM 1.2 based. I was wondering if there are any</tt><br>
<tt>> > plans to support TPM 2.0 in the future.</tt><br>
<tt>> </tt><br>
<tt>> I'm not aware of any plans.</tt></span><br>
<br>
<tt><span style="font-size:10.0pt">We're working on it...</span></tt><br>
<br>
<br>
<tt><span style="font-size:10.0pt">So maybe you have some comments to the following:</span></tt><br>
<br>
<tt><span style="font-size:10.0pt">There will be a patch for probing the TPM TIS hardware interface for whether there's a TPM 1.2 or a TPM 2.</span></tt><br>
<tt><span style="font-size:10.0pt">We then have a patch for prefixing all TPM 1.2 functions with tpm12_ and then introduce functions like these ones here:</span></tt><br>
<br>
<tt><span style="font-size:10.0pt">static ... tpm12_foo() { ... }</span></tt><br>
<tt><span style="font-size:10.0pt">static ... tpm2_foo() { ... }</span></tt><br>
<br>
<tt><span style="font-size:10.0pt">tpm_foo()</span></tt><br>
<tt><span style="font-size:10.0pt">{</span></tt><br>
<tt><span style="font-size:10.0pt">    [...]</span></tt><br>
<br>
<tt><span style="font-size:10.0pt">    switch (tpmversion) {</span></tt><br>
<tt><span style="font-size:10.0pt">    case TPM_VERSION_1_2:</span></tt><br>
<tt><span style="font-size:10.0pt">        tpm12_foo()</span></tt><br>
<tt><span style="font-size:10.0pt">        break;</span></tt><br>
<tt><span style="font-size:10.0pt">    case TPM_VERSION_2:</span></tt><br>
<tt><span style="font-size:10.0pt">        tpm2_foo();</span></tt><br>
<tt><span style="font-size:10.0pt">        break;</span></tt><br>
<tt><span style="font-size:10.0pt">    }</span></tt><br>
<br>
<tt><span style="font-size:10.0pt">    [...]</span></tt><br>
<tt><span style="font-size:10.0pt">}</span></tt><br>
<br>
<tt><span style="font-size:10.0pt">That way the probing will lead us to use either TPM1.2 or TPM 2 specific code. There will be multiple such constructs in tcgbios.c file.</span></tt><br>
<br>
<tt><span style="font-size:10.0pt">   Stefan</span></tt><o:p></o:p></p>
</div>
</body>
</html>