<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
It's not required to go into that tag.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We need two more patches that we haven't submitted yet to boot on Qemu.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Would it be okay if we used a library from ArmVirtPkg for RISCV64?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
See: <a href="https://github.com/riscv/riscv-edk2/commit/8c7960ef860c65f2646912c3dccbb308a98e0cc3" id="LPlnk">https://github.com/riscv/riscv-edk2/commit/8c7960ef860c65f2646912c3dccbb308a98e0cc3</a><br>
</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Or does it have to be moved to some other place first?</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> devel@edk2.groups.io <devel@edk2.groups.io> on behalf of gaoliming <gaoliming@byosoft.com.cn><br>
<b>Sent:</b> Friday, May 21, 2021 14:35<br>
<b>To:</b> devel@edk2.groups.io <devel@edk2.groups.io>; Schaefer, Daniel <daniel.schaefer@hpe.com><br>
<b>Cc:</b> Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; 'Michael D Kinney' <michael.d.kinney@intel.com>; 'Zhiguang Liu' <zhiguang.liu@intel.com>; 'Leif Lindholm' <leif@nuviainc.com><br>
<b>Subject:</b> 回复: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:宋体}
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:等线}
@font-face
        {font-family:Calibri}
@font-face
        {}
@font-face
        {}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0cm;
        font-size:12.0pt;
        font-family:宋体}
a:link, span.x_MsoHyperlink
        {color:blue;
        text-decoration:underline}
span.x_EmailStyle20
        {font-family:等线;
        color:windowtext}
.x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:72.0pt 90.0pt 72.0pt 90.0pt}
div.x_WordSection1
        {}
-->
</style>
<div lang="ZH-CN" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="x_WordSection1">
<p class="x_MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Daniel:</span></p>
<p class="x_MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:等线"> Thanks for your information. Acked-by: Liming Gao <gaoliming@byosoft.com.cn></span></p>
<p class="x_MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:等线"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:等线">  And, do you request to merge this patch for edk2 stable tag 202105?
</span></p>
<p class="x_MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:等线">  </span></p>
<p class="x_MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:等线">Thanks</span></p>
<p class="x_MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:等线">Liming</span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:等线">发件人<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11.0pt; font-family:等线"> devel@edk2.groups.io <devel@edk2.groups.io>
</span><b><span style="font-size:11.0pt; font-family:等线">代表 </span></b><span lang="EN-US" style="font-size:11.0pt; font-family:等线">Daniel Schaefer<br>
</span><b><span style="font-size:11.0pt; font-family:等线">发送时间<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11.0pt; font-family:等线"> 2021</span><span style="font-size:11.0pt; font-family:等线">年<span lang="EN-US">5</span>月<span lang="EN-US">21</span>日<span lang="EN-US">
 13:27<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> devel@edk2.groups.io; gaoliming@byosoft.com.cn<br>
</span><b>抄送<span lang="EN-US">:</span></b><span lang="EN-US"> Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; 'Michael D Kinney' <michael.d.kinney@intel.com>; 'Zhiguang Liu' <zhiguang.liu@intel.com>; 'Leif Lindholm' <leif@nuviainc.com><br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> Re: </span>回复<span lang="EN-US">: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64</span></span></p>
</div>
</div>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<div>
<p class="x_MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif; color:black">Great!</span></p>
</div>
<div>
<p class="x_MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif; color:black">It is verified I can boot Linux from a virtio ESP using this patch on QEMU virt machine.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif; color:black">See:
<a href="https://github.com/riscv/riscv-edk2-platforms/runs/2618819010?check_suite_focus=true">https://github.com/riscv/riscv-edk2-platforms/runs/2618819010?check_suite_focus=true</a></span></p>
</div>
<div>
<p class="x_MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif; color:black">Thanks,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif; color:black">Daniel</span></p>
</div>
<div class="x_MsoNormal" align="center" style="text-align:center"><span lang="EN-US">
<hr size="2" width="98%" align="center">
</span></div>
<div id="x_divRplyFwdMsg">
<p class="x_MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black">From:</span></b><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black">
<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>> on behalf of gaoliming <<a href="mailto:gaoliming@byosoft.com.cn">gaoliming@byosoft.com.cn</a>><br>
<b>Sent:</b> Friday, May 21, 2021 13:14<br>
<b>To:</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>>; Schaefer, Daniel <<a href="mailto:daniel.schaefer@hpe.com">daniel.schaefer@hpe.com</a>><br>
<b>Cc:</b> Chang, Abner (HPS SW/FW Technologist) <<a href="mailto:abner.chang@hpe.com">abner.chang@hpe.com</a>>; 'Michael D Kinney' <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>>; 'Zhiguang Liu' <<a href="mailto:zhiguang.liu@intel.com">zhiguang.liu@intel.com</a>>;
 'Leif Lindholm' <<a href="mailto:leif@nuviainc.com">leif@nuviainc.com</a>><br>
