Re: [edk2-devel] [Bug 3187] FaultTolerantWriteDxe defect will cause NVRAM not recovered after number of WorkSpaceRefresh().

2021-02-05 Thread Chuang, Marlboro
HI Keysound and all,

Sorry for not giving the statement well.
This is my first post so I was not aware of the message not complete on 
bugzilla.

Current issue is observed with below condition.

  *   Assume NVStorage = 0x5E000 and WorkSpace = 0x2000. The total working 
space is 0x6.
  *   When the NVStorage reclaiming reached the WorkSpace full, the 
WorkSpaceRefresh will be triggered. (FTW records reclaim)

The WorkSpaceRefresh() will do the reclaim for WorkSpace but it would move 
whole working block(0x6) for the process.

Once working block is moved to spare region and start to erase the working 
block, the system might be powered off at erase phase (due to the erasing time).

After power on again, the FTW won’t check WorkSpaceBlock valid and see it full 
so that it would start to do WorkSpaceRefresh again.

At this moment, the NVStorage header was erased due to previous 
WorkSpaceRefresh.

After WorkSpaceRefresh is done, the NVStorage header is corrupted and the 
system would not have the working NVStorage service.

The attachment contained the Duplicated code to simulate the user behavior and 
the temporary code fix for the issue.

  1.  DupCodeChange.7z – I use the CMOS to skip the infinite loop to reset 
system. This is just for reproducing the symptom not for any fix.
  2.  FixCodeChange.7z – This is the temporary solution to check if the 
WorkSpaceBlock header is valid or not. If it is not valid, going further to 
have the SpareBlock copying to WorkBlock.

Hope it would be more clear.

Thanks and regards,
Marlboro.


==
Marlboro Chuang
Firmware Engineer
Dell | TDC BIOS Core Team
Office : +886-2-23766313
Mobile: +886-986615685
marlboro.chu...@dell.com
==

From: Keysound Chang 
Sent: Friday, February 5, 2021 7:11 PM
To: devel@edk2.groups.io; Keysound Chang; Chuang, Marlboro; gaoliming
Subject: RE: [edk2-devel] [Bug 3187] FaultTolerantWriteDxe defect will cause 
NVRAM not recovered after number of WorkSpaceRefresh().


[EXTERNAL EMAIL]
After checking Bugzilla 3187, NVRAM already corrupted in this case. Sorry that 
I didn’t aware.

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Keysound Chang 
via groups.io
Sent: Friday, February 5, 2021 11:03 AM
To: devel@edk2.groups.io; 
marlboro.chu...@dell.com; gaoliming 
mailto:gaolim...@byosoft.com.cn>>
Subject: Re: [edk2-devel] [Bug 3187] FaultTolerantWriteDxe defect will cause 
NVRAM not recovered after number of WorkSpaceRefresh().

Hi Marlboro,

How about use non-volatile EFI variable instead of CMOS? Not sure all platforms 
support CMOS.

Regards,

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Chuang, 
Marlboro via groups.io
Sent: Thursday, February 4, 2021 3:08 PM
To: gaoliming mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io
Subject: Re: [edk2-devel] [Bug 3187] FaultTolerantWriteDxe defect will cause 
NVRAM not recovered after number of WorkSpaceRefresh().

HI Gaoliming,

The DupCodeChange is for simulating user force power off the system.
So I just use the CMOS to record the temporarily flag to ensure the code will 
not enter the infinite loop to reset the system.

Best Regards,
Marlboro.


==
Marlboro Chuang
Firmware Engineer
Dell | TDC BIOS Core Team
Office : +886-2-23766313
Mobile: +886-986615685
marlboro.chu...@dell.com
==

-Original Message-
From: gaoliming mailto:gaolim...@byosoft.com.cn>>
Sent: Thursday, February 4, 2021 2:55 PM
To: Chuang, Marlboro; devel@edk2.groups.io
Subject: 回复: [Bug 3187] FaultTolerantWriteDxe defect will cause NVRAM not 
recovered after number of WorkSpaceRefresh().


[EXTERNAL EMAIL]

Chuang:
I see you directly use IO port 0x70, 0x71. What purpose to use them?

Thanks
Liming
> -邮件原件-
> 发件人: Chuang, Marlboro 
> mailto:marlboro.chu...@dell.com>>
> 发送时间: 2021年2月3日 12:59
> 收件人: devel@edk2.groups.io
> 抄送: gaolim...@byosoft.com.cn
> 主题: RE: [Bug 3187] FaultTolerantWriteDxe defect will cause NVRAM not
> recovered after number of WorkSpaceRefresh().
>
> Hi All,
>
> Regarding to Bug 3187, I have the duplicated code change and fix code
> change as the attachment.
> Please help to review and refine it.
>
> Thanks and Regards,
> Marlboro.
>
>
> -Original Message-
> From: 
> bugzilla-dae...@bugzilla.tianocore.org
> mailto:bugzilla-dae...@bugzilla.tianocore.org>>
> Sent: Wednesday, February 3, 2021 11:04 AM
> To: Chuang, Marlboro
> Subject: [Bug 3187] FaultTolerantWriteDxe defect will cause NVRAM not
> recovered after number of 

Re: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

2021-02-05 Thread Ni, Ray
I see. Will send a V3.

From: Kinney, Michael D 
Sent: Saturday, February 6, 2021 3:54 AM
To: Ni, Ray ; devel@edk2.groups.io; Kinney, Michael D 

Subject: RE: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

My comment is only to make the history of changes easier to understand by 
separating the functional and non-functional changes.

Mike

From: Ni, Ray mailto:ray...@intel.com>>
Sent: Friday, February 5, 2021 10:38 AM
To: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; 
devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

Mike,

The clean up doesn’t cause any final instruction change and I have verified 
that.
The reason I put the fix in last because the Lock field is not needed with the 
fix but removing the Lock requires to adjust all the hard code offsets.

What potential issue do you see?

Thanks,
Ray

thanks,
ray

发件人: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
发送时间: Saturday, February 6, 2021 1:11:19 AM
收件人: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>; Ni, Ray 
mailto:ray...@intel.com>>; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
主题: RE: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

Hi Ray,

I really like the cleanup to remove hard coded offsets, but I think that change 
should be its own patch series.

Can we make the functional change to use XADD as its own patch series before 
the change to remove hard coded offsets and use struct?

Then have a 2nd patch series that is a non-functional change to remove hard 
coded offsets and use struct and remove the unused Lock field?

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io 
> mailto:devel@edk2.groups.io>> On Behalf Of Ni, Ray
> Sent: Thursday, February 4, 2021 11:58 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release
>
> Patch #1 follows Laszlo's suggestion to add global NASM macros
>
>   for NASM struc usage.
>
> Patch #2 changes all hardcode offset to use struc.
>
> Patch #3 doesn't have any change comparing to V1 except
>
>   1). dword/qword prefix is added.
>
>   2). the comments "program AP stack" is removed.
>
> Ray Ni (3):
>   MdePkg/Nasm.inc: add macros for C types used in structure definition
>   UefiCpuPkg/MpInitLib: Use NASM struc to avoid hardcode offset
>   UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release
>
>  MdePkg/Include/Ia32/Nasm.inc  |  38 ++
>  MdePkg/Include/X64/Nasm.inc   |  38 ++
>  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc   |  43 ---
>  .../Library/MpInitLib/Ia32/MpFuncs.nasm   |  98 +++-
>  UefiCpuPkg/Library/MpInitLib/MpEqu.inc|  99 
>  UefiCpuPkg/Library/MpInitLib/MpLib.c  |   1 -
>  UefiCpuPkg/Library/MpInitLib/MpLib.h  |   3 +-
>  UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc|  45 
>  UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 108 --
>  11 files changed, 272 insertions(+), 211 deletions(-)
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
>  create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc
>
> --
> 2.27.0.windows.1
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#71344): https://edk2.groups.io/g/devel/message/71344
> Mute This Topic: https://groups.io/mt/80401290/1643496
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [michael.d.kin...@intel.com]
> -=-=-=-=-=-=
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71387): https://edk2.groups.io/g/devel/message/71387
Mute This Topic: https://groups.io/mt/80401290/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 0/1] Introduce DxeMmUnblockMemoryLib Interface

2021-02-05 Thread Kun Qin
Hi Hao,

My plan was to follow up with the driver changes regarding Tcg2Smm and 
VariableSmmRuntimeDxe once this interface is officially checked in. But if it 
is preferred to submit the patch for Tcg2Smm and VariableSmmRuntimeDxe to make 
better sense on how this interface will be consumed, I can send them out in v2. 
Please let me know how you would like to proceed.

Thanks,
Kun


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71386): https://edk2.groups.io/g/devel/message/71386
Mute This Topic: https://groups.io/mt/80339609/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms][PATCH v1 3/3] MinPlatformPkg/SpiFvbService: Add Standalone MM support

2021-02-05 Thread Michael Kubacki
From: Michael Kubacki 

Adds support for MM_STANDALONE. Retains the directory path to the
SMM INF instance for backward compatibility with existing platforms.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 
---
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => }/FvbInfo.c   
   |  0
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.c  |  0
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Smm/SpiFvbServiceSmm.c => 
SpiFvbServiceMm.c}   | 34 +
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c  
   | 32 
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c 
   | 32 
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.h  |  4 --
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.h
   | 22 +++
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf 
   | 17 +
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{SpiFvbServiceSmm.inf => 
SpiFvbServiceStandaloneMm.inf} | 40 ++--
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc   
   |  2 +
 10 files changed, 129 insertions(+), 54 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/FvbInfo.c 
b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/FvbInfo.c
similarity index 100%
rename from Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/FvbInfo.c
rename to Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/FvbInfo.c
diff --git 
a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/SpiFvbServiceCommon.c
 b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c
similarity index 100%
rename from 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/SpiFvbServiceCommon.c
rename to 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c
diff --git 
a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSmm.c 
b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
similarity index 89%
rename from 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSmm.c
rename to Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
index 251fcae30b90..3175f5f32e31 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSmm.c
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
@@ -1,14 +1,15 @@
 /** @file
-  Common driver source for several Serial Flash devices
+  MM driver source for several Serial Flash devices
   which are compliant with the Intel(R) Serial Flash Interface Compatibility 
Specification.
 
-Copyright (c) 2017, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
+  Copyright (c) Microsoft Corporation.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
 #include "SpiFvbServiceCommon.h"
-#include 
+#include 
+#include 
 #include 
 
 /**
@@ -74,7 +75,7 @@ InstallFvbProtocol (
   //
   FvbHandle = NULL;
 
-  Status = gSmst->SmmInstallProtocolInterface (
+  Status = gMmst->MmInstallProtocolInterface (
 ,
 ,
 EFI_NATIVE_INTERFACE,
@@ -82,7 +83,7 @@ InstallFvbProtocol (
 );
   ASSERT_EFI_ERROR (Status);
 
-  Status = gSmst->SmmInstallProtocolInterface (
+  Status = gMmst->MmInstallProtocolInterface (
 ,
 ,
 EFI_NATIVE_INTERFACE,
@@ -92,22 +93,13 @@ InstallFvbProtocol (
 }
 
 /**
-
   The function does the necessary initialization work for
   Firmware Volume Block Driver.
 
-  @param[in]  ImageHandle   The firmware allocated handle for the UEFI 
image.
-  @param[in]  SystemTable   A pointer to the EFI system table.
-
-  @retval EFI_SUCCESS   This funtion always return EFI_SUCCESS.
-It will ASSERT on errors.
-
 **/
-EFI_STATUS
-EFIAPI
+VOID
 FvbInitialize (
-  IN EFI_HANDLEImageHandle,
-  IN EFI_SYSTEM_TABLE  *SystemTable
+  VOID
   )
 {
   EFI_FVB_INSTANCE  *FvbInstance;
@@ -219,8 +211,7 @@ FvbInitialize (
 mFvbModuleGlobal.FvbInstance =  (EFI_FVB_INSTANCE *) 
AllocateRuntimeZeroPool (BufferSize);
 if (mFvbModuleGlobal.FvbInstance == NULL) {
   ASSERT (FALSE);
-  Status = EFI_OUT_OF_RESOURCES;
-  goto ERROR;
+  return;
 }
 
 MaxLbaSize  = 0;
@@ -276,9 +267,4 @@ FvbInitialize (
 
 }
   }
-
-  return EFI_SUCCESS;
-
-ERROR:
-  return Status;
 }
diff --git 
a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c 

[edk2-devel] [edk2-platforms][PATCH v1 2/3] MinPlatformPkg/MinPlatformPkg.dsc: Add basic MM_STANDALONE libraries

2021-02-05 Thread Michael Kubacki
From: Michael Kubacki 

Adds a fundamental set of library instances that are needed to build
MM_STANDALONE modules.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 
---
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc 
b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index d0b559381720..5e88de43e08d 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -2,6 +2,7 @@
 #  Platform description.
 #
 # Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) Microsoft Corporation.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -112,6 +113,12 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
   
TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointLib.inf
 
+[LibraryClasses.common.MM_STANDALONE]
+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  
MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
+  
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
+  
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
+
 
###
 #
 # Components Section - list of the modules and components that will be 
processed by compilation
-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71384): https://edk2.groups.io/g/devel/message/71384
Mute This Topic: https://groups.io/mt/80420929/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms][PATCH v1 0/3] MinPlatformPkg: Add SpiFvbServiceStandaloneMm

2021-02-05 Thread Michael Kubacki
From: Michael Kubacki 

Adds a new component called SpiFvbServiceStandaloneMm that serves
as a Standalone MM compatible SPI FVB service driver.

Note that a MM_STANDALONE version of SpiFlashCommonLib is being
prepared to be sent but for the time being the module can be added
to the MinPlatformPkg build and rely upon a NULL instance in the
build.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 

