<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">
      <div id="rwhMsgHeader">Thanks for the link.  I agree that this
        change will make the StatusCodeHandler driver more modular, and
        is a step in the right direction.</div>
      <div><br>
      </div>
      <div>But I think it could go further, with almost no additional
        work, and simplify the overall Status Code mechanism, not just
        the StatusCodeHandler driver.  Currently, the StatusCodeHandler
        driver entry routines run some initialization code, register
        callbacks (eg. for ExitBootServices and SetVirtualAddressMap),
        and call the RscHandler PPI/Protocol to register the worker
        routines.  If I'm understanding the proposal correctly, all that
        code will be moved to the individual NULL libraries, since any
        particular library may or may not need any of it.  Then the
        StatusCodeHandler modules will be left with no code of their own
        at all:  they will only be wrappers for the NULL libraries. 
        Their entry routines will do nothing except return EFI_SUCCESS!
        (1)<br>
      </div>
      <div><br>
      </div>
      <div>It seems strange and wasteful to keep around empty modules
        like this.  So I'm suggesting adding the NULL libraries to the
        StatusCodeRouter modules instead.  They would need to export the
        protocol/PPI routines to the NULL libraries via a header file,
        so they could call them directly instead of looking up the
        protocol/PPI.  But that's a minor change.  Then you could remove
        the empty StatusCodeHandler modules entirely.  The advantage
        would be that there would be fewer modules in the build,
        simplifying the .dsc and .fdf files slightly.  It would also
        reduce code size a bit by sharing common library routines, such
        as BaseLib, with the StatusCodeRouter modules.</div>
      <div><br>
      </div>
      <div>If those don't seem like worthwhile advantages, that's OK
        with me.  I don't want to belabor the point, or impede
        progress.  If others are OK with the proposal as it stands, then
        I am too.<br>
      </div>
      <div><br>
      </div>
      <div>Thanks,<br>
      </div>
      <div>
        <div class="moz-signature">
          <p class="3DMsoNormal"><b><span
style="3D'font-size:10.0pt;font-family:"Arial",sans-serif;color:black'">Brian
                J. Johnson<br>
              </span></b><span
style="3D'font-size:10.0pt;font-family:"Arial",sans-serif;color:black'">Enterprise
              X86 Lab</span></p>
          <p class="3DMsoNormal"><span
style="3D'font-size:10.0pt;font-family:"Arial",sans-serif;color:black'">Hewlett
              Packard Enterprise<br>
            </span></p>
          <p class="3DMsoNormal"><br>
            <span
