<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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 bgcolor="white" lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:windowtext">Hi, Sami<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Please see my comments inline.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span style="color:windowtext"> devel@edk2.groups.io <devel@edk2.groups.io>
<b>On Behalf Of </b>Sami Mujawar<br>
<b>Sent:</b> Tuesday, November 2, 2021 5:43 PM<br>
<b>To:</b> Xu, Min M <min.m.xu@intel.com>; devel@edk2.groups.io<br>
<b>Cc:</b> Kinney, Michael D <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; nd <nd@arm.com><br>
<b>Subject:</b> Re: [edk2-devel] [PATCH V4 2/3] SecurityPkg: Support CcMeasurementProtocol in DxeTpm2MeasureBootLib<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>+/**<o:p></o:p></pre>
<pre>+  Create CcEvent from Tcg2Event.<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+  CcEvent is similar to Tcg2Event except the MrIndex.<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+  @param  CcProtocol  Pointer to the located Cc Measurement protocol instance.<o:p></o:p></pre>
<pre>+  @param  Tcg2Event   Pointer to the Tcg2Event.<o:p></o:p></pre>
<pre>+  @param  EventSize   Size of the Event.<o:p></o:p></pre>
<pre>+  @param  EfiCcEvent  The created CcEvent<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+  @retval EFI_SUCCESS           Successfully create the CcEvent<o:p></o:p></pre>
<pre>+  @retval EFI_INVALID_PARAMETER The input parameter is invalid<o:p></o:p></pre>
<pre>+  @retval EFI_UNSUPPORTED       The input PCRIndex cannot be mapped to Cc MR<o:p></o:p></pre>
<pre>+  @retval EFI_OUT_OF_RESOURCES  Out of resource<o:p></o:p></pre>
<pre>+**/<o:p></o:p></pre>
<pre>+EFI_STATUS<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">[SAMI] Is EFIAPI needed here? <o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">[Min] EFIAPI is not needed here. From the EDKII C Coding Standards Spec (<a href="https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/5_source_files/56_declarations_and_types">https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/5_source_files/56_declarations_and_types</a>)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">“The EFIAPI modifier must be used for all UEFI defined API functions, as well as for any function that takes a variable number of arguments. All protocol functions as well as public functions exposed by drivers
 must also be declared EFIAPI. This establishes a common calling convention for functions that could be referenced by other code that has potentially been built using a different compiler, with a different native calling convention”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">CreateCcEventFromTcg2Event is only called internally and it will not be exposed outside. So EFIAPI is not needed.<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre>+CreateCcEventFromTcg2Event (<o:p></o:p></pre>
<pre>+  IN  EFI_CC_MEASUREMENT_PROTOCOL   *CcProtocol,<o:p></o:p></pre>
<pre>+  IN  EFI_TCG2_EVENT                *Tcg2Event,<o:p></o:p></pre>
<pre>+  IN  UINT32                        EventSize,<o:p></o:p></pre>
<pre>+  IN OUT EFI_CC_EVENT               **EfiCcEvent<o:p></o:p></pre>
<pre>+  )<o:p></o:p></pre>
<pre>+{<o:p></o:p></pre>
<pre>+  UINT32            MrIndex;<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">[SAMI] I think it may be good to use the typedef for the measurment register index here i.e. EFI_CC_MR_INDEX.
<o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">[Min] Thanks for reminder. It will be fixed in the next version.<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Min</span><span style="color:white">_._,_._,_<o:p></o:p></span></p>
</div>
</div>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/83359">View/Reply Online (#83359)</a> |    |  <a target="_blank" href="https://groups.io/mt/86758671/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>