[edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation

Zhiguang Liu posted 1 patch 2 months, 1 week ago
Failed in applying to current master (apply log)
There is a newer version of this series
MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
[edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation
Posted by Zhiguang Liu 2 months, 1 week ago
Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that
this library can be used as BaseLib by Emulator.
Also, add some missing files

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Ray Ni <ray.ni@intel.com>
---
 MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
index 09a610c31c..fefa2e79f6 100644
--- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
+++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Base Library implementation for use with host based unit tests.
 #
-#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
 #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
 #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
 #  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
@@ -18,7 +18,7 @@
   FILE_GUID                      = 9555A0D3-09BA-46C4-A51A-45198E3C765E
   MODULE_TYPE                    = BASE
   VERSION_STRING                 = 1.1
-  LIBRARY_CLASS                  = BaseLib|HOST_APPLICATION
+  LIBRARY_CLASS                  = BaseLib
   LIBRARY_CLASS                  = UnitTestHostBaseLib|HOST_APPLICATION
 
 #
@@ -128,6 +128,7 @@
   X86RdRand.c
   X86SpeculationBarrier.c
   X86UnitTestHost.c
+  IntelTdxNull.c
 
 [Sources.X64]
   X64/LongJump.nasm
@@ -168,6 +169,7 @@
   X64/RdRand.nasm
   ChkStkGcc.c  | GCC
   X86UnitTestHost.c
+  IntelTdxNull.c
 
 [Sources.EBC]
   Ebc/CpuBreakpoint.c
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96886): https://edk2.groups.io/g/devel/message/96886
Mute This Topic: https://groups.io/mt/95401265/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation
Posted by gaoliming via groups.io 2 months, 1 week ago
Zhiguang:
  Can you explain more about the emulator usage model for this library?

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Zhiguang Liu
> 发送时间: 2022年12月2日 14:25
> 收件人: devel@edk2.groups.io
> 抄送: Zhiguang Liu <zhiguang.liu@intel.com>; Michael D Kinney
> <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>;
> Ray Ni <ray.ni@intel.com>
> 主题: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> HOST_APPLICATION limitation
> 
> Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that
> this library can be used as BaseLib by Emulator.
> Also, add some missing files
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Ray Ni <ray.ni@intel.com>
> ---
>  MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> index 09a610c31c..fefa2e79f6 100644
> --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Base Library implementation for use with host based unit tests.
>  #
> -#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
>  #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights
reserved.<BR>
>  #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
>  #  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All
> rights reserved.<BR>
> @@ -18,7 +18,7 @@
>    FILE_GUID                      =
> 9555A0D3-09BA-46C4-A51A-45198E3C765E
>    MODULE_TYPE                    = BASE
>    VERSION_STRING                 = 1.1
> -  LIBRARY_CLASS                  = BaseLib|HOST_APPLICATION
> +  LIBRARY_CLASS                  = BaseLib
>    LIBRARY_CLASS                  =
> UnitTestHostBaseLib|HOST_APPLICATION
> 
>  #
> @@ -128,6 +128,7 @@
>    X86RdRand.c
>    X86SpeculationBarrier.c
>    X86UnitTestHost.c
> +  IntelTdxNull.c
> 
>  [Sources.X64]
>    X64/LongJump.nasm
> @@ -168,6 +169,7 @@
>    X64/RdRand.nasm
>    ChkStkGcc.c  | GCC
>    X86UnitTestHost.c
> +  IntelTdxNull.c
> 
>  [Sources.EBC]
>    Ebc/CpuBreakpoint.c
> --
> 2.31.1.windows.1
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96888): https://edk2.groups.io/g/devel/message/96888
Mute This Topic: https://groups.io/mt/95402993/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation
Posted by Ni, Ray 2 months ago
Liming,
We are running some code that requires MSR access (e.g.: MtrrLib) in EmulatorPkg.