style="3D'font-size:10.0pt;font-family:"Arial",sans-serif;color:black'"></span></p>
        </div>
      </div>
      <div>(1) The StatusCodeHandlerRuntimeDxe driver also handles
        PcdStatusCodeReplayIn as part of its entry code.  That code
        would probably have to stay in a separate module rather than
        being linked to StatusCodeRouter as a NULL library.  That way it
        could be dispatched after the ReportStatusCode protocol is
        available.<br>
      </div>
      <div> <br>
        <hr id="rwhMsgHdrDivider" style="border:0;border-top:1px solid
          #B5C4DF;padding:0;margin:10px 0 5px 0;width:100%;">
        <div style="font-family:sans-serif !important; color:#000000
          !important; font-size:11pt !important;"><b>From:</b> Dong,
          Eric [<a class="moz-txt-link-freetext" href="mailto:eric.dong@intel.com">mailto:eric.dong@intel.com</a>]</div>
        <div style="font-family:sans-serif !important; color:#000000
          !important; font-size:11pt !important;"><b>Sent:</b> Thursday,
          June 25, 2020, 10:41 AM</div>
        <div style="font-family:sans-serif !important; color:#000000
          !important; font-size:11pt !important;"><b>To:</b> Brian J.
          Johnson <a class="moz-txt-link-rfc2396E" href="mailto:brian.johnson@hpe.com"><brian.johnson@hpe.com></a>, Bi, Dandan
          <a class="moz-txt-link-rfc2396E" href="mailto:dandan.bi@intel.com"><dandan.bi@intel.com></a>, Andrew Fish
          <a class="moz-txt-link-rfc2396E" href="mailto:afish@apple.com"><afish@apple.com></a>, edk2-devel-groups-io
          <a class="moz-txt-link-rfc2396E" href="mailto:devel@edk2.groups.io"><devel@edk2.groups.io></a></div>
        <div style="font-family:sans-serif !important; color:#000000
          !important; font-size:11pt !important;"><b>Cc:</b>
          <a class="moz-txt-link-abbreviated" href="mailto:rfc@edk2.groups.io">rfc@edk2.groups.io</a> <a class="moz-txt-link-rfc2396E" href="mailto:rfc@edk2.groups.io"><rfc@edk2.groups.io></a>, Ni, Ray
          <a class="moz-txt-link-rfc2396E" href="mailto:ray.ni@intel.com"><ray.ni@intel.com></a>, Wang, Jian J
          <a class="moz-txt-link-rfc2396E" href="mailto:jian.j.wang@intel.com"><jian.j.wang@intel.com></a>, Wu, Hao A
          <a class="moz-txt-link-rfc2396E" href="mailto:hao.a.wu@intel.com"><hao.a.wu@intel.com></a>, Tan, Ming
          <a class="moz-txt-link-rfc2396E" href="mailto:ming.tan@intel.com"><ming.tan@intel.com></a>, Laszlo Ersek
          <a class="moz-txt-link-rfc2396E" href="mailto:lersek@redhat.com"><lersek@redhat.com></a></div>
        <div style="font-family:sans-serif !important; color:#000000
          !important; font-size:11pt !important;"><b>Subject:</b>
          [edk2-devel] [edk2-rfc] MdeModulePkg/StatusCodeHandler:
          Separate NULL class libraries for Memory and serial handlers
          from MdeModulePkg/Universal/StatusCodeHandler modules</div>
        <br>
      </div>
    </div>
    <blockquote type="cite"
cite="mid:DM6PR11MB327435BE096745D601875006FE920@DM6PR11MB3274.namprd11.prod.outlook.com"
      style="border:none !important; margin-left:0px !important;
      margin-right:0px !important; margin-top:0px !important;
      padding-left:0px !important; padding-right:0px !important">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@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:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.3dmsonormal, li.3dmsonormal, div.3dmsonormal
        {mso-style-name:3dmsonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {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;}
/* List Definitions */
@list l0
        {mso-list-id:356810370;
        mso-list-template-ids:599684036;}
@list l0:level1
        {mso-level-start-at:3;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1
        {mso-list-id:615524700;
        mso-list-template-ids:-990078360;}
@list l1:level1
        {mso-level-start-at:2;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l2
        {mso-list-id:1559592059;
        mso-list-template-ids:2049575408;}
@list l3
        {mso-list-id:1858300882;
        mso-list-type:hybrid;
        mso-list-template-ids:645803518 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l3:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.25in;
        text-indent:-.25in;}
@list l3:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.25in;}
@list l3:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:1.25in;
        text-indent:-9.0pt;}
@list l3:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.75in;
        text-indent:-.25in;}
@list l3:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.25in;
        text-indent:-.25in;}
@list l3:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:2.75in;
        text-indent:-9.0pt;}
@list l3:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.25in;
        text-indent:-.25in;}
@list l3:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.75in;
        text-indent:-.25in;}
