Re: [edk2-devel] [PATCH v2] KabylakeOpenBoardPkg: Fixed system hang caused by MemoryTest.

2019-05-21 Thread Kubacki, Michael A
Reviewed-by: Michael Kubacki 

> -Original Message-
> From: Chiu, Chasel
> Sent: Tuesday, May 21, 2019 5:03 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Kubacki, Michael A
> 
> Subject: [PATCH v2] KabylakeOpenBoardPkg: Fixed system hang caused by
> MemoryTest.
> 
> From: "Chasel, Chiu" 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1550
> 
> OS hang due to non-existing memory reported as usable memory.
> There are 2 different RVP3 boards and one with 4GB memory down
> implementation while another one with 8GB. Since rest of the
> configurations are exactly the same, board detection is added
> to the same RVP3 BoardInitLib and only SPD policy assigned
> differently.
> 
> This also fixed below 2 issues:
> 1. Fixed build failuire when PcdMultiBoardSupport == FALSE.
>(Wrong Pcd TokenSpace used in DxeBoardAcpiTableLib.inf)
> 2. Always failed to read SPD from DIMM because SpdAddressTable
>policy was not updated properly. Fixed by a notify callback
>when policy PPI installed.
> 
> Test: Verified both RVP3 boards can boot to Windows.
> 
> Cc: Nate DeSimone 
> Cc: Michael Kubacki 
> Signed-off-by: Chasel Chiu 
> ---
> 
> Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yNotifyLib/PeiPreMemSiliconPolicyNotifyLib.c   | 103
> ++
> +
> 
> Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiSaPolicyUpdatePreMem.c|  17 ++---
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib
> /DxeMultiBoardAcpiSupportLib.c  |   4 ++--
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib
> /SmmMultiBoardAcpiSupportLib.c  |   6 +++---
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/
> KabylakeRvp3SpdTable.c | 117
> ++
> ++-
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/
> PeiBoardInitPreMemLib.c|   7 +--
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/
> PeiKabylakeRvp3Detect.c|  83
> ++
> +
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/
> PeiKabylakeRvp3InitPreMemLib.c | 127
> ++
> -
> 
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/
> PeiMultiBoardInitPostMemLib.c  |   4 ++--
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/
> PeiMultiBoardInitPreMemLib.c   |   4 ++--
>  Platform/Intel/KabylakeOpenBoardPkg/Library/BaseEcLib/BaseEcLib.c
> | 330
> ++
> ++
> ++
> ++
> ++
> 
> 
> Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yNotifyLib/PeiPreMemSiliconPolicyNotifyLib.inf |  43
> +++
> 
> Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolic
> yUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf |   9 -
>  Platform/Intel/KabylakeOpenBoardPkg/Include/EcCommands.h
> |  44 
>  Platform/Intel/KabylakeOpenBoardPkg/Include/Library/EcLib.h
> | 106
> ++
> 
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib
> /DxeBoardAcpiTableLib.inf   |   8 
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/
> PeiBoardInitPreMemLib.inf  |   3 ++-
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/
> PeiKabylakeRvp3InitLib.h   |   4 +++-
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/
> PeiMultiBoardInitPreMemLib.inf |   3 ++-
>  Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> |  12 ++--
>  Platform/Intel/KabylakeOpenBoardPkg/Library/BaseEcLib/BaseEcLib.inf
> |  29 +
>  21 files changed, 1013 insertions(+), 50 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPol
> icyNotifyLib/PeiPreMemSiliconPolicyNotifyLib.c
> 

[edk2-devel] [PATCH v2] KabylakeOpenBoardPkg: Fixed system hang caused by MemoryTest.

2019-05-21 Thread Chiu, Chasel
From: "Chasel, Chiu" 

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

OS hang due to non-existing memory reported as usable memory.
There are 2 different RVP3 boards and one with 4GB memory down
implementation while another one with 8GB. Since rest of the
configurations are exactly the same, board detection is added
to the same RVP3 BoardInitLib and only SPD policy assigned
differently.

This also fixed below 2 issues:
1. Fixed build failuire when PcdMultiBoardSupport == FALSE.
   (Wrong Pcd TokenSpace used in DxeBoardAcpiTableLib.inf)
2. Always failed to read SPD from DIMM because SpdAddressTable
   policy was not updated properly. Fixed by a notify callback
   when policy PPI installed.

Test: Verified both RVP3 boards can boot to Windows.

Cc: Nate DeSimone 
Cc: Michael Kubacki 
Signed-off-by: Chasel Chiu 
---
 
Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyNotifyLib/PeiPreMemSiliconPolicyNotifyLib.c
   | 103 
+++
 
Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdatePreMem.c
|  17 ++---
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.c
  |   4 ++--
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c
  |   6 +++---
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/KabylakeRvp3SpdTable.c
 | 117 
-
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiBoardInitPreMemLib.c
|   7 +--
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3Detect.c
|  83 
+++
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c
 | 127 
++-
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c
  |   4 ++--
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c
   |   4 ++--
 Platform/Intel/KabylakeOpenBoardPkg/Library/BaseEcLib/BaseEcLib.c  
  | 330 
++
 
Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyNotifyLib/PeiPreMemSiliconPolicyNotifyLib.inf
 |  43 +++
 
Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
 |   9 -
 Platform/Intel/KabylakeOpenBoardPkg/Include/EcCommands.h   
  |  44 

 Platform/Intel/KabylakeOpenBoardPkg/Include/Library/EcLib.h
  | 106 
++
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeBoardAcpiTableLib.inf
   |   8 
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf
  |   3 ++-
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitLib.h
   |   4 +++-
 
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
 |   3 ++-
 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc  
  |  12 ++--
 Platform/Intel/KabylakeOpenBoardPkg/Library/BaseEcLib/BaseEcLib.inf
  |  29 +
 21 files changed, 1013 insertions(+), 50 deletions(-)

diff --git 
a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyNotifyLib/PeiPreMemSiliconPolicyNotifyLib.c
 
b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyNotifyLib/PeiPreMemSiliconPolicyNotifyLib.c
new file mode 100644
index 00..0fedd81cd0
--- /dev/null
+++