Thanks,
Ray

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> gaoliming via groups.io
> Sent: Friday, December 2, 2022 5:48 PM
> To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com>
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Ni, Ray
> <ray.ni@intel.com>
> Subject: 回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> HOST_APPLICATION limitation
> 
> Zhiguang:
>   Can you explain more about the emulator usage model for this library?
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Zhiguang Liu
> > 发送时间: 2022年12月2日 14:25
> > 收件人: devel@edk2.groups.io
> > 抄送: Zhiguang Liu <zhiguang.liu@intel.com>; Michael D Kinney
> > <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>;
> > Ray Ni <ray.ni@intel.com>
> > 主题: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > HOST_APPLICATION limitation
> >
> > Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that
> > this library can be used as BaseLib by Emulator.
> > Also, add some missing files
> >
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Signed-off-by: Ray Ni <ray.ni@intel.com>
> > ---
> >  MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > index 09a610c31c..fefa2e79f6 100644
> > --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > @@ -1,7 +1,7 @@
> >  ## @file
> >  #  Base Library implementation for use with host based unit tests.
> >  #
> > -#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
> > +#  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.<BR>
> >  #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights
> reserved.<BR>
> >  #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
> >  #  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All
> > rights reserved.<BR>
> > @@ -18,7 +18,7 @@
> >    FILE_GUID                      =
> > 9555A0D3-09BA-46C4-A51A-45198E3C765E
> >    MODULE_TYPE                    = BASE
> >    VERSION_STRING                 = 1.1
> > -  LIBRARY_CLASS                  = BaseLib|HOST_APPLICATION
> > +  LIBRARY_CLASS                  = BaseLib
> >    LIBRARY_CLASS                  =
> > UnitTestHostBaseLib|HOST_APPLICATION
> >
> >  #
> > @@ -128,6 +128,7 @@
> >    X86RdRand.c
> >    X86SpeculationBarrier.c
> >    X86UnitTestHost.c
> > +  IntelTdxNull.c
> >
> >  [Sources.X64]
> >    X64/LongJump.nasm
> > @@ -168,6 +169,7 @@
> >    X64/RdRand.nasm
> >    ChkStkGcc.c  | GCC
> >    X86UnitTestHost.c
> > +  IntelTdxNull.c
> >
> >  [Sources.EBC]
> >    Ebc/CpuBreakpoint.c
> > --
> > 2.31.1.windows.1
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96940): https://edk2.groups.io/g/devel/message/96940
Mute This Topic: https://groups.io/mt/95463143/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation
Posted by Zhiguang Liu 2 months ago
Hi Liming,
Like ray said, we are trying to use some baselib function in EmulatorPkg, which is assembly code in normal BaseLib, and is mocked in UnitTestBaseLib, such as AsmWriteMsr64 and AsmCpuid.

Thanks
Zhiguang