@list l3:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:4.25in;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi Brian,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">In this new design, we still use register
          status code handler Protocol/Ppi to register the handler
          logic. We just want to change the StatusCodeHandler driver. We
          try to split the register logic to NULL library to make the
          code more modularity. We already created sample library in
          Edk2-Platforms repo  <a href="https://github.com/tianocore/edk2-platforms/tree/master/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib" moz-do-not-send="true">https://github.com/tianocore/edk2-platforms/tree/master/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib</a>. 
          You can check this code to understand more about what we want
          to do.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Thanks,<o:p></o:p></p>
        <p class="MsoNormal">Eric<o:p></o:p></p>
        <div style="border:none;border-left:solid blue 1.5pt;padding:0in
          0in 0in 4.0pt">
          <div>
            <div style="border:none;border-top:solid #E1E1E1
              1.0pt;padding:3.0pt 0in 0in 0in">
              <p class="MsoNormal"><b>From:</b> Brian J. Johnson
                <a class="moz-txt-link-rfc2396E" href="mailto:brian.johnson@hpe.com"><brian.johnson@hpe.com></a> <br>
                <b>Sent:</b> Thursday, June 25, 2020 4:25 AM<br>
                <b>To:</b> Bi, Dandan <a class="moz-txt-link-rfc2396E" href="mailto:dandan.bi@intel.com"><dandan.bi@intel.com></a>;
                Andrew Fish <a class="moz-txt-link-rfc2396E" href="mailto:afish@apple.com"><afish@apple.com></a>;
                edk2-devel-groups-io <a class="moz-txt-link-rfc2396E" href="mailto:devel@edk2.groups.io"><devel@edk2.groups.io></a><br>
                <b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:rfc@edk2.groups.io">rfc@edk2.groups.io</a>; Dong, Eric
                <a class="moz-txt-link-rfc2396E" href="mailto:eric.dong@intel.com"><eric.dong@intel.com></a>; Ni, Ray
                <a class="moz-txt-link-rfc2396E" href="mailto:ray.ni@intel.com"><ray.ni@intel.com></a>; Wang, Jian J
                <a class="moz-txt-link-rfc2396E" href="mailto:jian.j.wang@intel.com"><jian.j.wang@intel.com></a>; Wu, Hao A
                <a class="moz-txt-link-rfc2396E" href="mailto:hao.a.wu@intel.com"><hao.a.wu@intel.com></a>; Tan, Ming
                <a class="moz-txt-link-rfc2396E" href="mailto:ming.tan@intel.com"><ming.tan@intel.com></a>; Laszlo Ersek
                <a class="moz-txt-link-rfc2396E" href="mailto:lersek@redhat.com"><lersek@redhat.com></a><br>
                <b>Subject:</b> Re: [edk2-devel] [edk2-rfc]
                MdeModulePkg/StatusCodeHandler: Separate NULL class
                libraries for Memory and serial handlers from
                MdeModulePkg/Universal/StatusCodeHandler modules<o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"><o:p> </o:p></p>
          <div>
            <div id="rwhMsgHeader">
              <p class="MsoNormal">Dandan,<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">The Status Code Protocol/PPI is the
                high-level interface which is being implemented.  The
                ReportStatusCodeRouter module implements this in terms
                of the ReportStatusCodeHandler Protocol/PPI.  That
                allows multiple ReportStatusCodeHandler modules to be
                used at once, so they can each react to different types
                of status codes, or report them through multiple
                channels.  That sort of multiplexing seems like a useful
                feature.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Now we're considering adding a
                mechanism which allows registering status code handlers
                via NULL libraries, rather than via the protocol/PPI. 
                That sounds like exactly what ReportStatusCodeRouter is
                intended for.  It wouldn't really change its scope, it
                would just make it more flexible.  Adding this feature
                via a StatusCodeHandler module wouldn't improve
                modularity, it would just add complexity.  As an OEM,
                adding a custom handler would look the same to me either
                way:  I would have to add the NULL class library to a
                MdeModulePkg driver's entry in my .dsc file.  It doesn't
                matter to me whether it's the ReportStatusCodeRouter or
                StatusCodeHandler module.  And if I can do it in
                ReportStatusCodeRouter, then I don't need to include any
                StatusCodeHandler modules in the build at all.  That
                saves code space and reduces the number of modules in
                the APRIORI list, which are both good things.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">ReportStatusCodeRouterPei already has
                to track registered handlers in PEI when running from
                ROM (it uses a HOB.)  Tracking handlers from NULL
                libraries wouldn't be any harder.  In fact, it looks
                like it could just export the Register() function to the
                NULL libraries, and they could call it in their
                constructors.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">I think using NULL libraries for
                status code handlers is a great idea.  I'd just like to
                take that opportunity to reduce the complexity of the
                overall status code stack while we're at it.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Thanks,<o:p></o:p></p>
              <p class="3dmsonormal"><b><span
                    style="font-family:"Arial",sans-serif;color:black">Brian
                    J. Johnson<br>
                  </span></b><span
                  style="font-family:"Arial",sans-serif;color:black">Enterprise
                  X86 Lab</span><o:p></o:p></p>
              <p class="3dmsonormal"><span
                  style="font-family:"Arial",sans-serif;color:black">Hewlett
                  Packard Enterprise</span><o:p></o:p></p>
            </div>
            <div>
              <div class="MsoNormal"
