<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)">
<!--[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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:PMingLiU;
        panose-1:2 1 6 1 0 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:等线;
        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:"\@等线";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@PMingLiU";
        panose-1:2 1 6 1 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        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;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msipheaderdf3d92d6, li.msipheaderdf3d92d6, div.msipheaderdf3d92d6
        {mso-style-name:msipheaderdf3d92d6;
        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.EmailStyle23
        {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:802890323;
        mso-list-type:hybrid;
        mso-list-template-ids:-1197445634 995548254 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.25in;
        text-indent:-.25in;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:PMingLiU;
        mso-ansi-font-weight:bold;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.75in;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.25in;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.75in;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.25in;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.75in;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:4.25in;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:4.75in;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:5.25in;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l1
        {mso-list-id:854540318;
        mso-list-type:hybrid;
        mso-list-template-ids:2023665334 354467486 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-weight:bold;
        mso-bidi-font-weight:bold;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l2
        {mso-list-id:1099302179;
        mso-list-type:hybrid;
        mso-list-template-ids:-690445626 1369340650 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l2:level1
        {mso-level-number-format:alpha-upper;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.25in;
        mso-ansi-font-weight:bold;}
@list l2:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.25in;
        text-indent:-.25in;}
@list l2:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:1.75in;
        text-indent:-9.0pt;}
@list l2:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.25in;
        text-indent:-.25in;}
@list l2:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.75in;
        text-indent:-.25in;}
@list l2:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:3.25in;
        text-indent:-9.0pt;}
@list l2:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.75in;
        text-indent:-.25in;}
@list l2:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:4.25in;
        text-indent:-.25in;}
@list l2:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:4.75in;
        text-indent:-9.0pt;}
@list l3
        {mso-list-id:1920406110;
        mso-list-type:hybrid;
        mso-list-template-ids:877449044 765363678 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l3:level1
        {mso-level-number-format:alpha-upper;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.25in;
        mso-ansi-font-weight:bold;}
@list l3:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.25in;
        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.75in;
        text-indent:-9.0pt;}
@list l3:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.25in;
        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.75in;
        text-indent:-.25in;}
@list l3:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:3.25in;
        text-indent:-9.0pt;}
@list l3:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.75in;
        text-indent:-.25in;}
@list l3:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:4.25in;
        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.75in;
        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]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Abner,<o:p></o:p></p>
<p class="MsoNormal">I think we Mike’s first email regarding the package structure is a good guideline regarding how to place the modules.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What we are discussing is how to organize the module internal contents for different archs. Do you agree?<o:p></o:p></p>
<p class="MsoNormal">I want to clarify this so we have a clear boundary between the two topics.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, Mike’s proposal also defines the <arch> folder inside a module directory.<o:p></o:p></p>
<p class="MsoNormal">Maybe we just work together to refine Mike’s proposal and document it in EDKII coding standard document.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Chao, can you check Mike’s proposal and raise if there is anything not captured?<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">Ray<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> devel@edk2.groups.io <devel@edk2.groups.io> <b>
On Behalf Of </b>Chang, Abner via groups.io<br>
<b>Sent:</b> Wednesday, September 28, 2022 12:31 PM<br>
<b>To:</b> devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com><br>
<b>Cc:</b> Kinney, Michael D <michael.d.kinney@intel.com>; Sunil V L <sunilvl@ventanamicro.com>; lichao <lichao@loongson.cn>; Kirkendall, Garrett <Garrett.Kirkendall@amd.com>; Grimes, Paul <Paul.Grimes@amd.com>; He, Jiangang <Jiangang.He@amd.com>; Attar, AbdulLateef
 (Abdul Lateef) <AbdulLateef.Attar@amd.com>; Leif Lindholm <quic_llindhol@quicinc.com>; Andrew Fish <afish@apple.com><br>