Michael Kubacki (3):
  MinPlatformPkg/SpiFlashCommonLibNull: Make MODULE_TYPE BASE
  MinPlatformPkg/MinPlatformPkg.dsc: Add basic MM_STANDALONE libraries
  MinPlatformPkg/SpiFvbService: Add Standalone MM support

 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => }/FvbInfo.c   
   |  0
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.c  |  0
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Smm/SpiFvbServiceSmm.c => 
SpiFvbServiceMm.c}   | 34 +
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c  
   | 32 
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c 
   | 32 
 
Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
   |  4 +-
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.h  |  4 --
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.h
   | 22 +++
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf 
   | 17 +
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{SpiFvbServiceSmm.inf => 
SpiFvbServiceStandaloneMm.inf} | 40 ++--
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc   
   |  9 +
 11 files changed, 138 insertions(+), 56 deletions(-)
 rename Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/FvbInfo.c (100%)
 rename Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.c (100%)
 rename 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Smm/SpiFvbServiceSmm.c => 
SpiFvbServiceMm.c} (89%)
 create mode 100644 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c
 create mode 100644 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c
 rename Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.h (94%)
 create mode 100644 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.h
 copy Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{SpiFvbServiceSmm.inf 
=> SpiFvbServiceStandaloneMm.inf} (64%)

-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71382): https://edk2.groups.io/g/devel/message/71382
Mute This Topic: https://groups.io/mt/80420923/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms][PATCH v1 1/3] MinPlatformPkg/SpiFlashCommonLibNull: Make MODULE_TYPE BASE

2021-02-05 Thread Michael Kubacki
From: Michael Kubacki 

This NULL library can be used to link against a MODULE_TYPE other
than BASE and that would be useful as it is a NULL class instance.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 
---
 
Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
 
b/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
index d4964681de3d..75ef1cb921df 100644
--- 
a/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
+++ 
b/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
@@ -12,8 +12,8 @@ [Defines]
   BASE_NAME  = SpiFlashCommonLibNull
   FILE_GUID  = F35BBEE7-A681-443E-BB15-07AF9FABBDED
   VERSION_STRING = 1.0
-  MODULE_TYPE= DXE_SMM_DRIVER
-  LIBRARY_CLASS  = SpiFlashCommonLib|DXE_SMM_DRIVER
+  MODULE_TYPE= BASE
+  LIBRARY_CLASS  = SpiFlashCommonLib
 #
 # The following information is for reference only and not required by the 
build tools.
 #
-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71383): https://edk2.groups.io/g/devel/message/71383
Mute This Topic: https://groups.io/mt/80420927/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] EDK2

2021-02-05 Thread Andrew Fish via groups.io


> On Feb 4, 2021, at 7:30 PM, Kinney, Michael D  > wrote:
> 
> Hi Andrew,
>
> If the character is part of the code (not a comment), the ignoring the codec 
> error could silently produce the incorrect FW behavior.
>
> I prefer a failure with a correct identification of the file/line # so the 
> file can be fixed.
>
> The EDK II CI checks will not allow files in with these types of issues.
>

Mike,

I agree the UNI file should be strict. I was also thinking about comments, 
build config files etc? 

Is there a definition of what is legal in a comment? The code that had the 
crazy characters was not from TianoCore. 

Thanks,

Andrew Fish

> Mike
>
>
>
> From: Andrew Fish mailto:af...@apple.com>> 
> Sent: Thursday, February 4, 2021 4:11 PM
> To: edk2-devel-groups-io  >; Kinney, Michael D  >
> Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
> Subject: Re: [edk2-devel] EDK2
>
>
> 
> 
> On Feb 4, 2021, at 3:58 PM, Michael D Kinney  > wrote:
>
> Hi Tony,
>
> I suspect that one of your UNI files being processed by StrGather has an 
> invalid Unicode character in it.  Can you review the UNI files in the module 
> that is being build when this error is generated?
>
> I would be better if this code identified the file/line number with the 
> issue, so that would be a good Bugzilla to enter.
>
>
> Mike,
>
> I hit something like this too writing some Python. I think I ended up telling 
> the codec to ignore errors, so that might be another option? This I think the 
> issue I saw was in C code. 
>
> Thanks,
>
> Andrew Fish
> 
> 
> Mike
>
> From: devel@edk2.groups.io  
> mailto:devel@edk2.groups.io>> On Behalf Of Pham, Tony Q
> Sent: Thursday, February 4, 2021 1:39 PM
> To: devel@edk2.groups.io 
> Subject: [edk2-devel] EDK2
>
> Hi,
>
> I have a problem with build.py
>
> (Python 3.9.1 on win32) Traceback (most recent call last):
>   File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2635, in Main
> MyBuild.Launch()
>   File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2433, in Launch
> self._BuildModule()
>   File "C:\edk2\BaseTools\Source\Python\build\build.py", line 1895, in 
> _BuildModule
> Ma.CreateCodeFile(True)
>   File "C:\edk2\BaseTools\Source\Python\AutoGen\ModuleAutoGen.py", line 1832, 
> in CreateCodeFile
> for File in self.AutoGenFileList:
>   File "C:\edk2\BaseTools\Source\Python\Common\caching.py", line 28, in 
> __get__
> Value = obj.__dict__[self._function.__name__] = self._function(obj)
>   File "C:\edk2\BaseTools\Source\Python\AutoGen\ModuleAutoGen.py", line 983, 
> in AutoGenFileList
> GenC.CreateCode(self, AutoGenC, AutoGenH, StringH, AutoGenUniIdf, 
> UniStringBinBuffer, StringIdf, AutoGenUniIdf, IdfGenBinBuffer)
>   File "C:\edk2\BaseTools\Source\Python\AutoGen\GenC.py", line 2044, in 
> CreateCode
> CreateUnicodeStringCode(Info, AutoGenC, StringH, UniGenCFlag, 
> UniGenBinBuffer)
>   File "C:\edk2\BaseTools\Source\Python\AutoGen\GenC.py", line 1706, in 
> CreateUnicodeStringCode
> Header, Code = GetStringFiles(Info.UnicodeFileList, SrcList, IncList, 
> Info.IncludePathList, ['.uni', '.inf'], Info.Name, CompatibleMode, ShellMode, 
> UniGenCFlag, UniGenBinBuffer, FilterInfo)
>   File "C:\edk2\BaseTools\Source\Python\AutoGen\StrGather.py", line 563, in 
> GetStringFiles
> Uni = SearchString(Uni, sorted (FileList), IsCompatibleMode)
>   File "C:\edk2\BaseTools\Source\Python\AutoGen\StrGather.py", line 532, in 
> SearchString
> for Line in Lines:
>   File 
> "C:\Users\tqpham\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py",
>  line 23, in decode
> return codecs.charmap_decode(input,self.errors,decoding_table)[0]
> UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 5457: 
> character maps to 
>
>
> - Failed -
> Build end time: 13:36:22, Feb.04 2021
> Build total time: 00:00:02
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71381): https://edk2.groups.io/g/devel/message/71381
Mute This Topic: https://groups.io/mt/80393547/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] TianoCore Community Meeting Minutes - 2/4

2021-02-05 Thread Michael Kubacki

Hi Mike,

I'm planning to put up a branch that we can use as a reference for a 
conversation around uncrustify in the next couple of weeks.


Thanks,
Michael

On 2/5/2021 2:44 PM, Michael D Kinney wrote:

Hi Bret,

Please share the proposed adjustments.If we can use a well supported 
tool that allows us to remove the C parser from ECC, then I think that 
would be a big improvement.


Mike

*From:*devel@edk2.groups.io  *On Behalf Of *Bret 
Barkelew via groups.io

*Sent:* Friday, February 5, 2021 1:26 PM
*To:* Guptha, Soumya K ; 
annou...@edk2.groups.io; devel@edk2.groups.io; Desimone, Nathaniel L 


*Subject:* Re: [edk2-devel] TianoCore Community Meeting Minutes - 2/4

@Desimone, Nathaniel L , I’m 
interested in mentorship for the GSC project. Would like to talk offline 
about potential projects and past experience.


RE: ECC, we’re internally evaluating ‘uncrustify’ as an option to 1) 
check for formatting violations and 2) provide a tool to automatically 
format code prior to submission. There are changes that we’ve made to 
the tool to support ECC, but there are some small places that we’re 
coming up short. What would be the appetite to evaluate our progress and 
discuss possibly adjusting the ECC to be more flexible where we’ve come 
up short?


- Bret

*From: *Soumya Guptha via groups.io 


*Sent: *Thursday, February 4, 2021 8:12 PM
*To: *annou...@edk2.groups.io ; 
devel@edk2.groups.io 
*Subject: *[EXTERNAL] Re: [edk2-announce] TianoCore Community Meeting 
Minutes - 2/4


TianoCore Community Meeting Minutes (APAC/NMO)

February 4, 2021



EVENTS:

No new updates.



STABLE TAG:



edk2-stable202102 - Feature Planning freeze on 2/15

https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FEDK-II-Release-Planningdata=04%7C01%7CBret.Barkelew%40microsoft.com%7Ca97d5c438d514d0859ea08d8c98c43a6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637480951557144463%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=UA13OI0UuZ2QSboHsE4dZY5J0Az1uL8Boxldw0jdtmU%3Dreserved=0 







STEWARDS DOWNLOAD (Mike Kinney)

   *   Design meeting - we discussed on Automation & CI system.



   *   Community Action: Need help from the community on ECC tool (EFI 
code checker), we have critical issues, need help quickly.
  *   Kevin - will explore to see if someone has any expertise wrt 
ECC tool.




   *   Sean plans to send to the info to the community on the tool to 
help format the source code. Sean will send it to the mailing list.

Suggests making ECC smaller.



   *   Addressed all issues related to cmocka.



   *   Workflow for maintainers: some maintainers like to work on 
multiple pull requests, causing extra work, process issue. We are 
investigating on automation. Task is to Evaluate the automation feature 
and get feedback.




   *   Bugzilla Feature request - update on NASM compiler version will 
start now. This is not required by developers until after the Q1 stable tag.






Opens:

   1.  Nate - Google summer code (sponsored internship program run by 
google). Need some mentors to mentor the interns. Tianocore open source 
needs to apply. Application deadline Feb 19th. We need to develop 
interesting ideas for summer projects. Nate will start an offline thread 
to discuss ideas for projects. Couple of people have expressed some 
interest in becoming mentors.
Community Action: If you are interested in either mentoring or have a 
project idea, please send an email to (nathaniel.l.desim...@intel.com 
).




   1.  Sean - code contribution, project management - are we doing 
anything to improve.




Acknowledgments:

Community Action: Please send Soumya if you like to acknowledge anyone 
from the community, if anyone helped you close bugs or reviewed code 
etc..We will post those acknowledgements on the community page.




Soumya Guptha
Firmware Ecosystem Enabling Manager, SFP/IAGS












-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71380): https://edk2.groups.io/g/devel/message/71380
Mute This Topic: https://groups.io/mt/80399013/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg/PlatformBootManager: Connect console after EndOfDxe

2021-02-05 Thread Guo Dong

Trusted console is required for TCG Physical Presence and only trusted console 
could 
be connected before EndOfDxe. Since TCG Physical Presence is not enabled yet in
the UefiPayloadPkg, I think it is ok to have this change. 

Reviewed-by: Guo Dong 