style="mso-margin-top-alt:7.5pt;margin-right:0in;margin-bottom:3.75pt;margin-left:0in;text-align:center"
                align="center">
                <hr width="100%" size="2" align="center">
              </div>
              <div>
                <p class="MsoNormal"
style="mso-margin-top-alt:7.5pt;margin-right:0in;margin-bottom:3.75pt;margin-left:0in"><b>From:</b>
                  Bi, Dandan [<a href="mailto:dandan.bi@intel.com" moz-do-not-send="true">mailto:dandan.bi@intel.com</a>]<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"
style="mso-margin-top-alt:7.5pt;margin-right:0in;margin-bottom:3.75pt;margin-left:0in"><b>Sent:</b>
                  Monday, June 22, 2020, 2:27 AM<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"
style="mso-margin-top-alt:7.5pt;margin-right:0in;margin-bottom:3.75pt;margin-left:0in"><b>To:</b>
                  Andrew Fish <a href="mailto:afish@apple.com" moz-do-not-send="true"><afish@apple.com></a>,
                  edk2-devel-groups-io
                  <a href="mailto:devel@edk2.groups.io" moz-do-not-send="true"><devel@edk2.groups.io></a>,
                  <a href="mailto:brian.johnson@hpe.com" moz-do-not-send="true">
                    brian.johnson@hpe.com</a> <a href="mailto:brian.johnson@hpe.com" moz-do-not-send="true"><brian.johnson@hpe.com></a><o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"
style="mso-margin-top-alt:7.5pt;margin-right:0in;margin-bottom:3.75pt;margin-left:0in"><b>Cc:</b>
                  <a href="mailto:rfc@edk2.groups.io" moz-do-not-send="true">rfc@edk2.groups.io</a> <a href="mailto:rfc@edk2.groups.io" moz-do-not-send="true">
                    <rfc@edk2.groups.io></a>, Dong, Eric <a href="mailto:eric.dong@intel.com" moz-do-not-send="true"><eric.dong@intel.com></a>,
                  Ni, Ray
                  <a href="mailto:ray.ni@intel.com" moz-do-not-send="true"><ray.ni@intel.com></a>,
                  Wang, Jian J <a href="mailto:jian.j.wang@intel.com" moz-do-not-send="true">
                    <jian.j.wang@intel.com></a>, Wu, Hao A <a href="mailto:hao.a.wu@intel.com" moz-do-not-send="true"><hao.a.wu@intel.com></a>,
                  Tan, Ming
                  <a href="mailto:ming.tan@intel.com" moz-do-not-send="true"><ming.tan@intel.com></a>,
                  Laszlo Ersek <a href="mailto:lersek@redhat.com" moz-do-not-send="true">
                    <lersek@redhat.com></a>, Bi, Dandan <a href="mailto:dandan.bi@intel.com" moz-do-not-send="true"><dandan.bi@intel.com></a><o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"
