From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from loongson.cn (loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web12.2107.1649819835263573635 for ; Tue, 12 Apr 2022 20:17:27 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: loongson.cn, ip: 114.242.206.163, mailfrom: lichao@loongson.cn) Received: from lichao-PC (unknown [10.40.24.65]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxzxG0QFZiDlchAA--.12640S2; Wed, 13 Apr 2022 11:17:08 +0800 (CST) Date: Wed, 13 Apr 2022 11:17:08 +0800 From: "Chao Li" To: "=?utf-8?Q?=22Chang=2C_Abner_(HPS_SW/FW_Technologist)=22?=" Cc: "=?utf-8?Q?=22devel=40edk2.groups.io=22?=" , Michael D Kinney , Liming Gao , Zhiguang Liu Message-ID: <62C9ADB1-9836-4550-BBEE-2EDDE4210547@getmailspring.com> In-Reply-To: References: Subject: Re: [edk2-devel] [staging/LoongArch RESEND PATCH v1 25/33] MdePkg/BaseCpuLib: LoongArch Base CPU library implementation. X-Mailer: Mailspring MIME-Version: 1.0 X-CM-TRANSID: AQAAf9DxzxG0QFZiDlchAA--.12640S2 X-Coremail-Antispam: 1UD129KBjvJXoWfGrW5GF48CryUtrWkKr15urg_yoWkur4rpF n3JrsxGFyUXFWIvr93J3W7Grs5tF1kJ345GFs0vrs7Ar4jy3Wvk3W7t3y8X34UA34UArW8 ur4YqanxuFykGFUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUmmb7Iv0xC_tr1lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwV C2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40Eb7x2 x7xS6r1j6r4UMc02F40EFcxC0VAKzVAqx4xG6I80ewAqx4xG64kEw2xG04xIwI0_Xr0_Wr 1l5I8CrVC2j2CEjI02ccxYII8I67AEr4CY67k08wAv7VC0I7IYx2IY67AKxVWUGVWUXwAv 7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMx 8GjcxK6IxK0xIIj40E5I8CrwCY02Avz4vE-syl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC 6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUGVWUWwC20s026x8GjcxK67AKxVWUGVWUWw C2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_ JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrJr 0_WFyUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4U YxBIdaVFxhVjvjDU0xZFpf9x07j09a9UUUUU= X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAPCF3QvPKnwAABsj Content-Type: multipart/alternative; boundary="625640b4_4f8d8aa_14d0" --625640b4_4f8d8aa_14d0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Abner, You pointed out that you attached a patch to your last email, but I didn't = find it, do you forgot to put it? In the current EDK II code repo, I can no= t find the patch which you mentioned. -- Thanks, Chao ------------------------ On 4=E6=9C=88 8 2022, at 7:26 =E6=99=9A=E4=B8=8A, "Chang, Abner (HPS SW/FW = Technologist)" wrote: > Recently there is a work to migrate UefiCpuLib to CpuLib (patch attached)= , you may want to sync up your changes with that patch set. RISC-V will do = the same work later. > > Thanks > Abner > > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Chao Li > > Sent: Wednesday, February 9, 2022 2:56 PM > > To: devel@edk2.groups.io > > Cc: Michael D Kinney ; Liming Gao > > ; Zhiguang Liu > > Subject: [edk2-devel] [staging/LoongArch RESEND PATCH v1 25/33] > > MdePkg/BaseCpuLib: LoongArch Base CPU library implementation. > > > > Implement LoongArch CPU related functions in BaseCpuLib. > > > > Cc: Michael D Kinney > > Cc: Liming Gao > > Cc: Zhiguang Liu > > > > Signed-off-by: Chao Li > > --- > > MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 7 ++++++- > > MdePkg/Library/BaseCpuLib/BaseCpuLib.uni | 5 +++-- > > MdePkg/Library/BaseCpuLib/LoongArch/CpuFlushTlb.S | 15 > > +++++++++++++++ > > MdePkg/Library/BaseCpuLib/LoongArch/CpuSleep.S | 15 > > +++++++++++++++ > > 4 files changed, 39 insertions(+), 3 deletions(-) > > create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/CpuFlushTlb.S > > create mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/CpuSleep.S > > > > diff --git a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf > > b/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf > > index 950f5229b2..3101fc656e 100644 > > --- a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf > > +++ b/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf > > @@ -8,6 +8,7 @@ > > # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved. > > # Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
> > # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All ri= ghts > > reserved.
> > +# Portions Copyright (c) 2022, Loongson Technology Corporation Limited= . All > > rights reserved.
> > # > > # SPDX-License-Identifier: BSD-2-Clause-Patent > > # > > @@ -25,7 +26,7 @@ > > > > > > # > > -# VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 RISCV64 > > +# VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 RISCV64 > > LOONGARCH64 > > # > > > > [Sources.IA32] > > @@ -63,6 +64,10 @@ > > [Sources.RISCV64] > > RiscV/Cpu.S > > > > +[Sources.LOONGARCH64] > > + LoongArch/CpuFlushTlb.S | GCC > > + LoongArch/CpuSleep.S | GCC > > + > > [Packages] > > MdePkg/MdePkg.dec > > > > diff --git a/MdePkg/Library/BaseCpuLib/BaseCpuLib.uni > > b/MdePkg/Library/BaseCpuLib/BaseCpuLib.uni > > index 80dc495786..7c5c8dfb37 100644 > > --- a/MdePkg/Library/BaseCpuLib/BaseCpuLib.uni > > +++ b/MdePkg/Library/BaseCpuLib/BaseCpuLib.uni > > @@ -1,13 +1,14 @@ > > // /** @file > > // Instance of CPU Library for various architecture. > > // > > -// CPU Library implemented using ASM functions for IA-32, X64 and RISC= V64, > > +// CPU Library implemented using ASM functions for IA-32, X64, RISCV64 > > and LoongArch64, > > // PAL CALLs for IPF, and empty functions for EBC. > > // > > // Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved. > > // Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<= BR> > > // Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved. > > // Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All r= ights > > reserved.
> > +// Portions Copyright (c) 2022, Loongson Technology Corporation Limite= d. > > All rights reserved.
> > // > > // SPDX-License-Identifier: BSD-2-Clause-Patent > > // > > @@ -16,5 +17,5 @@ > > > > #string STR_MODULE_ABSTRACT #language en-US "Instance of CPU > > Library for various architectures" > > > > -#string STR_MODULE_DESCRIPTION #language en-US "CPU Library > > implemented using ASM functions for IA-32, X64 and RISCV64, PAL CALLs f= or > > IPF, and empty functions for EBC." > > +#string STR_MODULE_DESCRIPTION #language en-US "CPU Library > > implemented using ASM functions for IA-32, X64, RISCV64 and LoongArch64= , > > PAL CALLs for IPF, and empty functions for EBC." > > > > diff --git a/MdePkg/Library/BaseCpuLib/LoongArch/CpuFlushTlb.S > > b/MdePkg/Library/BaseCpuLib/LoongArch/CpuFlushTlb.S > > new file mode 100644 > > index 0000000000..8b792f0a37 > > --- /dev/null > > +++ b/MdePkg/Library/BaseCpuLib/LoongArch/CpuFlushTlb.S > > @@ -0,0 +1,15 @@ > > +#---------------------------------------------------------------------= --------- > > +# > > +# CpuFlushTlb() for LoongArch64 > > +# > > +# Copyright (c) 2022, Loongson Technology Corporation Limited. All rig= hts > > reserved.
> > +# > > +# SPDX-License-Identifier: BSD-2-Clause-Patent > > +# > > +#---------------------------------------------------------------------= --------- > > +ASM_GLOBAL ASM_PFX(CpuFlushTlb) > > + > > +ASM_PFX(CpuFlushTlb): > > + tlbflush > > + jirl $zero, $ra, 0 > > + .end > > diff --git a/MdePkg/Library/BaseCpuLib/LoongArch/CpuSleep.S > > b/MdePkg/Library/BaseCpuLib/LoongArch/CpuSleep.S > > new file mode 100644 > > index 0000000000..eb31b10714 > > --- /dev/null > > +++ b/MdePkg/Library/BaseCpuLib/LoongArch/CpuSleep.S > > @@ -0,0 +1,15 @@ > > +#---------------------------------------------------------------------= --------- > > +# > > +# CpuSleep() for LoongArch64 > > +# > > +# Copyright (c) 2022, Loongson Technology Corporation Limited. All rig= hts > > reserved.
> > +# > > +# SPDX-License-Identifier: BSD-2-Clause-Patent > > +# > > +#---------------------------------------------------------------------= --------- > > +ASM_GLOBAL ASM_PFX(CpuSleep) > > + > > +ASM_PFX(CpuSleep): > > + idle 0 > > + jirl $zero, $ra, 0 > > + .end > > -- > > 2.27.0 > > > > > > > >=20 > --625640b4_4f8d8aa_14d0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi Abner,

You pointed out that you attached a patch to y= our last email, but I didn't find it, do you forgot to put it? In the curre= nt EDK II code repo, I can not find the patch which you mentioned.

--
Thanks,
Chao
------------------------


On 4=E6=9C=88 8 2022, a= t 7:26 =E6=99=9A=E4=B8=8A, "Chang, Abner (HPS SW/FW Technologist)" <abne= r.chang@hpe.com> wrote:
Recently there is a w= ork to migrate UefiCpuLib to CpuLib (patch attached), you may want to sync = up your changes with that patch set. RISC-V will do the same work later.
Thanks
Abner

> -----Original Message= -----
> From: devel@edk2.groups.io <devel@edk2.groups.io>= ; On Behalf Of Chao Li
> Sent: Wednesday, February 9, 2022 2:5= 6 PM
> To: devel@edk2.groups.io
> Cc: Michael D K= inney <michael.d.kinney@intel.com>; Liming Gao
> <gao= liming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>
> Subject: [edk2-devel] [staging/LoongArch RESEND PATCH v1 25/33]<= /div>
> MdePkg/BaseCpuLib: LoongArch Base CPU library implementation= .
>
> Implement LoongArch CPU related functions i= n BaseCpuLib.
>
> Cc: Michael D Kinney <michae= l.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosof= t.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>=
>
> Signed-off-by: Chao Li <lichao@loongson.c= n>
> ---
> MdePkg/Library/BaseCpuLib/BaseCpuLi= b.inf | 7 ++++++-
> MdePkg/Library/BaseCpuLib/BaseCpuLib.uni |= 5 +++--
> MdePkg/Library/BaseCpuLib/LoongArch/CpuFlushTlb.S |= 15
> +++++++++++++++
> MdePkg/Library/BaseCpuLib= /LoongArch/CpuSleep.S | 15
> +++++++++++++++
> 4 = files changed, 39 insertions(+), 3 deletions(-)
> create mode = 100644 MdePkg/Library/BaseCpuLib/LoongArch/CpuFlushTlb.S
> cre= ate mode 100644 MdePkg/Library/BaseCpuLib/LoongArch/CpuSleep.S
&g= t;
> diff --git a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
> b/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
> index= 950f5229b2..3101fc656e 100644
> --- a/MdePkg/Library/BaseCpuL= ib/BaseCpuLib.inf
> +++ b/MdePkg/Library/BaseCpuLib/BaseCpuLib= .inf
> @@ -8,6 +8,7 @@
> # Portions copyright (c)= 2008 - 2009, Apple Inc. All rights reserved.<BR>
> # Po= rtions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
> # Copyright (c) 2020, Hewlett Packard Enterprise Development = LP. All rights
> reserved.<BR>
> +# Portion= s Copyright (c) 2022, Loongson Technology Corporation Limited. All
> rights reserved.<BR>
> #
> # SPDX-Li= cense-Identifier: BSD-2-Clause-Patent
> #
> @@ -2= 5,7 +26,7 @@
>
>
> #
> = -# VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 RISCV64
> = +# VALID_ARCHITECTURES =3D IA32 X64 EBC ARM AARCH64 RISCV64
> = LOONGARCH64
> #
>
> [Sources.IA32]
> @@ -63,6 +64,10 @@
> [Sources.RISCV64]
> RiscV/Cpu.S
>
> +[Sources.LOONGARCH64]
> + LoongArch/CpuFlushTlb.S | GCC
> + LoongArch/CpuSl= eep.S | GCC
> +
> [Packages]
> MdePk= g/MdePkg.dec
>
> diff --git a/MdePkg/Library/Base= CpuLib/BaseCpuLib.uni
> b/MdePkg/Library/BaseCpuLib/BaseCpuLib= .uni
> index 80dc495786..7c5c8dfb37 100644
> --- = a/MdePkg/Library/BaseCpuLib/BaseCpuLib.uni
> +++ b/MdePkg/Libr= ary/BaseCpuLib/BaseCpuLib.uni
> @@ -1,13 +1,14 @@
&g= t; // /** @file
> // Instance of CPU Library for various archi= tecture.
> //
> -// CPU Library implemented using= ASM functions for IA-32, X64 and RISCV64,
> +// CPU Library i= mplemented using ASM functions for IA-32, X64, RISCV64
> and L= oongArch64,
> // PAL CALLs for IPF, and empty functions for EB= C.
> //
> // Copyright (c) 2007 - 2014, Intel Cor= poration. All rights reserved.<BR>
> // Portions copyrig= ht (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
>= ; // Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<B= R>
> // Copyright (c) 2020, Hewlett Packard Enterprise Deve= lopment LP. All rights
> reserved.<BR>
> +/= / Portions Copyright (c) 2022, Loongson Technology Corporation Limited.
> All rights reserved.<BR>
> //
>= // SPDX-License-Identifier: BSD-2-Clause-Patent
> //
> @@ -16,5 +17,5 @@
>
> #string STR_MODULE_A= BSTRACT #language en-US "Instance of CPU
> Library for various= architectures"
>
> -#string STR_MODULE_DESCRIPTI= ON #language en-US "CPU Library
> implemented using ASM functi= ons for IA-32, X64 and RISCV64, PAL CALLs for
> IPF, and empty= functions for EBC."
> +#string STR_MODULE_DESCRIPTION #langua= ge en-US "CPU Library
> implemented using ASM functions for IA= -32, X64, RISCV64 and LoongArch64,
> PAL CALLs for IPF, and em= pty functions for EBC."
>
> diff --git a/MdePkg/L= ibrary/BaseCpuLib/LoongArch/CpuFlushTlb.S
> b/MdePkg/Library/B= aseCpuLib/LoongArch/CpuFlushTlb.S
> new file mode 100644
=
> index 0000000000..8b792f0a37
> --- /dev/null
> +++ b/MdePkg/Library/BaseCpuLib/LoongArch/CpuFlushTlb.S
&= gt; @@ -0,0 +1,15 @@
> +#-------------------------------------= -----------------------------------------
> +#
> = +# CpuFlushTlb() for LoongArch64
> +#
> +# Copyri= ght (c) 2022, Loongson Technology Corporation Limited. All rights
> reserved.<BR>
> +#
> +# SPDX-License-= Identifier: BSD-2-Clause-Patent
> +#
> +#--------= ----------------------------------------------------------------------
> +ASM_GLOBAL ASM_PFX(CpuFlushTlb)
> +
>= +ASM_PFX(CpuFlushTlb):
> + tlbflush
> + jirl $ze= ro, $ra, 0
> + .end
> diff --git a/MdePkg/Library= /BaseCpuLib/LoongArch/CpuSleep.S
> b/MdePkg/Library/BaseCpuLib= /LoongArch/CpuSleep.S
> new file mode 100644
> in= dex 0000000000..eb31b10714
> --- /dev/null
> +++ = b/MdePkg/Library/BaseCpuLib/LoongArch/CpuSleep.S
> @@ -0,0 +1,= 15 @@
> +#----------------------------------------------------= --------------------------
> +#
> +# CpuSleep() f= or LoongArch64
> +#
> +# Copyright (c) 2022, Loon= gson Technology Corporation Limited. All rights
> reserved.<= ;BR>
> +#
> +# SPDX-License-Identifier: BSD-2-= Clause-Patent
> +#
> +#--------------------------= ----------------------------------------------------
> +ASM_GL= OBAL ASM_PFX(CpuSleep)
> +
> +ASM_PFX(CpuSleep):<= /div>
> + idle 0
> + jirl $zero, $ra, 0
> = + .end
> --
> 2.27.0
>
>= ;
>
>
--625640b4_4f8d8aa_14d0--