<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);">
Great!</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);">
It is verified I can boot Linux from a virtio ESP using this patch on QEMU virt machine.</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-platforms/runs/2618819010?check_suite_focus=true" id="LPlnk377400">https://github.com/riscv/riscv-edk2-platforms/runs/2618819010?check_suite_focus=true</a><br>
</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);">
Thanks,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Daniel<br>
</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 13:14<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>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">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>
> -----邮件原件-----<br>
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Daniel<br>
> Schaefer<br>
> 发送时间: 2021年5月18日 10:35<br>
> 收件人: devel@edk2.groups.io; gaoliming@byosoft.com.cn<br>
> 抄送: 'Abner Chang' <abner.chang@hpe.com>; 'Michael D Kinney'<br>
> <michael.d.kinney@intel.com>; 'Zhiguang Liu' <zhiguang.liu@intel.com>;<br>
'Leif<br>
> Lindholm' <leif@nuviainc.com><br>
> 主题: Re: 回复: [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>
> >> -----邮件原件-----<br>
> >> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Daniel<br>
> >> Schaefer<br>
> >> 发送时间: 2021年5月16日 2:13<br>
> >> 收件人: devel@edk2.groups.io<br>
> >> 抄送: Abner Chang <abner.chang@hpe.com>; Michael D Kinney<br>
> >> <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>;<br>
> >> Zhiguang Liu <zhiguang.liu@intel.com>; Leif Lindholm<br>
<leif@nuviainc.com><br>
> >> 主题: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for<br>
> >> RiscV64<br>
> >><br>
> >> Cc: Abner Chang <abner.chang@hpe.com><br>
> >> Cc: Michael D Kinney <michael.d.kinney@intel.com><br>
> >> Cc: Liming Gao <gaoliming@byosoft.com.cn><br>
> >> Cc: Zhiguang Liu <zhiguang.liu@intel.com><br>
> >> Cc: Leif Lindholm <leif@nuviainc.com><br>
> >> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com><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>
<br>
</div>
</span></font></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/75438">View/Reply Online (#75438)</a> |    |  <a target="_blank" href="https://groups.io/mt/82979816/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>