style="mso-margin-top-alt:7.5pt;margin-right:0in;margin-bottom:3.75pt;margin-left:0in"><b>Subject:</b>
                  [edk2-devel] [edk2-rfc]
                  MdeModulePkg/StatusCodeHandler: Separate NULL class
                  libraries for Memory and serial handlers from
                  MdeModulePkg/Universal/StatusCodeHandler modules<o:p></o:p></p>
              </div>
              <p class="MsoNormal"
style="mso-margin-top-alt:7.5pt;margin-right:0in;margin-bottom:3.75pt;margin-left:0in"><o:p> </o:p></p>
            </div>
          </div>
          <blockquote style="border:none !important; margin-left:0px
            !important; margin-right:0px !important; margin-top:0px
            !important; padding-left:0px !important; padding-right:0px
            !important">
            <p class="MsoNormal">Hi Brian,<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Personally, I prefer to add the NULL
              class Library to StatusCodeHandler modules.<o:p></o:p></p>
            <ol style="margin-top:0in" type="1" start="1">
              <li class="MsoListParagraph"
                style="margin-top:3.0pt;margin-left:-.25in;mso-list:l3
                level1 lfo3">
                I think we should make the functionality of each module
                clear and separated. It may also be why we added
                ReportStatusCodeRouter and StatusCodeHandler modules in
                edk2 repo before.<o:p></o:p></li>
            </ol>
            <p class="MsoListParagraph"
style="mso-margin-top-alt:3.0pt;margin-right:0in;margin-bottom:0in;margin-left:.25in;margin-bottom:.0001pt">ReportStatusCodeRouter
              modules are responsible for producing Status Code
              Protocol/PPI and Report Status Code Handler Protocol/PPI,
              and StatusCodeHandler modules are responsible for
              producing handlers (Handlers can be provided by NULL class
              Libraries in this RFC). <o:p></o:p></p>
            <p class="MsoListParagraph"