<b>Subject:</b> Re: [edk2-devel] The principles of EDK2 module reconstruction for archs<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="msipheaderdf3d92d6" style="margin:0in"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue">[AMD Official Use Only - General]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><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> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>>
<b>On Behalf Of </b>Ni, Ray via groups.io<br>
<b>Sent:</b> Wednesday, September 28, 2022 11:34 AM<br>
<b>To:</b> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>; Chang, Abner <<a href="mailto:Abner.Chang@amd.com">Abner.Chang@amd.com</a>><br>
<b>Cc:</b> Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>>; Sunil V L <<a href="mailto:sunilvl@ventanamicro.com">sunilvl@ventanamicro.com</a>>; lichao <<a href="mailto:lichao@loongson.cn">lichao@loongson.cn</a>>;
 Kirkendall, Garrett <<a href="mailto:Garrett.Kirkendall@amd.com">Garrett.Kirkendall@amd.com</a>>; Grimes, Paul <<a href="mailto:Paul.Grimes@amd.com">Paul.Grimes@amd.com</a>>; He, Jiangang <<a href="mailto:Jiangang.He@amd.com">Jiangang.He@amd.com</a>>; Attar,
 AbdulLateef (Abdul Lateef) <<a href="mailto:AbdulLateef.Attar@amd.com">AbdulLateef.Attar@amd.com</a>>; Leif Lindholm <<a href="mailto:quic_llindhol@quicinc.com">quic_llindhol@quicinc.com</a>>; Andrew Fish <<a href="mailto:afish@apple.com">afish@apple.com</a>><br>
<b>Subject:</b> Re: [edk2-devel] The principles of EDK2 module reconstruction for archs<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="width:100.0%">
<tbody>
<tr>
<td style="background:#FFB900;padding:5.0pt 2.0pt 5.0pt 2.0pt"></td>
<td width="100%" style="width:100.0%;background:#FFF8E5;padding:5.0pt 4.0pt 5.0pt 12.0pt">
<div>
<p class="MsoNormal" style="mso-element:frame;mso-element-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly">
<b><span style="color:#222222">Caution:</span></b><span style="color:#222222"> This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
<o:p></o:p></span></p>
</div>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">The [Arch] refers to the Processor Architecture.<o:p></o:p></p>
<p class="MsoNormal">The [Module] refer to the EDK2 module.<o:p></o:p></p>
<p class="MsoNormal">The [X86] refers to both IA32 and X64.<o:p></o:p></p>
<p class="MsoNormal"><b>The principles to create the X86 folder in the module:<o:p></o:p></b></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo1"><b>When X86-vendor’s implementation is introduced to the existing module:</b><o:p></o:p></li></ol>
<ol style="margin-top:0in" start="1" type="A">
<li class="MsoListParagraph" style="margin-left:.25in;mso-list:l2 level1 lfo2"><b>The folder reconstruction:<o:p></o:p></b></li></ol>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.25in"><b>A-1. If the module is obviously used by IA32/X64 only<o:p></o:p></b></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">No need to create X86 folder<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">Create X86-vendor’s<b>
</b>stuff under the root directory of module<o:p></o:p></li></ul>
<p class="MsoNormal" style="margin-left:.25in;text-indent:.5in"><b>A-2. If the existing module is expected to accommodate the different archs or the module already has multiple archs:<o:p></o:p></b></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">Create X86 folder<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">Create X86-vendor’s<b>
</b>stuff under X86 folder<o:p></o:p></li></ul>
<p class="MsoNormal"><span style="color:#4472C4">[Ray] Looks good.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.25in;text-indent:.5in"><b><o:p> </o:p></b></p>
<ol style="margin-top:0in" start="2" type="A">
<li class="MsoListParagraph" style="margin-left:.25in;mso-list:l2 level1 lfo2"><b>The files reconstruction:<o:p></o:p></b></li></ol>
<p class="MsoNormal" style="margin-left:.75in"><b>B-1. The module INF metafile<o:p></o:p></b></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">The existing INF metafile should be kept without relocation. Should not have the impacts to the existing DSC/FDF file.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">The new introduced INF metafile should be located under the root directory of module with the file naming format as below. This keeps the consistent module file structure.<o:p></o:p></li></ul>
<ul style="margin-top:0in" type="disc">
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level2 lfo3"><OriginalFileName><arch>.inf<o:p></o:p></li></ul>
</ul>
<p class="MsoNormal"><span style="color:#4472C4">[Ray]  “CpuDxe.inf” and “CpuDxeArm.inf”? is that your intention? New developers may be confused that CpuDxe.inf supports only X86 arch.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">Do you have an example that one module supporting multiple archs using different INF files? MdeModulePkg/DxeIpl is a module supporting different archs with the same INF file.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#4472C4">Or shall we leave it to be decided between the patch contributor and package/module maintainer?<o:p></o:p></span></p>
<p class="MsoNormal"><b><i>[Chang, Abner]  Here I mean the library module, for example SmmCpuFeatureLib.inf and AmdSmmCpuFeatureLib.inf. Will make the statement clear. The file naming above would be changed to
</i><arch><OriginalFileName>.inf as Mike suggested.<i><o:p></o:p></i></b></p>
<p class="MsoNormal"><b><i><o:p> </o:p></i></b></p>
<p class="MsoNormal"><b><i>I am not sure if there is another example having arch-specific INF file. Usually the driver module has the abstract interface and the implementation in the library module. A newly introduced processor architecture driver may create
 it’s own module such as ArmCpuDxe if the delta between implementations  is huge. However, I would prefer to have arch-specific INF for the module if the module implementation can be leveraged. And yes, this requires the discussion between contributor and module
 maintainer if the principles can not perfectly identify the case.</i></b><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>                     B-2. Source files<o:p></o:p></b></p>