> -----Original Message-----
> From: Ni, Ray <ray.ni@intel.com>
> Sent: Monday, December 5, 2022 1:38 PM
> To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>; Liu,
> Zhiguang <zhiguang.liu@intel.com>
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> HOST_APPLICATION limitation
> 
> Liming,
> We are running some code that requires MSR access (e.g.: MtrrLib) in
> EmulatorPkg.
> 
> Thanks,
> Ray
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > gaoliming via groups.io
> > Sent: Friday, December 2, 2022 5:48 PM
> > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com>
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Ni, Ray
> > <ray.ni@intel.com>
> > Subject: 回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib:
> Remove
> > HOST_APPLICATION limitation
> >
> > Zhiguang:
> >   Can you explain more about the emulator usage model for this library?
> >
> > Thanks
> > Liming
> > > -----邮件原件-----
> > > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Zhiguang
> Liu
> > > 发送时间: 2022年12月2日 14:25
> > > 收件人: devel@edk2.groups.io
> > > 抄送: Zhiguang Liu <zhiguang.liu@intel.com>; Michael D Kinney
> > > <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>;
> > > Ray Ni <ray.ni@intel.com>
> > > 主题: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > > HOST_APPLICATION limitation
> > >
> > > Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that
> > > this library can be used as BaseLib by Emulator.
> > > Also, add some missing files
> > >
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > Signed-off-by: Ray Ni <ray.ni@intel.com>
> > > ---
> > >  MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > index 09a610c31c..fefa2e79f6 100644
> > > --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > @@ -1,7 +1,7 @@
> > >  ## @file
> > >  #  Base Library implementation for use with host based unit tests.
> > >  #
> > > -#  Copyright (c) 2007 - 2021, Intel Corporation. All rights
> > > reserved.<BR>
> > > +#  Copyright (c) 2007 - 2022, Intel Corporation. All rights
> > > +reserved.<BR>
> > >  #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights
> > reserved.<BR>
> > >  #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights
> > > reserved.<BR>  #  Copyright (c) 2020, Hewlett Packard Enterprise
> > > Development LP. All rights reserved.<BR> @@ -18,7 +18,7 @@
> > >    FILE_GUID                      =
> > > 9555A0D3-09BA-46C4-A51A-45198E3C765E
> > >    MODULE_TYPE                    = BASE
> > >    VERSION_STRING                 = 1.1
> > > -  LIBRARY_CLASS                  = BaseLib|HOST_APPLICATION
> > > +  LIBRARY_CLASS                  = BaseLib
> > >    LIBRARY_CLASS                  =
> > > UnitTestHostBaseLib|HOST_APPLICATION
> > >
> > >  #
> > > @@ -128,6 +128,7 @@
> > >    X86RdRand.c
> > >    X86SpeculationBarrier.c
> > >    X86UnitTestHost.c
> > > +  IntelTdxNull.c
> > >
> > >  [Sources.X64]
> > >    X64/LongJump.nasm
> > > @@ -168,6 +169,7 @@
> > >    X64/RdRand.nasm
> > >    ChkStkGcc.c  | GCC
> > >    X86UnitTestHost.c
> > > +  IntelTdxNull.c
> > >
> > >  [Sources.EBC]
> > >    Ebc/CpuBreakpoint.c
> > > --
> > > 2.31.1.windows.1
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> > 
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96941): https://edk2.groups.io/g/devel/message/96941
Mute This Topic: https://groups.io/mt/95463143/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation
Posted by gaoliming via groups.io 2 months ago
Zhiguang and Ray:
  Thanks for your sharing. It is OK to use UnitTestHostBaseLib in emulator platform. 
  Please also update the file header in module inf to describe this usage.

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Zhiguang Liu
> 发送时间: 2022年12月5日 13:53
> 收件人: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io; Gao, Liming
> <gaoliming@byosoft.com.cn>
> 抄送: Kinney, Michael D <michael.d.kinney@intel.com>
> 主题: Re: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> HOST_APPLICATION limitation
> 
> Hi Liming,
> Like ray said, we are trying to use some baselib function in EmulatorPkg,
> which is assembly code in normal BaseLib, and is mocked in UnitTestBaseLib,
> such as AsmWriteMsr64 and AsmCpuid.
> 
> Thanks
> Zhiguang
> 
> > -----Original Message-----
> > From: Ni, Ray <ray.ni@intel.com>
> > Sent: Monday, December 5, 2022 1:38 PM
> > To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>; Liu,
> > Zhiguang <zhiguang.liu@intel.com>
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>
> > Subject: RE: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > HOST_APPLICATION limitation
> >
> > Liming,
> > We are running some code that requires MSR access (e.g.: MtrrLib) in
> > EmulatorPkg.
> >
> > Thanks,
> > Ray
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > > gaoliming via groups.io
> > > Sent: Friday, December 2, 2022 5:48 PM
> > > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com>
> > > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Ni, Ray
> > > <ray.ni@intel.com>
> > > Subject: 回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib:
> > Remove
> > > HOST_APPLICATION limitation
> > >
> > > Zhiguang:
> > >   Can you explain more about the emulator usage model for this library?
> > >
> > > Thanks
> > > Liming
> > > > -----邮件原件-----
> > > > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表
> Zhiguang
> > Liu
> > > > 发送时间: 2022年12月2日 14:25
> > > > 收件人: devel@edk2.groups.io
> > > > 抄送: Zhiguang Liu <zhiguang.liu@intel.com>; Michael D Kinney
> > > > <michael.d.kinney@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>;
> > > > Ray Ni <ray.ni@intel.com>
> > > > 主题: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > > > HOST_APPLICATION limitation
> > > >
> > > > Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that
> > > > this library can be used as BaseLib by Emulator.
> > > > Also, add some missing files
> > > >
> > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > Signed-off-by: Ray Ni <ray.ni@intel.com>
> > > > ---
> > > >  MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 ++++--
> > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > index 09a610c31c..fefa2e79f6 100644
> > > > --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > @@ -1,7 +1,7 @@
> > > >  ## @file
> > > >  #  Base Library implementation for use with host based unit tests.
> > > >  #
> > > > -#  Copyright (c) 2007 - 2021, Intel Corporation. All rights
> > > > reserved.<BR>
> > > > +#  Copyright (c) 2007 - 2022, Intel Corporation. All rights
> > > > +reserved.<BR>
> > > >  #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights
> > > reserved.<BR>
> > > >  #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights
> > > > reserved.<BR>  #  Copyright (c) 2020, Hewlett Packard Enterprise
> > > > Development LP. All rights reserved.<BR> @@ -18,7 +18,7 @@
> > > >    FILE_GUID                      =
> > > > 9555A0D3-09BA-46C4-A51A-45198E3C765E
> > > >    MODULE_TYPE                    = BASE
> > > >    VERSION_STRING                 = 1.1
> > > > -  LIBRARY_CLASS                  =
> BaseLib|HOST_APPLICATION
> > > > +  LIBRARY_CLASS                  = BaseLib
> > > >    LIBRARY_CLASS                  =
> > > > UnitTestHostBaseLib|HOST_APPLICATION
> > > >
> > > >  #
> > > > @@ -128,6 +128,7 @@
> > > >    X86RdRand.c
> > > >    X86SpeculationBarrier.c
> > > >    X86UnitTestHost.c
> > > > +  IntelTdxNull.c
> > > >
> > > >  [Sources.X64]
> > > >    X64/LongJump.nasm
> > > > @@ -168,6 +169,7 @@
> > > >    X64/RdRand.nasm
> > > >    ChkStkGcc.c  | GCC
> > > >    X86UnitTestHost.c
> > > > +  IntelTdxNull.c
> > > >
> > > >  [Sources.EBC]
> > > >    Ebc/CpuBreakpoint.c
> > > > --
> > > > 2.31.1.windows.1
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97044): https://edk2.groups.io/g/devel/message/97044
Mute This Topic: https://groups.io/mt/95507155/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation
Posted by Zhiguang Liu 2 months ago
Hi Liming,
Sure, I will update the patch