style="mso-margin-top-alt:3.0pt;margin-right:0in;margin-bottom:0in;margin-left:.25in;margin-bottom:.0001pt"> So,
              that’s why I don’t want to add the NULL class Library to
              ReportStatusCodeRouter modules directly, which change the
              functionality scope of existing modules.<o:p></o:p></p>
            <p class="MsoListParagraph" style="margin-left:.25in"> <o:p></o:p></p>
            <ol style="margin-top:0in" type="1" start="2">
              <li class="MsoListParagraph"
                style="margin-left:-.25in;mso-list:l3 level1 lfo3">I
                agree that we have a lot of layers of indirection now,
                but what we may gain is the good modularity. And you
                also mentioned that one or more StatusCodeHandler
                Modules may be used. We also want to achieve that only
                the StatusCodeHandler modules in MdeModulePkg can be
                used after this separation, platform can only add its
                own handler Libs to meet its requirement.<o:p></o:p></li>
            </ol>
            <p class="MsoListParagraph"> <o:p></o:p></p>
            <ol style="margin-top:0in" type="1" start="3">
              <li class="MsoListParagraph"
                style="margin-left:-.25in;mso-list:l3 level1 lfo3">As
                Andrew mentioned below, if add the libraries to
                ReportStatusCodeRouter, there will be some issue we need
                to fix, which seems also make the code logic a little
                tricky to me.<o:p></o:p></li>
            </ol>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Thanks,<o:p></o:p></p>
            <p class="MsoNormal">Dandan<o:p></o:p></p>
            <div style="border:none;border-left:solid blue
              1.5pt;padding:0in 0in 0in 4.0pt">
              <div>
                <div style="border:none;border-top:solid #E1E1E1
                  1.0pt;padding:3.0pt 0in 0in 0in">
                  <p class="MsoNormal"><b>From:</b> Andrew Fish <a href="mailto:afish@apple.com" moz-do-not-send="true"><afish@apple.com></a>
                    <br>
                    <b>Sent:</b> Saturday, June 20, 2020 2:04 AM<br>
                    <b>To:</b> edk2-devel-groups-io <a href="mailto:devel@edk2.groups.io" moz-do-not-send="true"><devel@edk2.groups.io></a>;
                    <a href="mailto:brian.johnson@hpe.com" moz-do-not-send="true">brian.johnson@hpe.com</a><br>
                    <b>Cc:</b> Bi, Dandan <a href="mailto:dandan.bi@intel.com" moz-do-not-send="true"><dandan.bi@intel.com></a>;
                    <a href="mailto:rfc@edk2.groups.io" moz-do-not-send="true">rfc@edk2.groups.io</a>;
                    Dong, Eric <a href="mailto:eric.dong@intel.com" moz-do-not-send="true">
                      <eric.dong@intel.com></a>; Ni, Ray <a href="mailto:ray.ni@intel.com" moz-do-not-send="true"><ray.ni@intel.com></a>;
                    Wang, Jian J
                    <a href="mailto:jian.j.wang@intel.com" moz-do-not-send="true"><jian.j.wang@intel.com></a>;
                    Wu, Hao A <a href="mailto:hao.a.wu@intel.com" moz-do-not-send="true">
                      <hao.a.wu@intel.com></a>; Tan, Ming <a href="mailto:ming.tan@intel.com" moz-do-not-send="true"><ming.tan@intel.com></a><br>
                    <b>Subject:</b> Re: [edk2-devel] [edk2-rfc]
                    MdeModulePkg/StatusCodeHandler: Separate NULL class
                    libraries for Memory and serial handlers from
                    MdeModulePkg/Universal/StatusCodeHandler modules<o:p></o:p></p>
                </div>
              </div>
              <p class="MsoNormal"> <o:p></o:p></p>
              <p class="MsoNormal"> <o:p></o:p></p>
              <div>
                <p class="MsoNormal"><br>
                  <br>
                  <br>
                  <o:p></o:p></p>
                <blockquote style="border:none !important;
                  margin-left:0px !important; margin-right:0px
                  !important; margin-top:0px !important;
                  padding-left:0px !important; padding-right:0px
                  !important">
                  <div>
                    <p class="MsoNormal">On Jun 19, 2020, at 10:29 AM,
                      Brian J. Johnson <<a href="mailto:brian.johnson@hpe.com" moz-do-not-send="true">brian.johnson@hpe.com</a>wrote:<o:p></o:p></p>
                  </div>
                  <p class="MsoNormal"> <o:p></o:p></p>
                  <div>
                    <div>
                      <p class="MsoNormal"><span
                          style="font-size:9.0pt;font-family:"Helvetica",sans-serif">On
                          6/18/20 2:01 AM, Dandan Bi wrote:</span><o:p></o:p></p>
                    </div>
                    <blockquote style="border:none !important;
                      margin-left:0px !important; margin-right:0px
                      !important; margin-top:0px !important;
                      padding-left:0px !important; padding-right:0px
                      !important">
                      <div>
                        <p class="MsoNormal">Hi All,<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">REF:<span
                            class="apple-converted-space"> </span><a href="https://bugzilla.tianocore.org/show_bug.cgi?id=2816" moz-do-not-send="true"><span
                              style="color:#954F72">https://bugzilla.tianocore.org/show_bug.cgi?id=2816</span></a><o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">We plan to separate two
                          kinds of NULL class libraries for Memory and
                          serial handlers from<b>MdeModulePkg/Universal/StatusCodeHandler/…/
                            StatusCodeHandlerPei/RuntimeDxe/Smm</b><span
                            class="apple-converted-space"> </span>modules.<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">The benefit we want to gain
                          from this separation is to 1) make the code
                          clear and easy to maintain, 2) make platform
                          flexible to choose any handler library they
                          need, and it also can reduce image size since
                          the unused handlers can be excluded.<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">If you have any concern or
                          comments for this separation, please let me
                          know.<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">We plan to add new
                          separated NULL class library<span
                            class="apple-converted-space"> </span><b>MemoryStausCodeHandlerLib<span
                              class="apple-converted-space"> </span></b>and<span
                            class="apple-converted-space"><b> </b></span><b>SerialStatusCodeHandlerLib<span
                              class="apple-converted-space"> </span></b>with
                          different phase implementation into<span
                            class="apple-converted-space"> </span><b>MdeModulePkg\Library\</b><span
                            class="apple-converted-space"> </span>directory.<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">The main tree structure may
                          like below:<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">MdeModulePkg\Library<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">|------<b>MemoryStausCodeHandlerLib</b><o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">|------|------
                          PeiMemoryStausCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">|------|------
                          RuntimeDxeMemoryStatusCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">|------|------
                          SmmMemoryStausCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">|------<b>SerialStatusCodeHandlerLib</b><o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">|------|------
                          PeiSerialStatusCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">|------|------
                          RuntimeDxeSerialStatusCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">|------|------
                          SmmSerialStatusCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"><b> </b><o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"><b> </b><o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">We will update existing
                          platform use cases in edk2 and edk2-platform
                          repo to cover the new NULL class library to
                          make sure this change doesn’t impact any
                          platform.<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">After this separation,
                          StatusCodeHandler module usage will like
                          below, and it’s also very flexible for
                          platform to cover more handler libraries to
                          meet their requirements.<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf
                          {<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <span
                            class="apple-converted-space"> </span><LibraryClasses><o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal" style="text-indent:9.75pt">NULL|MdeModulePkg/Library/MemoryStausCodeHandlerLib/PeiMemoryStausCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal" style="text-indent:9.75pt">NULL|MdeModulePkg/Library/SerialStatusCodeHandlerLib/PeiSerialStatusCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">   <span
                            class="apple-converted-space"> </span>…<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">}<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf 
                          {<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <span
                            class="apple-converted-space"> </span><LibraryClasses><o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal" style="text-indent:9.75pt">NULL|MdeModulePkg/Library/MemoryStausCodeHandlerLib/RuntimeDxeMemoryStausCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal" style="text-indent:9.75pt">NULL|MdeModulePkg/Library/SerialStatusCodeHandlerLib/RuntimeDxeSerialStatusCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">   <span
                            class="apple-converted-space"> </span>…<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">}<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf
                          {<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <span
                            class="apple-converted-space"> </span><LibraryClasses><o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">  
 NULL|MdeModulePkg/Library/MemoryStausCodeHandlerLib/SmmMemoryStausCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal" style="text-indent:9.75pt">NULL|MdeModulePkg/Library/SerialStatusCodeHandlerLib/SmmSerialStatusCodeHandlerLib.inf<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">   <span
                            class="apple-converted-space"> </span>…<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">}<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal"> <o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">Thanks,<o:p></o:p></p>
                      </div>
                      <div>
                        <p class="MsoNormal">Dandan<o:p></o:p></p>
                      </div>
                    </blockquote>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;caret-color:
                      rgb(0, 0, 0);font-variant-caps:
                      normal;text-align:start;-webkit-text-stroke-width:
                      0px;word-spacing:0px">
                      <span
                        style="font-size:9.0pt;font-family:"Helvetica",sans-serif"> </span><o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;caret-color:
                      rgb(0, 0, 0);font-variant-caps:
                      normal;text-align:start;-webkit-text-stroke-width:
                      0px;word-spacing:0px">
                      <span
                        style="font-size:9.0pt;font-family:"Helvetica",sans-serif">Dandan,</span><o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;caret-color:
                      rgb(0, 0, 0);font-variant-caps:
                      normal;text-align:start;-webkit-text-stroke-width:
                      0px;word-spacing:0px">
                      <span
                        style="font-size:9.0pt;font-family:"Helvetica",sans-serif">We'll
                        have a lot of layers of indirection....  The
                        ReportStatusCodeRouter modules will call one or
                        more StatusCodeHandlerModules, and the standard
                        StatusCodeHandler modules will call multiple
                        StatusCodeHandlerLib libraries.</span><o:p></o:p></p>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;caret-color:
                      rgb(0, 0, 0);font-variant-caps:
                      normal;text-align:start;-webkit-text-stroke-width:
                      0px;word-spacing:0px">
                      <span
                        style="font-size:9.0pt;font-family:"Helvetica",sans-serif">How
                        about adding StatusCodeHandlerLib support
                        directly to the ReportStatusCodeRouter modules? 
                        Then platforms could omit the StatusCodeHandler
                        modules if they're only using the open-source
                        code.  That sounds like less overhead since
                        fewer modules would be needed.</span><o:p></o:p></p>
                    <div>
                      <p class="MsoNormal"> <o:p></o:p></p>
                    </div>
                  </div>
                </blockquote>
                <div>
                  <p class="MsoNormal"> <o:p></o:p></p>
                </div>
                <p class="MsoNormal">I think the need to execute from
                  ROM makes this tricky. <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">It looks to me that it is easy to
                  move from PCD to libs for the StatusCodeHandler since
                  registration is basically `RscHandlerPpi->Register
                  (SerialStatusCodeReportWorker);`. The issue I see is
                  the ReportStatusCodeRouter publishes RscHandlerPpi
                  after the PEIMs constructor has been called and if the
                  PEIM. Given globals don’t work when running from ROM
                  you would have to do something like publish a HOB in
                  the library constructor and then have
                  the GenericStatusCodePeiEntry() walk the HOBs and
                  install the handlers. So I guess it is a little easier
                  than I 1st thought when I started writing this mail,
                  but it would require a new public API. <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Thanks,<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Andrew Fish<br>
                  <br>
                  <br>
                  <o:p></o:p></p>
                <blockquote style="border:none !important;
                  margin-left:0px !important; margin-right:0px
                  !important; margin-top:0px !important;
                  padding-left:0px !important; padding-right:0px
                  !important">
                  <div>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;caret-color:
                      rgb(0, 0, 0);font-variant-caps:
                      normal;text-align:start;-webkit-text-stroke-width:
                      0px;word-spacing:0px">
                      <span
                        style="font-size:9.0pt;font-family:"Helvetica",sans-serif">Thanks,</span><o:p></o:p></p>
                    <div>
                      <p class="MsoNormal"><span
                          style="font-size:9.0pt;font-family:"Helvetica",sans-serif">--<span
                            class="apple-converted-space"> </span></span><o:p></o:p></p>
                      <p class="3dmsonormal"><b><span
                            style="font-size:9.0pt;font-family:"Helvetica",sans-serif">Brian
                            J. Johnson<br>
                          </span></b><span
                          style="font-size:9.0pt;font-family:"Helvetica",sans-serif">Enterprise
                          X86 Lab</span><o:p></o:p></p>
                      <p class="3dmsonormal"><span
                          style="font-size:9.0pt;font-family:"Helvetica",sans-serif">Hewlett
                          Packard Enterprise<br>
                          <br>
                          <a href="x-msg://64/3D%22hpe.com%22" moz-do-not-send="true"><b><span
                                style="color:#954F72">hpe.com</span></b></a></span><o:p></o:p></p>
                    </div>
                    <div>
                      <p class="MsoNormal"><o:p></o:p></p>
                    </div>
                  </div>
                </blockquote>
              </div>
              <p class="MsoNormal"> <o:p></o:p></p>
            </div>
          </blockquote>
          <p class="MsoNormal"><o:p> </o:p></p>
          <div>
            <p class="MsoNormal">-<o:p></o:p></p>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <div class="moz-signature"><br>
    </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/61734">View/Reply Online (#61734)</a> |


  


|


  
    <a target="_blank" href="https://groups.io/mt/74953841/1813853">Mute This Topic</a>
  

| <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>



<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>