<p class="MsoNormal"><b>                              </b>The new arch implementation is introduced to the module in order to leverage the source code and the module design architecture, so<o:p></o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">That is contributor’s responsibility to review the source code and strip the arch-dependent code away and put it into the arch-specific file. Leave the common code in the original
 file if there is no arch-specific and arch-specific-feature wordings in the file name. Create a common file for the common implementation otherwise.<b><o:p></o:p></b></li></ul>
<ul style="margin-top:0in" type="disc">
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level2 lfo3">The file naming for the arch-specific file<o:p></o:p></li></ul>
</ul>
<p class="MsoListParagraph" style="margin-left:1.75in"><OriginalFileName ><arch>.*<o:p></o:p></p>
<ul style="margin-top:0in" type="disc">
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level2 lfo3">The file naming for the common implementation<o:p></o:p></li></ul>
</ul>
<p class="MsoListParagraph" style="margin-left:1.75in">< OriginalFileNaming >Common.*<o:p></o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">That is contributor’s responsibility to relocate the arch-specific source files to the arch-specific folder.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">That is contributor’s responsibility to make sure the original INF metafile can properly pull-in the source file from arch-specific folder after the source file reconstruction.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">The common source files should be located under the root directory of module<o:p></o:p></li></ul>
<p class="MsoNormal">[Ray] If you check the MpInitLib, most of SEV logic are moved to AmdSev.c. But MpLib.c still contains logic to call functions from AmdSev.c based on some AMD specific check. In my opinion, that’s already good enough.<o:p></o:p></p>
<p class="MsoNormal"><b><i>[Chang, Abner]  I am not quite lean to the If-AMD-else in the source file solution. I prefer to separate AMD stuff or vendor feature to a separated file. So we can have the reviewer or maintainer for *Amd* files/module/packages specifically.
 This makes the review responsibility clear and efficient.<o:p></o:p></i></b></p>