<b>Subject:</b> </span><span style="font-size:11.0pt; color:black">回复</span><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black">:
</span><span style="font-size:11.0pt; color:black">回复</span><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:black">: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64</span><span lang="EN-US">
</span></p>
<div>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
</div>
</div>
<div>
<div>
<p class="x_MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US" style="font-size:11.0pt">Daniel:<br>
  Now, it is clear to me. So, I suggest to merge this change when it is<br>
verified on generic RISC-V QEMU virt machine. Is it OK?<br>
<br>
Thanks<br>
Liming<br>
> -----</span><span style="font-size:11.0pt">邮件原件<span lang="EN-US">-----<br>
> </span>发件人<span lang="EN-US">: <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>>
</span>代表<span lang="EN-US"> Daniel<br>
> Schaefer<br>
> </span>发送时间<span lang="EN-US">: 2021</span>年<span lang="EN-US">5</span>月<span lang="EN-US">18</span>日<span lang="EN-US"> 10:35<br>
> </span>收件人<span lang="EN-US">: <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>;
<a href="mailto:gaoliming@byosoft.com.cn">gaoliming@byosoft.com.cn</a><br>
> </span>抄送<span lang="EN-US">: 'Abner Chang' <<a href="mailto:abner.chang@hpe.com">abner.chang@hpe.com</a>>; 'Michael D Kinney'<br>
> <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>>; 'Zhiguang Liu' <<a href="mailto:zhiguang.liu@intel.com">zhiguang.liu@intel.com</a>>;<br>
'Leif<br>
> Lindholm' <<a href="mailto:leif@nuviainc.com">leif@nuviainc.com</a>><br>
> </span>主题<span lang="EN-US">: Re: </span>回复<span lang="EN-US">: [edk2-devel] [PATCH v1 1/1] Add MemoryFence<br>
> implementation for RiscV64<br>
> <br>
> On 5/18/21 9:04 AM, gaoliming wrote:<br>
> > Daniel:<br>
> >  Seemly, this API is missing in BaseLib for RiscV64 arch. How do you<br>
detect<br>
> > this issue?<br>
> <br>
> What do you mean it's missing?<br>
> Yes MemoryFence() for RiscV64 is missing currently, that's why I'm adding<br>
it<br>
> here.<br>
> <br>
> Maybe you mean that it's not currently used? That's also true.<br>
> I'm enabling the generic QEMU virt machine (like OVMF or ArmVirtPkg) for<br>
> RISC-V.<br>
> At least QemuFwCfgLib and VirtioLib need it.<br>
> That's why I have the need to add this implementation now.<br>
> <br>
> Does that clear it up?<br>
> <br>
> > Thanks<br>
> > Liming<br>
> >> -----</span>邮件原件<span lang="EN-US">-----<br>
> >> </span>发件人<span lang="EN-US">: <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>>
</span>代表<span lang="EN-US"> Daniel<br>
> >> Schaefer<br>
> >> </span>发送时间<span lang="EN-US">: 2021</span>年<span lang="EN-US">5</span>月<span lang="EN-US">16</span>日<span lang="EN-US"> 2:13<br>
> >> </span>收件人<span lang="EN-US">: <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
> >> </span>抄送<span lang="EN-US">: Abner Chang <<a href="mailto:abner.chang@hpe.com">abner.chang@hpe.com</a>>; Michael D Kinney<br>
> >> <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>>; Liming Gao <<a href="mailto:gaoliming@byosoft.com.cn">gaoliming@byosoft.com.cn</a>>;<br>
> >> Zhiguang Liu <<a href="mailto:zhiguang.liu@intel.com">zhiguang.liu@intel.com</a>>; Leif Lindholm<br>
<<a href="mailto:leif@nuviainc.com">leif@nuviainc.com</a>><br>
> >> </span>主题<span lang="EN-US">: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for<br>
> >> RiscV64<br>
> >><br>
> >> Cc: Abner Chang <<a href="mailto:abner.chang@hpe.com">abner.chang@hpe.com</a>><br>
> >> Cc: Michael D Kinney <<a href="mailto:michael.d.kinney@intel.com">michael.d.kinney@intel.com</a>><br>
> >> Cc: Liming Gao <<a href="mailto:gaoliming@byosoft.com.cn">gaoliming@byosoft.com.cn</a>><br>
> >> Cc: Zhiguang Liu <<a href="mailto:zhiguang.liu@intel.com">zhiguang.liu@intel.com</a>><br>
> >> Cc: Leif Lindholm <<a href="mailto:leif@nuviainc.com">leif@nuviainc.com</a>><br>
> >> Signed-off-by: Daniel Schaefer <<a href="mailto:daniel.schaefer@hpe.com">daniel.schaefer@hpe.com</a>><br>
> >> ---<br>
> >>  MdePkg/Library/BaseLib/BaseLib.inf           |  1 +<br>
> >>  MdePkg/Library/BaseLib/RiscV64/MemoryFence.S | 33<br>
> >> ++++++++++++++++++++<br>
> >>  2 files changed, 34 insertions(+)<br>
> >><br>
> >> diff --git a/MdePkg/Library/BaseLib/BaseLib.inf<br>
> >> b/MdePkg/Library/BaseLib/BaseLib.inf<br>
> >> index b76f3af380ea..b7ab5f632366 100644<br>
> >> --- a/MdePkg/Library/BaseLib/BaseLib.inf<br>
> >> +++ b/MdePkg/Library/BaseLib/BaseLib.inf<br>
> >> @@ -399,6 +399,7 @@<br>
> >>    RiscV64/DisableInterrupts.c<br>
> >><br>
> >><br>
> >>    RiscV64/EnableInterrupts.c<br>
> >><br>
> >><br>
> >>    RiscV64/CpuPause.c<br>
> >><br>
> >><br>
> >> +  RiscV64/MemoryFence.S             | GCC<br>
> >><br>
> >><br>
> >>    RiscV64/RiscVSetJumpLongJump.S    | GCC<br>
> >><br>
> >><br>
> >>    RiscV64/RiscVCpuBreakpoint.S      | GCC<br>
> >><br>
> >><br>
> >>    RiscV64/RiscVCpuPause.S           | GCC<br>
> >><br>
> >><br>
> >> diff --git a/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S<br>
> >> b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S<br>
> >> new file mode 100644<br>
> >> index 000000000000..283df9356a9a<br>
> >> --- /dev/null<br>
> >> +++ b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S<br>
> >> @@ -0,0 +1,33 @@<br>
> >><br>
> ><br>
+##-------------------------------------------------------------------------<br>
> > -----<br>
> >><br>
> >><br>
> >> +#<br>
> >><br>
> >><br>
> >> +# MemoryFence() for RiscV64<br>
> >><br>
> >><br>
> >> +<br>
> >><br>
> >><br>
> >> +# Copyright (c) 2021, Hewlett Packard Enterprise Development. All<br>
rights<br>
> >> reserved.<br>
> >><br>
> >><br>
> >> +#<br>
> >><br>
> >><br>
> >> +# SPDX-License-Identifier: BSD-2-Clause-Patent<br>
> >><br>
> >><br>
> >> +#<br>
> >><br>
> >><br>
> >><br>
> ><br>
+##-------------------------------------------------------------------------<br>
> > -----<br>
> >><br>
> >><br>
> >> +<br>
> >><br>
> >><br>
> >> +.text<br>
> >><br>
> >><br>
> >> +.p2align 2<br>
> >><br>
> >><br>
> >> +<br>
> >><br>
> >><br>
> >> +ASM_GLOBAL ASM_PFX(MemoryFence)<br>
> >><br>
> >><br>
> >> +<br>
> >><br>
> >><br>
> >> +<br>
> >><br>
> >><br>
> >> +#/**<br>
> >><br>
> >><br>
> >> +#  Used to serialize load and store operations.<br>
> >><br>
> >><br>
> >> +#<br>
> >><br>
> >><br>
> >> +#  All loads and stores that proceed calls to this function are<br>
> > guaranteed to<br>
> >> be<br>
> >><br>
> >><br>
> >> +#  globally visible when this function returns.<br>
> >><br>
> >><br>
> >> +#<br>
> >><br>
> >><br>
> >> +#**/<br>
> >><br>
> >><br>
> >> +#VOID<br>
> >><br>
> >><br>
> >> +#EFIAPI<br>
> >><br>
> >><br>
> >> +#MemoryFence (<br>
> >><br>
> >><br>
> >> +#  VOID<br>
> >><br>
> >><br>
> >> +#  );<br>
> >><br>
> >><br>
> >> +#<br>
> >><br>
> >><br>
> >> +ASM_PFX(MemoryFence):<br>
> >><br>
> >><br>
> >> +    // Fence on all memory and I/O<br>
> >><br>
> >><br>
> >> +    fence<br>
> >><br>
> >><br>
> >> +    ret<br>
> >><br>
> >><br>
> >> --<br>
> >> 2.30.1<br>
> >><br>
> >><br>
> >><br>
> >><br>
> >><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> <br>
> <br>
> <br>
> <br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</span></span></p>
</div>
</div>
<div>
<p class="x_MsoNormal"></p>
</div>
</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/75446">View/Reply Online (#75446)</a> |    |  <a target="_blank" href="https://groups.io/mt/82984716/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>