Thanks
Zhiguang

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> gaoliming via groups.io
> Sent: Wednesday, December 7, 2022 9:02 AM
> To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com>; Ni, Ray
> <ray.ni@intel.com>
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: 回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> HOST_APPLICATION limitation
> 
> Zhiguang and Ray:
>   Thanks for your sharing. It is OK to use UnitTestHostBaseLib in emulator
> platform.
>   Please also update the file header in module inf to describe this usage.
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Zhiguang Liu
> > 发送时间: 2022年12月5日 13:53
> > 收件人: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io; Gao, Liming
> > <gaoliming@byosoft.com.cn>
> > 抄送: Kinney, Michael D <michael.d.kinney@intel.com>
> > 主题: Re: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > HOST_APPLICATION limitation
> >
> > Hi Liming,
> > Like ray said, we are trying to use some baselib function in
> > EmulatorPkg, which is assembly code in normal BaseLib, and is mocked
> > in UnitTestBaseLib, such as AsmWriteMsr64 and AsmCpuid.
> >
> > Thanks
> > Zhiguang
> >
> > > -----Original Message-----
> > > From: Ni, Ray <ray.ni@intel.com>
> > > Sent: Monday, December 5, 2022 1:38 PM
> > > To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>;
> > > Liu, Zhiguang <zhiguang.liu@intel.com>
> > > Cc: Kinney, Michael D <michael.d.kinney@intel.com>
> > > Subject: RE: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib:
> Remove
> > > HOST_APPLICATION limitation
> > >
> > > Liming,
> > > We are running some code that requires MSR access (e.g.: MtrrLib) in
> > > EmulatorPkg.
> > >
> > > Thanks,
> > > Ray
> > >
> > > > -----Original Message-----
> > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > > > gaoliming via groups.io
> > > > Sent: Friday, December 2, 2022 5:48 PM
> > > > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com>
> > > > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Ni, Ray
> > > > <ray.ni@intel.com>
> > > > Subject: 回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib:
> > > Remove
> > > > HOST_APPLICATION limitation
> > > >
> > > > Zhiguang:
> > > >   Can you explain more about the emulator usage model for this library?
> > > >
> > > > Thanks
> > > > Liming
> > > > > -----邮件原件-----
> > > > > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表
> > Zhiguang
> > > Liu
> > > > > 发送时间: 2022年12月2日 14:25
> > > > > 收件人: devel@edk2.groups.io
> > > > > 抄送: Zhiguang Liu <zhiguang.liu@intel.com>; Michael D Kinney
> > > > > <michael.d.kinney@intel.com>; Liming Gao
> > > <gaoliming@byosoft.com.cn>;
> > > > > Ray Ni <ray.ni@intel.com>
> > > > > 主题: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > > > > HOST_APPLICATION limitation
> > > > >
> > > > > Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so
> > > > > that this library can be used as BaseLib by Emulator.
> > > > > Also, add some missing files
> > > > >
> > > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > > > Signed-off-by: Ray Ni <ray.ni@intel.com>
> > > > > ---
> > > > >  MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 ++++--
> > > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > > b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > > index 09a610c31c..fefa2e79f6 100644
> > > > > --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > > +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > > @@ -1,7 +1,7 @@
> > > > >  ## @file
> > > > >  #  Base Library implementation for use with host based unit tests.
> > > > >  #
> > > > > -#  Copyright (c) 2007 - 2021, Intel Corporation. All rights
> > > > > reserved.<BR>
> > > > > +#  Copyright (c) 2007 - 2022, Intel Corporation. All rights
> > > > > +reserved.<BR>
> > > > >  #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights
> > > > reserved.<BR>
> > > > >  #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights
> > > > > reserved.<BR>  #  Copyright (c) 2020, Hewlett Packard Enterprise
> > > > > Development LP. All rights reserved.<BR> @@ -18,7 +18,7 @@
> > > > >    FILE_GUID                      =
> > > > > 9555A0D3-09BA-46C4-A51A-45198E3C765E
> > > > >    MODULE_TYPE                    = BASE
> > > > >    VERSION_STRING                 = 1.1
> > > > > -  LIBRARY_CLASS                  =
> > BaseLib|HOST_APPLICATION
> > > > > +  LIBRARY_CLASS                  = BaseLib
> > > > >    LIBRARY_CLASS                  =
> > > > > UnitTestHostBaseLib|HOST_APPLICATION
> > > > >
> > > > >  #
> > > > > @@ -128,6 +128,7 @@
> > > > >    X86RdRand.c
> > > > >    X86SpeculationBarrier.c
> > > > >    X86UnitTestHost.c
> > > > > +  IntelTdxNull.c
> > > > >
> > > > >  [Sources.X64]
> > > > >    X64/LongJump.nasm
> > > > > @@ -168,6 +169,7 @@
> > > > >    X64/RdRand.nasm
> > > > >    ChkStkGcc.c  | GCC
> > > > >    X86UnitTestHost.c
> > > > > +  IntelTdxNull.c
> > > > >
> > > > >  [Sources.EBC]
> > > > >    Ebc/CpuBreakpoint.c
> > > > > --
> > > > > 2.31.1.windows.1
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97048): https://edk2.groups.io/g/devel/message/97048
Mute This Topic: https://groups.io/mt/95507515/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-