From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.5287.1621574079626358325 for ; Thu, 20 May 2021 22:14:40 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 21 May 2021 13:14:34 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Abner Chang'" , "'Michael D Kinney'" , "'Zhiguang Liu'" , "'Leif Lindholm'" References: <20210515181234.15186-1-daniel.schaefer@hpe.com> <009501d74b81$bf063b40$3d12b1c0$@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiDlm57lpI06IFtlZGsyLWRldmVsXSBbUEFUQ0ggdjEgMS8xXSBBZGQgTWVtb3J5RmVuY2UgaW1wbGVtZW50YXRpb24gZm9yIFJpc2NWNjQ=?= Date: Fri, 21 May 2021 13:14:37 +0800 Message-ID: <003d01d74e00$321459c0$963d0d40$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQFJypucKS8cqqScHdSjLYIRs6xE8QGbDUQpAnI/8Zmr6AAt0A== Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Daniel: Now, it is clear to me. So, I suggest to merge this change when it is verified on generic RISC-V QEMU virt machine. Is it OK? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA= =B1=ED Daniel > Schaefer > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA5=D4=C218=C8=D5 10:35 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; gaoliming@byosoft.com.cn > =B3=AD=CB=CD: 'Abner Chang' ; 'Michael D Kinney' > ; 'Zhiguang Liu' ; 'Leif > Lindholm' > =D6=F7=CC=E2: Re: =BB=D8=B8=B4: [edk2-devel] [PATCH v1 1/1] Add MemoryFe= nce > implementation for RiscV64 >=20 > On 5/18/21 9:04 AM, gaoliming wrote: > > Daniel: > > Seemly, this API is missing in BaseLib for RiscV64 arch. How do you detect > > this issue? >=20 > What do you mean it's missing? > Yes MemoryFence() for RiscV64 is missing currently, that's why I'm addin= g it > here. >=20 > Maybe you mean that it's not currently used? That's also true. > I'm enabling the generic QEMU virt machine (like OVMF or ArmVirtPkg) for > RISC-V. > At least QemuFwCfgLib and VirtioLib need it. > That's why I have the need to add this implementation now. >=20 > Does that clear it up? >=20 > > Thanks > > Liming > >> -----=D3=CA=BC=FE=D4=AD=BC=FE----- > >> =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4= =FA=B1=ED Daniel > >> Schaefer > >> =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA5=D4=C216=C8=D5 2:13 > >> =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > >> =B3=AD=CB=CD: Abner Chang ; Michael D Kinney > >> ; Liming Gao ; > >> Zhiguang Liu ; Leif Lindholm > >> =D6=F7=CC=E2: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementat= ion for > >> RiscV64 > >> > >> Cc: Abner Chang > >> Cc: Michael D Kinney > >> Cc: Liming Gao > >> Cc: Zhiguang Liu > >> Cc: Leif Lindholm > >> Signed-off-by: Daniel Schaefer > >> --- > >> MdePkg/Library/BaseLib/BaseLib.inf | 1 + > >> MdePkg/Library/BaseLib/RiscV64/MemoryFence.S | 33 > >> ++++++++++++++++++++ > >> 2 files changed, 34 insertions(+) > >> > >> diff --git a/MdePkg/Library/BaseLib/BaseLib.inf > >> b/MdePkg/Library/BaseLib/BaseLib.inf > >> index b76f3af380ea..b7ab5f632366 100644 > >> --- a/MdePkg/Library/BaseLib/BaseLib.inf > >> +++ b/MdePkg/Library/BaseLib/BaseLib.inf > >> @@ -399,6 +399,7 @@ > >> RiscV64/DisableInterrupts.c > >> > >> > >> RiscV64/EnableInterrupts.c > >> > >> > >> RiscV64/CpuPause.c > >> > >> > >> + RiscV64/MemoryFence.S | GCC > >> > >> > >> RiscV64/RiscVSetJumpLongJump.S | GCC > >> > >> > >> RiscV64/RiscVCpuBreakpoint.S | GCC > >> > >> > >> RiscV64/RiscVCpuPause.S | GCC > >> > >> > >> diff --git a/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S > >> b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S > >> new file mode 100644 > >> index 000000000000..283df9356a9a > >> --- /dev/null > >> +++ b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S > >> @@ -0,0 +1,33 @@ > >> > > +##-----------------------------------------------------------------------= -- > > ----- > >> > >> > >> +# > >> > >> > >> +# MemoryFence() for RiscV64 > >> > >> > >> + > >> > >> > >> +# Copyright (c) 2021, Hewlett Packard Enterprise Development. All rights > >> reserved. > >> > >> > >> +# > >> > >> > >> +# SPDX-License-Identifier: BSD-2-Clause-Patent > >> > >> > >> +# > >> > >> > >> > > +##-----------------------------------------------------------------------= -- > > ----- > >> > >> > >> + > >> > >> > >> +.text > >> > >> > >> +.p2align 2 > >> > >> > >> + > >> > >> > >> +ASM_GLOBAL ASM_PFX(MemoryFence) > >> > >> > >> + > >> > >> > >> + > >> > >> > >> +#/** > >> > >> > >> +# Used to serialize load and store operations. > >> > >> > >> +# > >> > >> > >> +# All loads and stores that proceed calls to this function are > > guaranteed to > >> be > >> > >> > >> +# globally visible when this function returns. > >> > >> > >> +# > >> > >> > >> +#**/ > >> > >> > >> +#VOID > >> > >> > >> +#EFIAPI > >> > >> > >> +#MemoryFence ( > >> > >> > >> +# VOID > >> > >> > >> +# ); > >> > >> > >> +# > >> > >> > >> +ASM_PFX(MemoryFence): > >> > >> > >> + // Fence on all memory and I/O > >> > >> > >> + fence > >> > >> > >> + ret > >> > >> > >> -- > >> 2.30.1 > >> > >> > >> > >> > >> > > > > > > > > > > > > > > > > >=20 >=20 >=20 >=20