<p class="MsoNormal"><i><span style="color:#4472C4">[Ray] You can take a look at the MpInitLib. There are some code paths that are AMD only. I agree to have dedicated reviewers from different vendors if the implementations are different.<o:p></o:p></span></i></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, if you check MdeModulePkg/DxeIpl, implementations for different archs are in different *<b>folders</b>*.<o:p></o:p></p>
<p class="MsoNormal">Can we leave this to the module owner to decide how to place the implementations?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><o:p> </o:p></b></p>
<ol style="margin-top:0in" start="2" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo1"><b>When a new arch’s implementation is introduced to the existing module which was developed for the specific arch:</b><o:p></o:p></li></ol>
<ol style="margin-top:0in" start="1" type="A">
<li class="MsoListParagraph" style="margin-left:.25in;mso-list:l3 level1 lfo4"><b>The folder reconstruction:<o:p></o:p></b></li></ol>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">Create arch folder for the existing arch implementation<o:p></o:p></li></ul>
<p class="MsoNormal"><span style="color:#4472C4">[Ray] Do you move existing arch implementation to that arch folder? It will break existing platforms a lot.<o:p></o:p></span></p>
<p class="MsoNormal"><b><i>[Chang, Abner] We will move the arch implementation to the arch folder without moving INF. This wont impact the platform DSC and FDF, however this has the impact to the existing overwrite.<o:p></o:p></i></b></p>
<p class="MsoNormal">[Ray] I might misunderstand your idea as “UefiCpuPkg/CpuDxe -> UefiCpuPkg/X86/CpuDxe”.<o:p></o:p></p>
<p class="MsoNormal">Now I guess you tries to say: “UefiCpuPkg/CpuDxe -> UefiCpuPkg/CpuDxe/X86”. That looks good to me.<o:p></o:p></p>
<p class="MsoNormal">We need a more clear statement here<span style="font-family:"Segoe UI Emoji",sans-serif">😊</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">Create the arch folder for the new introduced arch<o:p></o:p></li></ul>
<p class="MsoNormal"><span style="color:#4472C4">[Ray] I agree. But if we don’t create arch folder for existing arch implementation, the pkg layout will be a mess.<o:p></o:p></span></p>
<p class="MsoNormal"><b><i>[Chang, Abner] right, so the first bullet is important.<o:p></o:p></i></b></p>
<p class="MsoNormal"><b><o:p> </o:p></b></p>
<p class="MsoNormal"><span style="color:#4472C4">[Ray] Hard for me to understand all the principles here. Maybe we review existing code including to-be-upstreamed code and decide how to go.<o:p></o:p></span></p>
<p class="MsoNormal"><b><o:p> </o:p></b></p>
<ol style="margin-top:0in" start="2" type="A">
<li class="MsoListParagraph" style="margin-left:.25in;mso-list:l3 level1 lfo4"><b>The files reconstruction:<o:p></o:p></b></li></ol>
<p class="MsoListParagraph" style="margin-left:.75in"><b>B-1. The module INF metafile<o:p></o:p></b></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">The existing INF file should be kept without the relocation. Should not have the impacts to the existing DSC/FDF file.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">The new introduced INF metafile should be located under the root directory of module with the file naming format as below. This keeps the consistent module file structure.<o:p></o:p></li></ul>
<ul style="margin-top:0in" type="disc">
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level2 lfo3">< OriginalFileNaming><arch>.inf<o:p></o:p></li></ul>
</ul>
<p class="MsoListParagraph" style="margin-left:.75in"><b><o:p> </o:p></b></p>
<p class="MsoListParagraph" style="margin-left:.75in"><b>B-2. Source files<o:p></o:p></b></p>
<p class="MsoNormal">                             The new arch implementation is introduced to this module in order to leverage the source code and the module design architecture, so<o:p></o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">That is contributor’s responsibility to review the source code and strip the arch-dependent code away and put it into the arch-specific file. Leave the common code in the original
 file if there is no arch-specific wording in the file name. Create a common file for the common implementation otherwise.<b><o:p></o:p></b></li></ul>
<ul style="margin-top:0in" type="disc">
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level2 lfo3">The file naming for the arch-specific source file<o:p></o:p></li></ul>
</ul>
<p class="MsoListParagraph" style="margin-left:1.75in">< OriginalFileNaming ><arch>.*<o:p></o:p></p>
<ul style="margin-top:0in" type="disc">
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level2 lfo3">The file naming for the common implementation<o:p></o:p></li></ul>
</ul>
<p class="MsoListParagraph" style="margin-left:1.75in"><OriginalFileNaming>Common.*<o:p></o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">That is contributor’s responsibility to relocate the arch-specific source files to the arch-specific folder.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">That is contributor’s responsibility to make sure the original INF metafile can properly pull-in the source file from arch-specific folder after the source file reconstruction.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">The common source files should be located under the root directory of module<o:p></o:p></li></ul>
<p class="MsoListParagraph"><b><o:p> </o:p></b></p>
<ol style="margin-top:0in" start="3" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l1 level1 lfo1"><b>When a new arch implementation has a huge delta with the original implementation<o:p></o:p></b></li></ol>
<p class="MsoListParagraph">Create a separate module instance. The naming of the module should follow below format,<o:p></o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:.75in;mso-list:l0 level1 lfo3">Add the arch prefix with the original module name:<o:p></o:p></li></ul>
<p class="MsoListParagraph" style="margin-left:1.25in">< OriginalModuleNaming><arch><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"></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/94452">View/Reply Online (#94452)</a> |    |  <a target="_blank" href="https://groups.io/mt/93872791/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>