> -Original Message-
> From: Patrick Rudolph 
> Sent: Wednesday, February 3, 2021 3:26 AM
> To: Wang, Sunny (HPS SW) 
> Cc: devel@edk2.groups.io; Park, Aiden ; You, Benjamin
> ; philipp.deppenwi...@9elements.com; Ma,
> Maurice ; Dong, Guo 
> Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/PlatformBootManager:
> Connect console after EndOfDxe
> 
> Hi Sunny,
> none of the other packages are doing this before EndOfDxe. And there's
> no point in having trusted console as earlier as possible, as nothing
> is displayed in PlatformBootManagerBeforeConsole().
> Please explain your use case. I don't see one here.
> 
> Kind Regards,
> Patrick Rudolph
> 
> On Wed, Feb 3, 2021 at 10:32 AM Wang, Sunny (HPS SW)
>  wrote:
> >
> > Hi Patrick,
> >
> > I'm not familiar with UefiPayloadPkg. However, since we may want to enable
> the trusted console as earlier as possible, you may still need to keep the
> PlatformConsoleInit() call at the beginning of
> PlatformBootManagerBeforeConsole() to support the platform that has
> trusted/on-board Consoles.
> >
> > Regards,
> > Sunny Wang
> >
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Patrick
> Rudolph
> > Sent: Tuesday, February 2, 2021 4:34 PM
> > To: devel@edk2.groups.io
> > Cc: aiden.p...@intel.com; benjamin@intel.com;
> philipp.deppenwi...@9elements.com; maurice...@intel.com;
> guo.d...@intel.com
> > Subject: [edk2-devel] [PATCH] UefiPayloadPkg/PlatformBootManager:
> Connect console after EndOfDxe
> >
> > Currently the console is connected before EndOfDxe causing OptionsROMs to
> be loaded, but their drivers aren't used and thus no GOP is installed.
> >
> > To make use of 3rdparty OptionROMs connect the console after EndOfDxe.
> >
> > Tested on Intel CFL board using Nvidia Quadro GPU.
> >
> > Signed-off-by: Patrick Rudolph 
> > ---
> >  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c |
> 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> > index c5c6af0abc..7fa3a048b7 100644
> > ---
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> > +++
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
> > +++ c
> > @@ -157,8 +157,6 @@ PlatformBootManagerBeforeConsole (
> >EFI_INPUT_KEYDown;
> >EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
> >
> > -  PlatformConsoleInit ();
> > -
> >//
> >// Register ENTER as CONTINUE key
> >//
> > @@ -192,6 +190,8 @@ PlatformBootManagerBeforeConsole (
> >// Dispatch deferred images after EndOfDxe event and ReadyToLock
> installation.
> >//
> >EfiBootManagerDispatchDeferredImages ();
> > +
> > +  PlatformConsoleInit ();
> >  }
> >
> >  /**
> > --
> > 2.26.2
> >
> >
> >
> > 
> >
> >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71379): https://edk2.groups.io/g/devel/message/71379
Mute This Topic: https://groups.io/mt/80310284/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] TianoCore Community Meeting Minutes - 2/4

2021-02-05 Thread Michael D Kinney
Hi Bret,

Please share the proposed adjustments.  If we can use a well supported tool 
that allows us to remove the C parser from ECC, then I think that would be a 
big improvement.

Mike

From: devel@edk2.groups.io  On Behalf Of Bret Barkelew 
via groups.io
Sent: Friday, February 5, 2021 1:26 PM
To: Guptha, Soumya K ; annou...@edk2.groups.io; 
devel@edk2.groups.io; Desimone, Nathaniel L 
Subject: Re: [edk2-devel] TianoCore Community Meeting Minutes - 2/4

@Desimone, Nathaniel L, I’m interested 
in mentorship for the GSC project. Would like to talk offline about potential 
projects and past experience.

RE: ECC, we’re internally evaluating ‘uncrustify’ as an option to 1) check for 
formatting violations and 2) provide a tool to automatically format code prior 
to submission. There are changes that we’ve made to the tool to support ECC, 
but there are some small places that we’re coming up short. What would be the 
appetite to evaluate our progress and discuss possibly adjusting the ECC to be 
more flexible where we’ve come up short?

- Bret

From: Soumya Guptha via groups.io
Sent: Thursday, February 4, 2021 8:12 PM
To: annou...@edk2.groups.io; 
devel@edk2.groups.io
Subject: [EXTERNAL] Re: [edk2-announce] TianoCore Community Meeting Minutes - 
2/4

TianoCore Community Meeting Minutes (APAC/NMO)

February 4, 2021



EVENTS:

No new updates.



STABLE TAG:



edk2-stable202102 - Feature Planning freeze on 2/15

https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FEDK-II-Release-Planningdata=04%7C01%7CBret.Barkelew%40microsoft.com%7Ca97d5c438d514d0859ea08d8c98c43a6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637480951557144463%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=UA13OI0UuZ2QSboHsE4dZY5J0Az1uL8Boxldw0jdtmU%3Dreserved=0





STEWARDS DOWNLOAD (Mike Kinney)

  *   Design meeting - we discussed on Automation & CI system.



  *   Community Action: Need help from the community on ECC tool (EFI code 
checker), we have critical issues, need help quickly.
 *   Kevin - will explore to see if someone has any expertise wrt ECC tool.



  *   Sean plans to send to the info to the community on the tool to help 
format the source code. Sean will send it to the mailing list.
Suggests making ECC smaller.



  *   Addressed all issues related to cmocka.



  *   Workflow for maintainers: some maintainers like to work on multiple pull 
requests, causing extra work, process issue. We are investigating on 
automation. Task is to Evaluate the automation feature and get feedback.



  *   Bugzilla Feature request - update on NASM compiler version will start 
now. This is not required by developers until after the Q1 stable tag.





Opens:

  1.  Nate - Google summer code (sponsored internship program run by google). 
Need some mentors to mentor the interns. Tianocore open source needs to apply. 
Application deadline Feb 19th. We need to develop interesting ideas for summer 
projects. Nate will start an offline thread to discuss ideas for projects. 
Couple of people have expressed some interest in becoming mentors.
Community Action: If you are interested in either mentoring or have a project 
idea, please send an email to 
(nathaniel.l.desim...@intel.com).



  1.  Sean - code contribution, project management - are we doing anything to 
improve.



Acknowledgments:

Community Action: Please send Soumya if you like to acknowledge anyone from the 
community, if anyone helped you close bugs or reviewed code etc..We will post 
those acknowledgements on the community page.



Soumya Guptha
Firmware Ecosystem Enabling Manager, SFP/IAGS












-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71378): https://edk2.groups.io/g/devel/message/71378
Mute This Topic: https://groups.io/mt/80399013/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 2/2] Maintainers.txt: Change Jordan Justen to a reviewer for OvmfPkg

2021-02-05 Thread Ard Biesheuvel
On Thu, 4 Feb 2021 at 20:49, Jordan Justen  wrote:
>
> Cc: Laszlo Ersek 
> Cc: Ard Biesheuvel 
> Signed-off-by: Jordan Justen 

Acked-by: Ard Biesheuvel 

> ---
>  Maintainers.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 96e792ab66..e384971238 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -423,9 +423,9 @@ R: Siyuan Fu 
>  OvmfPkg
>  F: OvmfPkg/
>  W: http://www.tianocore.org/ovmf/
> -M: Jordan Justen 
>  M: Laszlo Ersek 
>  M: Ard Biesheuvel 
> +R: Jordan Justen 
>  S: Maintained
>
>  OvmfPkg: bhyve-related modules
> --
> 2.30.0
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71377): https://edk2.groups.io/g/devel/message/71377
Mute This Topic: https://groups.io/mt/80389015/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] EDK2

2021-02-05 Thread Kirkendall, Garrett
I found a couple of extensions for Visual Studio Code that will highlight bad 
characters.  "Highlight Dodgy Characters" seems to do the trick.

Sorry about that AMD Official Use Only thing.  The wonders of modern email apps!

Garrett Kirkendall
SMTS Firmware Engineer
7171 Southwest Parkway, Austin, TX 78735 USA
AMD   facebook  |  amd.com

From: Kinney, Michael D 
Sent: Friday, February 5, 2021 11:03 AM
To: Kirkendall, Garrett ; devel@edk2.groups.io; 
Feng, Bob C ; Andrew Fish ; Kinney, 
Michael D 
Cc: Pham, Tony Q 
Subject: RE: [edk2-devel] EDK2


[AMD Official Use Only - Internal Distribution Only]

[CAUTION: External Email]
One I know the file path, I usually use a Notepad++ feature:

  Search-> Find Chars In Range-> Non ASCII

Mike

From: Kirkendall, Garrett 
mailto:garrett.kirkend...@amd.com>>
Sent: Friday, February 5, 2021 7:11 AM
To: devel@edk2.groups.io; Feng, Bob C 
mailto:bob.c.f...@intel.com>>; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Andrew Fish 
mailto:af...@apple.com>>
Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
Subject: RE: [edk2-devel] EDK2


[AMD Official Use Only - Internal Distribution Only]

0x9d is one of those pesky "smart quotes" many applications love to use.  These 
are the double quote or single quote characters that slant left and right 
instead of the straight up and down like the ASCII versions.
They can be very hard to track down in a source file because a lot of editors 
have very subtle slants to the smart quotes.
This usually happens when you copy from one app like MS Word and paste into 
your source file.

Garrett Kirkendall
SMTS Firmware Engineer
7171 Southwest Parkway, Austin, TX 78735 USA
AMD   
facebook
  |  
amd.com

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Bob Feng via 
groups.io
Sent: Thursday, February 4, 2021 11:40 PM
To: devel@edk2.groups.io; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Andrew Fish 
mailto:af...@apple.com>>
Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
Subject: Re: [edk2-devel] EDK2

[CAUTION: External Email]
Tony,

This build failure should be caused by one of your c or header files have 
non-ascii characters.

You may need to change the basetools' code to see which file has non-ascii 
characters

Change C:\edk2\BaseTools\Source\Python\AutoGen\StrGather.py, Line 536
except:
EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 
"SearchString: Error while processing file", File=File, RaiseError=False)
raise
to
except:
EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 
"SearchString: Error while processing file", File=File, RaiseError=True)



Thanks,
Bob

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Michael D 
Kinney
Sent: Friday, February 5, 2021 11:30 AM
To: Andrew Fish mailto:af...@apple.com>>; edk2-devel-groups-io 
mailto:devel@edk2.groups.io>>; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
Subject: Re: [edk2-devel] EDK2

Hi Andrew,

If the character is part of the code (not a comment), the ignoring the codec 
error could silently produce the incorrect FW behavior.

I prefer a failure with a correct identification of the file/line # so the file 
can be fixed.

The EDK II CI checks will not allow files in with these types of issues.

Mike



From: Andrew Fish mailto:af...@apple.com>>
Sent: Thursday, February 4, 2021 4:11 PM
To: edk2-devel-groups-io mailto:devel@edk2.groups.io>>; 
Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
Subject: Re: [edk2-devel] EDK2



On Feb 4, 2021, at 3:58 PM, Michael D Kinney 
mailto:michael.d.kin...@intel.com>> wrote:

Hi Tony,

I suspect that one of your UNI files being processed by StrGather has an 
invalid Unicode character in it.  Can you review the UNI files in the module 
that is being build when this error is generated?

I would be better if this code identified the file/line number with the issue, 
so that would be a good Bugzilla to enter.



Re: [edk2-devel] [PATCH] Maintainers.txt: Update Maintainers and reviewers for UefiPayloadPkg

2021-02-05 Thread Ma, Maurice
Reviewed-by:  Maurice Ma 

Regards
Maurice

> -Original Message-
> From: Guo Dong 
> Sent: Sunday, January 24, 2021 9:59
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> ; philipp.deppenwi...@9elements.com; Kinney,
> Michael D 
> Subject: [edk2-devel] [PATCH] Maintainers.txt: Update Maintainers and
> reviewers for UefiPayloadPkg
> 
> Add Philipp Deppenwiese as Maintainer.
> Update Maurice Ma and Benjamin You as reviewers to continue support
> UefiPayloadPkg patch review.
> 
> Cc: Philipp Deppenwiese 
> Cc: Benjamin You 
> Cc: Maurice Ma 
> Cc: Michael D Kinney 
> Signed-off-by: Guo Dong 
> ---
>  Maintainers.txt | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index 2cd356551e..2a49a9e6aa
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -576,11 +576,13 @@ R: Catharine West 
> UefiPayloadPkg
>  F: UefiPayloadPkg/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/UefiPayloadPkg
> -M: Maurice Ma 
>  M: Guo Dong 
> -M: Benjamin You 
> +M: Philipp Deppenwiese 
> +R: Benjamin You 
> +R: Maurice Ma 
>  S: Maintained
> 
> +
>  UnitTestFrameworkPkg
>  F: UnitTestFrameworkPkg/
>  M: Michael D Kinney 
> --
> 2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71375): https://edk2.groups.io/g/devel/message/71375
Mute This Topic: https://groups.io/mt/80083811/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] TianoCore Community Meeting Minutes - 2/4

2021-02-05 Thread Bret Barkelew via groups.io
@Desimone, Nathaniel L, I’m interested 
in mentorship for the GSC project. Would like to talk offline about potential 
projects and past experience.

RE: ECC, we’re internally evaluating ‘uncrustify’ as an option to 1) check for 
formatting violations and 2) provide a tool to automatically format code prior 
to submission. There are changes that we’ve made to the tool to support ECC, 
but there are some small places that we’re coming up short. What would be the 
appetite to evaluate our progress and discuss possibly adjusting the ECC to be 
more flexible where we’ve come up short?

- Bret

From: Soumya Guptha via groups.io
Sent: Thursday, February 4, 2021 8:12 PM
To: annou...@edk2.groups.io; 
devel@edk2.groups.io
Subject: [EXTERNAL] Re: [edk2-announce] TianoCore Community Meeting Minutes - 
2/4

TianoCore Community Meeting Minutes (APAC/NMO)

February 4, 2021



EVENTS:

No new updates.



STABLE TAG:



edk2-stable202102 - Feature Planning freeze on 2/15

https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FEDK-II-Release-Planningdata=04%7C01%7CBret.Barkelew%40microsoft.com%7Ca97d5c438d514d0859ea08d8c98c43a6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637480951557144463%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=UA13OI0UuZ2QSboHsE4dZY5J0Az1uL8Boxldw0jdtmU%3Dreserved=0





STEWARDS DOWNLOAD (Mike Kinney)

  *   Design meeting - we discussed on Automation & CI system.



  *   Community Action: Need help from the community on ECC tool (EFI code 
checker), we have critical issues, need help quickly.
 *   Kevin - will explore to see if someone has any expertise wrt ECC tool.



  *   Sean plans to send to the info to the community on the tool to help 
format the source code. Sean will send it to the mailing list.
Suggests making ECC smaller.



  *   Addressed all issues related to cmocka.



  *   Workflow for maintainers: some maintainers like to work on multiple pull 
requests, causing extra work, process issue. We are investigating on 
automation. Task is to Evaluate the automation feature and get feedback.



  *   Bugzilla Feature request - update on NASM compiler version will start 
now. This is not required by developers until after the Q1 stable tag.





Opens:

  1.  Nate - Google summer code (sponsored internship program run by google). 
Need some mentors to mentor the interns. Tianocore open source needs to apply. 
Application deadline Feb 19th. We need to develop interesting ideas for summer 
projects. Nate will start an offline thread to discuss ideas for projects. 
Couple of people have expressed some interest in becoming mentors.
Community Action: If you are interested in either mentoring or have a project 
idea, please send an email to (nathaniel.l.desim...@intel.com).



  1.  Sean - code contribution, project management - are we doing anything to 
improve.



Acknowledgments:

Community Action: Please send Soumya if you like to acknowledge anyone from the 
community, if anyone helped you close bugs or reviewed code etc..We will post 
those acknowledgements on the community page.



Soumya Guptha
Firmware Ecosystem Enabling Manager, SFP/IAGS












-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71374): https://edk2.groups.io/g/devel/message/71374
Mute This Topic: https://groups.io/mt/80399013/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

2021-02-05 Thread Michael D Kinney
My comment is only to make the history of changes easier to understand by 
separating the functional and non-functional changes.

Mike

From: Ni, Ray 
Sent: Friday, February 5, 2021 10:38 AM
To: Kinney, Michael D ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

Mike,

The clean up doesn’t cause any final instruction change and I have verified 
that.
The reason I put the fix in last because the Lock field is not needed with the 
fix but removing the Lock requires to adjust all the hard code offsets.

What potential issue do you see?

Thanks,
Ray

thanks,
ray

发件人: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
发送时间: Saturday, February 6, 2021 1:11:19 AM
收件人: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>; Ni, Ray 
mailto:ray...@intel.com>>; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
主题: RE: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

Hi Ray,

I really like the cleanup to remove hard coded offsets, but I think that change 
should be its own patch series.

Can we make the functional change to use XADD as its own patch series before 
the change to remove hard coded offsets and use struct?

Then have a 2nd patch series that is a non-functional change to remove hard 
coded offsets and use struct and remove the unused Lock field?

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io 
> mailto:devel@edk2.groups.io>> On Behalf Of Ni, Ray
> Sent: Thursday, February 4, 2021 11:58 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release
>
> Patch #1 follows Laszlo's suggestion to add global NASM macros
>
>   for NASM struc usage.
>
> Patch #2 changes all hardcode offset to use struc.
>
> Patch #3 doesn't have any change comparing to V1 except
>
>   1). dword/qword prefix is added.
>
>   2). the comments "program AP stack" is removed.
>
> Ray Ni (3):
>   MdePkg/Nasm.inc: add macros for C types used in structure definition
>   UefiCpuPkg/MpInitLib: Use NASM struc to avoid hardcode offset
>   UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release
>
>  MdePkg/Include/Ia32/Nasm.inc  |  38 ++
>  MdePkg/Include/X64/Nasm.inc   |  38 ++
>  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc   |  43 ---
>  .../Library/MpInitLib/Ia32/MpFuncs.nasm   |  98 +++-
>  UefiCpuPkg/Library/MpInitLib/MpEqu.inc|  99 
>  UefiCpuPkg/Library/MpInitLib/MpLib.c  |   1 -
>  UefiCpuPkg/Library/MpInitLib/MpLib.h  |   3 +-
>  UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc|  45 
>  UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 108 --
>  11 files changed, 272 insertions(+), 211 deletions(-)
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
>  create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc
>
> --
> 2.27.0.windows.1
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#71344): https://edk2.groups.io/g/devel/message/71344
> Mute This Topic: https://groups.io/mt/80401290/1643496
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [michael.d.kin...@intel.com]
> -=-=-=-=-=-=
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71373): https://edk2.groups.io/g/devel/message/71373
Mute This Topic: https://groups.io/mt/80401290/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V3 40/40] Maintainers.txt: Add TigerlakeSiliconPkg maintainers

2021-02-05 Thread Chaganty, Rangasai V
Thanks Heng for all the hard work! And thank you Nate for pushing the series.

-Original Message-
From: Desimone, Nathaniel L  
Sent: Friday, February 05, 2021 10:37 AM
To: Luo, Heng ; devel@edk2.groups.io
Cc: Chaganty, Rangasai V 
Subject: RE: [Patch V3 40/40] Maintainers.txt: Add TigerlakeSiliconPkg 
maintainers

The series has been pushed as d55602c~..ee33d4f

Thanks Again Heng!

> -Original Message-
> From: Luo, Heng 
> Sent: Thursday, February 4, 2021 11:41 PM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V ; Desimone, 
> Nathaniel L 
> Subject: [Patch V3 40/40] Maintainers.txt: Add TigerlakeSiliconPkg 
> maintainers
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3171
> 
> Cc: Sai Chaganty 
> Cc: Nate DeSimone 
> Signed-off-by: Heng Luo 
> ---
>  Maintainers.txt | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index 
> 56e16fc48c..34f0b58581
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -242,6 +242,12 @@ F: Silicon/Intel/KabylakeSiliconPkg/
>  M: Chasel Chiu  M: Sai Chaganty 
>  +Silicon/Intel/TigerlakeSiliconPkg+F:
> Silicon/Intel/TigerlakeSiliconPkg/+M: Sai Chaganty
> +M: Nate DeSimone
> +R: Heng Luo + 
> Silicon/Intel/SimicsX58SktPkg F: Silicon/Intel/SimicsX58SktPkg/ M: 
> Agyeman Prince --
> 2.24.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71372): https://edk2.groups.io/g/devel/message/71372
Mute This Topic: https://groups.io/mt/80401179/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

2021-02-05 Thread Ni, Ray
Mike,

The clean up doesn’t cause any final instruction change and I have verified 
that.
The reason I put the fix in last because the Lock field is not needed with the 
fix but removing the Lock requires to adjust all the hard code offsets.

What potential issue do you see?

Thanks,
Ray

thanks,
ray

发件人: Kinney, Michael D 
发送时间: Saturday, February 6, 2021 1:11:19 AM
收件人: devel@edk2.groups.io ; Ni, Ray ; 
Kinney, Michael D 
主题: RE: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

Hi Ray,

I really like the cleanup to remove hard coded offsets, but I think that change 
should be its own patch series.

Can we make the functional change to use XADD as its own patch series before 
the change to remove hard coded offsets and use struct?

Then have a 2nd patch series that is a non-functional change to remove hard 
coded offsets and use struct and remove the unused Lock field?

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ni, Ray
> Sent: Thursday, February 4, 2021 11:58 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release
>
> Patch #1 follows Laszlo's suggestion to add global NASM macros
>
>   for NASM struc usage.
>
> Patch #2 changes all hardcode offset to use struc.
>
> Patch #3 doesn't have any change comparing to V1 except
>
>   1). dword/qword prefix is added.
>
>   2). the comments "program AP stack" is removed.
>
> Ray Ni (3):
>   MdePkg/Nasm.inc: add macros for C types used in structure definition
>   UefiCpuPkg/MpInitLib: Use NASM struc to avoid hardcode offset
>   UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release
>
>  MdePkg/Include/Ia32/Nasm.inc  |  38 ++
>  MdePkg/Include/X64/Nasm.inc   |  38 ++
>  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc   |  43 ---
>  .../Library/MpInitLib/Ia32/MpFuncs.nasm   |  98 +++-
>  UefiCpuPkg/Library/MpInitLib/MpEqu.inc|  99 
>  UefiCpuPkg/Library/MpInitLib/MpLib.c  |   1 -
>  UefiCpuPkg/Library/MpInitLib/MpLib.h  |   3 +-
>  UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc|  45 
>  UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 108 --
>  11 files changed, 272 insertions(+), 211 deletions(-)
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
>  create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc
>
> --
> 2.27.0.windows.1
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#71344): https://edk2.groups.io/g/devel/message/71344
> Mute This Topic: https://groups.io/mt/80401290/1643496
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [michael.d.kin...@intel.com]
> -=-=-=-=-=-=
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71371): https://edk2.groups.io/g/devel/message/71371
Mute This Topic: https://groups.io/mt/80401290/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V3 40/40] Maintainers.txt: Add TigerlakeSiliconPkg maintainers

2021-02-05 Thread Nate DeSimone
The series has been pushed as d55602c~..ee33d4f

Thanks Again Heng!

> -Original Message-
> From: Luo, Heng 
> Sent: Thursday, February 4, 2021 11:41 PM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V ; Desimone,
> Nathaniel L 
> Subject: [Patch V3 40/40] Maintainers.txt: Add TigerlakeSiliconPkg
> maintainers
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3171
> 
> Cc: Sai Chaganty 
> Cc: Nate DeSimone 
> Signed-off-by: Heng Luo 
> ---
>  Maintainers.txt | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index 56e16fc48c..34f0b58581
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -242,6 +242,12 @@ F: Silicon/Intel/KabylakeSiliconPkg/
>  M: Chasel Chiu  M: Sai Chaganty
>  +Silicon/Intel/TigerlakeSiliconPkg+F:
> Silicon/Intel/TigerlakeSiliconPkg/+M: Sai Chaganty
> +M: Nate DeSimone
> +R: Heng Luo +
> Silicon/Intel/SimicsX58SktPkg F: Silicon/Intel/SimicsX58SktPkg/ M: Agyeman
> Prince --
> 2.24.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71370): https://edk2.groups.io/g/devel/message/71370
Mute This Topic: https://groups.io/mt/80401179/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release

2021-02-05 Thread Michael D Kinney
Hi Ray,

I really like the cleanup to remove hard coded offsets, but I think that change 
should be its own patch series.

Can we make the functional change to use XADD as its own patch series before 
the change to remove hard coded offsets and use struct?

Then have a 2nd patch series that is a non-functional change to remove hard 
coded offsets and use struct and remove the unused Lock field?

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ni, Ray
> Sent: Thursday, February 4, 2021 11:58 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v2 0/3] Use XADD to avoid lock acquire/release
> 
> Patch #1 follows Laszlo's suggestion to add global NASM macros
> 
>   for NASM struc usage.
> 
> Patch #2 changes all hardcode offset to use struc.
> 
> Patch #3 doesn't have any change comparing to V1 except
> 
>   1). dword/qword prefix is added.
> 
>   2). the comments "program AP stack" is removed.
> 
> Ray Ni (3):
>   MdePkg/Nasm.inc: add macros for C types used in structure definition
>   UefiCpuPkg/MpInitLib: Use NASM struc to avoid hardcode offset
>   UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release
> 
>  MdePkg/Include/Ia32/Nasm.inc  |  38 ++
>  MdePkg/Include/X64/Nasm.inc   |  38 ++
>  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc   |  43 ---
>  .../Library/MpInitLib/Ia32/MpFuncs.nasm   |  98 +++-
>  UefiCpuPkg/Library/MpInitLib/MpEqu.inc|  99 
>  UefiCpuPkg/Library/MpInitLib/MpLib.c  |   1 -
>  UefiCpuPkg/Library/MpInitLib/MpLib.h  |   3 +-
>  UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc|  45 
>  UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 108 --
>  11 files changed, 272 insertions(+), 211 deletions(-)
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
>  create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc
> 
> --
> 2.27.0.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#71344): https://edk2.groups.io/g/devel/message/71344
> Mute This Topic: https://groups.io/mt/80401290/1643496
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [michael.d.kin...@intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71369): https://edk2.groups.io/g/devel/message/71369
Mute This Topic: https://groups.io/mt/80401290/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] EDK2

2021-02-05 Thread Michael D Kinney
One I know the file path, I usually use a Notepad++ feature:

  Search-> Find Chars In Range-> Non ASCII

Mike

From: Kirkendall, Garrett 
Sent: Friday, February 5, 2021 7:11 AM
To: devel@edk2.groups.io; Feng, Bob C ; Kinney, Michael D 
; Andrew Fish 
Cc: Pham, Tony Q 
Subject: RE: [edk2-devel] EDK2


[AMD Official Use Only - Internal Distribution Only]

0x9d is one of those pesky "smart quotes" many applications love to use.  These 
are the double quote or single quote characters that slant left and right 
instead of the straight up and down like the ASCII versions.
They can be very hard to track down in a source file because a lot of editors 
have very subtle slants to the smart quotes.
This usually happens when you copy from one app like MS Word and paste into 
your source file.

Garrett Kirkendall
SMTS Firmware Engineer
7171 Southwest Parkway, Austin, TX 78735 USA
AMD   facebook  |  amd.com

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Bob Feng via 
groups.io
Sent: Thursday, February 4, 2021 11:40 PM
To: devel@edk2.groups.io; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Andrew Fish 
mailto:af...@apple.com>>
Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
Subject: Re: [edk2-devel] EDK2

[CAUTION: External Email]
Tony,

This build failure should be caused by one of your c or header files have 
non-ascii characters.

You may need to change the basetools’ code to see which file has non-ascii 
characters

Change C:\edk2\BaseTools\Source\Python\AutoGen\StrGather.py, Line 536
except:
EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 
"SearchString: Error while processing file", File=File, RaiseError=False)
raise
to
except:
EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 
"SearchString: Error while processing file", File=File, RaiseError=True)



Thanks,
Bob

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Michael D 
Kinney
Sent: Friday, February 5, 2021 11:30 AM
To: Andrew Fish mailto:af...@apple.com>>; edk2-devel-groups-io 
mailto:devel@edk2.groups.io>>; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
Subject: Re: [edk2-devel] EDK2

Hi Andrew,

If the character is part of the code (not a comment), the ignoring the codec 
error could silently produce the incorrect FW behavior.

I prefer a failure with a correct identification of the file/line # so the file 
can be fixed.

The EDK II CI checks will not allow files in with these types of issues.

Mike



From: Andrew Fish mailto:af...@apple.com>>
Sent: Thursday, February 4, 2021 4:11 PM
To: edk2-devel-groups-io mailto:devel@edk2.groups.io>>; 
Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
Subject: Re: [edk2-devel] EDK2



On Feb 4, 2021, at 3:58 PM, Michael D Kinney 
mailto:michael.d.kin...@intel.com>> wrote:

Hi Tony,

I suspect that one of your UNI files being processed by StrGather has an 
invalid Unicode character in it.  Can you review the UNI files in the module 
that is being build when this error is generated?

I would be better if this code identified the file/line number with the issue, 
so that would be a good Bugzilla to enter.


Mike,

I hit something like this too writing some Python. I think I ended up telling 
the codec to ignore errors, so that might be another option? This I think the 
issue I saw was in C code.

Thanks,

Andrew Fish

Mike

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Pham, Tony Q
Sent: Thursday, February 4, 2021 1:39 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] EDK2

Hi,

I have a problem with build.py

(Python 3.9.1 on win32) Traceback (most recent call last):
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2635, in Main
MyBuild.Launch()
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2433, in Launch
self._BuildModule()
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 1895, in 
_BuildModule
Ma.CreateCodeFile(True)
  File "C:\edk2\BaseTools\Source\Python\AutoGen\ModuleAutoGen.py", line 1832, 
in CreateCodeFile
for File in self.AutoGenFileList:
  File "C:\edk2\BaseTools\Source\Python\Common\caching.py", line 28, in __get__
Value = obj.__dict__[self._function.__name__] = self._function(obj)
  File "C:\edk2\BaseTools\Source\Python\AutoGen\ModuleAutoGen.py", line 983, in 
AutoGenFileList
GenC.CreateCode(self, AutoGenC, AutoGenH, StringH, AutoGenUniIdf, 
UniStringBinBuffer, StringIdf, AutoGenUniIdf, IdfGenBinBuffer)
  File "C:\edk2\BaseTools\Source\Python\AutoGen\GenC.py", line 2044, in 
CreateCode
CreateUnicodeStringCode(Info, AutoGenC, StringH, UniGenCFlag, 
UniGenBinBuffer)
  File 

Re: [edk2-devel] [PATCH v6 7/9] OvmfPkg/CpuHotplugSmm: add CpuEject()

2021-02-05 Thread Laszlo Ersek
Hi Ankur,

I figure it's prudent for me to follow up here too:

On 02/04/21 03:49, Ankur Arora wrote:
> On 2021-02-03 12:58 p.m., Laszlo Ersek wrote:
>> On 02/03/21 07:45, Ankur Arora wrote:
>>> On 2021-02-02 6:15 a.m., Laszlo Ersek wrote:
 On 02/02/21 15:00, Laszlo Ersek wrote:

> ... I guess that volatile-qualifying both CPU_HOT_EJECT_DATA, and the
> array pointed-to by CPU_HOT_EJECT_DATA.ApicIdMap, should suffice. In
> combination with the sync-up point that you quoted. This seems to
> match
> existing practice in PiSmmCpuDxeSmm -- there are no concurrent
> accesses,
> so atomicity is not a concern, and serializing the instruction streams
> coarsely, with the sync-up, in combination with volatile accesses,
> should presumably guarantee visibility (on x86 anyway).

 To summarize, this is what I would ask for:

 - make CPU_HOT_EJECT_DATA volatile

 - make (*CPU_HOT_EJECT_DATA.ApicIdMap) volatile

 - after storing something to CPU_HOT_EJECT_DATA or
 CPU_HOT_EJECT_DATA.ApicIdMap on the BSP, execute a MemoryFence()

 - before fetching something from CPU_HOT_EJECT_DATA or
 CPU_HOT_EJECT_DATA.ApicIdMap on an AP, execute a MemoryFence()


 Except: MemoryFence() isn't a *memory fence* in fact.

 See "MdePkg/Library/BaseLib/X64/GccInline.c".

 It's just a compiler barrier, which may not add anything beyond what
 we'd already have from "volatile".

 Case in point: PiSmmCpuDxeSmm performs heavy multi-processing, but does
 not contain a single invocation of MemoryFence(). It uses volatile
 objects, and a handful of InterlockedCompareExchangeXx() calls, for
 implementing semaphores. (NB: there is no 8-bit variant of
 InterlockedCompareExchange(), as "volatile UINT8" is considered atomic
 in itself, and a suitable basis for a sempahore too.) And given the
 synchronization from those semaphores, PiSmmCpuDpxeSmm trusts that
 updates to the *other* volatile objects are both atomic and visible.

 I'm pretty sure this only works because x86 is in-order. There are
 instruction stream barriers in place, and compiler barriers too, but no
 actual memory barriers.
>>>
>>> Right and just to separate them explicitly, there are two problems:
>>>
>>>   - compiler: where the compiler caches stuff in or looks at stale
>>> memory
>>> locations. Now, AFAICS, this should not happen because the ApicIdMap
>>> would
>>> never change once set so the compiler should reasonably be able to cache
>>> the address of ApicIdMap and dereference it (thus obviating the need for
>>> volatile.)
>>
>> (CPU_HOT_EJECT_DATA.Handler does change though.)
> 
> Yeah, I did kinda elide over that. Let me think this through in v7
> and add more explicit comments and then we can see if it still looks
> fishy?
> 
> Thanks
> Ankur
> 
>>
>>> The compiler could, however, cache any assignments to ApicIdMap[Idx]
>>> (especially given LTO) and we could use a MemoryFence() (as the compiler
>>> barrier that it is) to force the store.
>>>
>>>   - CPU pipeline: as you said, right now we basically depend on x86
>>> store
>>> order semantics (and the CpuPause() loop around AllCpusInSync, kinda
>>> provides
>>> a barrier.)
>>>
>>> So the BSP writes in this order:
>>> ApicIdMap[Idx]=x; ... ->AllCpusInSync = true
>>>
>>> And whenever the AP sees ->AllCpusInSync == True, it has to now see
>>> ApicIdMap[Idx] == x.
>>
>> Yes.
>>
>>>
>>> Maybe the thing to do is to detail this barrier in a commit
>>> note/comment?
>>
>> That would be nice.
>>
>>> And add the MemoryFence() but not the volatile.
>>
>> Yes, that should work.

Please *do* add the volatile, and also the MemoryFence(). When built
with Visual Studio, MemoryFence() does nothing at all (at least when LTO
is in effect -- which it almost always is). So we should have the
volatile for making things work, and MemoryFence() as a conceptual
reminder, so we know where to fix up things, when (if!) we come around
fixing this mess with MemoryFence(). Reference:

https://edk2.groups.io/g/rfc/message/500
https://edk2.groups.io/g/rfc/message/501
https://edk2.groups.io/g/rfc/message/502
https://edk2.groups.io/g/rfc/message/503

Thanks!
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71367): https://edk2.groups.io/g/devel/message/71367
Mute This Topic: https://groups.io/mt/80199926/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg/CpuExceptionHandlerLib: Clear CET shadow stack token busy bit

2021-02-05 Thread Laszlo Ersek
On 02/05/21 10:35, Sheng, W wrote:
> Hi Jiewen, Eric, Ray, Rahul, Ersek,
> I have updated the patch v2. And all comments are fixed.
> Since open CI is using NASM 2.14.02, it has not supported CET instructions 
> yet. 
> I would like to use DB xx xx xx xx to replace the assembly instruction before 
> NASM 2.15.01 is used by open CI.
> Could you continue the code review ?
> Thank you.
> BR
> Sheng Wei

I'll let others review this patch.

I'm OK to add macros to the nasm.inc files under MdePkg, as wrappers for
the DB-encoded CET instructions, as long as you also file a reminder BZ
to replace the DBs with the actual instructions, once a CET-supporting
NASM becomes available in CI.

Thanks
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71366): https://edk2.groups.io/g/devel/message/71366
Mute This Topic: https://groups.io/mt/80205210/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 3/3] UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release

2021-02-05 Thread Laszlo Ersek
On 02/05/21 08:58, Ni, Ray wrote:
> When AP firstly wakes up, MpFuncs.nasm contains below logic to assign
> an unique ApIndex to each AP according to who comes first:
> ---NASM---
> movedi, esi
> addedi, MP_CPU_EXCHANGE_INFO_FIELD (Lock)
> moveax, NotVacantFlag
> 
> TestLock:
> xchg   [edi], eax
> cmpeax, NotVacantFlag
> jz TestLock
> 
> movecx, esi
> addecx, MP_CPU_EXCHANGE_INFO_FIELD (ApIndex)
> incdword [ecx]
> movebx, [ecx]
> 
> Releaselock:
> moveax, VacantFlag
> xchg   [edi], eax
> ---NASM END---
> 
> "LOCK INC" cannot be used to increase MP_CPU_EXCHANGE_INFO.ApIndex
> because not only the MP_CPU_EXCHANGE_INFO.ApIndex should be
> increased, but also the result should be stored to a thread local
> general purpose register EBX.
> 
> This patch learns from the NASM implementation of
> InternalSyncIncrement() to use "XADD" instruction which can increase
> the global ApIndex and store the original ApIndex to EBX in one
> instruction.
> 
> With this patch, OVMF when running in a 255 threads QEMU spends about
> one second to wakeup all APs. Original implementation needs more than
> 10 seconds.
> 
> Signed-off-by: Ray Ni 
> Cc: Laszlo Ersek 
> Cc: Eric Dong 
> Cc: Rahul1 Kumar 
> ---
>  .../Library/MpInitLib/Ia32/MpFuncs.nasm   | 20 ---
>  UefiCpuPkg/Library/MpInitLib/MpEqu.inc|  4 
>  UefiCpuPkg/Library/MpInitLib/MpLib.c  |  1 -
>  UefiCpuPkg/Library/MpInitLib/MpLib.h  |  3 +--
>  UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 18 -
>  5 files changed, 9 insertions(+), 37 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm 
> b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm
> index 2f1b102717..7bd2415670 100644
> --- a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm
> +++ b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm
> @@ -122,22 +122,10 @@ SkipEnableExecuteDisable:
>  
>  ; AP init
>  movedi, esi
> -addedi, MP_CPU_EXCHANGE_INFO_FIELD (Lock)
> -moveax, NotVacantFlag
> -
> -TestLock:
> -xchg   [edi], eax
> -cmpeax, NotVacantFlag
> -jz TestLock
> -
> -movecx, esi
> -addecx, MP_CPU_EXCHANGE_INFO_FIELD (ApIndex)
> -incdword [ecx]
> -movebx, [ecx]
> -
> -Releaselock:
> -moveax, VacantFlag
> -xchg   [edi], eax
> +addedi, MP_CPU_EXCHANGE_INFO_FIELD (ApIndex)
> +movebx, 1
> +lock xadd  dword [edi], ebx ; EBX = ApIndex++
> +incebx  ; EBX is CpuNumber
>  
>  movedi, esi
>  addedi, MP_CPU_EXCHANGE_INFO_FIELD (StackSize)
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpEqu.inc 
> b/UefiCpuPkg/Library/MpInitLib/MpEqu.inc
> index 46c2b5c116..2e9368a374 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpEqu.inc
> +++ b/UefiCpuPkg/Library/MpInitLib/MpEqu.inc
> @@ -13,9 +13,6 @@
>  
> ;---
>  %include "Nasm.inc"
>  
> -VacantFlagequ00h
> -NotVacantFlag equ0ffh
> -
>  CPU_SWITCH_STATE_IDLE equ0
>  CPU_SWITCH_STATE_STORED   equ1
>  CPU_SWITCH_STATE_LOADED   equ2
> @@ -72,7 +69,6 @@ endstruc
>  ; Equivalent NASM structure of MP_CPU_EXCHANGE_INFO
>  ;
>  struc MP_CPU_EXCHANGE_INFO
> -  .Lock: CTYPE_UINTN 1
>.StackStart:   CTYPE_UINTN 1
>.StackSize:CTYPE_UINTN 1
>.CFunction:CTYPE_UINTN 1
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c 
> b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index 2568986d8c..5040053dad 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -1006,7 +1006,6 @@ FillExchangeInfoData (
>IA32_CR4 Cr4;
>  
>ExchangeInfo  = CpuMpData->MpCpuExchangeInfo;
> -  ExchangeInfo->Lock= 0;
>ExchangeInfo->StackStart  = CpuMpData->Buffer;
>ExchangeInfo->StackSize   = CpuMpData->CpuApStackSize;
>ExchangeInfo->BufferStart = CpuMpData->WakeupBuffer;
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h 
> b/UefiCpuPkg/Library/MpInitLib/MpLib.h
> index 02652eaae1..0bd60388b1 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h
> @@ -1,7 +1,7 @@
>  /** @file
>Common header file for MP Initialize Library.
>  
> -  Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.
> +  Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.
>Copyright (c) 2020, AMD Inc. All rights reserved.
>  
>SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -190,7 +190,6 @@ typedef struct _CPU_MP_DATA  CPU_MP_DATA;
>  // into this 

Re: [edk2-devel] EDK2

2021-02-05 Thread Kirkendall, Garrett
[AMD Official Use Only - Internal Distribution Only]

0x9d is one of those pesky "smart quotes" many applications love to use.  These 
are the double quote or single quote characters that slant left and right 
instead of the straight up and down like the ASCII versions.
They can be very hard to track down in a source file because a lot of editors 
have very subtle slants to the smart quotes.
This usually happens when you copy from one app like MS Word and paste into 
your source file.

Garrett Kirkendall
SMTS Firmware Engineer
7171 Southwest Parkway, Austin, TX 78735 USA
AMD   facebook  |  amd.com

From: devel@edk2.groups.io  On Behalf Of Bob Feng via 
groups.io
Sent: Thursday, February 4, 2021 11:40 PM
To: devel@edk2.groups.io; Kinney, Michael D ; 
Andrew Fish 
Cc: Pham, Tony Q 
Subject: Re: [edk2-devel] EDK2

[CAUTION: External Email]
Tony,

This build failure should be caused by one of your c or header files have 
non-ascii characters.

You may need to change the basetools' code to see which file has non-ascii 
characters

Change C:\edk2\BaseTools\Source\Python\AutoGen\StrGather.py, Line 536
except:
EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 
"SearchString: Error while processing file", File=File, RaiseError=False)
raise
to
except:
EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 
"SearchString: Error while processing file", File=File, RaiseError=True)



Thanks,
Bob

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Michael D 
Kinney
Sent: Friday, February 5, 2021 11:30 AM
To: Andrew Fish mailto:af...@apple.com>>; edk2-devel-groups-io 
mailto:devel@edk2.groups.io>>; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
Subject: Re: [edk2-devel] EDK2

Hi Andrew,

If the character is part of the code (not a comment), the ignoring the codec 
error could silently produce the incorrect FW behavior.

I prefer a failure with a correct identification of the file/line # so the file 
can be fixed.

The EDK II CI checks will not allow files in with these types of issues.

Mike



From: Andrew Fish mailto:af...@apple.com>>
Sent: Thursday, February 4, 2021 4:11 PM
To: edk2-devel-groups-io mailto:devel@edk2.groups.io>>; 
Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Cc: Pham, Tony Q mailto:tony.q.p...@intel.com>>
Subject: Re: [edk2-devel] EDK2



On Feb 4, 2021, at 3:58 PM, Michael D Kinney 
mailto:michael.d.kin...@intel.com>> wrote:

Hi Tony,

I suspect that one of your UNI files being processed by StrGather has an 
invalid Unicode character in it.  Can you review the UNI files in the module 
that is being build when this error is generated?

I would be better if this code identified the file/line number with the issue, 
so that would be a good Bugzilla to enter.


Mike,

I hit something like this too writing some Python. I think I ended up telling 
the codec to ignore errors, so that might be another option? This I think the 
issue I saw was in C code.

Thanks,

Andrew Fish

Mike

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Pham, Tony Q
Sent: Thursday, February 4, 2021 1:39 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] EDK2

Hi,

I have a problem with build.py

(Python 3.9.1 on win32) Traceback (most recent call last):
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2635, in Main
MyBuild.Launch()
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 2433, in Launch
self._BuildModule()
  File "C:\edk2\BaseTools\Source\Python\build\build.py", line 1895, in 
_BuildModule
Ma.CreateCodeFile(True)
  File "C:\edk2\BaseTools\Source\Python\AutoGen\ModuleAutoGen.py", line 1832, 
in CreateCodeFile
for File in self.AutoGenFileList:
  File "C:\edk2\BaseTools\Source\Python\Common\caching.py", line 28, in __get__
Value = obj.__dict__[self._function.__name__] = self._function(obj)
  File "C:\edk2\BaseTools\Source\Python\AutoGen\ModuleAutoGen.py", line 983, in 
AutoGenFileList
GenC.CreateCode(self, AutoGenC, AutoGenH, StringH, AutoGenUniIdf, 
UniStringBinBuffer, StringIdf, AutoGenUniIdf, IdfGenBinBuffer)
  File "C:\edk2\BaseTools\Source\Python\AutoGen\GenC.py", line 2044, in 
CreateCode
CreateUnicodeStringCode(Info, AutoGenC, StringH, UniGenCFlag, 
UniGenBinBuffer)
  File "C:\edk2\BaseTools\Source\Python\AutoGen\GenC.py", line 1706, in 
CreateUnicodeStringCode
Header, Code = GetStringFiles(Info.UnicodeFileList, SrcList, IncList, 
Info.IncludePathList, ['.uni', '.inf'], Info.Name, CompatibleMode, ShellMode, 
UniGenCFlag, UniGenBinBuffer, FilterInfo)
  File "C:\edk2\BaseTools\Source\Python\AutoGen\StrGather.py", line 563, in 
GetStringFiles
Uni = SearchString(Uni, sorted (FileList), IsCompatibleMode)
  File 

Re: [edk2-devel] [PATCH v2 2/3] UefiCpuPkg/MpInitLib: Use NASM struc to avoid hardcode offset

2021-02-05 Thread Laszlo Ersek
On 02/05/21 08:58, Ni, Ray wrote:
> In Windows environment, "dumpbin /disasm" is used to verify the
> disassembly before and after using NASM struc doesn't change.
> 
> Signed-off-by: Ray Ni 
> Cc: Eric Dong 
> Cc: Laszlo Ersek 
> Cc: Rahul Kumar 
> ---
>  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc   |  43 
>  .../Library/MpInitLib/Ia32/MpFuncs.nasm   |  82 +++---
>  UefiCpuPkg/Library/MpInitLib/MpEqu.inc| 103 ++
>  UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |   5 +-
>  UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc|  45 
>  UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm |  94 
>  7 files changed, 195 insertions(+), 182 deletions(-)
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
>  create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc
>  delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf 
> b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> index 1771575c69..860a9750e2 100644
> --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  MP Initialize Library instance for DXE driver.
>  #
> -#  Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
>  ##
> @@ -22,14 +22,13 @@ [Defines]
>  #
>  
>  [Sources.IA32]
> -  Ia32/MpEqu.inc
>Ia32/MpFuncs.nasm
>  
>  [Sources.X64]
> -  X64/MpEqu.inc
>X64/MpFuncs.nasm
>  
>  [Sources.common]
> +  MpEqu.inc
>DxeMpLib.c
>MpLib.c
>MpLib.h
> diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc 
> b/UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
> deleted file mode 100644
> index 4f5a7c859a..00
> --- a/UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -;--
>  ;
> -; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> -; SPDX-License-Identifier: BSD-2-Clause-Patent
> -;
> -; Module Name:
> -;
> -;   MpEqu.inc
> -;
> -; Abstract:
> -;
> -;   This is the equates file for Multiple Processor support
> -;
> -;---
> -
> -VacantFlagequ00h
> -NotVacantFlag equ0ffh
> -
> -CPU_SWITCH_STATE_IDLE equ0
> -CPU_SWITCH_STATE_STORED   equ1
> -CPU_SWITCH_STATE_LOADED   equ2
> -
> -LockLocation  equ(SwitchToRealProcEnd - 
> RendezvousFunnelProcStart)
> -StackStartAddressLocation equLockLocation + 04h
> -StackSizeLocation equLockLocation + 08h
> -ApProcedureLocation   equLockLocation + 0Ch
> -GdtrLocation  equLockLocation + 10h
> -IdtrLocation  equLockLocation + 16h
> -BufferStartLocation   equLockLocation + 1Ch
> -ModeOffsetLocationequLockLocation + 20h
> -ApIndexLocation   equLockLocation + 24h
> -CodeSegmentLocation   equLockLocation + 28h
> -DataSegmentLocation   equLockLocation + 2Ch
> -EnableExecuteDisableLocation  equLockLocation + 30h
> -Cr3Location   equLockLocation + 34h
> -InitFlagLocation  equLockLocation + 38h
> -CpuInfoLocation   equLockLocation + 3Ch
> -NumApsExecutingLocation   equLockLocation + 40h
> -InitializeFloatingPointUnitsAddress equ  LockLocation + 48h
> -ModeTransitionMemoryLocationequ  LockLocation + 4Ch
> -ModeTransitionSegmentLocation   equ  LockLocation + 50h
> -ModeHighMemoryLocation  equ  LockLocation + 52h
> -ModeHighSegmentLocation equ  LockLocation + 56h
> -
> diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm 
> b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm
> index 7e81d24aa6..2f1b102717 100644
> --- a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm
> +++ b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm
> @@ -1,5 +1,5 @@
>  
> ;--
>  ;
> -; Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
> +; Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
>  ; SPDX-License-Identifier: BSD-2-Clause-Patent
>  ;
>  ; Module Name:
> @@ -39,21 +39,21 @@ BITS 16
>  movfs, ax
>  movgs, ax
>  
> -movsi,  BufferStartLocation
> +movsi,  MP_CPU_EXCHANGE_INFO_FIELD (BufferStart)
>  movebx, [si]
>  
> -movsi,  DataSegmentLocation
> +movsi,  MP_CPU_EXCHANGE_INFO_FIELD (DataSegment)
>  movedx, 

Re: [edk2-devel] [PATCH v2 1/3] MdePkg/Nasm.inc: add macros for C types used in structure definition

2021-02-05 Thread Laszlo Ersek
On 02/05/21 08:58, Ni, Ray wrote:
> Signed-off-by: Ray Ni 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> ---
>  MdePkg/Include/Ia32/Nasm.inc | 38 
>  MdePkg/Include/X64/Nasm.inc  | 38 
>  2 files changed, 76 insertions(+)
> 
> diff --git a/MdePkg/Include/Ia32/Nasm.inc b/MdePkg/Include/Ia32/Nasm.inc
> index 31ce861f1e..017fe5ffd8 100644
> --- a/MdePkg/Include/Ia32/Nasm.inc
> +++ b/MdePkg/Include/Ia32/Nasm.inc
> @@ -20,3 +20,41 @@
>  %macro INCSSP_EAX  0
>  DB 0xF3, 0x0F, 0xAE, 0xE8
>  %endmacro
> +
> +; NASM provides built-in macros STRUC and ENDSTRUC for structure definition.
> +; For example, to define a structure called mytype containing a longword,
> +; a word, a byte and a string of bytes, you might code
> +;
> +; struc   mytype 
> +;
> +;  mt_long:  resd1 
> +;  mt_word:  resw1 
> +;  mt_byte:  resb1 
> +;  mt_str:   resb32 
> +;
> +; endstruc
> +;
> +; Below macros are help to map the C types and the RESB family of 
> pseudo-instructions.
> +; So that the above structure definition can be coded as
> +;
> +; struc   mytype 
> +;
> +;  mt_long:  CTYPE_UINT321 
> +;  mt_word:  CTYPE_UINT161 
> +;  mt_byte:  CTYPE_UINT8 1 
> +;  mt_str:   CTYPE_CHAR8 32 
> +;
> +; endstruc
> +%define CTYPE_UINT64resq
> +%define CTYPE_INT64 resq
> +%define CTYPE_UINT32resd
> +%define CTYPE_INT32 resd
> +%define CTYPE_UINT16resw
> +%define CTYPE_INT16 resw
> +%define CTYPE_BOOLEAN   resb
> +%define CTYPE_UINT8 resb
> +%define CTYPE_CHAR8 resb
> +%define CTYPE_INT8  resb
> +
> +%define CTYPE_UINTN resd
> +%define CTYPE_INTN  resd
> diff --git a/MdePkg/Include/X64/Nasm.inc b/MdePkg/Include/X64/Nasm.inc
> index 42412735ea..b48d8680bb 100644
> --- a/MdePkg/Include/X64/Nasm.inc
> +++ b/MdePkg/Include/X64/Nasm.inc
> @@ -20,3 +20,41 @@
>  %macro INCSSP_RAX  0
>  DB 0xF3, 0x48, 0x0F, 0xAE, 0xE8
>  %endmacro
> +
> +; NASM provides built-in macros STRUC and ENDSTRUC for structure definition.
> +; For example, to define a structure called mytype containing a longword,
> +; a word, a byte and a string of bytes, you might code
> +;
> +; struc   mytype 
> +;
> +;  mt_long:  resd1 
> +;  mt_word:  resw1 
> +;  mt_byte:  resb1 
> +;  mt_str:   resb32 
> +;
> +; endstruc
> +;
> +; Below macros are help to map the C types and the RESB family of 
> pseudo-instructions.
> +; So that the above structure definition can be coded as
> +;
> +; struc   mytype 
> +;
> +;  mt_long:  CTYPE_UINT321 
> +;  mt_word:  CTYPE_UINT161 
> +;  mt_byte:  CTYPE_UINT8 1 
> +;  mt_str:   CTYPE_CHAR8 32 
> +;
> +; endstruc
> +%define CTYPE_UINT64resq
> +%define CTYPE_INT64 resq
> +%define CTYPE_UINT32resd
> +%define CTYPE_INT32 resd
> +%define CTYPE_UINT16resw
> +%define CTYPE_INT16 resw
> +%define CTYPE_BOOLEAN   resb
> +%define CTYPE_UINT8 resb
> +%define CTYPE_CHAR8 resb
> +%define CTYPE_INT8  resb
> +
> +%define CTYPE_UINTN resq
> +%define CTYPE_INTN  resq
> 

Reviewed-by: Laszlo Ersek 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71362): https://edk2.groups.io/g/devel/message/71362
Mute This Topic: https://groups.io/mt/80401291/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 05/27] ArmPkg: Fix Ecc error 9005 in CpuDxe

2021-02-05 Thread Sami Mujawar
Hi Pierre,

This patch looks good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71361): https://edk2.groups.io/g/devel/message/71361
Mute This Topic: https://groups.io/mt/8373/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 04/27] ArmPkg: Fix Ecc error 8001 in ArmArchTimerLib

2021-02-05 Thread Sami Mujawar
Hi Pierre,

Thank you for this patch.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71360): https://edk2.groups.io/g/devel/message/71360
Mute This Topic: https://groups.io/mt/8378/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 03/27] ArmPkg: Fix Ecc error 8001 in Chipset

2021-02-05 Thread Sami Mujawar
On Thu, Jan 21, 2021 at 01:51 AM, PierreGondois wrote:

> 
> diff --git a/ArmPkg/Include/Chipset/ArmCortexA5x.h
> b/ArmPkg/Include/Chipset/ArmCortexA5x.h
> index 2661ed8c0182..2cce9f7e2bbb 100644
> --- a/ArmPkg/Include/Chipset/ArmCortexA5x.h
> +++ b/ArmPkg/Include/Chipset/ArmCortexA5x.h
> @@ -1,6 +1,6 @@
> /** @file
> 
> - Copyright (c) 2012-2014, ARM Limited. All rights reserved.
> + Copyright (c) 2012 - 2021, Arm Limited. All rights reserved.
> 
> SPDX-License-Identifier: BSD-2-Clause-Patent

There is no code change in this file. Can you exclude the changes in this file 
from the patch, please?

With that changed:

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71359): https://edk2.groups.io/g/devel/message/71359
Mute This Topic: https://groups.io/mt/8375/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 02/27] ArmPkg: Fix Ecc error 8001 in SemihostLib

2021-02-05 Thread Sami Mujawar
Thank you for this patch.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71358): https://edk2.groups.io/g/devel/message/71358
Mute This Topic: https://groups.io/mt/8372/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 01/27] ArmPkg: Fix Ecc error 8001 in Chipset

2021-02-05 Thread Sami Mujawar
Hi Pierre,

On Thu, Jan 21, 2021 at 01:51 AM, PierreGondois wrote:

> 
> -#ifndef __ARM_CORTEX_A5x_H__
> -#define __ARM_CORTEX_A5x_H__
> +#ifndef ARM_CORTEX_A5X_H__
> +#define ARM_CORTEX_A5X_H__

There should be a single trailing underscore for #include guards. See 
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/5_source_files/53_include_files#5-3-5-all-include-file-contents-must-be-protected-by-a-include-guard

With that changed:

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71357): https://edk2.groups.io/g/devel/message/71357
Mute This Topic: https://groups.io/mt/8379/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Bug 3187] FaultTolerantWriteDxe defect will cause NVRAM not recovered after number of WorkSpaceRefresh().

2021-02-05 Thread Keysound Chang
After checking Bugzilla 3187, NVRAM already corrupted in this case. Sorry that 
I didn’t aware.

From: devel@edk2.groups.io  On Behalf Of Keysound Chang 
via groups.io
Sent: Friday, February 5, 2021 11:03 AM
To: devel@edk2.groups.io; marlboro.chu...@dell.com; gaoliming 

Subject: Re: [edk2-devel] [Bug 3187] FaultTolerantWriteDxe defect will cause 
NVRAM not recovered after number of WorkSpaceRefresh().

Hi Marlboro,

How about use non-volatile EFI variable instead of CMOS? Not sure all platforms 
support CMOS.

Regards,

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Chuang, 
Marlboro via groups.io
Sent: Thursday, February 4, 2021 3:08 PM
To: gaoliming mailto:gaolim...@byosoft.com.cn>>; 
devel@edk2.groups.io
Subject: Re: [edk2-devel] [Bug 3187] FaultTolerantWriteDxe defect will cause 
NVRAM not recovered after number of WorkSpaceRefresh().

HI Gaoliming,

The DupCodeChange is for simulating user force power off the system.
So I just use the CMOS to record the temporarily flag to ensure the code will 
not enter the infinite loop to reset the system.

Best Regards,
Marlboro.


==
Marlboro Chuang
Firmware Engineer
Dell | TDC BIOS Core Team
Office : +886-2-23766313
Mobile: +886-986615685
marlboro.chu...@dell.com
==

-Original Message-
From: gaoliming mailto:gaolim...@byosoft.com.cn>>
Sent: Thursday, February 4, 2021 2:55 PM
To: Chuang, Marlboro; devel@edk2.groups.io
Subject: 回复: [Bug 3187] FaultTolerantWriteDxe defect will cause NVRAM not 
recovered after number of WorkSpaceRefresh().


[EXTERNAL EMAIL]

Chuang:
I see you directly use IO port 0x70, 0x71. What purpose to use them?

Thanks
Liming
> -邮件原件-
> 发件人: Chuang, Marlboro 
> mailto:marlboro.chu...@dell.com>>
> 发送时间: 2021年2月3日 12:59
> 收件人: devel@edk2.groups.io
> 抄送: gaolim...@byosoft.com.cn
> 主题: RE: [Bug 3187] FaultTolerantWriteDxe defect will cause NVRAM not
> recovered after number of WorkSpaceRefresh().
>
> Hi All,
>
> Regarding to Bug 3187, I have the duplicated code change and fix code
> change as the attachment.
> Please help to review and refine it.
>
> Thanks and Regards,
> Marlboro.
>
>
> -Original Message-
> From: 
> bugzilla-dae...@bugzilla.tianocore.org
> mailto:bugzilla-dae...@bugzilla.tianocore.org>>
> Sent: Wednesday, February 3, 2021 11:04 AM
> To: Chuang, Marlboro
> Subject: [Bug 3187] FaultTolerantWriteDxe defect will cause NVRAM not
> recovered after number of WorkSpaceRefresh().
>
>
> [EXTERNAL EMAIL]
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=3187
>
> gaolim...@byosoft.com.cn changed:
>
> What |Removed |Added
> 
> Priority|Lowest |Normal
> Status|UNCONFIRMED |CONFIRMED
> CC|
> |gaolim...@byosoft.com.cn
> Assignee|unassig...@tianocore.org
> |marlboro.chu...@dell.com
> Ever confirmed|0 |1
>
> --- Comment #2 from gaolim...@byosoft.com.cn 
> ---
> @Marlboro: can you send your patch to edk2 mail list?
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You are the assignee for the bug.
> You reported the bug.








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71356): https://edk2.groups.io/g/devel/message/71356
Mute This Topic: https://groups.io/mt/80376504/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] reg: iPxe Boot in NetworkPkg

2021-02-05 Thread Michael Brown

On 05/02/2021 08:28, Sivaraman Nainar wrote:

Hello Maciej:

I met an issue when tried to do the PXE boot with keeping the ipxe.efi 
as boot file.


When iPXE.efi is set as boot file once it downloaded it again starts, it 
does the download and start of iPXE continuously and at some point it 
asserts in MNP Driver.


Do you mean that you have set up an infinite loop in which UEFI loads 
ipxe.efi which loads ipxe.efi which loads ipxe.efi which loads ipxe.efi 
etc?


If so, then my guess is that you are simply running out of stack space. 
As far as I can tell, there is no memory protection around the stack in 
EDK2: once you have set up any kind of infinite recursion scenario then 
you are guaranteed to eventually underrun the stack and start 
overwriting random areas of memory.


Michael


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71355): https://edk2.groups.io/g/devel/message/71355
Mute This Topic: https://groups.io/mt/80401588/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] ARM ltd. platform maintainership

2021-02-05 Thread Leif Lindholm
Hi Sami,

On Thu, Feb 4, 2021 at 5:19 PM Sami Mujawar  wrote:
> I can take up the maintenance for these packages.
>
> Please let me know if you want me to send a patch to update the
maintainership.

That would be much appreciated, thank you.
While I'm obviously always happy to be cc:d on patches, I think it would
set the wrong expectations if I was left as a reviewer, so please just drop
me from the section.

Best Regards,

Leif

> From: Leif Lindholm 
> Sent: 04 February 2021 01:10 PM
> To: edk2-devel-groups-io 
> Cc: Sami Mujawar ; Thomas Abraham <
thomas.abra...@arm.com>; Ard Biesheuvel 
> Subject: ARM ltd. platform maintainership
>
>
>
> Hi Sami, Thomas,
>
>
>
> I would like to step down from the maintainership of the ARM ltd.
platforms in edk2-platforms (
>
> F: Platform/ARM/
> F: Silicon/ARM/
> ).
>
> Can ARM provide a replacement maintainer?
>
>
>
> Best Regards,
>
>
>
> Leif
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71354): https://edk2.groups.io/g/devel/message/71354
Mute This Topic: https://groups.io/mt/80378687/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 1/1] UefiCpuPkg/CpuExceptionHandlerLib: Clear CET shadow stack token busy bit

2021-02-05 Thread Yao, Jiewen
Would you please add comment on why we need reserve and program the 8 bytes 
here?
Something like:

//
// The highest address on the stack (0xFF8) is a save-previous-ssp token 
pointing to a location that is 40 bytes away - 0xFD0.
// The supervisor shadow stack token is just above it at address 0xFF0. This is 
where the interrupt SSP table points.
// So when an interrupt of exception occurs, we can use 
SAVESSP/RESTORESSP/CLEARSSBUSY for the supervisor shadow stack,
// due to the reason the RETF in SMM exception handler cannot clear the BUSY 
flag with same CPL.
// (only IRET or RETF with different CPL can clear BUSY flag)
// Please refer to UefiCpuPkg/Library/CpuExceptionHandlerLib/X64 for the full 
stack frame at runtime.
//

-  mCetInterruptSsp = (UINT32)((UINTN)ShadowStack + EFI_PAGES_TO_SIZE(1) - 
sizeof(UINT64));
+  InterruptSsp = (UINT32)((UINTN)ShadowStack + EFI_PAGES_TO_SIZE(1) - 
sizeof(UINT64));
+  *(UINT32 *)(UINTN)InterruptSsp = (InterruptSsp - sizeof(UINT64) * 4) | 
0x2;
+  mCetInterruptSsp = InterruptSsp - sizeof(UINT64);

> -Original Message-
> From: Sheng, W 
> Sent: Friday, February 5, 2021 5:28 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric ; Ni, Ray ; Laszlo Ersek
> ; Kumar, Rahul1 ; Yao, Jiewen
> ; Feng, Roger 
> Subject: [PATCH v2 1/1] UefiCpuPkg/CpuExceptionHandlerLib: Clear CET shadow
> stack token busy bit
> 
> If CET shadows stack feature enabled in SMM and stack switch is enabled.
> When code execute from SMM handler to SMM exception, CPU will check SMM
> exception shadow stack token busy bit if it is cleared or not.
> If it is set, it will trigger #DF exception.
> If it is not set, CPU will set the busy bit when enter SMM exception.
> So, the busy bit should be cleared when return back form SMM exception to
> SMM handler. Otherwise, keeping busy bit 1 will cause to trigger #DF
> exception when enter SMM exception next time.
> So, we use instruction SAVEPREVSSP, CLRSSBSY and RSTORSSP to clear the
> shadow stack token busy bit before RETF instruction in SMM exception.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3192
> 
> Signed-off-by: Sheng Wei 
> Cc: Eric Dong 
> Cc: Ray Ni 
> Cc: Laszlo Ersek 
> Cc: Rahul Kumar 
> Cc: Jiewen Yao 
> Cc: Roger Feng 
> ---
>  .../DxeCpuExceptionHandlerLib.inf  |  3 ++
>  .../PeiCpuExceptionHandlerLib.inf  |  3 ++
>  .../SecPeiCpuExceptionHandlerLib.inf   |  4 ++
>  .../SmmCpuExceptionHandlerLib.inf  |  3 ++
>  .../X64/Xcode5ExceptionHandlerAsm.nasm | 48
> --
>  .../Xcode5SecPeiCpuExceptionHandlerLib.inf |  4 ++
>  UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c   |  5 ++-
>  7 files changed, 66 insertions(+), 4 deletions(-)
> 
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
> index 07b34c92a8..e7a81bebdb 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
> @@ -43,6 +43,9 @@
>gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList
>gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize
> 
> +[FeaturePcd]
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard##
> CONSUMES
> +
>  [Packages]
>MdePkg/MdePkg.dec
>MdeModulePkg/MdeModulePkg.dec
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
> index feae7b3e06..cf5bfe4083 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
> @@ -57,3 +57,6 @@
>  [Pcd]
>gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard# CONSUMES
> 
> +[FeaturePcd]
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard##
> CONSUMES
> +
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.i
> nf
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.i
> nf
> index 967cb61ba6..8ae4feae62 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.i
> nf
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.i
> nf
> @@ -49,3 +49,7 @@
>LocalApicLib
>PeCoffGetEntryPointLib
>VmgExitLib
> +
> +[FeaturePcd]
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard##
> CONSUMES
> +
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
> index 4cdb11c04e..5c3d1f7cfd 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
> @@ -53,3 +53,6 @@
>

Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg/CpuExceptionHandlerLib: Clear CET shadow stack token busy bit

2021-02-05 Thread Sheng Wei
Hi Jiewen, Eric, Ray, Rahul, Ersek,
I have updated the patch v2. And all comments are fixed.
Since open CI is using NASM 2.14.02, it has not supported CET instructions yet. 
I would like to use DB xx xx xx xx to replace the assembly instruction before 
NASM 2.15.01 is used by open CI.
Could you continue the code review ?
Thank you.
BR
Sheng Wei

> -Original Message-
> From: Sheng, W
> Sent: 2021年2月3日 10:43
> To: Yao, Jiewen ; devel@edk2.groups.io
> Cc: Dong, Eric ; Ni, Ray ; Laszlo
> Ersek ; Kumar, Rahul1 
> Subject: RE: [edk2-devel] [PATCH 2/2] UefiCpuPkg/CpuExceptionHandlerLib:
> Clear CET shadow stack token busy bit
> 
> Hi Jiewen,
> Thank you for the comments.
> 1)
> I have tried CET is working if set
> gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess = TRUE
> 
> 2)
> 3)
> I will add detail comments and add shadow stack layout in the source code
> file.
> 
> 4)
> Sorry for miss the code in file
> https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/PiSmmCpuDx
> eSmm/X64/SmmFuncsArch.c
> I will update the code in next patch set.
> 
> I will raise patch V2 after we get the consensus of using BD xxx or update
> NASM version for CET instruction support.
> BR
> Sheng Wei
> 
> 
> > -Original Message-
> > From: Yao, Jiewen 
> > Sent: 2021年1月31日 9:47
> > To: devel@edk2.groups.io; Yao, Jiewen ; Sheng,
> W
> > 
> > Cc: Dong, Eric ; Ni, Ray ;
> > Laszlo Ersek ; Kumar, Rahul1
> > 
> > Subject: RE: [edk2-devel] [PATCH 2/2]
> UefiCpuPkg/CpuExceptionHandlerLib:
> > Clear CET shadow stack token busy bit
> >
> > One more question:
> >
> > 4) I saw from original author's note: The interrupt SSP table point
> > should be 0xFF0.
> >
> > I have not seen you update
> >
> https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/PiSmmCpuDx
> > eSmm/X64/SmmFuncsArch.c#L194
> >
> > May I know that SSP table point is ?
> >
> >
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of Yao,
> > > Jiewen
> > > Sent: Sunday, January 31, 2021 9:38 AM
> > > To: Sheng, W ; devel@edk2.groups.io
> > > Cc: Dong, Eric ; Ni, Ray ;
> > > Laszlo Ersek ; Kumar, Rahul1
> > > ; Yao, Jiewen 
> > > Subject: Re: [edk2-devel] [PATCH 2/2]
> > UefiCpuPkg/CpuExceptionHandlerLib:
> > > Clear CET shadow stack token busy bit
> > >
> > > Hi
> > > I have some feedback.
> > >
> > > 1) Would you please confirm you have validated the
> > >
> >
> https://github.com/tianocore/edk2/tree/master/UefiCpuPkg/Library/SmmC
> > p
> > > uF
> > > eaturesLib and
> > >
> >
> https://github.com/tianocore/edk2/tree/master/UefiCpuPkg/PiSmmCpuDx
> > eSm
> > > m with dynamic paging turn on
> > >
> >
> (gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess|FALSE
> > ),
> > > and with multiple page fault triggered in the code?
> > >
> > > 2) Would you please add comment for the assembly instruction?
> > >
> > > I saw good comment from the original author. Not sure why you
> > > removed
> > them?
> > >
> > >  push %rax   ; SSP should be 0xFD8 at this point
> > >  mov $0x04, %rax ; advance past cs:lip:prevssp;supervisor
> > shadow
> > > stack token
> > >  INCSSP %rax; After this SSP should be 0xFF8
> > >  SAVEPREVSSP ; now s shadow stack restore token will be
> > > created at 0xFD0
> > >  RDSSP %rax  ; Read new SSP - should be 0x1000
> > >  CLRSSBSY (%rax - $0x10) ; Clear token at 0xFF0; SSP should be 0
> > > after this
> > >  RESTORESSP (%rax - $0x30) ; Restore to token at 0xFD0 - new SSP
> > > will be 0xFD0
> > >  Mov $0x01, %rax ; Pop off the new save token created
> > >  INCSSP %rax; SSP should be 0xFD8 now
> > >  pop %rax; restore rax
> > >  Retf; Return
> > >
> > > 3) Please draw the stack layout in the file. It will help other
> > > people maintain the code later.
> > >
> > > For example:
> > >
> > > ++
> > > 0xFD0 |   FREE | // it is 
> > > 0xFD8|0x02|(LMA & CS.L), after
> > > SAVEPREVSSP.
> > > ++
> > > 0xFD8 |  Prev SSP   |
> > > ++
> > > 0xFE0 |   RIP|
> > > ++
> > > 0xFE8 |   CS  |
> > > ++
> > > 0xFF0 |  0xFF0 | BUSY| // BUSY flag cleared after 
> > > CLRSSBSY
> > > ++
> > > 0xFF8 | 0xFD8|0x02|(LMA & CS.L) |
> > > ++
> > >
> > > Thank you
> > > Yao Jiewen
> > >
> > >
> > > > -Original Message-
> > > > From: Sheng, W 
> > > > Sent: Friday, January 29, 2021 4:00 PM
> > > > To: devel@edk2.groups.io
> > > > Cc: Dong, Eric ; Ni, Ray ;
> > > > Laszlo
> > > Ersek

[edk2-devel] [PATCH v2 1/1] UefiCpuPkg/CpuExceptionHandlerLib: Clear CET shadow stack token busy bit

2021-02-05 Thread Sheng Wei
If CET shadows stack feature enabled in SMM and stack switch is enabled.
When code execute from SMM handler to SMM exception, CPU will check SMM
exception shadow stack token busy bit if it is cleared or not.
If it is set, it will trigger #DF exception.
If it is not set, CPU will set the busy bit when enter SMM exception.
So, the busy bit should be cleared when return back form SMM exception to
SMM handler. Otherwise, keeping busy bit 1 will cause to trigger #DF
exception when enter SMM exception next time.
So, we use instruction SAVEPREVSSP, CLRSSBSY and RSTORSSP to clear the
shadow stack token busy bit before RETF instruction in SMM exception.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3192

Signed-off-by: Sheng Wei 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Laszlo Ersek 
Cc: Rahul Kumar 
Cc: Jiewen Yao 
Cc: Roger Feng 
---
 .../DxeCpuExceptionHandlerLib.inf  |  3 ++
 .../PeiCpuExceptionHandlerLib.inf  |  3 ++
 .../SecPeiCpuExceptionHandlerLib.inf   |  4 ++
 .../SmmCpuExceptionHandlerLib.inf  |  3 ++
 .../X64/Xcode5ExceptionHandlerAsm.nasm | 48 --
 .../Xcode5SecPeiCpuExceptionHandlerLib.inf |  4 ++
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c   |  5 ++-
 7 files changed, 66 insertions(+), 4 deletions(-)

diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
index 07b34c92a8..e7a81bebdb 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
@@ -43,6 +43,9 @@
   gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList
   gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize
 
+[FeaturePcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard## CONSUMES
+
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
index feae7b3e06..cf5bfe4083 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
@@ -57,3 +57,6 @@
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard# CONSUMES
 
+[FeaturePcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard## CONSUMES
+
diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
index 967cb61ba6..8ae4feae62 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
@@ -49,3 +49,7 @@
   LocalApicLib
   PeCoffGetEntryPointLib
   VmgExitLib
+
+[FeaturePcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard## CONSUMES
+
diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
index 4cdb11c04e..5c3d1f7cfd 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
@@ -53,3 +53,6 @@
   DebugLib
   VmgExitLib
 
+[FeaturePcd]
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard## CONSUMES
+
diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerAsm.nasm 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerAsm.nasm
index 26cae56cc5..05a802a633 100644
--- 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerAsm.nasm
+++ 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerAsm.nasm
@@ -1,5 +1,5 @@
 
;-- 
;
-; Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
+; Copyright (c) 2012 - 2021, Intel Corporation. All rights reserved.
 ; SPDX-License-Identifier: BSD-2-Clause-Patent
 ;
 ; Module Name:
@@ -13,6 +13,7 @@
 ; Notes:
 ;
 ;--
+%include "Nasm.inc"
 
 ;
 ; CommonExceptionHandler()
@@ -23,6 +24,7 @@
 extern ASM_PFX(mErrorCodeFlag); Error code flags for exceptions
 extern ASM_PFX(mDoFarReturnFlag)  ; Do far return flag
 extern ASM_PFX(CommonExceptionHandler)
+extern ASM_PFX(FeaturePcdGet (PcdCpuSmmStackGuard))
 
 SECTION .data
 
@@ -371,8 +373,48 @@ DoReturn:
 pushqword [rax + 0x18]   ; save EFLAGS in new location
 mov rax, [rax]; restore rax
 popfq ; restore EFLAGS
-DB  0x48   ; prefix to composite "retq" with next "retf"
-retf  ; far return
+
+; The follow algorithm 

[edk2-devel] [PATCH v2 0/1] Fix CET shadow stack token busy bit clear issue

2021-02-05 Thread Sheng Wei
If CET shadows stack feature enabled in SMM and stack switch is enabled.
When code execute from SMM handler to SMM exception, CPU will check SMM
exception shadow stack token busy bit if it is cleared or not.
If it is set, it will trigger #DF exception.
If it is not set, CPU will set the busy bit when enter SMM exception.
So, the busy bit should be cleared when return back form SMM exception to
SMM handler. Otherwise, keeping busy bit 1 will cause to trigger #DF
exception when enter SMM exception next time.
So, we use instruction SAVEPREVSSP, CLRSSBSY and RSTORSSP to clear the
shadow stack token busy bit before RETF instruction in SMM exception.
Since open CI is using NASM 2.14.02, it has not supported CET instructions
yet. Use DB xx xx xx xx to replace the assembly instruction before NASM
2.15.01 is used.

Change from patch set 1 to patch set 2:
1 Add behavior description in source code comment.
2 Structure interrupt shadow stack memory in InitShadowStack().
3 Update commit comment.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3192

Signed-off-by: Sheng Wei 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Laszlo Ersek 
Cc: Rahul Kumar 
Cc: Jiewen Yao 
Cc: Roger Feng 

Sheng Wei (1):
  UefiCpuPkg/CpuExceptionHandlerLib: Clear CET shadow stack token busy
bit

 .../DxeCpuExceptionHandlerLib.inf  |  3 ++
 .../PeiCpuExceptionHandlerLib.inf  |  3 ++
 .../SecPeiCpuExceptionHandlerLib.inf   |  4 ++
 .../SmmCpuExceptionHandlerLib.inf  |  3 ++
 .../X64/Xcode5ExceptionHandlerAsm.nasm | 48 --
 .../Xcode5SecPeiCpuExceptionHandlerLib.inf |  4 ++
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c   |  5 ++-
 7 files changed, 66 insertions(+), 4 deletions(-)

-- 
2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71350): https://edk2.groups.io/g/devel/message/71350
Mute This Topic: https://groups.io/mt/80402160/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] reg: iPxe Boot in NetworkPkg

2021-02-05 Thread Sivaraman Nainar
Hello Maciej:

I met an issue when tried to do the PXE boot with keeping the ipxe.efi as boot 
file.

When iPXE.efi is set as boot file once it downloaded it again starts, it does 
the download and start of iPXE continuously and at some point it asserts in MNP 
Driver.

When it trying to access the context of SNP Context in MNP driver it asserts.

Have we ever validated Ipxe as the Pxt Boot file?

-Siva







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71349): https://edk2.groups.io/g/devel/message/71349
Mute This Topic: https://groups.io/mt/80401588/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



>>Start PXE over IPv4.
  Station IP address is 10.0.84.120

  Server IP address is 10.0.84.155
  NBP filename is ipxe.efi
  NBP filesize is 988032 Bytes
 Downloading NBP file...

  NBP file downloaded successfully.
BDS.SaveMemoryTypeInformation(8A59FE40)
Unknown.Entry(852193A9)
iPXE initialising devices...Realtek UEFI UNDI Driver.Stop=
SnpDxe.Stop=
MnpDxe.Stop=
ArpDxe.Stop=
UefiPxeBcDxe.Stop=
Success
Success
Ip4Dxe.Stop=
TcpDxe.Stop=
HttpDxe.Stop=
Success
Success
Udp4Dxe.Stop=
Dhcp4Dxe.Stop=
HttpBootDxe.Stop=
Success
Success
Mtftp4Dxe.Stop=
Success
DnsDxe.Stop=
Success
Success
Success
Ip6Dxe.Stop=
TCP Network Service Driver.Stop=
HttpDxe.Stop=
Success
Success
Udp6Dxe.Stop=
Dhcp6Dxe.Stop=
UEFI HTTP Boot Driver.Stop=
Success
UEFI PXE Base Code Driver.Stop=
Success
Success
Mtftp6Dxe.Stop=
Success
DNS Network Service Driver.Stop=
Success
Success
Success
VlanConfigDxe.Stop=
Success
Success

snp->undi.shutdown()  8000h:6h

snp->undi.stop()  8000h:6h
Success
Success
ipxe.efi.Start(8527D6EA)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)]=Success
MnpDxe.Start(8A251850)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
ArpDxe.Start(8A25DB74)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
VlanConfigDxe.Start(8A0768B0)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
Ip4Dxe.Start(8A047F18)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
TcpDxe.Start(8A0B9E60)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
HttpDxe.Start(8A07ED0C)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
Udp4Dxe.Start(8A031910)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
Dhcp4Dxe.Start(8A05DB40)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
HttpBootDxe.Start(8A093DDC)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
Mtftp4Dxe.Start(8A03C940)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
UefiPxeBcDxe.Start(8A0A7F60)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
Ip6Dxe.Start(8A01A0C8)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
TCP Network Service 
Driver.Start(8A0B9F40)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
HttpDxe.Start(8A07ED78)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
Udp6Dxe.Start(8A00E874)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
Dhcp6Dxe.Start(8A003CBC)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
UEFI HTTP Boot 
Driver.Start(8A09442C)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
Mtftp6Dxe.Start(89FF8A88)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
UEFI PXE Base Code 
Driver.Start(8A0A7F84)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
DNS Network Service 
Driver.Start(8A0690CC)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
DnsDxe.Start(8A068E38)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)]=Success
ipxe.efi.Start(8527D6EA)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)/IPv4(0.0.0.0)]=Unsupported
ipxe.efi.Start(8527D6EA)[PciRoot(0x0)/Pci(0x1C,0x0)/Pci(0x0,0x0)/MAC(309C23E81359,0x1)/IPv6(:::::::)]=Unsupported
UefiPxeBcDxe.Stop=
Success
ok



iPXE 1.20.1+ (g485f8) -- Open Source Network Boot Firmware -- http://ipxe.org
Features: DNS HTTP iSCSI TFTP SRP AoE EFI Menu

Press Ctrl-B for the iPXE command line...   
  net0: 30:9c:23:e8:13:59 using rtl8168 on :01:00.0 (open)
  [Link:down, TX:0 TXE:0 RX:0 RXE:0]
  [Link status: Down (http://ipxe.org/38086193)]
Waiting for link-up on net0 ok
Configuring (net0 30:9c:23:e8:13:59).. ok
net0: 10.0.84.120/255.255.248.0 gw 10.0.80.1
net0: fe80::329c:23ff:fee8:1359/64
Next server: 10.0.84.155
Filename: ipxe.efi
tftp://10.0.84.155/ipxe.efi... ok
ipxe.efi : 988032 bytes [EFI]
Unknown.Entry(84F903A9)
iPXE initialising devices...ipxe.efi.Stop=
MnpDxe.Stop=
ArpDxe.Stop=
Success
Ip4Dxe.Stop=
TcpDxe.Stop=
HttpDxe.Stop=
Success
Success
Udp4Dxe.Stop=

Re: [edk2-devel] How can I receive EAP packets?

2021-02-05 Thread Siyuan, Fu
You may check the Ip4Dxe as example.

> 在 2021年2月5日,15:16,梁宇飞  写道:
> 
> Do you have any examples or documentation of using MNP?
> 
> Best regards
> Yufei liang
> -邮件原件-
> 发件人: 梁宇飞 [mailto:yufei.li...@jumple.com] 
> 发送时间: 2021年2月5日 8:48
> 收件人: 'Fu, Siyuan'; 'Laszlo Ersek'; 'devel@edk2.groups.io'
> 抄送: 'Maciej Rabeda'; 'Wu, Jiaxin'
> 主题: 答复: [edk2-devel] How can I receive EAP packets?
> 
> Thank you for your reply.
> I will try to use MNP protocol.
> 
>>> Not sure if this is the "hybrid mode" you asking about.
> Sorry, it's wrong. It should be "Promiscuous mode".
> 
> Best regards
> Yufei liang
> -邮件原件-
> 发件人: Fu, Siyuan [mailto:siyuan...@intel.com]
> 发送时间: 2021年2月4日 22:10
> 收件人: Laszlo Ersek; devel@edk2.groups.io; yufei.li...@jumple.com
> 抄送: Maciej Rabeda; Wu, Jiaxin
> 主题: RE: [edk2-devel] How can I receive EAP packets?
> 
>> -Original Message-
>> From: Laszlo Ersek 
>> Sent: 2021年2月4日 17:56
>> To: devel@edk2.groups.io; yufei.li...@jumple.com
>> Cc: Maciej Rabeda ; Fu, Siyuan 
>> ; Wu, Jiaxin 
>> Subject: Re: [edk2-devel] How can I receive EAP packets?
>> 
>>> On 02/03/21 04:20, 梁宇飞 wrote:
>>> Hi,everyone, I am using edkii to write EAP certified loader, I use 
>>> EFI_ SIMPLE_ NETWORK.Transmit () to contract, want to use EFI_ 
>>> SIMPLE_ NETWORK.Receive () to receive packets. It is found that
> 
> The SNP protocol is low level interface to access network adaptor directly, 
> It's not designed to be used by application level, because it could only have 
> one consumer unlike other service binding network service protocols. So any 
> packet receive through SNP will be only delivered to this single consumer. 
> If your "EAP certified loader" consumes SNP protocol, all upper layer network 
> stack (TCP/IP, etc) will stop work. So, at least use MNP protocol instead.
> 
>>> ordinary IP packets can be received, but EAP packets cannot be 
>>> received. How can I receive EAP package? I think there is a saying 
>>> of hybrid mode in the program under windows. I want to know whether
> 
> The MNP protocol "EnablePromiscuousReceive" allows you to receive packets  
> that are sent to any MAC address. The IP protocol child instance with 0.0.0.0 
> station address allows you to receive packets that are send to any IP address.
> Not sure if this is the "hybrid mode" you asking about.
> 
>>> there is such a saying under EDK. In addition, I think EDK provides 
>>> EFI_ EAP_ Protocol, I want to use this interface for user name and 
>>> password authentication, but look at EFI_ EAP_ Protocol interface, 
>>> do not know how to use, I would like to ask the relevant example code?
> 
> As I know there is no driver to produce/consume EAP protocol in EDK2.
> 
> Thanks
> Siyuan
> 
>> I don't know anything about "EAP", but I've CC'd the NetworkPkg owners.
>> 
>> Thanks
>> Laszlo
> 
> 
> 
> 
> 
> 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71348): https://edk2.groups.io/g/devel/message/71348
Mute This Topic: https://groups.io/mt/80401337/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-