[edk2-devel] [PATCH v3 8/8] edk2-platforms: Maintainers.txt

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

Add maintainer and reviewer of ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Abdul Lateef Attar 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nickle Wang 
Reviewed-by: Michael D Kinney 
Reviewed-by: Nickle Wang 
---
 Maintainers.txt | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index 7471913660..8279a8ac5d 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -164,6 +164,13 @@ F: Features/Intel/UserInterface/
 M: Dandan Bi 
 R: Liming Gao 
 
+Features/ManageabilityPkg
+F: Features/ManageabilityPkg/
+M: Abner Chang 
+M: Isaac Oram 
+R: Abdul Lateef Attar 
+R: Nickle Wang 
+
 Platform/Intel
 F: Platform/Intel/
 M: Sai Chaganty 
@@ -326,10 +333,10 @@ R: Yuwei Chen 
 
 Loongson platforms
 F: Platform/Loongson/
-M: Bibo Mao  
+M: Bibo Mao 
 M: Xianglai li 
 M: Chao Li 
- 
+
 Marvell platforms and silicon
 F: Platform/Marvell/
 F: Platform/SolidRun/Armada80x0McBin/
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH v3 7/8] ManageabilityPkg: Add IpmiProtocol to Manageability Package

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

Add Ipmi Protocol/Ppi/SMM modules to ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Nickle Wang 
---
 Features/ManageabilityPkg/Include/Dsc/Manageability.dsc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
index 994c93f17c..0d868fdf4a 100644
--- a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -16,3 +16,10 @@
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
 
+[Components.IA32]
+  ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
+
+[Components.X64]
+  ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
+  ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf
+
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH v3 6/8] ManageabilityPkg: Implement Ipmi Protocol/Ppi

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

Add Ipmi Protocol/Ppi/SMM implementations.
The underlying implementation of transport
interface depends on the binded
ManageabilityTransportLib.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../IpmiProtocol/Dxe/IpmiProtocolDxe.inf  |  50 
 .../Universal/IpmiProtocol/Pei/IpmiPpiPei.inf |  53 
 .../IpmiProtocol/Smm/IpmiProtocolSmm.inf  |  52 
 .../IpmiProtocol/Common/IpmiProtocolCommon.h  | 108 
 .../IpmiProtocol/Pei/IpmiPpiInternal.h|  25 ++
 .../IpmiProtocol/Common/IpmiProtocolCommon.c  | 252 ++
 .../Universal/IpmiProtocol/Dxe/IpmiProtocol.c | 177 
 .../Universal/IpmiProtocol/Pei/IpmiPpi.c  | 159 +++
 .../Universal/IpmiProtocol/Smm/IpmiProtocol.c | 147 ++
 9 files changed, 1023 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Common/IpmiProtocolCommon.h
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiInternal.h
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Common/IpmiProtocolCommon.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocol.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpi.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.c

diff --git 
a/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf 
b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
new file mode 100644
index 00..ff5ec56c73
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
@@ -0,0 +1,50 @@
+## @file
+# IPMI Protocol DXE Driver.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  INF_VERSION= 0x0001001d
+  BASE_NAME  = IpmiDxe
+  FILE_GUID  = BC41B0C2-9D8A-42B5-A28F-02CE0D4A6C28
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= DxeIpmiEntry
+  UNLOAD_IMAGE   = IpmiUnloadImage
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  IpmiProtocol.c
+  ../Common/IpmiProtocolCommon.c
+  ../Common/IpmiProtocolCommon.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  ManageabilityPkg/ManageabilityPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  ManageabilityTransportHelperLib
+  ManageabilityTransportLib
+  UefiDriverEntryPoint
+  UefiBootServicesTableLib
+
+[Protocols]
+  gIpmiProtocolGuid   # PROTOCOL ALWAYS_PRODUCED
+
+[Guids]
+  gManageabilityProtocolIpmiGuid
+  gManageabilityTransportKcsGuid
+
+[FixedPcd]
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress
+
+[Depex]
+  TRUE
diff --git 
a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf 
b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
new file mode 100644
index 00..4e00693f64
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
@@ -0,0 +1,53 @@
+## @file
+# IPMI Protocol PEI Driver.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  INF_VERSION= 0x0001001d
+  BASE_NAME  = IpmiPei
+  FILE_GUID  = 7832F989-CB72-4715-ADCA-35C0B031856C
+  MODULE_TYPE= PEIM
+  VERSION_STRING = 1.0
+  ENTRY_POINT= PeiIpmiEntry
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  IpmiPpi.c
+  IpmiPpiInternal.h
+  ../Common/IpmiProtocolCommon.c
+  ../Common/IpmiProtocolCommon.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  ManageabilityPkg/ManageabilityPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  MemoryAllocationLib
+  ManageabilityTransportHelperLib
+  ManageabilityTransportLib
+  PeimEntryPoint
+  ManageabilityTransportLib
+
+[Ppis]
+  gPeiIpmiPpiGuid   # PPI ALWAYS PRODUCED
+
+[Guids]
+  gManageabilityProtocolIpmiGuid
+  gManageabilityTransportKcsGuid
+
+[FixedPcd]
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress
+
+[Depex]
+  TRUE
diff --git 
a/Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf 
b/Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf
new 

[edk2-devel] [PATCH v3 5/8] ManageabilityPkg/ManageabilityTransportKcsLib

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

This is the KCS manageability transport library
instance follows the design guidance described
in Readme file under ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../ManageabilityPkg/ManageabilityPkg.dsc |   3 +
 .../Dxe/DxeManageabilityTransportKcs.inf  |  44 ++
 .../Common/ManageabilityTransportKcs.h| 105 
 .../Common/KcsCommon.c| 502 ++
 .../Dxe/ManageabilityTransportKcs.c   | 389 ++
 .../Dxe/ManageabilityTransportKcs.uni |  13 +
 6 files changed, 1056 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsCommon.c
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/ManageabilityTransportKcs.c
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/ManageabilityTransportKcs.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index 0dd0ab41fc..45e07ac34f 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -36,6 +36,9 @@
 !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
 !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
 
+[Components]
+  
ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
+
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
 
diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
new file mode 100644
index 00..f0a6afa074
--- /dev/null
+++ 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
@@ -0,0 +1,44 @@
+## @file
+# KCS instance of Manageability Transport Library
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001B
+  BASE_NAME  = DxeManageabilityTransportKcs
+  MODULE_UNI_FILE= ManageabilityTransportKcs.uni
+  FILE_GUID  = FCCC8B34-145A-4927-9F08-553ADC579AF7
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = ManageabilityTransportLib
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  ManageabilityTransportKcs.c
+  ../Common/KcsCommon.c
+  ../Common/ManageabilityTransportKcs.h
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  IoLib
+  TimerLib
+  MemoryAllocationLib
+
+[Guids]
+  gManageabilityTransportKcsGuid
+  gManageabilityProtocolMctpGuid
+  gManageabilityProtocolIpmiGuid
+
+[FixedPcd]
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress   # Used as default KCS I/O 
base adddress
+
diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
new file mode 100644
index 00..f1758ffd8f
--- /dev/null
+++ 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
@@ -0,0 +1,105 @@
+/** @file
+
+  Manageability transport KCS internal used definitions.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef MANAGEABILITY_TRANSPORT_KCS_LIB_H_
+#define MANAGEABILITY_TRANSPORT_KCS_LIB_H_
+
+#include 
+
+#define MANAGEABILITY_TRANSPORT_KCS_SIGNATURE  SIGNATURE_32 ('M', 'T', 'K', 
'C')
+
+#define KCS_BASE_ADDRESS  mKcsHardwareInfo.IoBaseAddress
+#define KCS_REG_DATA_IN   mKcsHardwareInfo.IoDataInAddress
+#define KCS_REG_DATA_OUT  mKcsHardwareInfo.IoDataOutAddress
+#define KCS_REG_COMMAND   mKcsHardwareInfo.IoCommandAddress
+#define KCS_REG_STATUSmKcsHardwareInfo.IoStatusAddress
+
+///
+/// Manageability transport KCS internal data structure.
+///
+typedef struct {
+  UINTNSignature;
+  MANAGEABILITY_TRANSPORT_TOKENToken;
+} MANAGEABILITY_TRANSPORT_KCS;
+
+#define MANAGEABILITY_TRANSPORT_KCS_FROM_LINK(a)  CR (a, 
MANAGEABILITY_TRANSPORT_KCS, Token, MANAGEABILITY_TRANSPORT_KCS_SIGNATURE)
+
+#define IPMI_KCS_GET_STATE(s)  (s >> 6)
+#define IPMI_KCS_SET_STATE(s)  (s << 6)
+
+/// 5 

[edk2-devel] [PATCH v3 4/8] ManageabilityPkg: Add ManageabilityTransportHelperLib

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

The helper functions library facilitates reducing
duplicated code in the manageability transport
library instances.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Abdul Lateef Attar 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |  23 +-
 .../Include/Dsc/Manageability.dsc |   2 +
 .../BaseManageabilityTransportHelper.inf  |  41 +++
 .../Library/ManageabilityTransportHelperLib.h |  93 +++
 .../BaseManageabilityTransportHelper.c| 261 ++
 .../BaseManageabilityTransportHelper.uni  |  13 +
 6 files changed, 432 insertions(+), 1 deletion(-)
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index ebf6e6315e..ebbb04dc0e 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -22,6 +22,27 @@
   #   Manageability Transport Library definitions
   ManageabilityTransportLib|Include/Library/ManageabilityTransportLib.h
 
+  ##  @libraryclass Manageability Transport Helper Library
+  #   Provide the help functions to use ManageabilityTransportLib
+  
ManageabilityTransportHelperLib|Include/Library/ManageabilityTransportHelperLib.h
+
 [Guids]
-  gManageabilityPkgTokenSpaceGuid = { 0xBDEFFF48, 0x1C31, 0x49CD, { 0xA7, 
0x6D, 0x92, 0x9E, 0x60, 0xDB, 0xB9, 0xF8 } }
+  gManageabilityPkgTokenSpaceGuid   = { 0xBDEFFF48, 0x1C31, 0x49CD, { 0xA7, 
0x6D, 0x92, 0x9E, 0x60, 0xDB, 0xB9, 0xF8 } }
+
+  # Manageability Transport Interface type
+  #
+  # Manageability Transport KCS
+  gManageabilityTransportKcsGuid= { 0x5A6E64E9, 0xFD47, 0x4086, { 0xAA, 
0xB0, 0x7A, 0x5F, 0xD7, 0x6B, 0x02, 0x2E } }
+  # Manageability Transport I2C
+  gManageabilityTransportI2CGuid= { 0x5B174658, 0x8263, 0x4CB8, { 0xA0, 
0x0F, 0xD6, 0x82, 0xE6, 0xBC, 0x74, 0x93 } }
+  # Manageability Transport PCI VDM
+  gManageabilityTransportPciVdmGuid = { 0x388021A7, 0xFB59, 0x4811, { 0x9D, 
0xA7, 0xD5, 0x63, 0x7D, 0x04, 0xA7, 0x2F } }
 
+  # Manageability Protocol Specification
+  #
+  # Manageability Protocol IPMI
+  gManageabilityProtocolIpmiGuid= { 0x36ACA47C, 0xCC80, 0x473B, { 0xAB, 
0xEC, 0xF3, 0x98, 0xFF, 0x87, 0x74, 0x5B } }
+  # Manageability Protocol MCTP
+  gManageabilityProtocolMctpGuid= { 0x76FED8F1, 0x0BE5, 0x4269, { 0xA3, 
0x1A, 0x38, 0x0F, 0x54, 0xF1, 0xA1, 0x8A } }
+  # Manageability Protocol PLDM
+  gManageabilityProtocolPldmGuid= { 0x3958090D, 0x69DD, 0x4868, { 0x9C, 
0x41, 0xC9, 0xAC, 0x31, 0xB5, 0x25, 0xC5 } }
diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
index 2cb63c1ca6..994c93f17c 100644
--- a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -5,6 +5,8 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
+[LibraryClasses]
+  
ManageabilityTransportHelperLib|ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #
diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
new file mode 100644
index 00..95c3362ddb
--- /dev/null
+++ 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
@@ -0,0 +1,41 @@
+## @file
+# Null instance of Manageability Transport Helper Library
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001B
+  BASE_NAME  = BaseManageabilityTransportHelper
+  MODULE_UNI_FILE= BaseManageabilityTransportHelper.uni
+  FILE_GUID  = 52F2DE11-A8FC-4A06-B8C6-10DCF4A7397C
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = ManageabilityTransportHelperLib
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  BaseManageabilityTransportHelper.c
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[Guids]
+  gManageabilityTransportKcsGuid
+  

[edk2-devel] [PATCH v3 3/8] ManageabilityPkg: Add NULL ManageabilityTransportLib

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

The NULL instance of ManageabilityTransportLib
library.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Abdul Lateef Attar 
Reviewed-by: Nickle Wang 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |   9 +
 .../ManageabilityPkg/ManageabilityPkg.dsc |   4 +-
 .../BaseManageabilityTransportNull.inf|  28 ++
 .../Library/ManageabilityTransportIpmiLib.h   |  24 ++
 .../Library/ManageabilityTransportLib.h   | 336 ++
 .../BaseManageabilityTransportNull.c  |  64 
 .../BaseManageabilityTransportNull.uni|  13 +
 7 files changed, 477 insertions(+), 1 deletion(-)
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.c
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 8a0e28f50b..ebf6e6315e 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -16,3 +16,12 @@
 
 [Includes]
   Include
+
+[LibraryClasses]
+  ##  @libraryclass Manageability Transport Library
+  #   Manageability Transport Library definitions
+  ManageabilityTransportLib|Include/Library/ManageabilityTransportLib.h
+
+[Guids]
+  gManageabilityPkgTokenSpaceGuid = { 0xBDEFFF48, 0x1C31, 0x49CD, { 0xA7, 
0x6D, 0x92, 0x9E, 0x60, 0xDB, 0xB9, 0xF8 } }
+
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index 46cc215a0f..0dd0ab41fc 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -36,5 +36,7 @@
 !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
 !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
 
-!include Include/Dsc/Manageability.dsc
+[LibraryClasses]
+  
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
 
+!include Include/Dsc/Manageability.dsc
diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
new file mode 100644
index 00..3cb97afb8b
--- /dev/null
+++ 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
@@ -0,0 +1,28 @@
+## @file
+# Null instance of Manageability Transport Library
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001B
+  BASE_NAME  = BaseManageabilityTransportNull
+  MODULE_UNI_FILE= BaseManageabilityTransportNull.uni
+  FILE_GUID  = B63DC070-FB44-44F3-8E9A-DA6CC712EF4F
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = ManageabilityTransportLib
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  BaseManageabilityTransportNull.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
new file mode 100644
index 00..7ca6acf6ef
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
@@ -0,0 +1,24 @@
+/** @file
+
+  This file defines the manageability IPMI protocol specific transport data.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef MANAGEABILITY_TRANSPORT_IPMI_LIB_H_
+#define MANAGEABILITY_TRANSPORT_IPMI_LIB_H_
+
+#include 
+
+///
+/// The IPMI command header which is apart from
+/// the payload.
+///
+typedef struct {
+  UINT8NetFn;
+  UINT8Lun;
+  UINT8Command;
+} MANAGEABILITY_IPMI_TRANSPORT_HEADER;
+
+#endif
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
new file mode 100644
index 00..c022b4ac5c
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
@@ -0,0 +1,336 @@
+/** @file
+
+  This file defines the manageability transport interface library and 
functions.
+
+  Copyright (C) 2023 

[edk2-devel] [PATCH v3 2/8] ManageabilityPkg: Initial package

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

Initial commit of ManageabilityPkg

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Abdul Lateef Attar 
Reviewed-by: Nickle Wang 
---
 .../ManageabilityPkg/ManageabilityPkg.dec | 18 +
 .../Include/Dsc/Manageability.dsc | 16 
 .../ManageabilityPkg/ManageabilityPkg.dsc | 40 +++
 3 files changed, 74 insertions(+)
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dec
 create mode 100644 Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dsc

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
new file mode 100644
index 00..8a0e28f50b
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -0,0 +1,18 @@
+## @file
+# Manageabilty Package
+# This is the package provides the edk2 drivers and libraries
+# those are related to the platform management.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  DEC_SPECIFICATION = 0x0001001d
+  PACKAGE_NAME  = ManageabilityPkg
+  PACKAGE_GUID  = 36310119-4FB2-4BA3-959D-74C16B849F9E
+  PACKAGE_VERSION   = 1.0
+
+[Includes]
+  Include
diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
new file mode 100644
index 00..2cb63c1ca6
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -0,0 +1,16 @@
+## @file
+# Common libraries for Manageabilty Package
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  #
+  # This library provides the instrinsic functions generated by a given 
compiler.
+  #
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
new file mode 100644
index 00..46cc215a0f
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -0,0 +1,40 @@
+## @file
+# Manageabilty Package
+# This is the package provides edk2 drivers and libraries
+# those are related to the platform management.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  PLATFORM_NAME  = ManageabilityPkg
+  PLATFORM_GUID  = 7A98123A-B194-40B6-A863-A52192F6D65D
+  PLATFORM_VERSION   = 1.0
+  DSC_SPECIFICATION  = 0x0001001e
+  OUTPUT_DIRECTORY   = Build/ManageabilityPkg
+  SUPPORTED_ARCHITECTURES= IA32|X64|ARM|AARCH64|RISCV64
+  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
+  SKUID_IDENTIFIER   = DEFAULT
+
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[PcdsFeatureFlag]
+  #
+  # MinPlatform common include currently required PCD
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
+!include Include/Dsc/Manageability.dsc
+
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH v3 0/8] Introduce ManageabilityPkg

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

edk2 ManageabilityPkg is introduced to provide edk2 drivers
and libraries for industry platform management standards,
such as PLDM (Platform Level Data Model), MCTP (Management
Component Transfer Protocol),
IPMI (Intelligent Platform Management Interface) and others.
The framework of ManageabilityPkg is designed to flexibly
support the transport interfaces for above industry
standards, the transport interfaces such as KCS or I2C for
IPMI, PCI VDM (Vendor Defined Message),
I2C or KCS for MCTP, or the OEM proprietary transports.
Please check the Readme file for the design guidance:
https://github.com/changab/edk2-platforms/blob/Manageability_IPMI_upstream/Features/ManageabilityPkg/Readme.md

In V3: 1. Address reviewers commnets on V2.
   2. Revise IpmiPpi driver to not using global vriable.

In V2: Fix some issues on below files,
  1. Features/ManageabilityPkg/Library/Common/KcsCommon.c
  2. Features/ManageabilityPkg/Library/Dxe/ManageabilityTransportKcs.c
  3. 
Features/ManageabilityPkg/Universal/IpmiProtocol/Common/IpmiprotocolCommon.c

In V1, we had implemented,
- KCS manageability transport library
- Manageability library helper library
- IPMI PEI/DXE/SMM protocol implementations

Next upstream would be edk2 MCTP_PROTOCOL
implementation that also consumes the manageability
transport libraries.

Signed-off-by: Abner Chang 
Cc: Abdul Lateef Attar 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nickle Wang 

Abner Chang (8):
  ManageabilityPkg: Add Readme file
  ManageabilityPkg: Initial package
  ManageabilityPkg: Add NULL ManageabilityTransportLib
  ManageabilityPkg: Add ManageabilityTransportHelperLib
  ManageabilityPkg/ManageabilityTransportKcsLib
  ManageabilityPkg: Implement Ipmi Protocol/Ppi
  ManageabilityPkg: Add IpmiProtocol to Manageability Package
  edk2-platforms: Maintainers.txt

 .../ManageabilityPkg/ManageabilityPkg.dec |  48 ++
 .../Include/Dsc/Manageability.dsc |  25 +
 .../ManageabilityPkg/ManageabilityPkg.dsc |  45 ++
 .../BaseManageabilityTransportHelper.inf  |  41 +
 .../BaseManageabilityTransportNull.inf|  28 +
 .../Dxe/DxeManageabilityTransportKcs.inf  |  44 +
 .../IpmiProtocol/Dxe/IpmiProtocolDxe.inf  |  50 ++
 .../Universal/IpmiProtocol/Pei/IpmiPpiPei.inf |  53 ++
 .../IpmiProtocol/Smm/IpmiProtocolSmm.inf  |  52 ++
 .../Library/ManageabilityTransportHelperLib.h |  93 +++
 .../Library/ManageabilityTransportIpmiLib.h   |  24 +
 .../Library/ManageabilityTransportLib.h   | 336 
 .../Common/ManageabilityTransportKcs.h| 105 +++
 .../IpmiProtocol/Common/IpmiProtocolCommon.h  | 108 +++
 .../IpmiProtocol/Pei/IpmiPpiInternal.h|  25 +
 .../BaseManageabilityTransportHelper.c| 261 ++
 .../BaseManageabilityTransportNull.c  |  64 ++
 .../Common/KcsCommon.c| 502 
 .../Dxe/ManageabilityTransportKcs.c   | 389 +
 .../IpmiProtocol/Common/IpmiProtocolCommon.c  | 252 ++
 .../Universal/IpmiProtocol/Dxe/IpmiProtocol.c | 177 +
 .../Universal/IpmiProtocol/Pei/IpmiPpi.c  | 159 
 .../Universal/IpmiProtocol/Smm/IpmiProtocol.c | 147 
 Features/ManageabilityPkg/Readme.md   | 177 +
 .../Media/ManageabilityDriverStack.svg| 752 ++
 .../BaseManageabilityTransportHelper.uni  |  13 +
 .../BaseManageabilityTransportNull.uni|  13 +
 .../Dxe/ManageabilityTransportKcs.uni |  13 +
 Maintainers.txt   |  11 +-
 29 files changed, 4005 insertions(+), 2 deletions(-)
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dec
 create mode 100644 Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dsc
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Common/IpmiProtocolCommon.h
 create mode 100644 

[edk2-devel] [PATCH v3 1/1] ArmPkg/SmbiosMiscDxe: Adjust the priority of getting firmware version

2023-03-20 Thread Tinh Nguyen via groups.io
The BIOS Firmware Version in the SMBIOS Type 0 can be fetched from
the fixed PcdFirmwareVersionString or platform specific OemMiscLib.
In fact, the support from OemMiscLib comes into play when the firmware
version may be modified at boot time for extended information.
Therefore, the priority of getting the version from OemMiscLib should
be higher.

In case there is no modification in the OemMiscLib, we have to keep
HII string STR_MISC_BIOS_VERSION empty or 'Not Specified'
to indicate that the firmware version should be fetched from
the PcdFirmwareVersionString.

Signed-off-by: Tinh Nguyen 
Reviewed-by: Rebecca Cran 
---

Changes since v1:
  + Change GetBiosVersion () to SetBiosVersion () and move the selection logic
  fully into SetBiosVersion ().
Changes since v2:
  + Add Reviewed-by: Rebecca Cran  and remove @retval
  VOID

 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 57 

 1 file changed, 35 insertions(+), 22 deletions(-)

diff --git 
a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c 
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
index 66ead22a6e2c..876a74614285 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
+  Copyright (c) 2022 - 2023, Ampere Computing LLC. All rights reserved.
   Copyright (c) 2021, NUVIA Inc. All rights reserved.
   Copyright (c) 2009, Intel Corporation. All rights reserved.
   Copyright (c) 2015, Hisilicon Limited. All rights reserved.
@@ -124,22 +124,46 @@ GetBiosReleaseDate (
   return ReleaseDate;
 }
 
-/**
-  Fetches the firmware ('BIOS') version from the
-  FirmwareVersionInfo HOB.
+/**  Fetches the Firmware version string for SMBIOS type 0
+
+  This function get the Firmware version string from OemMiscLib first,
+  if it is invalid then PcdFirmwareVersionString is used as a fallback.
 
-  @return The version as a UTF-16 string
 **/
-CHAR16 *
-GetBiosVersion (
+VOID
+SetBiosVersion (
   VOID
   )
 {
-  CHAR16  *ReleaseString;
+  CHAR16 *DefaultVersionString;
+  CHAR16 *Version;
+  EFI_STRING_ID  TokenToUpdate;
 
-  ReleaseString = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString);
+  DefaultVersionString = HiiGetString (
+   mSmbiosMiscHiiHandle,
+   STRING_TOKEN (STR_MISC_BIOS_VERSION),
+   NULL
+   );
 
-  return ReleaseString;
+  OemUpdateSmbiosInfo (
+mSmbiosMiscHiiHandle,
+STRING_TOKEN (STR_MISC_BIOS_VERSION),
+BiosVersionType00
+);
+
+  Version = HiiGetString (
+  mSmbiosMiscHiiHandle,
+  STRING_TOKEN (STR_MISC_BIOS_VERSION),
+  NULL
+  );
+
+  if (((StrCmp (Version, DefaultVersionString) == 0) || (StrLen (Version) == 
0))) {
+Version = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString);
+if (StrLen (Version) > 0) {
+  TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
+  HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
+}
+  }
 }
 
 /**
@@ -187,18 +211,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
 HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL);
   }
 
-  Version = GetBiosVersion ();
-
-  if (StrLen (Version) > 0) {
-TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
-HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
-  } else {
-OemUpdateSmbiosInfo (
-  mSmbiosMiscHiiHandle,
-  STRING_TOKEN (STR_MISC_BIOS_VERSION),
-  BiosVersionType00
-  );
-  }
+  SetBiosVersion ();
 
   Char16String = GetBiosReleaseDate ();
   if (StrLen (Char16String) > 0) {
--
2.39.2


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101467): https://edk2.groups.io/g/devel/message/101467
Mute This Topic: https://groups.io/mt/97748102/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] SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2

2023-03-20 Thread Yao, Jiewen
Sounds good. Thanks.

Reviewed-by: Jiewen Yao 

> -Original Message-
> From: kra...@redhat.com 
> Sent: Monday, March 20, 2023 11:00 PM
> To: devel@edk2.groups.io; Yao, Jiewen 
> Cc: Pawel Polawski ; Wang, Jian J
> ; Oliver Steffen ; Xu, Min M
> ; Marvin Häuser ;
> jma...@redhat.com
> Subject: Re: [edk2-devel] [PATCH v2 1/1]
> SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2
> 
> On Mon, Mar 20, 2023 at 01:20:29PM +, Yao, Jiewen wrote:
> > Would you please share with us what test has been done for this patch?
> 
> Usual regression testing, including booting images with and without
> secure boot.  Additionally checked images with the wrong signature
> are rejected (try boot grub.efi directly instead of using the
> shim.efi -> grub.efi chain).
> 
> take care,
>   Gerd
> 
> >
> > Thank you
> > Yao, Jiewen
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of Gerd
> > > Hoffmann
> > > Sent: Monday, March 20, 2023 6:02 PM
> > > To: devel@edk2.groups.io
> > > Cc: Pawel Polawski ; Wang, Jian J
> > > ; Oliver Steffen ; Xu,
> Min M
> > > ; Marvin Häuser ; Yao,
> > > Jiewen ; jma...@redhat.com
> > > Subject: Re: [edk2-devel] [PATCH v2 1/1]
> > > SecurityPkg/DxeImageVerificationLib: Check result of
> GetEfiGlobalVariable2
> > >
> > > On Fri, Mar 03, 2023 at 11:35:53AM +0100, Gerd Hoffmann wrote:
> > > > Call gRT->GetVariable() directly to read the SecureBoot variable.  It is
> > > > one byte in size so we can easily place it on the stack instead of
> > > > having GetEfiGlobalVariable2() allocate it for us, which avoids a few
> > > > possible error cases.
> > > >
> > > > Skip secure boot checks if (and only if):
> > > >
> > > >  (a) the SecureBoot variable is not present (EFI_NOT_FOUND) according
> to
> > > >  the return value, or
> > > >  (b) the SecureBoot variable was read successfully and is set to
> > > >  SECURE_BOOT_MODE_DISABLE.
> > > >
> > > > Previously the code skipped the secure boot checks on *any*
> > > > gRT->GetVariable() error (GetEfiGlobalVariable2 sets the variable
> > > > value to NULL in that case) and also on memory allocation failures.
> > > >
> > > > Fixes: CVE-2019-14560
> > > > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=2167
> > > > Signed-off-by: Gerd Hoffmann 
> > >
> > > Ping.  Any comments on this patch?
> > >
> > > take care,
> > >   Gerd
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> > 
> >
> >
> 
> --



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




Re: [edk2-devel] [PATCH 4/5] MdeModulePkg: Consume new alignment-related macros

2023-03-20 Thread Wu, Hao A
Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu

> -Original Message-
> From: Gerd Hoffmann 
> Sent: Friday, March 3, 2023 2:51 PM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Gerd Hoffmann
> ; Wang, Jian J ; Yao, Jiewen
> ; Marvin Häuser ; James
> Bottomley ; Michael Roth ;
> Wu, Hao A ; Kinney, Michael D
> ; Oliver Steffen ; Xu, Min
> M ; Gao, Liming ; Ni, Ray
> ; Tom Lendacky ; Aktas,
> Erdem ; Liu, Zhiguang ;
> Pawel Polawski ; Justen, Jordan L
> ; Vitaly Cheptsov 
> Subject: [PATCH 4/5] MdeModulePkg: Consume new alignment-related macros
> 
> From: Marvin Häuser 
> 
> This patch substitutes the macros that were renamed in the first
> patch with the new, shared alignment macros.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Ray Ni 
> Cc: Vitaly Cheptsov 
> Signed-off-by: Marvin Häuser 
> ---
>  MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h|  3 +-
>  .../Ata/AtaAtapiPassThru/AtaAtapiPassThru.h   |  2 --
>  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h   |  1 -
>  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h  |  2 --
>  .../Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h |  2 --
>  .../Bus/Ufs/UfsPassThruDxe/UfsPassThru.h  |  2 --
>  MdeModulePkg/Universal/EbcDxe/EbcExecute.h|  3 +-
>  MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c   |  2 +-
>  .../Bus/Ata/AhciPei/AhciPeiPassThru.c |  6 ++--
>  .../Ata/AtaAtapiPassThru/AtaAtapiPassThru.c   | 12 +++
>  .../Bus/Ata/AtaBusDxe/AtaPassThruExecute.c|  2 +-
>  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c  |  4 +--
>  .../Bus/Ufs/UfsPassThruDxe/UfsPassThru.c  |  6 ++--
>  MdeModulePkg/Universal/EbcDxe/EbcExecute.c| 36 +--
>  14 files changed, 36 insertions(+), 47 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h
> b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h
> index 71d34c962ad1..e2e4ba43e7c4 100644
> --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h
> +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h
> @@ -146,8 +146,7 @@ typedef union {
>  #define AHCI_PORT_SERR  0x0030
>  #define AHCI_PORT_CI0x0038
> 
> -#define ADDRESS_IS_ALIGNED_(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> -#define TIMER_PERIOD_SECONDS(Seconds)MultU64x32((UINT64)(Seconds),
> 1000)
> +#define TIMER_PERIOD_SECONDS(Seconds)  MultU64x32((UINT64)(Seconds),
> 1000)
> 
>  #pragma pack(1)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h
> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h
> index 7937886614e1..016fc6890ae9 100644
> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h
> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h
> @@ -148,8 +148,6 @@ struct _ATA_NONBLOCK_TASK {
>  #define ATA_ATAPI_TIMEOUT   EFI_TIMER_PERIOD_SECONDS(3)
>  #define ATA_SPINUP_TIMEOUT  EFI_TIMER_PERIOD_SECONDS(10)
> 
> -#define ADDRESS_IS_ALIGNED_(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> -
>  #define ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
>CR (a, \
>ATA_ATAPI_PASS_THRU_INSTANCE, \
> diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> index 47346e911d47..6bc345f7e777 100644
> --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> @@ -76,7 +76,6 @@
>  #define ATA_TASK_SIGNATURE  SIGNATURE_32 ('A', 'T', 'S', 'K')
>  #define ATA_DEVICE_SIGNATURESIGNATURE_32 ('A', 'B', 'I', 'D')
>  #define ATA_SUB_TASK_SIGNATURE  SIGNATURE_32 ('A', 'S', 'T', 'S')
> -#define ADDRESS_IS_ALIGNED_(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> 
>  //
>  // ATA bus data structure for ATA controller
> diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> index ed384ad52182..5a25b55c4952 100644
> --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> @@ -38,8 +38,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #define IS_DEVICE_FIXED(a)  (a)->FixedDevice ? 1 : 0
> 
> -#define ADDRESS_IS_ALIGNED_(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> -
>  #define UFS_WLUN_RPMB  0xC4
> 
>  typedef struct {
> diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h
> b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h
> index 1adb382aa8c3..ed4776f548e0 100644
> --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h
> +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h
> @@ -133,8 +133,6 @@ typedef struct _UFS_PEIM_HC_PRIVATE_DATA {
> 
>  #define ROUNDUP8(x)  (((x) % 8 == 0) ? (x) : ((x) / 8 + 1) * 8)
> 
> -#define ADDRESS_IS_ALIGNED_(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> -
>  #define GET_UFS_PEIM_HC_PRIVATE_DATA_FROM_THIS(a) CR (a,
> UFS_PEIM_HC_PRIVATE_DATA, BlkIoPpi, UFS_PEIM_HC_SIG)
>  #define GET_UFS_PEIM_HC_PRIVATE_DATA_FROM_THIS2(a)CR (a,
> UFS_PEIM_HC_PRIVATE_DATA, BlkIo2Ppi, UFS_PEIM_HC_SIG)
>  #define GET_UFS_PEIM_HC_PRIVATE_DATA_FROM_THIS_NOTIFY(a)  CR (a,
> UFS_PEIM_HC_PRIVATE_DATA, EndOfPeiNotifyList, UFS_PEIM_HC_SIG)
> 

Re: [edk2-devel] [edk2-platforms][PATCH V2 6/8] ManageabilityPkg: Implement Ipmi Protocol/Ppi

2023-03-20 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Nickle, see my feedbacks below,

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, March 20, 2023 9:40 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Liming Gao ; Isaac Oram
> ; Nate DeSimone
> ; Attar, AbdulLateef (Abdul Lateef)
> ; Igor Kulchytskyy 
> Subject: RE: [edk2-platforms][PATCH V2 6/8] ManageabilityPkg: Implement
> Ipmi Protocol/Ppi
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Please find my comment inline below.
> 
> Regards,
> Nickle
> 
> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Wednesday, March 8, 2023 10:17 PM
> To: devel@edk2.groups.io
> Cc: Liming Gao ; Isaac Oram
> ; Nate DeSimone
> ; Abdul Lateef Attar
> ; Nickle Wang ; Igor Kulchytskyy
> 
> Subject: [edk2-platforms][PATCH V2 6/8] ManageabilityPkg: Implement Ipmi
> Protocol/Ppi
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Add Ipmi Protocol/Ppi/SMM implementations.
> The underlying implementation of transport interface depends on the
> binded ManageabilityTransportLib.
> 
> Signed-off-by: Abner Chang 
> Cc: Liming Gao 
> Cc: Isaac Oram 
> Cc: Nate DeSimone 
> Cc: Abdul Lateef Attar 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../IpmiProtocol/Dxe/IpmiProtocolDxe.inf  |  50 
>  .../Universal/IpmiProtocol/Pei/IpmiPpiPei.inf |  51 
>  .../IpmiProtocol/Smm/IpmiProtocolSmm.inf  |  52 
>  .../IpmiProtocol/Common/IpmiProtocolCommon.h  | 108
>   .../IpmiProtocol/Common/IpmiProtocolCommon.c  | 247
> ++  .../Universal/IpmiProtocol/Dxe/IpmiProtocol.c | 177
> +
>  .../Universal/IpmiProtocol/Pei/IpmiPpi.c  | 151 +++
>  .../Universal/IpmiProtocol/Smm/IpmiProtocol.c | 147 +++
>  8 files changed, 983 insertions(+)
>  create mode 100644
> Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.in
> f
>  create mode 100644
> Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
>  create mode 100644
> Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm
> .inf
>  create mode 100644
> Features/ManageabilityPkg/Universal/IpmiProtocol/Common/IpmiProtocolC
> ommon.h
>  create mode 100644
> Features/ManageabilityPkg/Universal/IpmiProtocol/Common/IpmiProtocolC
> ommon.c
>  create mode 100644
> Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocol.c
>  create mode 100644
> Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpi.c
>  create mode 100644
> Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.c
> 
> diff --git
> a/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.
> inf
> b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe
> .inf
> new file mode 100644
> index 00..ff5ec56c73
> --- /dev/null
> +++
> b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolD
> +++ xe.inf
> @@ -0,0 +1,50 @@
> +## @file
> +# IPMI Protocol DXE Driver.
> +#
> +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> +reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent ##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001d
> +  BASE_NAME  = IpmiDxe
> +  FILE_GUID  = BC41B0C2-9D8A-42B5-A28F-02CE0D4A6C28
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= DxeIpmiEntry
> +  UNLOAD_IMAGE   = IpmiUnloadImage
> +
> +#
> +#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
> +#
> +
> +[Sources]
> +  IpmiProtocol.c
> +  ../Common/IpmiProtocolCommon.c
> +  ../Common/IpmiProtocolCommon.h
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  ManageabilityPkg/ManageabilityPkg.dec
> +
> +[LibraryClasses]
> +  BaseMemoryLib
> +  DebugLib
> +  ManageabilityTransportHelperLib
> +  ManageabilityTransportLib
> +  UefiDriverEntryPoint
> +  UefiBootServicesTableLib
> +
> +[Protocols]
> +  gIpmiProtocolGuid   # PROTOCOL ALWAYS_PRODUCED
> +
> +[Guids]
> +  gManageabilityProtocolIpmiGuid
> +  gManageabilityTransportKcsGuid
> +
> +[FixedPcd]
> +  gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress
> +
> +[Depex]
> +  TRUE
> diff --git
> a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
> b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
> new file mode 100644
> index 00..058bfb63cb
> --- /dev/null
> +++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.in
> +++ f
> @@ -0,0 +1,51 @@
> +## @file
> +# IPMI Protocol PEI Driver.
> +#
> +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> +reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent ##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001d
> +  BASE_NAME  = IpmiPei
> +  FILE_GUID  = 

Re: [edk2-devel] [PATCH 1/5] MdeModulePkg: Rename IS_ALIGNED macros to avoid name collisions

2023-03-20 Thread Wu, Hao A
Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu

> -Original Message-
> From: Gerd Hoffmann 
> Sent: Friday, March 3, 2023 2:51 PM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Gerd Hoffmann
> ; Wang, Jian J ; Yao, Jiewen
> ; Marvin Häuser ; James
> Bottomley ; Michael Roth ;
> Wu, Hao A ; Kinney, Michael D
> ; Oliver Steffen ; Xu, Min
> M ; Gao, Liming ; Ni, Ray
> ; Tom Lendacky ; Aktas,
> Erdem ; Liu, Zhiguang ;
> Pawel Polawski ; Justen, Jordan L
> 
> Subject: [PATCH 1/5] MdeModulePkg: Rename IS_ALIGNED macros to avoid
> name collisions
> 
> From: Marvin Häuser 
> 
> This patch is a preparation for the patches that follow. The
> subsequent patches will introduce and integrate new alignment-related
> macros, which collide with existing definitions in MdeModulePkg.
> Temporarily rename them to avoid build failure, till they can be
> substituted with the new, shared definitions.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Ray Ni 
> Signed-off-by: Marvin Häuser 
> ---
>  MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h|  4 +--
>  .../Ata/AtaAtapiPassThru/AtaAtapiPassThru.h   |  2 +-
>  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h   |  2 +-
>  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h  |  2 +-
>  .../Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h |  2 +-
>  .../Bus/Ufs/UfsPassThruDxe/UfsPassThru.h  |  2 +-
>  MdeModulePkg/Universal/EbcDxe/EbcExecute.h|  4 +--
>  MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c   |  2 +-
>  .../Bus/Ata/AhciPei/AhciPeiPassThru.c |  6 ++--
>  .../Ata/AtaAtapiPassThru/AtaAtapiPassThru.c   | 12 +++
>  .../Bus/Ata/AtaBusDxe/AtaPassThruExecute.c|  2 +-
>  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c  |  4 +--
>  .../Bus/Ufs/UfsPassThruDxe/UfsPassThru.c  |  6 ++--
>  MdeModulePkg/Universal/EbcDxe/EbcExecute.c| 36 +--
>  14 files changed, 43 insertions(+), 43 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h
> b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h
> index 4aed1cb7ad8a..71d34c962ad1 100644
> --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h
> +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.h
> @@ -146,8 +146,8 @@ typedef union {
>  #define AHCI_PORT_SERR  0x0030
>  #define AHCI_PORT_CI0x0038
> 
> -#define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
> -#define TIMER_PERIOD_SECONDS(Seconds)  MultU64x32((UINT64)(Seconds),
> 1000)
> +#define ADDRESS_IS_ALIGNED_(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> +#define TIMER_PERIOD_SECONDS(Seconds)MultU64x32((UINT64)(Seconds),
> 1000)
> 
>  #pragma pack(1)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h
> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h
> index 62ba6d6680dd..7937886614e1 100644
> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h
> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h
> @@ -148,7 +148,7 @@ struct _ATA_NONBLOCK_TASK {
>  #define ATA_ATAPI_TIMEOUT   EFI_TIMER_PERIOD_SECONDS(3)
>  #define ATA_SPINUP_TIMEOUT  EFI_TIMER_PERIOD_SECONDS(10)
> 
> -#define IS_ALIGNED(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> +#define ADDRESS_IS_ALIGNED_(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> 
>  #define ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
>CR (a, \
> diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> index 4428c484fd6c..47346e911d47 100644
> --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.h
> @@ -76,7 +76,7 @@
>  #define ATA_TASK_SIGNATURE  SIGNATURE_32 ('A', 'T', 'S', 'K')
>  #define ATA_DEVICE_SIGNATURESIGNATURE_32 ('A', 'B', 'I', 'D')
>  #define ATA_SUB_TASK_SIGNATURE  SIGNATURE_32 ('A', 'S', 'T', 'S')
> -#define IS_ALIGNED(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> +#define ADDRESS_IS_ALIGNED_(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> 
>  //
>  // ATA bus data structure for ATA controller
> diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> index 5b4047e1dbdd..ed384ad52182 100644
> --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
> @@ -38,7 +38,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #define IS_DEVICE_FIXED(a)  (a)->FixedDevice ? 1 : 0
> 
> -#define IS_ALIGNED(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> +#define ADDRESS_IS_ALIGNED_(addr, size)  (((UINTN) (addr) & (size - 1)) == 0)
> 
>  #define UFS_WLUN_RPMB  0xC4
> 
> diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h
> b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h
> index a0b615b7eab3..1adb382aa8c3 100644
> --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h
> +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsBlockIoPei.h
> @@ -133,7 +133,7 @@ typedef struct _UFS_PEIM_HC_PRIVATE_DATA {
> 
>  #define ROUNDUP8(x)  (((x) % 8 == 0) ? (x) : ((x) / 8 + 1) * 8)
> 
> -#define IS_ALIGNED(addr, size)  (((UINTN) (addr) & 

Re: [edk2-devel] [edk2-platforms][PATCH V2 5/8] ManageabilityPkg/ManageabilityTransportKcsLib

2023-03-20 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Nickle,
Thanks for catching those issue. I am fixing it now.

There is few feedbacks below,

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, March 20, 2023 9:32 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Liming Gao ; Isaac Oram
> ; Nate DeSimone
> ; Attar, AbdulLateef (Abdul Lateef)
> ; Igor Kulchytskyy 
> Subject: RE: [edk2-platforms][PATCH V2 5/8]
> ManageabilityPkg/ManageabilityTransportKcsLib
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Please see my comments inline below.
> 
> Regards,
> Nickle
> 
> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Wednesday, March 8, 2023 10:17 PM
> To: devel@edk2.groups.io
> Cc: Liming Gao ; Isaac Oram
> ; Nate DeSimone
> ; Abdul Lateef Attar
> ; Nickle Wang ; Igor Kulchytskyy
> 
> Subject: [edk2-platforms][PATCH V2 5/8]
> ManageabilityPkg/ManageabilityTransportKcsLib
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> This is the KCS manageability transport library instance follows the design
> guidance described in Readme file under ManageabilityPkg.
> 
> Signed-off-by: Abner Chang 
> Cc: Liming Gao 
> Cc: Isaac Oram 
> Cc: Nate DeSimone 
> Cc: Abdul Lateef Attar 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../ManageabilityPkg/ManageabilityPkg.dsc |   3 +
>  .../Dxe/DxeManageabilityTransportKcs.inf  |  44 ++
>  .../Common/ManageabilityTransportKcs.h| 106 
>  .../Common/KcsCommon.c| 480 ++
>  .../Dxe/ManageabilityTransportKcs.c   | 384 ++
>  .../Dxe/ManageabilityTransportKcs.uni |  13 +
>  6 files changed, 1030 insertions(+)
>  create mode 100644
> Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/Dxe
> ManageabilityTransportKcs.inf
>  create mode 100644
> Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common
> /ManageabilityTransportKcs.h
>  create mode 100644
> Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common
> /KcsCommon.c
>  create mode 100644
> Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/Man
> ageabilityTransportKcs.c
>  create mode 100644
> Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/Man
> ageabilityTransportKcs.uni
> 
> diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc
> b/Features/ManageabilityPkg/ManageabilityPkg.dsc
> index 0dd0ab41fc..45e07ac34f 100644
> --- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
> +++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
> @@ -36,6 +36,9 @@
>  !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
>  !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
> 
> +[Components]
> +
> +ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManagea
> bil
> +ityTransportKcs.inf
> +
>  [LibraryClasses]
> 
> ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTra
> nsportNullLib/BaseManageabilityTransportNull.inf
> 
> diff --git
> a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/Dx
> eManageabilityTransportKcs.inf
> b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/Dx
> eManageabilityTransportKcs.inf
> new file mode 100644
> index 00..f0a6afa074
> --- /dev/null
> +++
> b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe
> +++ /DxeManageabilityTransportKcs.inf
> @@ -0,0 +1,44 @@
> +## @file
> +# KCS instance of Manageability Transport Library # # Copyright (C)
> +2023 Advanced Micro Devices, Inc. All rights reserved. #
> +SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001B
> +  BASE_NAME  = DxeManageabilityTransportKcs
> +  MODULE_UNI_FILE= ManageabilityTransportKcs.uni
> +  FILE_GUID  = FCCC8B34-145A-4927-9F08-553ADC579AF7
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = ManageabilityTransportLib
> +
> +#
> +#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
> +#
> +
> +[Sources]
> +  ManageabilityTransportKcs.c
> +  ../Common/KcsCommon.c
> +  ../Common/ManageabilityTransportKcs.h
> +
> +[Packages]
> +  ManageabilityPkg/ManageabilityPkg.dec
> +  MdePkg/MdePkg.dec
> +
> +[LibraryClasses]
> +  DebugLib
> +  IoLib
> +  TimerLib
> +  MemoryAllocationLib
> +
> +[Guids]
> +  gManageabilityTransportKcsGuid
> +  gManageabilityProtocolMctpGuid
> +  gManageabilityProtocolIpmiGuid
> +
> +[FixedPcd]
> +  gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress   # Used as default
> KCS I/O base adddress
> +
> diff --git
> a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Commo
> n/ManageabilityTransportKcs.h
> b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Comm
> on/ManageabilityTransportKcs.h
> new file mode 

[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, March 21, 2023 #cal-reminder

2023-03-20 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO*

*When:*
Tuesday, March 21, 2023
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d

*Organizer:* Liming Gao gaolim...@byosoft.com.cn ( 
gaolim...@byosoft.com.cn?subject=Re:%20Event:%20TianoCore%20Bug%20Triage%20-%20APAC%20%2F%20NAMO
 )

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1753765 )

*Description:*

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao



Microsoft Teams meeting

*Join on your computer or mobile app*

Click here to join the meeting ( 
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d
 )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions ( 
https://conf.intel.com/teams/?conf=1160620940=teams=conf.intel.com=test_call
 )

*Or call in (audio only)*

+1 916-245-6934,,77463821# ( tel:+19162456934,,77463821# ) United States, 
Sacramento

Phone Conference ID: 774 638 21#

Find a local number ( 
https://dialin.teams.microsoft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=77463821
 ) | Reset PIN ( https://mysettings.lync.com/pstnconferencing )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2=0=en-US
 )


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




[edk2-devel] Now: Tools, CI, Code base construction meeting series - Monday, March 20, 2023 #cal-notice

2023-03-20 Thread Group Notification
*Tools, CI, Code base construction meeting series*

*When:*
Monday, March 20, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://github.com/tianocore/edk2/discussions/2614

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1753770 )

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


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




[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, March 20, 2023 #cal-reminder

2023-03-20 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, March 20, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://github.com/tianocore/edk2/discussions/2614

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1753770 )

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


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




Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

2023-03-20 Thread Leif Lindholm
Hi Abdul,

On Mon, Mar 20, 2023 at 14:09:11 +, Attar, AbdulLateef (Abdul Lateef) wrote:
> AMD/BoardPkg will contains the modules/drivers to support MinPlatformPkg 
> framework.
>BoardPkg will be generic across all AMD boards which are based on 
> MinPlatformPkg framework.
>It's like "edk2-platforms/Platform/Qemu/QemuOpenBoardPkg".
>We will gradually add modules and libraries to it.

So, if the purpose is exclusively to support MinPlatformPkg platforms,
I think that should be part of the name.
Like Platform/AMD/AmdMinPlatformPkg (for example).

> AMD/PlatformPkg will contain the modules/drivers which are generic to future 
> AMD platform.
>Currently we don't have complete platform, we can drop
>PlatformPkg for now till we have complete(reasonable modules)
>solution.

It will certainly be easier to reason about what the preferred
naming/layout should be once there is code to look at for examples.
It may be that parts of it would live more naturally under
Silicon/AMD, for example.

> It's better to not touch existing AMD/OverdriveBoard, restructuring
> requires changes to .dsc and .fdf files, might break backward
> compatibility.

No problem. Config files occasionally need to be revamped, but that's
simply a mechanical exercise.

> How about having just BoardPkg like below?

That, too, is a completely generic name that conveys no information
about *what* boards one can expect to find in there.

Regards,

Leif

> AMD board package
> F: Platform/AMD/BoardPkg
> M: Maintainer1
> M: Maintainer2
> 
> Please let me know your thoughts.
> 
> Thanks
> AbduL
> 
> 
> 
> 
> -Original Message-
> From: Leif Lindholm 
> Sent: 20 March 2023 18:35
> To: devel@edk2.groups.io; Chang, Abner 
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Ard 
> Biesheuvel ; Michael D Kinney 
> 
> Subject: Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds 
> AMD/BoardPkg and AMD/PlatformPkg maintainers
> 
> Caution: This message originated from an External Source. Use proper caution 
> when opening attachments, clicking links, or responding.
> 
> 
> Hi Abner,
> 
> On Sat, Mar 18, 2023 at 09:16:17 +, Chang, Abner via groups.io wrote:
> > I don't see any modules under OverdriveBoard, is this package still
> 
> The code is split between Platform/AMD and Silicon/AMD/Styx, the latter also 
> being used by SoftIron/Overdrive1000 and LeMaker Cello (although that one is 
> pretty much defunct and should probably be dropped).
> 
> > in use? Do you still remember where is FDF and DSC come from (as there
> > is AMD copyright 2014-2016) back to the moment when you was introduced
> > this package?
> 
> As the git history tells you:
> ---
> commit f4d38e50c0f24eb78eb003a94f583025621c63db
> Author: Leif Lindholm 
> Date:   Thu Aug 3 12:24:22 2017 +0100
> 
> Platform,Silicon: import AMD Styx SoC support and platforms
> 
> Common files for AMD Overdrive, SoftIron Overdrive 1000
> and LeMaker Cello, as well as actual platform support.
> Imported from commit efd798c1eb of
> https://git.linaro.org/uefi/OpenPlatformPkg.git
> ---
> 
> and the initial commit of the platform in that repository is:
> ---
> From: Leo Duran 
> Date: Thu, 20 Aug 2015 13:30:24 -0500
> 
> Subject: Platforms/AMD: add support for AMD Overdrive and Lemaker Cello
> 
> This adds support for the AMD Seattle based Overdrive and Husky
> platforms,
> and the Lemaker Cello which is derived from it.
> 
> This code was tested with upstream EDK2 commit 758ea94651.
> 
> The binaries in this branch are based on SeattleFDK 1.0.0.2
> (Linaro SeattleFDK commit 4b419f2ef2)
> ---
> 
> Regards,
> 
> Leif
> 
> >
> > Thanks
> > Abner
> >
> > > -Original Message-
> > > From: Leif Lindholm 
> > > Sent: Saturday, March 18, 2023 12:09 AM
> > > To: Attar, AbdulLateef (Abdul Lateef) 
> > > Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef)
> > > ; Ard Biesheuvel
> > > ; Chang, Abner ;
> > > Michael D Kinney 
> > > Subject: Re: [PATCH v2 RESEND 4/4] Maintainers.txt: Adds
> > > AMD/BoardPkg and AMD/PlatformPkg maintainers
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > On Fri, Mar 17, 2023 at 12:20:07 +0530, Abdul Lateef Attar wrote:
> > > > From: Abdul Lateef Attar 
> > > >
> > > > Adds maintainers for AMD/BoardPkg and AMD/PlatformPkg.
> > > >
> > > > Signed-off-by: Abdul Lateef Attar 
> > > > Cc: Ard Biesheuvel 
> > > > Cc: Leif Lindholm 
> > > > Cc: Abner Chang 
> > > > Cc: Michael D Kinney 
> > > > ---
> > > >  Maintainers.txt | 6 ++
> > > >  1 file changed, 6 insertions(+)
> > > >
> > > > diff --git a/Maintainers.txt b/Maintainers.txt index
> > > > 747191366070..bb8ab643e090 100644
> > > > --- a/Maintainers.txt
> > > > +++ b/Maintainers.txt
> > > > @@ -91,6 +91,12 @@ F: Silicon/AMD/Styx/
> > > >  M: Ard Biesheuvel 
> > > >  M: Leif Lindholm 
> > > >
> > > > +AMD Platform
> > >
> > > 

Re: [edk2-devel] [PATCH v2 2/4] OvmfPkg/PlatformInitLib: detect physical address space

2023-03-20 Thread Gerd Hoffmann
  Hi,

> It seems that Page1GSupport is already TRUE in my case, so
> unfortunately, the suggested changes don't help.
> 
> Before commit bbda386d25, PhysMemAddressWidth is 36, after the commit,
> it's 47. I tried with hardcoding different values:
> 45 - My VM boots fine.
> 46 - I run into a "KVM internal error. Suberror: 1" during Linux boot
> (that's also what happens with 47 and 750 MiB of memory).
> 47 - Hangs right away and display is never initialized.

Hmm.  "KVM internal error" sound like this could be a linux kernel bug.

I can't reproduce this, although I'm not testing with kvm but with tcg
because I don't have a machine with 48 phys-bits at hand.

RedHat QE didn't ran into any problems either, although it certainly
could be they didn't test guests with only 512 MB.

> Is there any interest to use a smaller limit than 47 from upstream's
> perspective? Admittedly, it is a rather niche case to use OVMF with so
> little memory.

Well, the problem OVMF has (compared to physical platforms) is that it
needs to scale from tiny (512 MB) to huge (multi-TB).  There are some
heuristics in place to deal with that like the one limiting the address
space used in case there is no support for gigabyte pages.

So, just lowering the limit doesn't look like a good plan.  We can try
tweak the heuristics so OVMF picks better defaults for both huge and
tiny guests.  For that it would be good to figure what the actual root
cause is.  Is it really memory pressure?  With gigabyte pages available
it should not need that much memory for page tables ...

In any case you can run qemu with "-cpu $name,phys-bits=" to make
the guest address space smaller.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101457): https://edk2.groups.io/g/devel/message/101457
Mute This Topic: https://groups.io/mt/94113631/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 RESEND 3/4] Platform/AMD/BoarkPkg: Adds SetCacheMtrrLib library

2023-03-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Thanks for reviewing, will submit V3 patch.

-Original Message-
From: Leif Lindholm 
Sent: 17 March 2023 21:30
To: Attar, AbdulLateef (Abdul Lateef) 
Cc: devel@edk2.groups.io; Ard Biesheuvel ; Chang, 
Abner ; Michael D Kinney 
Subject: Re: [PATCH v2 RESEND 3/4] Platform/AMD/BoarkPkg: Adds SetCacheMtrrLib 
library

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


Typo in subject: BoarkPkg

On Fri, Mar 17, 2023 at 12:20:06 +0530, Abdul Lateef Attar wrote:
> Adds SetCacheMtrrLib library for AMD processor based boards.
> This library sets MTRR value or various memory ranges.
>
> Signed-off-by: Abdul Lateef Attar 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> ---
>  Platform/AMD/BoardPkg/BoardPkg.dsc|  10 ++
>  .../SetCacheMtrrLib/SetCacheMtrrLib.inf   |  37 +
>  .../Library/SetCacheMtrrLib/SetCacheMtrrLib.c | 132
> ++
>  3 files changed, 179 insertions(+)
>  create mode 100644
> Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
>  create mode 100644
> Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
>
> diff --git a/Platform/AMD/BoardPkg/BoardPkg.dsc
> b/Platform/AMD/BoardPkg/BoardPkg.dsc
> index cb4065b86c60..aa0ee8287cd8 100644
> --- a/Platform/AMD/BoardPkg/BoardPkg.dsc
> +++ b/Platform/AMD/BoardPkg/BoardPkg.dsc
> @@ -18,3 +18,13 @@ [Defines]
>
>  [Packages]
>BoardPkg/BoardPkg.dec
> +  MinPlatformPkg/MinPlatformPkg.dec
> +  MdePkg/MdePkg.dec

Sort?

> +  UefiCpuPkg/UefiCpuPkg.dec
> +
> +[LibraryClasses.common.PEIM]
> +
> +SetCacheMtrrLib|BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
> +
> +[Components.IA32]
> +  BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
> +

Please drop blank line at end of file.

> diff --git
> a/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
> b/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
> new file mode 100644
> index ..c1d3f8dc
> --- /dev/null
> +++ b/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.in
> +++ f
> @@ -0,0 +1,37 @@
> +## @file
> +# Component information file for Platform SetCacheMtrr Library.
> +# This library implementation is for AMD processor based platforms.
> +#
> +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> +reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> +
> +[Defines]
> +  INF_VERSION= 1.29
> +  BASE_NAME  = PeiSetCacheMtrrLib
> +  FILE_GUID  = 1E8468E0-5EB4-4088-9B52-BFDC6E4DAE87
> +  MODULE_TYPE= PEIM
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = SetCacheMtrrLib
> +
> +[LibraryClasses]
> +  BaseLib
> +  DebugLib
> +  MtrrLib
> +
> +[Packages]
> +  MinPlatformPkg/MinPlatformPkg.dec
> +  MdePkg/MdePkg.dec

Sort?

> +  UefiCpuPkg/UefiCpuPkg.dec
> +
> +[Sources]
> +  SetCacheMtrrLib.c
> +
> +[Guids]
> +
> +[Pcd]
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize
> +

Please drop blank line at end of file.

/
Leif

> diff --git
> a/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
> b/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
> new file mode 100644
> index ..18404405d9fa
> --- /dev/null
> +++ b/Platform/AMD/BoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
> @@ -0,0 +1,132 @@
> +/** @file
> +
> +SetCacheMtrr library functions.
> +This library implementation is for AMD processor based platforms.
> +
> +Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> +reserved.
> +
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/**
> +  This function sets the cache MTRR values for PEI phase.
> +**/
> +VOID
> +EFIAPI
> +SetCacheMtrr (
> +  VOID
> +  )
> +{
> +  EFI_STATUS  Status;
> +
> +  Status = MtrrSetMemoryAttribute (
> + 0,
> + 0xA,
> + CacheWriteBack
> + );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "Error(%r) in setting CacheWriteBack for 0-0x9\n",
> +  Status
> +  ));
> +  }
> +
> +  Status = MtrrSetMemoryAttribute (
> + 0xA,
> + 0x2,
> + CacheUncacheable
> + );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "Error(%r) in setting CacheUncacheable for 0xA-0xB\n",
> +  Status
> +  ));
> +  }
> +
> +  Status = MtrrSetMemoryAttribute (
> + 0xC,
> + 0x4,
> + CacheWriteProtected
> + );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "Error(%r) in setting CacheWriteProtected for 0xC-0xF\n",
> +  Status
> +  ));
> +  

Re: [edk2-devel] [PATCH v2 RESEND 2/4] Platform/AMD/PlatformPkg: Adds PciHotPlug init protocol implementation

2023-03-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Leif,
Please see inline my reply [Abdul]
I'll address the remaining review comments and submit V3 version.
Thanks
AbduL
-Original Message-
From: Leif Lindholm 
Sent: 17 March 2023 21:25
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 

Cc: Ard Biesheuvel ; Chang, Abner 
; Michael D Kinney 
Subject: Re: [edk2-devel] [PATCH v2 RESEND 2/4] Platform/AMD/PlatformPkg: Adds 
PciHotPlug init protocol implementation

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


On Fri, Mar 17, 2023 at 12:20:05 +0530, Abdul Lateef Attar via groups.io wrote:
> Adds PCI hotplug init protocol implementation.

What are some notable aspects of this initial implementation?
[Abdul] AMD/BoardPkg and AMD/PlatformPkg will contains module/drivers 
to support MinPlatformPkg framework.
In initial implementation we will be adding modules which need different 
implementation from Intel based platforms
to adapt MinPlatformPkg, e.g. SetCacheMtrrLib library etc., as we progress more 
we will add more modules.

What groups of platforms is it intended to cover?
[Abdul] Its generic for all AMD processor based platforms based on latest(as of 
2023) MinPlatformPkg framework.

> Signed-off-by: Abdul Lateef Attar 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> ---
>  Platform/AMD/PlatformPkg/PlatformPkg.dec  |  16 +
>  Platform/AMD/PlatformPkg/PlatformPkg.dsc  |  23 ++
>  .../PlatformPkg/PciHotPlug/PciHotPlugInit.inf |  41 +++
>  .../PlatformPkg/PciHotPlug/PciHotPlugInit.c   | 340 ++
>  4 files changed, 420 insertions(+)
>  create mode 100644
> Platform/AMD/PlatformPkg/PciHotPlug/PciHotPlugInit.inf
>  create mode 100644
> Platform/AMD/PlatformPkg/PciHotPlug/PciHotPlugInit.c
>
> diff --git a/Platform/AMD/PlatformPkg/PlatformPkg.dec
> b/Platform/AMD/PlatformPkg/PlatformPkg.dec
> index 6155860979cb..1bc38d6025c3 100644
> --- a/Platform/AMD/PlatformPkg/PlatformPkg.dec
> +++ b/Platform/AMD/PlatformPkg/PlatformPkg.dec
> @@ -13,3 +13,19 @@ [Defines]
>PACKAGE_NAME   = PlatformPkg
>PACKAGE_GUID   = 38FBA311-E2AA-4620-9A90-9A23753D1878
>PACKAGE_VERSION= 0.1
> +
> +[Guids]
> +  gPlatformPkgTokenSpaceGuid = { 0x95ECA58D, 0x09B6, 0x4420, { 0xB4, 
> 0xE7, 0x01, 0x7F, 0x6A, 0x5B, 0x26, 0x0F }}
> +
> +[PcdsDynamic, PcdsDynamicEx]
> +  #
> +  # PCI HotPlug Resource Padding
> +  #
> +  # IO Resource padding in bytes, default 4KB
> +
> +gPlatformPkgTokenSpaceGuid.PcdPciHotPlugResourcePadIO|0x1000|UINT
> +64|0x1000
> +  # PreFetch Memory padding in bytes, default 2MB
> +
> +gPlatformPkgTokenSpaceGuid.PcdPciHotPlugResourcePadPMem|0x0020|UI
> +NT64|0x1001
> +  # Non-PreFetch Memory padding in bytes, default 1MB
> +
> +gPlatformPkgTokenSpaceGuid.PcdPciHotPlugResourcePadMem|0x0010|UIN
> +T64|0x1002
> +  # PCI bus padding, number of bus to reserve, default 2 bus
> +
> +gPlatformPkgTokenSpaceGuid.PcdPciHotPlugResourcePadBus|2|UINT8|0x1000
> +0003
> diff --git a/Platform/AMD/PlatformPkg/PlatformPkg.dsc
> b/Platform/AMD/PlatformPkg/PlatformPkg.dsc
> index 704566b9ea73..9a693070ab3f 100644
> --- a/Platform/AMD/PlatformPkg/PlatformPkg.dsc
> +++ b/Platform/AMD/PlatformPkg/PlatformPkg.dsc
> @@ -16,5 +16,28 @@ [Defines]
>BUILD_TARGETS   = DEBUG | RELEASE | NOOPT
>SUPPORTED_ARCHITECTURES = IA32 | X64
>
> +

Please don't add spurious whitespaces.

>  [Packages]
>PlatformPkg/PlatformPkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec

I won't be maintaining this code, but I generally advocate sorting these types 
of enumerations alphabetically in order to speed up reading.

(That's not really possible for the block below.)

> +
> +[LibraryClasses.Common]
> +
> +UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEn
> +tryPoint.inf
> +
> +UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/Uefi
> +BootServicesTableLib.inf
> +
> +DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort
> +.inf
> +
> +MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> +AllocationLib.inf
> +  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> +  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
> +  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> +
> +RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilter
> +LibNull.inf
> +
> +SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialP
> +ortLib16550.inf
> +  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> +
> +DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/Ba
> +seDebugPrintErrorLevelLib.inf
> +  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
> +
> +PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlat
> +formHookLibNull.inf
> +  

Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

2023-03-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Hi Leif,

AMD/BoardPkg will contains the modules/drivers to support MinPlatformPkg 
framework.
   BoardPkg will be generic across all AMD boards which are based on 
MinPlatformPkg framework.
   It's like "edk2-platforms/Platform/Qemu/QemuOpenBoardPkg".
   We will gradually add modules and libraries to it.

AMD/PlatformPkg will contain the modules/drivers which are generic to future 
AMD platform.
   Currently we don't have complete platform, we can drop PlatformPkg for now 
till we have complete(reasonable modules) solution.

It's better to not touch existing AMD/OverdriveBoard, restructuring requires 
changes to .dsc and .fdf files, might break backward compatibility.

How about having just BoardPkg like below?

AMD board package
F: Platform/AMD/BoardPkg
M: Maintainer1
M: Maintainer2

Please let me know your thoughts.

Thanks
AbduL




-Original Message-
From: Leif Lindholm 
Sent: 20 March 2023 18:35
To: devel@edk2.groups.io; Chang, Abner 
Cc: Attar, AbdulLateef (Abdul Lateef) ; Ard 
Biesheuvel ; Michael D Kinney 

Subject: Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds 
AMD/BoardPkg and AMD/PlatformPkg maintainers

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


Hi Abner,

On Sat, Mar 18, 2023 at 09:16:17 +, Chang, Abner via groups.io wrote:
> I don't see any modules under OverdriveBoard, is this package still

The code is split between Platform/AMD and Silicon/AMD/Styx, the latter also 
being used by SoftIron/Overdrive1000 and LeMaker Cello (although that one is 
pretty much defunct and should probably be dropped).

> in use? Do you still remember where is FDF and DSC come from (as there
> is AMD copyright 2014-2016) back to the moment when you was introduced
> this package?

As the git history tells you:
---
commit f4d38e50c0f24eb78eb003a94f583025621c63db
Author: Leif Lindholm 
Date:   Thu Aug 3 12:24:22 2017 +0100

Platform,Silicon: import AMD Styx SoC support and platforms

Common files for AMD Overdrive, SoftIron Overdrive 1000
and LeMaker Cello, as well as actual platform support.
Imported from commit efd798c1eb of
https://git.linaro.org/uefi/OpenPlatformPkg.git
---

and the initial commit of the platform in that repository is:
---
From: Leo Duran 
Date: Thu, 20 Aug 2015 13:30:24 -0500

Subject: Platforms/AMD: add support for AMD Overdrive and Lemaker Cello

This adds support for the AMD Seattle based Overdrive and Husky
platforms,
and the Lemaker Cello which is derived from it.

This code was tested with upstream EDK2 commit 758ea94651.

The binaries in this branch are based on SeattleFDK 1.0.0.2
(Linaro SeattleFDK commit 4b419f2ef2)
---

Regards,

Leif

>
> Thanks
> Abner
>
> > -Original Message-
> > From: Leif Lindholm 
> > Sent: Saturday, March 18, 2023 12:09 AM
> > To: Attar, AbdulLateef (Abdul Lateef) 
> > Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef)
> > ; Ard Biesheuvel
> > ; Chang, Abner ;
> > Michael D Kinney 
> > Subject: Re: [PATCH v2 RESEND 4/4] Maintainers.txt: Adds
> > AMD/BoardPkg and AMD/PlatformPkg maintainers
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > On Fri, Mar 17, 2023 at 12:20:07 +0530, Abdul Lateef Attar wrote:
> > > From: Abdul Lateef Attar 
> > >
> > > Adds maintainers for AMD/BoardPkg and AMD/PlatformPkg.
> > >
> > > Signed-off-by: Abdul Lateef Attar 
> > > Cc: Ard Biesheuvel 
> > > Cc: Leif Lindholm 
> > > Cc: Abner Chang 
> > > Cc: Michael D Kinney 
> > > ---
> > >  Maintainers.txt | 6 ++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/Maintainers.txt b/Maintainers.txt index
> > > 747191366070..bb8ab643e090 100644
> > > --- a/Maintainers.txt
> > > +++ b/Maintainers.txt
> > > @@ -91,6 +91,12 @@ F: Silicon/AMD/Styx/
> > >  M: Ard Biesheuvel 
> > >  M: Leif Lindholm 
> > >
> > > +AMD Platform
> >
> > Annoyingly, I'm now going to ask the question I have been avoiding
> > up until now. What does "AMD Platform" mean?
> > I mean, you've placed this straight after the entry for the Seattle 
> > platforms.
> > I think the name, and package names, are too generic.
> >
> > /
> > Leif
> >
> > > +F: Platform/AMD/BoardPkg
> > > +F: Platform/AMD/PlatformPkg
> > > +M: Abner Chang 
> > > +M: Abdul Lateef Attar 
> > > +
> > >  Ampere Computing
> > >  F: Platform/Ampere
> > >  F: Silicon/Ampere
> > > --
> > > 2.25.1
> > >
>
>
> 
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101456): https://edk2.groups.io/g/devel/message/101456
Mute This Topic: https://groups.io/mt/97667946/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 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

2023-03-20 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Hi Leif,
How about adding a separate entry?
Currently its generic to adapt the MinPlatformPkg, later will add more specific 
platforms.

AMD board and platform
F: Platform/AMD/BoardPkg
F: Platform/AMD/PlatformPkg
M: maintainer1
M: maintainer2

AMD Seattle
F: Platform/AMD/OverdriveBoard/
F: Platform/LeMaker/CelloBoard/
F: Platform/SoftIron/
F: Silicon/AMD/Styx/
M: Ard Biesheuvel 
M: Leif Lindholm 

Thanks
AbduL

-Original Message-
From: Leif Lindholm 
Sent: 17 March 2023 21:39
To: Attar, AbdulLateef (Abdul Lateef) 
Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Ard Biesheuvel ; Chang, 
Abner ; Michael D Kinney 
Subject: Re: [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and 
AMD/PlatformPkg maintainers

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


On Fri, Mar 17, 2023 at 12:20:07 +0530, Abdul Lateef Attar wrote:
> From: Abdul Lateef Attar 
>
> Adds maintainers for AMD/BoardPkg and AMD/PlatformPkg.
>
> Signed-off-by: Abdul Lateef Attar 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> ---
>  Maintainers.txt | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/Maintainers.txt b/Maintainers.txt index
> 747191366070..bb8ab643e090 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -91,6 +91,12 @@ F: Silicon/AMD/Styx/
>  M: Ard Biesheuvel 
>  M: Leif Lindholm 
>
> +AMD Platform

Annoyingly, I'm now going to ask the question I have been avoiding up until 
now. What does "AMD Platform" mean?
I mean, you've placed this straight after the entry for the Seattle platforms.
I think the name, and package names, are too generic.

/
Leif

> +F: Platform/AMD/BoardPkg
> +F: Platform/AMD/PlatformPkg
> +M: Abner Chang 
> +M: Abdul Lateef Attar 
> +
>  Ampere Computing
>  F: Platform/Ampere
>  F: Silicon/Ampere
> --
> 2.25.1
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101455): https://edk2.groups.io/g/devel/message/101455
Mute This Topic: https://groups.io/mt/97667946/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] SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2

2023-03-20 Thread Gerd Hoffmann
On Mon, Mar 20, 2023 at 01:20:29PM +, Yao, Jiewen wrote:
> Would you please share with us what test has been done for this patch?

Usual regression testing, including booting images with and without
secure boot.  Additionally checked images with the wrong signature
are rejected (try boot grub.efi directly instead of using the
shim.efi -> grub.efi chain).

take care,
  Gerd

> 
> Thank you
> Yao, Jiewen
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Gerd
> > Hoffmann
> > Sent: Monday, March 20, 2023 6:02 PM
> > To: devel@edk2.groups.io
> > Cc: Pawel Polawski ; Wang, Jian J
> > ; Oliver Steffen ; Xu, Min M
> > ; Marvin Häuser ; Yao,
> > Jiewen ; jma...@redhat.com
> > Subject: Re: [edk2-devel] [PATCH v2 1/1]
> > SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2
> > 
> > On Fri, Mar 03, 2023 at 11:35:53AM +0100, Gerd Hoffmann wrote:
> > > Call gRT->GetVariable() directly to read the SecureBoot variable.  It is
> > > one byte in size so we can easily place it on the stack instead of
> > > having GetEfiGlobalVariable2() allocate it for us, which avoids a few
> > > possible error cases.
> > >
> > > Skip secure boot checks if (and only if):
> > >
> > >  (a) the SecureBoot variable is not present (EFI_NOT_FOUND) according to
> > >  the return value, or
> > >  (b) the SecureBoot variable was read successfully and is set to
> > >  SECURE_BOOT_MODE_DISABLE.
> > >
> > > Previously the code skipped the secure boot checks on *any*
> > > gRT->GetVariable() error (GetEfiGlobalVariable2 sets the variable
> > > value to NULL in that case) and also on memory allocation failures.
> > >
> > > Fixes: CVE-2019-14560
> > > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=2167
> > > Signed-off-by: Gerd Hoffmann 
> > 
> > Ping.  Any comments on this patch?
> > 
> > take care,
> >   Gerd
> > 
> > 
> > 
> > 
> > 
> 
> 
> 
> 
> 
> 

-- 



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




Re: [edk2-devel] [edk2-platforms][PATCH 1/2][RESEND] PlatformPayloadFeaturePkg.dsc: Add missing packages

2023-03-20 Thread Sheng Lean Tan
Can anyone help to review this? Thanks :)


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




Re: [edk2-devel] [edk2-platforms][PATCH 2/2][RESEND] PlatformPayloadFeaturePkg.py: Add Linux support

2023-03-20 Thread Sheng Lean Tan
Can anyone help to review this? Thanks :)


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101450): https://edk2.groups.io/g/devel/message/101450
Mute This Topic: https://groups.io/mt/97727098/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/4] OvmfPkg/PlatformInitLib: detect physical address space

2023-03-20 Thread Fiona Ebner
Am 17.03.23 um 15:01 schrieb Gerd Hoffmann:
>   Hi,
> 
>> With edk2-stable202205 or when reverting the commit, my VM boots with
>> only 512 MiB of assigned memory. With the commit, with 512 MiB it cannot
>> even initialize the display, with 750 MiB it runs into a different error
>> during Linux boot, and with 900 MiB it boots fine again.
>>
>> So it seems that having a larger PhysMemAddressWidth requires more
>> memory? Is this expected and does running VMs with this version simply
>> require more memory now? Is there a way to avoid that?
> 
> Might be more memory being needed for page tables.  Making sure gigabyte
> pages are enabled (-cpu $name,pdpe1gb=on), so edk2 can use them for the
> mmio window identity mapping.
> 
> Alternatively try change the cap:
> 
> 
> diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c 
> b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
> index 38cece9173e8..76df6fd020bf 100644
> --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
> +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
> @@ -669,9 +669,9 @@ PlatformAddressWidthFromCpuid (
>PhysBits = 47;
>  }
>  
> -if (!Page1GSupport && (PhysBits > 40)) {
> -  DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 40 (no 1G pages 
> available)\n", __func__));
> -  PhysBits = 40;
> +if (!Page1GSupport && (PhysBits > 38)) {
> +  DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 38 (no 1G pages 
> available)\n", __func__));
> +  PhysBits = 38;
>  }
>  
>  PlatformInfoHob->PhysMemAddressWidth = PhysBits;
> 
> 
> HTH,
>   Gerd
> 
> 

It seems that Page1GSupport is already TRUE in my case, so
unfortunately, the suggested changes don't help.

Before commit bbda386d25, PhysMemAddressWidth is 36, after the commit,
it's 47. I tried with hardcoding different values:
45 - My VM boots fine.
46 - I run into a "KVM internal error. Suberror: 1" during Linux boot
(that's also what happens with 47 and 750 MiB of memory).
47 - Hangs right away and display is never initialized.

Is there any interest to use a smaller limit than 47 from upstream's
perspective? Admittedly, it is a rather niche case to use OVMF with so
little memory.

In any case, thank you for taking a look!

Best Regards,
Fiona



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




[edk2-devel] [PATCH v1 4/4] ArmVirtPkg: Fix depex in kvmtool guest Rtc library

2023-03-20 Thread Sami Mujawar
The Rtc library for the kvmtool guest firmware configures the
RTC controller address range as runtime memory by calling the
gDS->SetMemorySpaceAttributes().
The SetMemorySpaceAttributes() function has a dependency on
the CPU Arch Protocol. If the CPU Arch Protocol is not
installed the call to set the memory attributes fails with
error code EFI_NOT_AVAILABLE_YET.

Therefore, set the library dependency on the CPU Arch protocol.

Signed-off-by: Sami Mujawar 
---
 ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf 
b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf
index 
f0a7c19ca5f4b5a8eeab08af64175ae6f3526b12..c10a6737a0736b11a8f45b661f8ac38948cb40b0
 100644
--- a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf
+++ b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  FDT client library for motorola,mc146818 RTC driver
 #
-#  Copyright (c) 2020, ARM Limited. All rights reserved.
+#  Copyright (c) 2020 - 2023, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -40,4 +40,4 @@ [Pcd]
   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister64
 
 [Depex]
-  gFdtClientProtocolGuid
+  gFdtClientProtocolGuid AND gEfiCpuArchProtocolGuid
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH v1 3/4] ArmVirtPkg: Fix parsing of serial port node

2023-03-20 Thread Sami Mujawar
When scanning for the Serial Port in the device
tree, the length and value parameters to ScanMem8()
are not in the right order. This results in the
serial port not being detected if the chosen node
in the device tree has additional elements.

Therefore, pass the parameters to ScanMem8() in the
correct order to fix this issue.

Signed-off-by: Sami Mujawar 
---
 ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c 
| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c 
b/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c
index 
fb1daf32769c20521e93de7af0f54a6a8e2c8369..c1b81920214b16137fd7c40b8ec897031e6fe9aa
 100644
--- 
a/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c
+++ 
b/ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c
@@ -1,7 +1,7 @@
 /** @file
   Early Platform Hook Library instance for 16550 Uart.
 
-  Copyright (c) 2020, ARM Ltd. All rights reserved.
+  Copyright (c) 2020 - 2023, Arm Ltd. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -67,7 +67,7 @@ GetSerialConsolePortAddress (
   }
 
   // Determine the actual path length, as a colon terminates the path.
-  Path = ScanMem8 (Prop, ':', PropSize);
+  Path = ScanMem8 (Prop, PropSize, ':');
   if (Path == NULL) {
 PathLen = AsciiStrLen (Prop);
   } else {
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH v1 0/4] Bug fixes for DynamicTablesPkg and ArmVirtPkg/kvmtool

2023-03-20 Thread Sami Mujawar
This patch series has the following fixes for DynamicTablesPkg and
ArmVirtPkg/Kvmtool:

  1. Reduces the log output from TableHelperLib in DynamicTablesPkg.
  2. Fixes issue with parsing of the serial port node in
 ArmSerialPortParser in DynamicTablesPkg and
 EarlyFdt16550SerialPortHookLib in ArmVirtPkg. This issue
 was not observed until another entry was added in the 'chosen'
 node in the DT when doing some experiments.
  3. Fixes the DEPEX in the Kvmtool guest RTC library as the missing
 dependency on CPU Architecture protocol would cause occasional
 failures.

The changes can be seen at:
https://github.com/samimujawar/edk2/tree/2596_bug_fix_dynamictables_kvmtool_v1

Sami Mujawar (4):
  DynamicTablesPkg: Reduce log output from TableHelperLib
  DynamicTablesPkg: Fix parsing of serial port node
  ArmVirtPkg: Fix parsing of serial port node
  ArmVirtPkg: Fix depex in kvmtool guest Rtc library

 ArmVirtPkg/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.c  
   |  4 +--
 ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf   
   |  4 +--
 
DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
 | 28 ++--
 DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.c   
   |  4 +--
 4 files changed, 20 insertions(+), 20 deletions(-)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH v1 2/4] DynamicTablesPkg: Fix parsing of serial port node

2023-03-20 Thread Sami Mujawar
When scanning for the Serial Port in the device
tree, the length and value parameters to ScanMem8()
are not in the right order. This results in the
serial port not being detected if the chosen node
in the device tree has additional elements.

Therefore, pass the parameters to ScanMem8() in the
correct order to fix this issue.

Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.c | 4 
++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.c 
b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.c
index 
cfd032df4d746ad2a414a0258d99fe670f1928a2..732b482eebe3754543167e45737e48242fddf065
 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Serial/ArmSerialPortParser.c
@@ -1,7 +1,7 @@
 /** @file
   Arm Serial Port Parser.
 
-  Copyright (c) 2021, ARM Limited. All rights reserved.
+  Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Reference(s):
@@ -290,7 +290,7 @@ GetSerialConsoleNode (
   }
 
   // Determine the actual path length, as a colon terminates the path.
-  Path = ScanMem8 (Prop, ':', PropSize);
+  Path = ScanMem8 (Prop, PropSize, ':');
   if (Path == NULL) {
 PathLen = (UINT32)AsciiStrLen (Prop);
   } else {
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH v1 1/4] DynamicTablesPkg: Reduce log output from TableHelperLib

2023-03-20 Thread Sami Mujawar
Reduce the log output from Configuration Manager Object Parser
in TableHelperLib by enabling the logs only if DEBUG_INFO is
enabled.

Signed-off-by: Sami Mujawar 
---
 
DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
 | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git 
a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
 
b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 
5e4b88e8cc754ea72157ea4a0c6d0f5b9eae2495..99d6032510a5e912c9189df82c4d2b4398458d2d
 100644
--- 
a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ 
b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -1,7 +1,7 @@
 /** @file
   Configuration Manager Object parser.
 
-  Copyright (c) 2021 - 2022, ARM Limited. All rights reserved.
+  Copyright (c) 2021 - 2023, ARM Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -787,7 +787,7 @@ PrintOemId (
   )
 {
   DEBUG ((
-DEBUG_ERROR,
+DEBUG_INFO,
 (Format != NULL) ? Format : "%C%C%C%C%C%C",
 Ptr[0],
 Ptr[1],
@@ -855,7 +855,7 @@ PrintCmObjDesc (
 *RemainingSize -= Parser[Index].Length;
 if (*RemainingSize < 0) {
   DEBUG ((
-DEBUG_ERROR,
+DEBUG_INFO,
 "\nERROR: %a: Buffer overrun\n",
 Parser[Index].NameStr
 ));
@@ -865,11 +865,11 @@ PrintCmObjDesc (
 
 // Indentation
 for (IndentIndex = 0; IndentIndex < IndentLevel; IndentIndex++) {
-  DEBUG ((DEBUG_ERROR, "  "));
+  DEBUG ((DEBUG_INFO, "  "));
 }
 
 DEBUG ((
-  DEBUG_ERROR,
+  DEBUG_INFO,
   "%-*a :",
   OUTPUT_FIELD_COLUMN_WIDTH - 2 * IndentLevel,
   Parser[Index].NameStr
@@ -879,20 +879,20 @@ PrintCmObjDesc (
 } else if (Parser[Index].Format != NULL) {
   switch (Parser[Index].Length) {
 case 1:
-  DEBUG ((DEBUG_ERROR, Parser[Index].Format, *(UINT8 *)Data));
+  DEBUG ((DEBUG_INFO, Parser[Index].Format, *(UINT8 *)Data));
   break;
 case 2:
-  DEBUG ((DEBUG_ERROR, Parser[Index].Format, *(UINT16 *)Data));
+  DEBUG ((DEBUG_INFO, Parser[Index].Format, *(UINT16 *)Data));
   break;
 case 4:
-  DEBUG ((DEBUG_ERROR, Parser[Index].Format, *(UINT32 *)Data));
+  DEBUG ((DEBUG_INFO, Parser[Index].Format, *(UINT32 *)Data));
   break;
 case 8:
-  DEBUG ((DEBUG_ERROR, Parser[Index].Format, ReadUnaligned64 (Data)));
+  DEBUG ((DEBUG_INFO, Parser[Index].Format, ReadUnaligned64 (Data)));
   break;
 default:
   DEBUG ((
-DEBUG_ERROR,
+DEBUG_INFO,
 "\nERROR: %a: CANNOT PARSE THIS FIELD, Field Length = %d\n",
 Parser[Index].NameStr,
 Parser[Index].Length
@@ -901,7 +901,7 @@ PrintCmObjDesc (
 } else if (Parser[Index].SubObjParser != NULL) {
   SubStructSize = Parser[Index].Length;
 
-  DEBUG ((DEBUG_ERROR, "\n"));
+  DEBUG ((DEBUG_INFO, "\n"));
   PrintCmObjDesc (
 Data,
 Parser[Index].SubObjParser,
@@ -912,14 +912,14 @@ PrintCmObjDesc (
 } else {
   ASSERT (0);
   DEBUG ((
-DEBUG_ERROR,
+DEBUG_INFO,
 "\nERROR: %a: CANNOT PARSE THIS FIELD, Field Length = %d\n",
 Parser[Index].NameStr,
 Parser[Index].Length
 ));
 }
 
-DEBUG ((DEBUG_ERROR, "\n"));
+DEBUG ((DEBUG_INFO, "\n"));
 Data = (UINT8 *)Data + Parser[Index].Length;
   } // for
 }
@@ -978,7 +978,7 @@ ParseCmObjDesc (
 
   for (ObjIndex = 0; ObjIndex < ObjectCount; ObjIndex++) {
 DEBUG ((
-  DEBUG_ERROR,
+  DEBUG_INFO,
   "\n%-*a [%d/%d]:\n",
   OUTPUT_FIELD_COLUMN_WIDTH,
   ParserArray->ObjectName,
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101445): https://edk2.groups.io/g/devel/message/101445
Mute This Topic: https://groups.io/mt/97731605/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 07/18] UefiCpuPkg/CpuPageTableLib:Add check for Mask and Attr

2023-03-20 Thread duntan
Gred, 
Thanks for the test. I found the root cause and will fix the issue in next 
version patch.

Thanks,
Dun

-Original Message-
From: Gerd Hoffmann  
Sent: Monday, March 20, 2023 7:43 PM
To: Tan, Dun 
Cc: devel@edk2.groups.io; Dong, Eric ; Ni, Ray 
; Kumar, Rahul R 
Subject: Re: [Patch V3 07/18] UefiCpuPkg/CpuPageTableLib:Add check for Mask and 
Attr

On Mon, Mar 20, 2023 at 01:33:18PM +0800, Dun Tan wrote:
> For different usage, check if the combination for Mask and Attr is 
> valid when creating or updating page table.
> 
> 1.For non-present range
>   1.1Mask.Present is 0 but some other attributes is provided.
>  This case is invalid.
>   1.2Mask.Present is 1 and Attr.Present is 0. In this case,all
>  other attributes should not be provided.
>   1.3Mask.Present is 1 and Attr.Present is 1. In this case,all
>  attributes should be provided to intialize the attribute.
> 
> 2.For present range
>   2.1Mask.Present is 1 and Attr.Present is 0.In this case, all
>  other attributes should not be provided.
> All other usage for present range is permitted.
> In the mentioned cases, 1.2 and 2.1 can be merged into 1 check.

This patch breaks OVMF.  Log tail:

AP Loop Mode is 1
AP Vector: non-16-bit = 3EFCE000/447
GetMicrocodePatchInfoFromHob: MicrocodeBase = 0x0, MicrocodeSize = 0x0 
WakeupBufferStart = 87000, WakeupBufferSize = DD AP Vector: 16-bit = 87000/39, 
ExchangeInfo = 87039/A4
CpuDxe: 5-Level Paging = 0
CPU[]: Microcode revision = , expected = 
CPU[0001]: Microcode revision = , expected =  ASSERT 
/home/kraxel/projects/edk2/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c(65):
 Status == ((RETURN_STATUS)(0x8000ULL | (5)))

take care,
  Gerd



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




Re: [edk2-devel] [edk2-platforms][PATCH V2 6/8] ManageabilityPkg: Implement Ipmi Protocol/Ppi

2023-03-20 Thread Nickle Wang via groups.io
Please find my comment inline below.

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com  
Sent: Wednesday, March 8, 2023 10:17 PM
To: devel@edk2.groups.io
Cc: Liming Gao ; Isaac Oram ; 
Nate DeSimone ; Abdul Lateef Attar 
; Nickle Wang ; Igor Kulchytskyy 

Subject: [edk2-platforms][PATCH V2 6/8] ManageabilityPkg: Implement Ipmi 
Protocol/Ppi

External email: Use caution opening links or attachments


From: Abner Chang 

Add Ipmi Protocol/Ppi/SMM implementations.
The underlying implementation of transport interface depends on the binded 
ManageabilityTransportLib.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../IpmiProtocol/Dxe/IpmiProtocolDxe.inf  |  50 
 .../Universal/IpmiProtocol/Pei/IpmiPpiPei.inf |  51 
 .../IpmiProtocol/Smm/IpmiProtocolSmm.inf  |  52 
 .../IpmiProtocol/Common/IpmiProtocolCommon.h  | 108   
.../IpmiProtocol/Common/IpmiProtocolCommon.c  | 247 ++  
.../Universal/IpmiProtocol/Dxe/IpmiProtocol.c | 177 +
 .../Universal/IpmiProtocol/Pei/IpmiPpi.c  | 151 +++
 .../Universal/IpmiProtocol/Smm/IpmiProtocol.c | 147 +++
 8 files changed, 983 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Common/IpmiProtocolCommon.h
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Common/IpmiProtocolCommon.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocol.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpi.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.c

diff --git 
a/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf 
b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
new file mode 100644
index 00..ff5ec56c73
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolD
+++ xe.inf
@@ -0,0 +1,50 @@
+## @file
+# IPMI Protocol DXE Driver.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent ##
+
+[Defines]
+  INF_VERSION= 0x0001001d
+  BASE_NAME  = IpmiDxe
+  FILE_GUID  = BC41B0C2-9D8A-42B5-A28F-02CE0D4A6C28
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= DxeIpmiEntry
+  UNLOAD_IMAGE   = IpmiUnloadImage
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  IpmiProtocol.c
+  ../Common/IpmiProtocolCommon.c
+  ../Common/IpmiProtocolCommon.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  ManageabilityPkg/ManageabilityPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  ManageabilityTransportHelperLib
+  ManageabilityTransportLib
+  UefiDriverEntryPoint
+  UefiBootServicesTableLib
+
+[Protocols]
+  gIpmiProtocolGuid   # PROTOCOL ALWAYS_PRODUCED
+
+[Guids]
+  gManageabilityProtocolIpmiGuid
+  gManageabilityTransportKcsGuid
+
+[FixedPcd]
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress
+
+[Depex]
+  TRUE
diff --git 
a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf 
b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
new file mode 100644
index 00..058bfb63cb
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.in
+++ f
@@ -0,0 +1,51 @@
+## @file
+# IPMI Protocol PEI Driver.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent ##
+
+[Defines]
+  INF_VERSION= 0x0001001d
+  BASE_NAME  = IpmiPei
+  FILE_GUID  = 7832F989-CB72-4715-ADCA-35C0B031856C
+  MODULE_TYPE= PEIM
+  VERSION_STRING = 1.0
+  ENTRY_POINT= PeiIpmiEntry
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  IpmiPpi.c
+  ../Common/IpmiProtocolCommon.c
+  ../Common/IpmiProtocolCommon.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  ManageabilityPkg/ManageabilityPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  ManageabilityTransportHelperLib
+  ManageabilityTransportLib
+  PeimEntryPoint
+  ManageabilityTransportLib
+
+[Ppis]
+  gPeiIpmiPpiGuid   # PPI ALWAYS PRODUCED
+
+[Guids]
+  gManageabilityProtocolIpmiGuid
+  gManageabilityTransportKcsGuid
+

Re: [edk2-devel] [edk2-platforms][PATCH V2 5/8] ManageabilityPkg/ManageabilityTransportKcsLib

2023-03-20 Thread Nickle Wang via groups.io
Please see my comments inline below.

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com  
Sent: Wednesday, March 8, 2023 10:17 PM
To: devel@edk2.groups.io
Cc: Liming Gao ; Isaac Oram ; 
Nate DeSimone ; Abdul Lateef Attar 
; Nickle Wang ; Igor Kulchytskyy 

Subject: [edk2-platforms][PATCH V2 5/8] 
ManageabilityPkg/ManageabilityTransportKcsLib

External email: Use caution opening links or attachments


From: Abner Chang 

This is the KCS manageability transport library instance follows the design 
guidance described in Readme file under ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../ManageabilityPkg/ManageabilityPkg.dsc |   3 +
 .../Dxe/DxeManageabilityTransportKcs.inf  |  44 ++
 .../Common/ManageabilityTransportKcs.h| 106 
 .../Common/KcsCommon.c| 480 ++
 .../Dxe/ManageabilityTransportKcs.c   | 384 ++
 .../Dxe/ManageabilityTransportKcs.uni |  13 +
 6 files changed, 1030 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsCommon.c
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/ManageabilityTransportKcs.c
 create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/ManageabilityTransportKcs.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index 0dd0ab41fc..45e07ac34f 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -36,6 +36,9 @@
 !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
 !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc

+[Components]
+  
+ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabil
+ityTransportKcs.inf
+
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf

diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
new file mode 100644
index 00..f0a6afa074
--- /dev/null
+++ b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe
+++ /DxeManageabilityTransportKcs.inf
@@ -0,0 +1,44 @@
+## @file
+# KCS instance of Manageability Transport Library # # Copyright (C) 
+2023 Advanced Micro Devices, Inc. All rights reserved. # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  INF_VERSION= 0x0001001B
+  BASE_NAME  = DxeManageabilityTransportKcs
+  MODULE_UNI_FILE= ManageabilityTransportKcs.uni
+  FILE_GUID  = FCCC8B34-145A-4927-9F08-553ADC579AF7
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = ManageabilityTransportLib
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  ManageabilityTransportKcs.c
+  ../Common/KcsCommon.c
+  ../Common/ManageabilityTransportKcs.h
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  IoLib
+  TimerLib
+  MemoryAllocationLib
+
+[Guids]
+  gManageabilityTransportKcsGuid
+  gManageabilityProtocolMctpGuid
+  gManageabilityProtocolIpmiGuid
+
+[FixedPcd]
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress   # Used as default KCS I/O 
base adddress
+
diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
new file mode 100644
index 00..d5a16efc81
--- /dev/null
+++ b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Com
+++ mon/ManageabilityTransportKcs.h
@@ -0,0 +1,106 @@
+/** @file
+
+  Manageability transport KCS internal used definitions.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent **/
+
+#ifndef MANAGEABILITY_TRANSPORT_KCS_LIB_H_
+#define MANAGEABILITY_TRANSPORT_KCS_LIB_H_
+
+#include 
+
+#define MANAGEABILITY_TRANSPORT_KCS_SIGNATURE  SIGNATURE_32 ('M', 'T', 
+'K', 'C')
+
+#define KCS_BASE_ADDRESS  mKcsHardwareInfo.IoBaseAddress
+#define KCS_REG_DATA_IN   mKcsHardwareInfo.IoDataInAddress
+#define KCS_REG_DATA_OUT  mKcsHardwareInfo.IoDataOutAddress
+#define KCS_REG_COMMAND   mKcsHardwareInfo.IoCommandAddress
+#define KCS_REG_STATUSmKcsHardwareInfo.IoStatusAddress
+

Re: [edk2-devel] [PATCH v2 1/1] ArmPkg/SmbiosMiscDxe: Adjust the priority of getting firmware version

2023-03-20 Thread Rebecca Cran

On 3/20/23 2:33 AM, Tinh Nguyen wrote:

-/**
-  Fetches the firmware ('BIOS') version from the
-  FirmwareVersionInfo HOB.
+/**  Fetches the Firmware version string for SMBIOS type 0
  
-  @return The version as a UTF-16 string

+  This function get the Firmware version string from OemMiscLib first,
+  if it is invalid then PcdFirmwareVersionString is used as a fallback.
+
+  @retval  VOID
  **/
-CHAR16 *
-GetBiosVersion (
+VOID
+SetBiosVersion (
VOID
)


Don't use @retval on a function that doesn't return anything.


With that fixed:

Reviewed-by: Rebecca Cran 


--

Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101440): https://edk2.groups.io/g/devel/message/101440
Mute This Topic: https://groups.io/mt/97726956/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] SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2

2023-03-20 Thread Yao, Jiewen
Would you please share with us what test has been done for this patch?

Thank you
Yao, Jiewen

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Gerd
> Hoffmann
> Sent: Monday, March 20, 2023 6:02 PM
> To: devel@edk2.groups.io
> Cc: Pawel Polawski ; Wang, Jian J
> ; Oliver Steffen ; Xu, Min M
> ; Marvin Häuser ; Yao,
> Jiewen ; jma...@redhat.com
> Subject: Re: [edk2-devel] [PATCH v2 1/1]
> SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2
> 
> On Fri, Mar 03, 2023 at 11:35:53AM +0100, Gerd Hoffmann wrote:
> > Call gRT->GetVariable() directly to read the SecureBoot variable.  It is
> > one byte in size so we can easily place it on the stack instead of
> > having GetEfiGlobalVariable2() allocate it for us, which avoids a few
> > possible error cases.
> >
> > Skip secure boot checks if (and only if):
> >
> >  (a) the SecureBoot variable is not present (EFI_NOT_FOUND) according to
> >  the return value, or
> >  (b) the SecureBoot variable was read successfully and is set to
> >  SECURE_BOOT_MODE_DISABLE.
> >
> > Previously the code skipped the secure boot checks on *any*
> > gRT->GetVariable() error (GetEfiGlobalVariable2 sets the variable
> > value to NULL in that case) and also on memory allocation failures.
> >
> > Fixes: CVE-2019-14560
> > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=2167
> > Signed-off-by: Gerd Hoffmann 
> 
> Ping.  Any comments on this patch?
> 
> take care,
>   Gerd
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [edk2-platforms][PATCH V2 7/8] ManageabilityPkg: Add IpmiProtocol to Manageability Package

2023-03-20 Thread Nickle Wang via groups.io
Reviewed-by: Nickle Wang 

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com  
Sent: Wednesday, March 8, 2023 10:17 PM
To: devel@edk2.groups.io
Cc: Liming Gao ; Isaac Oram ; 
Nate DeSimone ; Abdul Lateef Attar 
; Nickle Wang ; Igor Kulchytskyy 

Subject: [edk2-platforms][PATCH V2 7/8] ManageabilityPkg: Add IpmiProtocol to 
Manageability Package

External email: Use caution opening links or attachments


From: Abner Chang 

Add Ipmi Protocol/Ppi/SMM modules to ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 Features/ManageabilityPkg/Include/Dsc/Manageability.dsc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
index 994c93f17c..0d868fdf4a 100644
--- a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -16,3 +16,10 @@
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
   ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf

+[Components.IA32]
+  ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
+
+[Components.X64]
+  ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
+  ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf
+
--
2.37.1.windows.1



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




Re: [edk2-devel] [edk2-platforms][PATCH V2 8/8] edk2-platforms: Maintainers.txt

2023-03-20 Thread Nickle Wang via groups.io
Reviewed-by: Nickle Wang 

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com  
Sent: Wednesday, March 8, 2023 10:17 PM
To: devel@edk2.groups.io
Cc: Abdul Lateef Attar ; Leif Lindholm 
; Michael D Kinney ; 
Liming Gao ; Isaac Oram ; 
Nickle Wang 
Subject: [edk2-platforms][PATCH V2 8/8] edk2-platforms: Maintainers.txt

External email: Use caution opening links or attachments


From: Abner Chang 

Add maintainer and reviewer of ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Abdul Lateef Attar 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nickle Wang 
Reviewed-by: Michael D Kinney 
---
 Maintainers.txt | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Maintainers.txt b/Maintainers.txt index 7471913660..8279a8ac5d 
100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -164,6 +164,13 @@ F: Features/Intel/UserInterface/
 M: Dandan Bi 
 R: Liming Gao 

+Features/ManageabilityPkg
+F: Features/ManageabilityPkg/
+M: Abner Chang 
+M: Isaac Oram 
+R: Abdul Lateef Attar 
+R: Nickle Wang 
+
 Platform/Intel
 F: Platform/Intel/
 M: Sai Chaganty  @@ -326,10 +333,10 @@ R: Yuwei 
Chen 

 Loongson platforms
 F: Platform/Loongson/
-M: Bibo Mao 
+M: Bibo Mao 
 M: Xianglai li 
 M: Chao Li 
-
+
 Marvell platforms and silicon
 F: Platform/Marvell/
 F: Platform/SolidRun/Armada80x0McBin/
--
2.37.1.windows.1



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




Re: [edk2-devel] [PATCH 1/3] BaseTools: Allow users to specify compiler to use with make CC= CXX=

2023-03-20 Thread Rebecca Cran
Sorry, I don't think I saw a suggestion from you to not set CC - though 
I may have missed emails since this patch series was sent from the email 
of my former employer.


Marvin did suggest that though, so I can certainly add another patch to 
the series to do that.



--

Rebecca Cran


On 3/20/23 3:35 AM, Gerd Hoffmann wrote:

On Fri, Mar 17, 2023 at 04:43:24AM -0600, Rebecca Cran wrote:

On 3/15/23 4:07 AM, Gerd Hoffmann wrote:

Rework the BaseTools Makefiles removing the 'BUILD_' prefix (BUILD_CC
and BUILD_CXX) and using the standard name 'LDFLAGS' instead of
'LFLAGS'. This allows clang to be used by running
'make -C BaseTools CC=clang CXX=clang++'.

Hmm, not sure this is a good idea.  I suspect there was some reason to
use BUILD_CC instead of CC in the first place ...

It looks like the change to use BUILD_CC was introduced by Liming in:


     BaseTools GnuMakefile: Update GCC Flags to the specific one with BUILD_
prefix

     To avoid the conflict with the default GCC flag name, BUILD_ prefix is
added.

     Cc: Giri P Mudusuru 
     Cc: Yonghong Zhu 
     Contributed-under: TianoCore Contribution Agreement 1.0
     Signed-off-by: Liming Gao 
     Reviewed-by: Yonghong Zhu 
     Reviewed-by: Giri P Mudusuru 


I don't understand how that would help, and I'm wondering if it was perhaps
the result of a misunderstanding.

Hmm, neither the commit message nor the patch itself have any hints of
actual problems fixed.  The "conflict" notion indeed hints this might
have been a misunderstanding.

So, going back to just use CC + CFLAGS + friends looks fine to me.

The suggestion to simply not set CC stands stands.

take care,
   Gerd




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101436): https://edk2.groups.io/g/devel/message/101436
Mute This Topic: https://groups.io/mt/97022154/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 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

2023-03-20 Thread Leif Lindholm
Hi Abner,

On Sat, Mar 18, 2023 at 09:16:17 +, Chang, Abner via groups.io wrote:
> I don't see any modules under OverdriveBoard, is this package still

The code is split between Platform/AMD and Silicon/AMD/Styx, the
latter also being used by SoftIron/Overdrive1000 and LeMaker Cello
(although that one is pretty much defunct and should probably be
dropped).

> in use? Do you still remember where is FDF and DSC come from (as
> there is AMD copyright 2014-2016) back to the moment when you was
> introduced this package?

As the git history tells you:
---
commit f4d38e50c0f24eb78eb003a94f583025621c63db
Author: Leif Lindholm 
Date:   Thu Aug 3 12:24:22 2017 +0100

Platform,Silicon: import AMD Styx SoC support and platforms

Common files for AMD Overdrive, SoftIron Overdrive 1000
and LeMaker Cello, as well as actual platform support.
Imported from commit efd798c1eb of
https://git.linaro.org/uefi/OpenPlatformPkg.git
---

and the initial commit of the platform in that repository is:
---
From: Leo Duran 
Date: Thu, 20 Aug 2015 13:30:24 -0500

Subject: Platforms/AMD: add support for AMD Overdrive and Lemaker Cello

This adds support for the AMD Seattle based Overdrive and Husky
platforms,
and the Lemaker Cello which is derived from it.

This code was tested with upstream EDK2 commit 758ea94651.

The binaries in this branch are based on SeattleFDK 1.0.0.2
(Linaro SeattleFDK commit 4b419f2ef2)
---

Regards,

Leif

> 
> Thanks
> Abner
> 
> > -Original Message-
> > From: Leif Lindholm 
> > Sent: Saturday, March 18, 2023 12:09 AM
> > To: Attar, AbdulLateef (Abdul Lateef) 
> > Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef)
> > ; Ard Biesheuvel
> > ; Chang, Abner ;
> > Michael D Kinney 
> > Subject: Re: [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg
> > and AMD/PlatformPkg maintainers
> > 
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> > 
> > 
> > On Fri, Mar 17, 2023 at 12:20:07 +0530, Abdul Lateef Attar wrote:
> > > From: Abdul Lateef Attar 
> > >
> > > Adds maintainers for AMD/BoardPkg and AMD/PlatformPkg.
> > >
> > > Signed-off-by: Abdul Lateef Attar 
> > > Cc: Ard Biesheuvel 
> > > Cc: Leif Lindholm 
> > > Cc: Abner Chang 
> > > Cc: Michael D Kinney 
> > > ---
> > >  Maintainers.txt | 6 ++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/Maintainers.txt b/Maintainers.txt index
> > > 747191366070..bb8ab643e090 100644
> > > --- a/Maintainers.txt
> > > +++ b/Maintainers.txt
> > > @@ -91,6 +91,12 @@ F: Silicon/AMD/Styx/
> > >  M: Ard Biesheuvel 
> > >  M: Leif Lindholm 
> > >
> > > +AMD Platform
> > 
> > Annoyingly, I'm now going to ask the question I have been avoiding up until
> > now. What does "AMD Platform" mean?
> > I mean, you've placed this straight after the entry for the Seattle 
> > platforms.
> > I think the name, and package names, are too generic.
> > 
> > /
> > Leif
> > 
> > > +F: Platform/AMD/BoardPkg
> > > +F: Platform/AMD/PlatformPkg
> > > +M: Abner Chang 
> > > +M: Abdul Lateef Attar 
> > > +
> > >  Ampere Computing
> > >  F: Platform/Ampere
> > >  F: Silicon/Ampere
> > > --
> > > 2.25.1
> > >
> 
> 
> 
> 
> 


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




Re: [edk2-devel] [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg and AMD/PlatformPkg maintainers

2023-03-20 Thread Leif Lindholm
Hi Abner,

On Sat, Mar 18, 2023 at 09:03:50 +, Chang, Abner via groups.io wrote:
> AMD\PlatformPkg is mainly for the modules that are generic to AMD's
> server, client or other platforms, while AMD\BoardPkg that contains
> the modules that support MinPlatformrPkg framework. AMD\BoardPkg may
> also provide the modules those are common to all AMD boards and
> leverage by the board specific packages under AMD\BoardPkg. Perhaps
> AMD\Board would a better naming that contains both common board
> modules and the specific board packages.

We don't really have a rigorous "here is what the contents of a vendor
directory should look like" ruleset.

My interpretation is as follows:
a Pkg has a .dec and a Pkg shouldn't live in a Pkg.

So, I'm not opposed to non-package subdirectories to AMD that
themselves contain packages.

But then, what's the difference between a board and a platform?

> I don't know the context of
> OverdriveBoard , however we would like to see OverdriveBoard is
> relocated to under AMD\Board(Pkg) as well. With this we can have a
> well organized AMD directory under edk2-platform that provides AMD
> opensource edk2 solution to industry.

That sounds ideal to me.
We just need to figure out a directory layout that will work, for
Overdrive/Styx, the platforms supported by this set, and future
platforms.

Regards,

Leif


> 
> Thanks
> Abner
> 
> > -Original Message-
> > From: Leif Lindholm 
> > Sent: Saturday, March 18, 2023 12:09 AM
> > To: Attar, AbdulLateef (Abdul Lateef) 
> > Cc: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef)
> > ; Ard Biesheuvel
> > ; Chang, Abner ;
> > Michael D Kinney 
> > Subject: Re: [PATCH v2 RESEND 4/4] Maintainers.txt: Adds AMD/BoardPkg
> > and AMD/PlatformPkg maintainers
> > 
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> > 
> > 
> > On Fri, Mar 17, 2023 at 12:20:07 +0530, Abdul Lateef Attar wrote:
> > > From: Abdul Lateef Attar 
> > >
> > > Adds maintainers for AMD/BoardPkg and AMD/PlatformPkg.
> > >
> > > Signed-off-by: Abdul Lateef Attar 
> > > Cc: Ard Biesheuvel 
> > > Cc: Leif Lindholm 
> > > Cc: Abner Chang 
> > > Cc: Michael D Kinney 
> > > ---
> > >  Maintainers.txt | 6 ++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/Maintainers.txt b/Maintainers.txt index
> > > 747191366070..bb8ab643e090 100644
> > > --- a/Maintainers.txt
> > > +++ b/Maintainers.txt
> > > @@ -91,6 +91,12 @@ F: Silicon/AMD/Styx/
> > >  M: Ard Biesheuvel 
> > >  M: Leif Lindholm 
> > >
> > > +AMD Platform
> > 
> > Annoyingly, I'm now going to ask the question I have been avoiding up until
> > now. What does "AMD Platform" mean?
> > I mean, you've placed this straight after the entry for the Seattle 
> > platforms.
> > I think the name, and package names, are too generic.
> > 
> > /
> > Leif
> > 
> > > +F: Platform/AMD/BoardPkg
> > > +F: Platform/AMD/PlatformPkg
> > > +M: Abner Chang 
> > > +M: Abdul Lateef Attar 
> > > +
> > >  Ampere Computing
> > >  F: Platform/Ampere
> > >  F: Silicon/Ampere
> > > --
> > > 2.25.1
> > >
> 
> 
> 
> 
> 


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




Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo

2023-03-20 Thread Sean Rhodes
Hi Ray

Some members of the coreboot community want to centre the logo (as it is
currently) and some want to use the Microsoft recommended position. All we
want to do is have the option to build edk2 with one or the other.

Thanks

Sean

On Mon, 20 Mar 2023 at 09:56, Ni, Ray  wrote:

> Sheng Lean Tan,
>
>
>
> In short, I am looking forward to be convinced by you and Sean, but so far
> I haven’t been.
>
>
>
>1. In the beginning, I left comments to suggest you use the logic
>below to meet your requirement.
>Status = gBS->HandleProtocol (gST->ConsoleOutHandle,
>, (VOID **) );
>
> if (!EFI_ERROR (Status)) {
>   //
>   // Center of LOGO is in the vertical position 38.2% when
> PcdBootLogoOnlyEnable is TRUE
>   // Y = (VerticalResolution - LogoHeight) / 2
>   // Y' = VerticalResolution * 0.382 - LogoHeight * 0.5
>   // OffsetY + Y = Y'
>   // OffsetY = Y' - Y = -0.118 * VerticalResolution
>   //
>   *Attribute = EdkiiPlatformLogoDisplayAttributeCenter;
>   *OffsetX   = 0;
>   *OffsetY   = -118 * (INTN)
> GraphicsOutput->Mode->Info->VerticalResolution / 1000;
> }
>
>
>
>1. Then, Sean replied following: “Thank you, it does, and I think it
>will work for most splash images. However, the way it's written in my patch
>accounts for the Image size. This will handle splash images that are equal
>to, or larger than the resolution of the display. “
>
>
>
>1. Then, I replied “The logic I shared below is from the LogoDxe
>driver which produces EDKII_PLATFORM_LOGO_PROTOCOL. This driver should know
>the image size and it can account for the image size.”
>
> Then, I don’t think we are talking in the same page. Maybe I didn’t
> understand your problem, maybe you didn’t understand my above sample code.
>
> Thanks,
>
> Ray
>
>
>
>
>
>
>
> *From:* Sheng Lean Tan 
> *Sent:* Monday, March 20, 2023 4:12 PM
> *To:* devel@edk2.groups.io; Ni, Ray ; Kinney, Michael D
> 
> *Cc:* Rhodes, Sean ; Gao, Zhichao <
> zhichao@intel.com>; Wang, Jian J ; Gao, Liming
> 
> *Subject:* Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to
> control the position of the Logo
>
>
>
> Hi Ray,
>
> Any feedback per Mic feedback?
>
> Sent from my iPhone
>
>
> On 15. Mar 2023, at 16:35, Michael D Kinney 
> wrote:
>
> 
>
> HI Ray,
>
>
>
> I think it is a reasonable request to have the EDK II logo driver support
> multiple standards for the logo location.  Especially if they are
> documented in public specifications.
>
>
>
> The additional conditions of supporting a logo larger than the display
> resolution also looks like a good corner case to cover no matter what logo
> location standard is used.
>
>
>
> Perhaps a single PCD that is a enum of logo locations.  Default 0x00 can
> be EDK II default that is centered in the display.  0x01 can be BGRT.
> Leaves from for more if there are additional public standard logo locations.
>
>
>
> Mike
>
>
>
>
>
> *From:* Ni, Ray 
> *Sent:* Wednesday, March 15, 2023 2:24 AM
> *To:* devel@edk2.groups.io; Rhodes, Sean 
> *Cc:* Kinney, Michael D ; Gao, Zhichao <
> zhichao@intel.com>; Wang, Jian J ; Gao, Liming
> 
> *Subject:* RE: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to
> control the position of the Logo
>
>
>
> What’s the meaning of “have both options”?
>
> If you want to support two cases, put the logic in your platform specific
> Logo driver.
>
> This Logo driver is just for reference.
>
>
>
> *From:* devel@edk2.groups.io  *On Behalf Of *Sean
> Rhodes
> *Sent:* Friday, March 10, 2023 9:43 PM
> *To:* Ni, Ray 
> *Cc:* devel@edk2.groups.io; Kinney, Michael D ;
> Gao, Zhichao ; Wang, Jian J ;
> Gao, Liming 
> *Subject:* Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to
> control the position of the Logo
>
>
>
> Hi Ray
>
>
>
> > You can return a carefully-calculated X/Y value to make
> the logo at MS preferred position.
>
> As we discussed before, we need to have both options.
>
>
>
> Thanks
>
>
>
> Sean
>
>
>
> On Wed, 8 Mar 2023 at 09:01, Ni, Ray  wrote:
>
> Maybe I didn’t explain my idea clearly.
>
> That is:
>
> You can get the screen resolution in the code that
> produces Logo protocol.
>
> You can return a carefully-calculated X/Y value to make
> the logo at MS preferred position.
>
>
>
> *From:* devel@edk2.groups.io  *On Behalf Of *Ni, Ray
> *Sent:* Wednesday, October 26, 2022 10:32 AM
> *To:* Kinney, Michael D ; devel@edk2.groups.io;
> Rhodes, Sean 
> *Cc:* Gao, Zhichao ; Wang, Jian J <
> jian.j.w...@intel.com>; Gao, Liming 
> *Subject:* Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to
> control the position of the Logo
>
>
>
> Are you suggesting that the exiting logic be updated for this use case
> without adding a new enum?
>
>1. yes.
>
>
>
> *From:* Kinney, Michael D 
> *Sent:* Wednesday, October 26, 2022 12:21 AM
> *To:* devel@edk2.groups.io; Ni, Ray ; Rhodes, Sean <
> sean@starlabs.systems>; Kinney, Michael D 
> *Cc:* 

Re: [edk2-devel] [PATCH v2 1/1] SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2

2023-03-20 Thread Min Xu
It's good to me.
Reviewed-by: Min Xu 

Thanks

> -Original Message-
> From: Gerd Hoffmann 
> Sent: Monday, March 20, 2023 6:02 PM
> To: devel@edk2.groups.io
> Cc: Pawel Polawski ; Wang, Jian J
> ; Oliver Steffen ; Xu, Min M
> ; Marvin Häuser ; Yao, Jiewen
> ; jma...@redhat.com
> Subject: Re: [PATCH v2 1/1] SecurityPkg/DxeImageVerificationLib: Check
> result of GetEfiGlobalVariable2
> 
> On Fri, Mar 03, 2023 at 11:35:53AM +0100, Gerd Hoffmann wrote:
> > Call gRT->GetVariable() directly to read the SecureBoot variable.  It
> > is one byte in size so we can easily place it on the stack instead of
> > having GetEfiGlobalVariable2() allocate it for us, which avoids a few
> > possible error cases.
> >
> > Skip secure boot checks if (and only if):
> >
> >  (a) the SecureBoot variable is not present (EFI_NOT_FOUND) according to
> >  the return value, or
> >  (b) the SecureBoot variable was read successfully and is set to
> >  SECURE_BOOT_MODE_DISABLE.
> >
> > Previously the code skipped the secure boot checks on *any*
> > gRT->GetVariable() error (GetEfiGlobalVariable2 sets the variable
> > value to NULL in that case) and also on memory allocation failures.
> >
> > Fixes: CVE-2019-14560
> > Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=2167
> > Signed-off-by: Gerd Hoffmann 
> 
> Ping.  Any comments on this patch?
> 
> take care,
>   Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101432): https://edk2.groups.io/g/devel/message/101432
Mute This Topic: https://groups.io/mt/97359253/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 07/18] UefiCpuPkg/CpuPageTableLib:Add check for Mask and Attr

2023-03-20 Thread Gerd Hoffmann
On Mon, Mar 20, 2023 at 01:33:18PM +0800, Dun Tan wrote:
> For different usage, check if the combination for Mask and
> Attr is valid when creating or updating page table.
> 
> 1.For non-present range
>   1.1Mask.Present is 0 but some other attributes is provided.
>  This case is invalid.
>   1.2Mask.Present is 1 and Attr.Present is 0. In this case,all
>  other attributes should not be provided.
>   1.3Mask.Present is 1 and Attr.Present is 1. In this case,all
>  attributes should be provided to intialize the attribute.
> 
> 2.For present range
>   2.1Mask.Present is 1 and Attr.Present is 0.In this case, all
>  other attributes should not be provided.
> All other usage for present range is permitted.
> In the mentioned cases, 1.2 and 2.1 can be merged into 1 check.

This patch breaks OVMF.  Log tail:

AP Loop Mode is 1
AP Vector: non-16-bit = 3EFCE000/447
GetMicrocodePatchInfoFromHob: MicrocodeBase = 0x0, MicrocodeSize = 0x0
WakeupBufferStart = 87000, WakeupBufferSize = DD
AP Vector: 16-bit = 87000/39, ExchangeInfo = 87039/A4
CpuDxe: 5-Level Paging = 0
CPU[]: Microcode revision = , expected = 
CPU[0001]: Microcode revision = , expected = 
ASSERT 
/home/kraxel/projects/edk2/UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c(65):
 Status == ((RETURN_STATUS)(0x8000ULL | (5)))

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101431): https://edk2.groups.io/g/devel/message/101431
Mute This Topic: https://groups.io/mt/97725704/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 00/18] Fix issues in CpuPageTableLib

2023-03-20 Thread Gerd Hoffmann
On Mon, Mar 20, 2023 at 01:33:11PM +0800, duntan wrote:
> In the V3 patch set:
> 1.Modify the V2 patch set based on Ray's comments
> 2.Remove the patch to enable PAE paging. Will do this in future patches
> 3.Add patches to combine code branch for non-present and leaf ParentEntry

Patch series breaks OVMF.  Going bisect, stay tuned ...

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101430): https://edk2.groups.io/g/devel/message/101430
Mute This Topic: https://groups.io/mt/97725693/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 0/2] OvmfPkg: Enable measured direct boot on AMD SEV-SNP

2023-03-20 Thread Gerd Hoffmann
On Thu, Mar 02, 2023 at 09:15:30AM +, Dov Murik wrote:
> AMD SEV and SEV-ES support measured direct boot with
> kernel/initrd/cmdline hashes injected by QEMU and verified by OVMF
> during boot.
> 
> To enable the same approach for AMD SEV-SNP, we declare the kernel
> hashes page in the SNP metadata list as a new region type.  When QEMU
> encounters that region in the list, it will insert the hashes of
> kernel/initrd/cmdline and encrypt the page (or, if the user turned off
> kernel hashes, it will validate the page as a zero page).
> 
> The first patch rearranges the pages in AmdSevX64's MEMFD so they are in
> the same order both as in the main target (OvmfPkgX64), with the
> exception of the SEV Launch Secret page which isn't defined in
> OvmfPkgX64.
> 
> The second patch modifies the SNP metadata structure such that on
> AmdSev target the SEV Launch Secret page is explicitly defined in SNP
> metadata list, and therefore it is not included in the ranges that are
> pre-validated (zero pages) by the VMM; instead the VMM will insert
> content into this page (the hashes table), or mark it explicitly as a
> zero page if no hashes are added.
> 
> This series is available at:
> https://github.com/confidential-containers-demo/edk2/tree/snp-kernel-hashes-v3
> 
> A corresponding QEMU RFC series will be published soon in qemu-devel, or
> use this tree:
> https://github.com/confidential-containers-demo/qemu/tree/snp-kernel-hashes-v3

For the series:
Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH 0/5] MdePkg/Base.h: Introduce various alignment-related macros

2023-03-20 Thread Gerd Hoffmann
On Fri, Mar 03, 2023 at 07:51:10AM +0100, Gerd Hoffmann wrote:

Ping.  Any comments on this?

The interesting update actually adding the macros is in patch #3.

thanks & take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101428): https://edk2.groups.io/g/devel/message/101428
Mute This Topic: https://groups.io/mt/97357264/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/PiSmmCpuDxeSmm: fix error handling

2023-03-20 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Gerd Hoffmann 
> Sent: Friday, March 10, 2023 8:49 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Oliver Steffen ; Gerd
> Hoffmann ; Kumar, Rahul R
> ; Pawel Polawski ;
> Dong, Eric 
> Subject: [PATCH 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: fix error handling
> 
> ASSERT() is not proper handling of allocation failures, it gets compiled
> out on RELEASE builds.  Print a message and enter dead loop instead.
> 
> Signed-off-by: Gerd Hoffmann 
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
> index 55a9f79da8eb..2e41df1f1074 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
> @@ -879,6 +879,12 @@ PiCpuSmmEntry (
>  //
>  BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize *
> (mMaxNumberOfCpus - 1));
>  Buffer  = AllocateAlignedCodePages (BufferPages, SIZE_4KB);
> +if (!Buffer) {
> +  DEBUG ((DEBUG_ERROR, "Failed to allocate %d pages.\n", BufferPages));
> +  CpuDeadLoop ();
> +  return EFI_OUT_OF_RESOURCES;
> +}
> +
>  ASSERT (Buffer != NULL);
>  DEBUG ((DEBUG_INFO, "New Allcoated SMRAM SaveState Buffer (0x%08x,
> 0x%08x)\n", Buffer, EFI_PAGES_TO_SIZE (BufferPages)));
>}
> --
> 2.39.2



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




Re: [edk2-devel] [PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: drop support for obsolete processors

2023-03-20 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Gerd Hoffmann 
> Sent: Friday, March 10, 2023 8:49 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Oliver Steffen ; Gerd
> Hoffmann ; Kumar, Rahul R
> ; Pawel Polawski ;
> Dong, Eric 
> Subject: [PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: drop support for
> obsolete processors
> 
> It's highly unlikely the code ever runs on processors which are
> almost 30 years old.  Drop the code handling them.
> 
> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=4345
> Signed-off-by: Gerd Hoffmann 
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 20 +---
>  1 file changed, 5 insertions(+), 15 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
> index d2d0950f3b42..55a9f79da8eb 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
> @@ -871,24 +871,14 @@ PiCpuSmmEntry (
>  //
>  DEBUG ((DEBUG_INFO, "PiCpuSmmEntry: gSmmBaseHobGuid not
> found!\n"));
>  //
> +// very old processors (i486 + pentium) need 32k not 4k alignment,
> exclude them.
> +//
> +ASSERT (FamilyId >= 6);
> +//
>  // Allocate buffer for all of the tiles.
>  //
> -// Intel(R) 64 and IA-32 Architectures Software Developer's Manual
> -// Volume 3C, Section 34.11 SMBASE Relocation
> -//   For Pentium and Intel486 processors, the SMBASE values must be
> -//   aligned on a 32-KByte boundary or the processor will enter shutdown
> -//   state during the execution of a RSM instruction.
> -//
> -// Intel486 processors: FamilyId is 4
> -// Pentium processors : FamilyId is 5
> -//
>  BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize *
> (mMaxNumberOfCpus - 1));
> -if ((FamilyId == 4) || (FamilyId == 5)) {
> -  Buffer = AllocateAlignedCodePages (BufferPages, SIZE_32KB);
> -} else {
> -  Buffer = AllocateAlignedCodePages (BufferPages, SIZE_4KB);
> -}
> -
> +Buffer  = AllocateAlignedCodePages (BufferPages, SIZE_4KB);
>  ASSERT (Buffer != NULL);
>  DEBUG ((DEBUG_INFO, "New Allcoated SMRAM SaveState Buffer (0x%08x,
> 0x%08x)\n", Buffer, EFI_PAGES_TO_SIZE (BufferPages)));
>}
> --
> 2.39.2



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




Re: [edk2-devel] [PATCH v2 1/1] SecurityPkg/DxeImageVerificationLib: Check result of GetEfiGlobalVariable2

2023-03-20 Thread Gerd Hoffmann
On Fri, Mar 03, 2023 at 11:35:53AM +0100, Gerd Hoffmann wrote:
> Call gRT->GetVariable() directly to read the SecureBoot variable.  It is
> one byte in size so we can easily place it on the stack instead of
> having GetEfiGlobalVariable2() allocate it for us, which avoids a few
> possible error cases.
> 
> Skip secure boot checks if (and only if):
> 
>  (a) the SecureBoot variable is not present (EFI_NOT_FOUND) according to
>  the return value, or
>  (b) the SecureBoot variable was read successfully and is set to
>  SECURE_BOOT_MODE_DISABLE.
> 
> Previously the code skipped the secure boot checks on *any*
> gRT->GetVariable() error (GetEfiGlobalVariable2 sets the variable
> value to NULL in that case) and also on memory allocation failures.
> 
> Fixes: CVE-2019-14560
> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=2167
> Signed-off-by: Gerd Hoffmann 

Ping.  Any comments on this patch?

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101425): https://edk2.groups.io/g/devel/message/101425
Mute This Topic: https://groups.io/mt/97359253/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] OvmfPkg/PlatformInitLib: move mmconfig to 0xe0000000

2023-03-20 Thread Gerd Hoffmann
On Tue, Mar 07, 2023 at 07:54:51AM +0100, Gerd Hoffmann wrote:
> v2:
>  - rebase to latest master.
> 
> Gerd Hoffmann (3):
>   OvmfPkg/PlatformInitLib: update address space layout comment
>   OvmfPkg/PlatformInitLib: move mmconfig to 0xe000
>   OvmfPkg/PlatformInitLib: simplify mtrr setup

Ping.  Any comments on this patch series?

thanks,
  Gerd



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




Re: [edk2-devel] [PATCH 1/1] UefiCpuPkg/MpInitLib: fix apic mode for cpu hotplug

2023-03-20 Thread Gerd Hoffmann
On Tue, Mar 07, 2023 at 01:20:37PM +0100, Gerd Hoffmann wrote:
> In case the number of CPUs can in increase beyond 255
> due to CPU hotplug choose x2apic mode.
> 
> Signed-off-by: Gerd Hoffmann 

Ping.  Any comments on this patch?

thanks,
  Gerd

> ---
>  UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c 
> b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index e5dc852ed95f..d73b95001263 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -526,7 +526,9 @@ CollectProcessorCount (
>//
>// Enable x2APIC mode if
>//  1. Number of CPU is greater than 255; or
> -  //  2. There are any logical processors reporting an Initial APIC ID of 
> 255 or greater.
> +  //  2. The platform exposed the exact *boot* CPU count to us in advance, 
> and
> +  // more than 255 logical processors are possible later, with hotplug; 
> or
> +  //  3. There are any logical processors reporting an Initial APIC ID of 
> 255 or greater.
>//
>X2Apic = FALSE;
>if (CpuMpData->CpuCount > 255) {
> @@ -534,6 +536,10 @@ CollectProcessorCount (
>  // If there are more than 255 processor found, force to enable X2APIC
>  //
>  X2Apic = TRUE;
> +  } else if ((PcdGet32 (PcdCpuBootLogicalProcessorNumber) > 0) &&
> + (PcdGet32 (PcdCpuMaxLogicalProcessorNumber) > 255))
> +  {
> +X2Apic = TRUE;
>} else {
>  CpuInfoInHob = (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob;
>  for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
> -- 
> 2.39.2
> 

-- 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101423): https://edk2.groups.io/g/devel/message/101423
Mute This Topic: https://groups.io/mt/97447597/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/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo

2023-03-20 Thread Ni, Ray
Sheng Lean Tan,

In short, I am looking forward to be convinced by you and Sean, but so far I 
haven’t been.


  1.  In the beginning, I left comments to suggest you use the logic below to 
meet your requirement.
Status = gBS->HandleProtocol (gST->ConsoleOutHandle, 
, (VOID **) );
if (!EFI_ERROR (Status)) {
  //
  // Center of LOGO is in the vertical position 38.2% when 
PcdBootLogoOnlyEnable is TRUE
  // Y = (VerticalResolution - LogoHeight) / 2
  // Y' = VerticalResolution * 0.382 - LogoHeight * 0.5
  // OffsetY + Y = Y'
  // OffsetY = Y' - Y = -0.118 * VerticalResolution
  //
  *Attribute = EdkiiPlatformLogoDisplayAttributeCenter;
  *OffsetX   = 0;
  *OffsetY   = -118 * (INTN) GraphicsOutput->Mode->Info->VerticalResolution 
/ 1000;
}


  1.  Then, Sean replied following: “Thank you, it does, and I think it will 
work for most splash images. However, the way it's written in my patch accounts 
for the Image size. This will handle splash images that are equal to, or larger 
than the resolution of the display. “


  1.  Then, I replied “The logic I shared below is from the LogoDxe driver 
which produces EDKII_PLATFORM_LOGO_PROTOCOL. This driver should know the image 
size and it can account for the image size.”
Then, I don’t think we are talking in the same page. Maybe I didn’t understand 
your problem, maybe you didn’t understand my above sample code.
Thanks,
Ray



From: Sheng Lean Tan 
Sent: Monday, March 20, 2023 4:12 PM
To: devel@edk2.groups.io; Ni, Ray ; Kinney, Michael D 

Cc: Rhodes, Sean ; Gao, Zhichao ; 
Wang, Jian J ; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control 
the position of the Logo

Hi Ray,
Any feedback per Mic feedback?
On 15. Mar 2023, at 16:35, Michael D Kinney 
mailto:michael.d.kin...@intel.com>> wrote:

HI Ray,

I think it is a reasonable request to have the EDK II logo driver support 
multiple standards for the logo location.  Especially if they are documented in 
public specifications.

The additional conditions of supporting a logo larger than the display 
resolution also looks like a good corner case to cover no matter what logo 
location standard is used.

Perhaps a single PCD that is a enum of logo locations.  Default 0x00 can be EDK 
II default that is centered in the display.  0x01 can be BGRT.  Leaves from for 
more if there are additional public standard logo locations.

Mike


From: Ni, Ray mailto:ray...@intel.com>>
Sent: Wednesday, March 15, 2023 2:24 AM
To: devel@edk2.groups.io; Rhodes, Sean 
mailto:sean@starlabs.systems>>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Gao, Zhichao 
mailto:zhichao@intel.com>>; Wang, Jian J 
mailto:jian.j.w...@intel.com>>; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
Subject: RE: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control 
the position of the Logo

What’s the meaning of “have both options”?
If you want to support two cases, put the logic in your platform specific Logo 
driver.
This Logo driver is just for reference.

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Sean Rhodes
Sent: Friday, March 10, 2023 9:43 PM
To: Ni, Ray mailto:ray...@intel.com>>
Cc: devel@edk2.groups.io; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Gao, Zhichao 
mailto:zhichao@intel.com>>; Wang, Jian J 
mailto:jian.j.w...@intel.com>>; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
Subject: Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control 
the position of the Logo

Hi Ray

> You can return a carefully-calculated X/Y value to make the 
> logo at MS preferred position.
As we discussed before, we need to have both options.

Thanks

Sean

On Wed, 8 Mar 2023 at 09:01, Ni, Ray 
mailto:ray...@intel.com>> wrote:
Maybe I didn’t explain my idea clearly.
That is:
You can get the screen resolution in the code that produces 
Logo protocol.
You can return a carefully-calculated X/Y value to make the 
logo at MS preferred position.

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Ni, Ray
Sent: Wednesday, October 26, 2022 10:32 AM
To: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; 
devel@edk2.groups.io; Rhodes, Sean 
mailto:sean@starlabs.systems>>
Cc: Gao, Zhichao mailto:zhichao@intel.com>>; Wang, 
Jian J mailto:jian.j.w...@intel.com>>; Gao, Liming 
mailto:gaolim...@byosoft.com.cn>>
Subject: Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control 
the position of the Logo

Are you suggesting that the exiting logic be updated for this use case without 
adding a new enum?

  1.  yes.

From: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>
Sent: Wednesday, October 26, 2022 12:21 AM
To: devel@edk2.groups.io; Ni, Ray 

Re: [edk2-devel] [PATCH v3 00/11] OvmfPkg: add Crypto Driver support

2023-03-20 Thread Gerd Hoffmann
On Thu, Mar 09, 2023 at 12:09:23PM +0100, Gerd Hoffmann wrote:
> v3 changes:
>  - rebase to latest master.
>  - enable crypto driver only for SMM + DXE.
>  - CI passes now \o/

Ping.  Any comments on this series?

take care,
  Gerd



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




Re: [edk2-devel] [PATCH RESEND 4/4] OvmfPkg/CcExitLib: Use documented XSave area base size for SEV-SNP

2023-03-20 Thread Gerd Hoffmann
On Wed, Mar 15, 2023 at 04:57:47PM -0500, Michael Roth wrote:
> Currently OVMF tries to rely on the base size advertised via the CPUID
> table entries corresponding to leaf 0xD, sub-leafs 0x0/0x1. This will
> generally work for KVM guests, but might not for other SEV-SNP
> hypervisor implementations. Make the handling more robust by simply
> using the base area size documented by the APM.
> 
> Reviewed-by: Tom Lendacky 
> Acked-by: Jiewen Yao 
> Signed-off-by: Michael Roth 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH RESEND 3/4] OvmfPkg/CcExitLib: Fix SEV-SNP XSave area size calculation

2023-03-20 Thread Gerd Hoffmann
On Wed, Mar 15, 2023 at 04:57:46PM -0500, Michael Roth wrote:
> CPUID leaf 0xD sub-leafs 0x0 and 0x1 contain cumulative sizes for the
> enabled XSave areas. Those sizes are calculated by tallying up all the
> other sub-leafs that contain per-area size information for XSave areas
> that are currently enabled in XCr0/XSS. The current check has the logic
> inverted. Fix that.
> 
> This doesn't seem to cause problems currently, but could in the future
> if OVMF made more extensive use of XSave areas. It was noticed while
> implementing SNP-related tests for KVM Unit Tests, which re-uses the
> OVMF #VC handler in some cases.

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH RESEND 2/4] OvmfPkg/AmdSevDxe: Update ConfidentialComputing blob struct definition

2023-03-20 Thread Gerd Hoffmann
On Wed, Mar 15, 2023 at 04:57:45PM -0500, Roth, Michael via groups.io wrote:
> The Confidential Computing blob defined here is intended to match the
> definition defined by linux guest kernel. Previously, both definitions
> relied on natural alignment, but that relies on both OVMF and kernel
> being compiled as 64-bit. While there aren't currently any plans to
> enable SNP support for 32-bit compilations, the kernel definition has
> since been updated to use explicit padding/reserved fields to avoid
> this dependency. Update OVMF to match that definition.
> 
> While at it, also fix up the Reserved fields to match the numbering
> used in the kernel.
> 
> No functional changes (for currently-supported environments, at least).
> 
> Reviewed-by: Tom Lendacky 
> Acked-by: Jiewen Yao 
> Signed-off-by: Michael Roth 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH RESEND 1/4] OvmfPkg/AmdSevDxe: Allocate SEV-SNP CC blob as EfiACPIReclaimMemory

2023-03-20 Thread Gerd Hoffmann
On Wed, Mar 15, 2023 at 04:57:44PM -0500, Michael Roth wrote:
> The SEV-SNP Confidential Computing blob contains metadata that should
> remain accessible for the life of the guest. Allocate it as
> EfiACPIReclaimMemory to ensure the memory isn't overwritten by the guest
> operating system later.
> 
> Reported-by: Dov Murik 
> Suggested-by: Dov Murik 
> Reviewed-by: Dov Murik 
> Reviewed-by: Tom Lendacky 
> Signed-off-by: Michael Roth 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH 1/3] BaseTools: Allow users to specify compiler to use with make CC= CXX=

2023-03-20 Thread Gerd Hoffmann
On Fri, Mar 17, 2023 at 04:43:24AM -0600, Rebecca Cran wrote:
> On 3/15/23 4:07 AM, Gerd Hoffmann wrote:
> > > Rework the BaseTools Makefiles removing the 'BUILD_' prefix (BUILD_CC
> > > and BUILD_CXX) and using the standard name 'LDFLAGS' instead of
> > > 'LFLAGS'. This allows clang to be used by running
> > > 'make -C BaseTools CC=clang CXX=clang++'.
> > Hmm, not sure this is a good idea.  I suspect there was some reason to
> > use BUILD_CC instead of CC in the first place ...
> 
> It looks like the change to use BUILD_CC was introduced by Liming in:
> 
> 
>     BaseTools GnuMakefile: Update GCC Flags to the specific one with BUILD_
> prefix
> 
>     To avoid the conflict with the default GCC flag name, BUILD_ prefix is
> added.
> 
>     Cc: Giri P Mudusuru 
>     Cc: Yonghong Zhu 
>     Contributed-under: TianoCore Contribution Agreement 1.0
>     Signed-off-by: Liming Gao 
>     Reviewed-by: Yonghong Zhu 
>     Reviewed-by: Giri P Mudusuru 
> 
> 
> I don't understand how that would help, and I'm wondering if it was perhaps
> the result of a misunderstanding.

Hmm, neither the commit message nor the patch itself have any hints of
actual problems fixed.  The "conflict" notion indeed hints this might
have been a misunderstanding.

So, going back to just use CC + CFLAGS + friends looks fine to me.

The suggestion to simply not set CC stands stands.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101416): https://edk2.groups.io/g/devel/message/101416
Mute This Topic: https://groups.io/mt/97022154/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 2/2][RESEND] PlatformPayloadFeaturePkg.py: Add Linux support

2023-03-20 Thread Patrick Rudolph
- Use OS specific path seperator instead of hardcoding ';'
- Fix case of build artifact FV/PLATFORMPAYLOAD.Fv

Test:
python Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
works on Linux.

Signed-off-by: Patrick Rudolph 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4358
---
 Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py 
b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
index 2fbb8215..51aa8de5 100644
--- a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
+++ b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
@@ -38,7 +38,7 @@ def BuildUniversalPayload(Args, MacroList):
 # Find universal UEFI payload build build script
 #
 Edk2PayloadBuildScript = 
os.path.normpath("UefiPayloadPkg/UniversalPayloadBuild.py")
-for package_path in os.environ['PACKAGES_PATH'].split(';'):
+for package_path in os.environ['PACKAGES_PATH'].split(os.pathsep):
 if os.path.exists (os.path.join (package_path, 
Edk2PayloadBuildScript)):
 Edk2PayloadBuildScript = os.path.join (package_path, 
Edk2PayloadBuildScript)
 break
@@ -49,7 +49,7 @@ def BuildUniversalPayload(Args, MacroList):
 BuildDir   = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/UefiPayloadPkgX64"))
 PlatformFvReportPath   = os.path.join(BuildDir, 
"PlatformPayloadReport.txt")
 UniversalUefiPld   = os.path.join(BuildDir, 'UniversalPayload.elf')
-PlatformFv = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/PlatformPayloadFeaturePkg"), 
f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/PlatformPayload.Fv"))
+PlatformFv = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/PlatformPayloadFeaturePkg"), 
f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/PLATFORMPAYLOAD.Fv"))
 
 if "CLANG_BIN" in os.environ:
 LlvmObjcopyPath = os.path.join(os.environ["CLANG_BIN"], "llvm-objcopy")
-- 
2.39.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101415): https://edk2.groups.io/g/devel/message/101415
Mute This Topic: https://groups.io/mt/97727098/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 1/2][RESEND] PlatformPayloadFeaturePkg.dsc: Add missing packages

2023-03-20 Thread Patrick Rudolph
Add package that are required to build PlatformPayloadFeaturePkg.

Test:
Running python 
Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
generates a FV.

Signed-off-by: Patrick Rudolph 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4359
---
 Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc 
b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc
index e36e5d6e..9dcd1da6 100644
--- a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc
+++ b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc
@@ -33,6 +33,9 @@
 
 [Packages]
   MinPlatformPkg/MinPlatformPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  UefiPayloadPkg/UefiPayloadPkg.dec
 
 

 #
-- 
2.39.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101414): https://edk2.groups.io/g/devel/message/101414
Mute This Topic: https://groups.io/mt/97727097/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/3] RedfishPkg/Library: Redfish BMC USBNIC Host Interface

2023-03-20 Thread Nickle Wang via groups.io
Thanks for addressing my comments.

Reviewed-by: Nickle Wang 

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com  
Sent: Monday, March 20, 2023 4:14 PM
To: devel@edk2.groups.io
Cc: Nickle Wang ; Igor Kulchytskyy 
Subject: [PATCH v2 1/3] RedfishPkg/Library: Redfish BMC USBNIC Host Interface

External email: Use caution opening links or attachments


From: Abner Chang 

BMC exposed USB NIC platform Redfish Host Interface
library implementation.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |   10 +
 .../PlatformHostInterfaceBmcUsbNicLib.inf |   48 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |3 +-
 .../PlatformHostInterfaceBmcUsbNicLib.h   |   84 ++
 .../PlatformHostInterfaceBmcUsbNicLib.c   | 1291 +
 5 files changed, 1435 insertions(+), 1 deletion(-)
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 53e52c2b008..42d28d6dac3 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -113,3 +113,13 @@
   # Default is set to not add.
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExAddingExpect|FALSE|BOOLEAN|0x1004
+  #
+  # Use PCD to declare the Redfish host nmae becasue there is no
+  # specification for that.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName|"Redfish 
service"|VOID*|0x1005
+  #
+  # Use PCD to declare the Redfish service UUID becasue there is no
+  # specification for that.
+  #
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid|L"----"|VOID*|0x1006
diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
new file mode 100644
index 000..f2c7d7fec89
--- /dev/null
+++ 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
@@ -0,0 +1,48 @@
+## @file
+#  Module to provide the platform Redfish Host Interface information
+#  of USB NIC Device exposed by BMC.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001000b
+  BASE_NAME  = PlatformHostInterfaceBmcUsbNicLib
+  FILE_GUID  = C4837B58-225E-4352-8FDC-4C52A5D65891
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = PlatformHostInterfaceBmcUsbNicLib
+
+[Sources]
+  PlatformHostInterfaceBmcUsbNicLib.c
+  PlatformHostInterfaceBmcUsbNicLib.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  NetworkPkg/NetworkPkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IpmiLib
+  IpmiCommandLib
+  MemoryAllocationLib
+  UefiLib
+  UefiBootServicesTableLib
+
+[Protocols]
+  gEfiSimpleNetworkProtocolGuid ## CONSUMED
+  gEfiUsbIoProtocolGuid ## CONSUMED
+  gEfiDevicePathProtocolGuid## CONSUMED
+
+[Pcd]
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName ## CONSUMED
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid  ## CONSUMED
+
+[Depex]
+  gIpmiProtocolGuid
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index 21f01353ede..913f2b2f358 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -14,7 +14,8 @@
 #include 
 #include 

-#define DEBUG_REDFISH_NETWORK  DEBUG_INFO   ///< Debug error level for Redfish 
networking function
+#define DEBUG_REDFISH_NETWORK DEBUG_INFO   ///< Debug error level for 
Redfish networking function
+#define DEBUG_REDFISH_HOST_INTERFACE  DEBUG_INFO   ///< Debug error level for 
Redfish networking function

 /**

diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
new file mode 100644
index 000..669c304fc3d
--- /dev/null
+++ 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
@@ -0,0 +1,84 @@
+/** @file
+  Header file to provide the platform Redfish Host Interface information
+  of USB NIC Device exposed by BMC.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef PLATFORM_HOST_INTERFACE_BMC_USB_NIC_LIB_H_
+#define 

[edk2-devel] [PATCH v2 1/1] ArmPkg/SmbiosMiscDxe: Adjust the priority of getting firmware version

2023-03-20 Thread Tinh Nguyen via groups.io
The BIOS Firmware Version in the SMBIOS Type 0 can be fetched from
the fixed PcdFirmwareVersionString or platform specific OemMiscLib.
In fact, the support from OemMiscLib comes into play when the firmware
version may be modified at boot time for extended information.
Therefore, the priority of getting the version from OemMiscLib should
be higher.

In case there is no modification in the OemMiscLib, we have to keep
HII string STR_MISC_BIOS_VERSION empty or 'Not Specified'
to indicate that the firmware version should be fetched from
the PcdFirmwareVersionString.

Signed-off-by: Tinh Nguyen 
---

Changes since v1:
  + Change GetBiosVersion () to SetBiosVersion () and move the selection logic
  fully into SetBiosVersion ().

 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 58 

 1 file changed, 36 insertions(+), 22 deletions(-)

diff --git 
a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c 
b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
index 66ead22a6e2c..01cf4dd16c4f 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
+  Copyright (c) 2022 - 2023, Ampere Computing LLC. All rights reserved.
   Copyright (c) 2021, NUVIA Inc. All rights reserved.
   Copyright (c) 2009, Intel Corporation. All rights reserved.
   Copyright (c) 2015, Hisilicon Limited. All rights reserved.
@@ -124,22 +124,47 @@ GetBiosReleaseDate (
   return ReleaseDate;
 }
 
-/**
-  Fetches the firmware ('BIOS') version from the
-  FirmwareVersionInfo HOB.
+/**  Fetches the Firmware version string for SMBIOS type 0
 
-  @return The version as a UTF-16 string
+  This function get the Firmware version string from OemMiscLib first,
+  if it is invalid then PcdFirmwareVersionString is used as a fallback.
+
+  @retval  VOID
 **/
-CHAR16 *
-GetBiosVersion (
+VOID
+SetBiosVersion (
   VOID
   )
 {
-  CHAR16  *ReleaseString;
+  CHAR16 *DefaultVersionString;
+  CHAR16 *Version;
+  EFI_STRING_ID  TokenToUpdate;
 
-  ReleaseString = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString);
+  DefaultVersionString = HiiGetString (
+   mSmbiosMiscHiiHandle,
+   STRING_TOKEN (STR_MISC_BIOS_VERSION),
+   NULL
+   );
 
-  return ReleaseString;
+  OemUpdateSmbiosInfo (
+mSmbiosMiscHiiHandle,
+STRING_TOKEN (STR_MISC_BIOS_VERSION),
+BiosVersionType00
+);
+
+  Version = HiiGetString (
+  mSmbiosMiscHiiHandle,
+  STRING_TOKEN (STR_MISC_BIOS_VERSION),
+  NULL
+  );
+
+  if (((StrCmp (Version, DefaultVersionString) == 0) || (StrLen (Version) == 
0))) {
+Version = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString);
+if (StrLen (Version) > 0) {
+  TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
+  HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
+}
+  }
 }
 
 /**
@@ -187,18 +212,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
 HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL);
   }
 
-  Version = GetBiosVersion ();
-
-  if (StrLen (Version) > 0) {
-TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
-HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
-  } else {
-OemUpdateSmbiosInfo (
-  mSmbiosMiscHiiHandle,
-  STRING_TOKEN (STR_MISC_BIOS_VERSION),
-  BiosVersionType00
-  );
-  }
+  SetBiosVersion ();
 
   Char16String = GetBiosReleaseDate ();
   if (StrLen (Char16String) > 0) {
--
2.39.2


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




Re: [edk2-devel] [edk2-platforms][PATCH V2 4/8] ManageabilityPkg: Add ManageabilityTransportHelperLib

2023-03-20 Thread Nickle Wang via groups.io
Please find my comment inline below.

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com  
Sent: Wednesday, March 8, 2023 10:17 PM
To: devel@edk2.groups.io
Cc: Liming Gao ; Isaac Oram ; 
Nate DeSimone ; Nickle Wang 
; Igor Kulchytskyy ; Abdul Lateef Attar 

Subject: [edk2-platforms][PATCH V2 4/8] ManageabilityPkg: Add 
ManageabilityTransportHelperLib

External email: Use caution opening links or attachments


From: Abner Chang 

The helper functions library facilitates reducing duplicated code in the 
manageability transport library instances.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Abdul Lateef Attar 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |  23 +-
 .../Include/Dsc/Manageability.dsc |   2 +
 .../BaseManageabilityTransportHelper.inf  |  40 +++
 .../Library/ManageabilityTransportHelperLib.h |  93 +++
 .../BaseManageabilityTransportHelper.c| 242 ++
 .../BaseManageabilityTransportHelper.uni  |  13 +
 6 files changed, 412 insertions(+), 1 deletion(-)  create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.c
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index ebf6e6315e..ebbb04dc0e 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -22,6 +22,27 @@
   #   Manageability Transport Library definitions
   ManageabilityTransportLib|Include/Library/ManageabilityTransportLib.h

+  ##  @libraryclass Manageability Transport Helper Library
+  #   Provide the help functions to use ManageabilityTransportLib
+  
+ ManageabilityTransportHelperLib|Include/Library/ManageabilityTransport
+ HelperLib.h
+
 [Guids]
-  gManageabilityPkgTokenSpaceGuid = { 0xBDEFFF48, 0x1C31, 0x49CD, { 0xA7, 
0x6D, 0x92, 0x9E, 0x60, 0xDB, 0xB9, 0xF8 } }
+  gManageabilityPkgTokenSpaceGuid   = { 0xBDEFFF48, 0x1C31, 0x49CD, { 0xA7, 
0x6D, 0x92, 0x9E, 0x60, 0xDB, 0xB9, 0xF8 } }
+
+  # Manageability Transport Interface type  #  # Manageability 
+ Transport KCS
+  gManageabilityTransportKcsGuid= { 0x5A6E64E9, 0xFD47, 0x4086, { 0xAA, 
0xB0, 0x7A, 0x5F, 0xD7, 0x6B, 0x02, 0x2E } }
+  # Manageability Transport I2C
+  gManageabilityTransportI2CGuid= { 0x5B174658, 0x8263, 0x4CB8, { 0xA0, 
0x0F, 0xD6, 0x82, 0xE6, 0xBC, 0x74, 0x93 } }
+  # Manageability Transport PCI VDM
+  gManageabilityTransportPciVdmGuid = { 0x388021A7, 0xFB59, 0x4811, { 
+ 0x9D, 0xA7, 0xD5, 0x63, 0x7D, 0x04, 0xA7, 0x2F } }

+  # Manageability Protocol Specification  #  # Manageability Protocol 
+ IPMI
+  gManageabilityProtocolIpmiGuid= { 0x36ACA47C, 0xCC80, 0x473B, { 0xAB, 
0xEC, 0xF3, 0x98, 0xFF, 0x87, 0x74, 0x5B } }
+  # Manageability Protocol MCTP
+  gManageabilityProtocolMctpGuid= { 0x76FED8F1, 0x0BE5, 0x4269, { 0xA3, 
0x1A, 0x38, 0x0F, 0x54, 0xF1, 0xA1, 0x8A } }
+  # Manageability Protocol PLDM
+  gManageabilityProtocolPldmGuid= { 0x3958090D, 0x69DD, 0x4868, { 0x9C, 
0x41, 0xC9, 0xAC, 0x31, 0xB5, 0x25, 0xC5 } }
diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
index 2cb63c1ca6..994c93f17c 100644
--- a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -5,6 +5,8 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ##
+[LibraryClasses]
+  
+ManageabilityTransportHelperLib|ManageabilityPkg/Library/BaseManageabil
+ityTransportHelperLib/BaseManageabilityTransportHelper.inf

 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #
diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
new file mode 100644
index 00..39abcbcb53
--- /dev/null
+++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelper
+++ Lib/BaseManageabilityTransportHelper.inf
@@ -0,0 +1,40 @@
+## @file
+# Null instance of Manageability Transport Helper Library # # Copyright 
+(C) 2023 Advanced Micro Devices, Inc. All rights reserved. # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  INF_VERSION= 0x0001001B
+  BASE_NAME  = BaseManageabilityTransportHelper
+  MODULE_UNI_FILE= BaseManageabilityTransportHelper.uni
+  FILE_GUID  = 52F2DE11-A8FC-4A06-B8C6-10DCF4A7397C
+  MODULE_TYPE

Re: [edk2-devel] [PATCH 1/3] RedfishPkg/Library: Redfish BMC USBNIC Host Interface

2023-03-20 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Nickle,
Thanks for those good comments. V2 patch was just sent!

Abner

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, March 20, 2023 11:13 AM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy 
> Subject: RE: [PATCH 1/3] RedfishPkg/Library: Redfish BMC USBNIC Host
> Interface
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Please find my comment inline below, thanks!
> 
> Regards,
> Nickle
> 
> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Thursday, March 9, 2023 11:41 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [PATCH 1/3] RedfishPkg/Library: Redfish BMC USBNIC Host Interface
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> BMC exposed USB NIC platform Redfish Host Interface library
> implementation.
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  RedfishPkg/RedfishPkg.dec |   10 +
>  .../PlatformHostInterfaceBmcUsbNicLib.inf |   48 +
>  RedfishPkg/Include/Library/RedfishDebugLib.h  |3 +-
>  .../PlatformHostInterfaceBmcUsbNicLib.h   |   84 ++
>  .../PlatformHostInterfaceBmcUsbNicLib.c   | 1280 +
>  5 files changed, 1424 insertions(+), 1 deletion(-)  create mode 100644
> RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterf
> aceBmcUsbNicLib.inf
>  create mode 100644
> RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterf
> aceBmcUsbNicLib.h
>  create mode 100644
> RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterf
> aceBmcUsbNicLib.c
> 
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index
> 53e52c2b008..251aa5e2b76 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -113,3 +113,13 @@
># Default is set to not add.
>#
> 
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExAddingExpect|FALSE|BOO
> LEAN|0x1004
> +  #
> +  # Use PCD to declare the Redfish host nmae becasue there is no  #
> + specification for that.
> +  #
> +
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName|""|VOID*|0x100
> 5
> +  #
> +  # Use PCD to declare the Redfish service UUID becasue there is no  #
> + specification for that.
> +  #
> +
> +
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid|L""|VOID*|0x1
> 00
> + 6
> 
> Would it be good to provide dummy string for above PCDs? For example:
> 
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName|"edk2_redfishpkg"|V
> OID*|0x1005
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid|L"
> "|VOID*|0x100
> 
> diff --git
> a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte
> rfaceBmcUsbNicLib.inf
> b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte
> rfaceBmcUsbNicLib.inf
> new file mode 100644
> index 000..f2c7d7fec89
> --- /dev/null
> +++
> b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostI
> +++ nterfaceBmcUsbNicLib.inf
> @@ -0,0 +1,48 @@
> +## @file
> +#  Module to provide the platform Redfish Host Interface information #
> +of USB NIC Device exposed by BMC.
> +#
> +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> +
> +[Defines]
> +  INF_VERSION= 0x0001000b
> +  BASE_NAME  = PlatformHostInterfaceBmcUsbNicLib
> +  FILE_GUID  = C4837B58-225E-4352-8FDC-4C52A5D65891
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = PlatformHostInterfaceBmcUsbNicLib
> +
> +[Sources]
> +  PlatformHostInterfaceBmcUsbNicLib.c
> +  PlatformHostInterfaceBmcUsbNicLib.h
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  NetworkPkg/NetworkPkg.dec
> +  RedfishPkg/RedfishPkg.dec
> +
> +[LibraryClasses]
> +  BaseMemoryLib
> +  DebugLib
> +  IpmiLib
> +  IpmiCommandLib
> +  MemoryAllocationLib
> +  UefiLib
> +  UefiBootServicesTableLib
> +
> +[Protocols]
> +  gEfiSimpleNetworkProtocolGuid ## CONSUMED
> +  gEfiUsbIoProtocolGuid ## CONSUMED
> +  gEfiDevicePathProtocolGuid## CONSUMED
> +
> +[Pcd]
> +  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName ## CONSUMED
> +  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid  ## CONSUMED
> +
> +[Depex]
> +  gIpmiProtocolGuid
> diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h
> b/RedfishPkg/Include/Library/RedfishDebugLib.h
> index 21f01353ede..913f2b2f358 100644
> --- a/RedfishPkg/Include/Library/RedfishDebugLib.h
> +++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
> @@ -14,7 +14,8 @@
>  #include 
>  #include 
> 
> -#define DEBUG_REDFISH_NETWORK  DEBUG_INFO   ///< Debug error level
> for Redfish 

[edk2-devel] [PATCH v2 1/3] RedfishPkg/Library: Redfish BMC USBNIC Host Interface

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

BMC exposed USB NIC platform Redfish Host Interface
library implementation.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |   10 +
 .../PlatformHostInterfaceBmcUsbNicLib.inf |   48 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |3 +-
 .../PlatformHostInterfaceBmcUsbNicLib.h   |   84 ++
 .../PlatformHostInterfaceBmcUsbNicLib.c   | 1291 +
 5 files changed, 1435 insertions(+), 1 deletion(-)
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 53e52c2b008..42d28d6dac3 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -113,3 +113,13 @@
   # Default is set to not add.
   #
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExAddingExpect|FALSE|BOOLEAN|0x1004
+  #
+  # Use PCD to declare the Redfish host nmae becasue there is no
+  # specification for that.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName|"Redfish 
service"|VOID*|0x1005
+  #
+  # Use PCD to declare the Redfish service UUID becasue there is no
+  # specification for that.
+  #
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid|L"----"|VOID*|0x1006
diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
new file mode 100644
index 000..f2c7d7fec89
--- /dev/null
+++ 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
@@ -0,0 +1,48 @@
+## @file
+#  Module to provide the platform Redfish Host Interface information
+#  of USB NIC Device exposed by BMC.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001000b
+  BASE_NAME  = PlatformHostInterfaceBmcUsbNicLib
+  FILE_GUID  = C4837B58-225E-4352-8FDC-4C52A5D65891
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = PlatformHostInterfaceBmcUsbNicLib
+
+[Sources]
+  PlatformHostInterfaceBmcUsbNicLib.c
+  PlatformHostInterfaceBmcUsbNicLib.h
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  NetworkPkg/NetworkPkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IpmiLib
+  IpmiCommandLib
+  MemoryAllocationLib
+  UefiLib
+  UefiBootServicesTableLib
+
+[Protocols]
+  gEfiSimpleNetworkProtocolGuid ## CONSUMED
+  gEfiUsbIoProtocolGuid ## CONSUMED
+  gEfiDevicePathProtocolGuid## CONSUMED
+
+[Pcd]
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishHostName ## CONSUMED
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishServiceUuid  ## CONSUMED
+
+[Depex]
+  gIpmiProtocolGuid
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index 21f01353ede..913f2b2f358 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -14,7 +14,8 @@
 #include 
 #include 
 
-#define DEBUG_REDFISH_NETWORK  DEBUG_INFO   ///< Debug error level for Redfish 
networking function
+#define DEBUG_REDFISH_NETWORK DEBUG_INFO   ///< Debug error level for 
Redfish networking function
+#define DEBUG_REDFISH_HOST_INTERFACE  DEBUG_INFO   ///< Debug error level for 
Redfish networking function
 
 /**
 
diff --git 
a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
new file mode 100644
index 000..669c304fc3d
--- /dev/null
+++ 
b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
@@ -0,0 +1,84 @@
+/** @file
+  Header file to provide the platform Redfish Host Interface information
+  of USB NIC Device exposed by BMC.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef PLATFORM_HOST_INTERFACE_BMC_USB_NIC_LIB_H_
+#define PLATFORM_HOST_INTERFACE_BMC_USB_NIC_LIB_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define BMC_USB_NIC_HOST_INTERFASCE_READINESS_GUID \
+{  \
+  0xDD96F5D7, 0x4AE1, 0x4E6C, {0xA1, 0x30, 0xA5, 0xAC, 0x77, 0xDD, 

[edk2-devel] [PATCH v2 2/3] RedfishPkg: Update Redfish DSC

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

Update Redfish DSC for
PlatformHostInterfaceBmcUsbNicLib.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Nickle Wang 
---
 RedfishPkg/RedfishPkg.dsc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index cf25b63cc29..223ab72c1db 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -3,6 +3,7 @@
 #
 # Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
 # (C) Copyright 2021 Hewlett-Packard Enterprise Development LP.
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -34,6 +35,7 @@
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   
RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
+  
RedfishPlatformHostInterfaceLib|RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
   HttpLib|NetworkPkg/Library/DxeHttpLib/DxeHttpLib.inf
   HttpIoLib|NetworkPkg/Library/DxeHttpIoLib/DxeHttpIoLib.inf
   NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
@@ -41,6 +43,10 @@
   
RedfishPlatformCredentialLib|RedfishPkg/Library/PlatformCredentialLibNull/PlatformCredentialLibNull.inf
   
RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/RedfishContentCodingLibNull.inf
 
+  # NULL instance of IPMI related library.
+  IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
+  
IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
+
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #
   # This library provides the instrinsic functions generated by a given 
compiler.
@@ -51,6 +57,7 @@
 
 [Components]
   
RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
+  
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
   RedfishPkg/Library/PlatformCredentialLibNull/PlatformCredentialLibNull.inf
   
RedfishPkg/Library/RedfishContentCodingLibNull/RedfishContentCodingLibNull.inf
   RedfishPkg/Library/DxeRestExLib/DxeRestExLib.inf
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH v2 0/3] BMC USBNIC Platform HI Lib

2023-03-20 Thread Chang, Abner via groups.io
From: Abner Chang 

In V2: Address review comments.

BZ #: 4282
Implement the platform Redfish host interface library that
uses IPMI commands to get the network information of
BMC-exposed USB NIC for building up the SMBIOS type 42
record.

The prerequisites: BZ #4213, 4214 and 4231

Check "Platform with BMC and the BMC-Exposed USB Network Device"
section in readme.md for the design of implementation.

PR: https://github.com/tianocore/edk2/pull/4101

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 

Abner Chang (3):
  RedfishPkg/Library: Redfish BMC USBNIC Host Interface
  RedfishPkg: Update Redfish DSC
  RedfishPkg: Update Readme.md

 RedfishPkg/RedfishPkg.dec |   10 +
 RedfishPkg/RedfishPkg.dsc |7 +
 .../PlatformHostInterfaceBmcUsbNicLib.inf |   48 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |3 +-
 .../PlatformHostInterfaceBmcUsbNicLib.h   |   84 ++
 .../PlatformHostInterfaceBmcUsbNicLib.c   | 1291 +
 RedfishPkg/Readme.md  |  112 +-
 .../Documents/Media/BmcExposedUsbNic.svg  |  283 
 .../Media/EmualtorPlatformLibrary.svg |  286 
 .../Media/PlatformWihtBmcLibrary.svg  |  328 +
 10 files changed, 2443 insertions(+), 9 deletions(-)
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.inf
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.h
 create mode 100644 
RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInterfaceBmcUsbNicLib.c
 create mode 100644 RedfishPkg/Documents/Media/BmcExposedUsbNic.svg
 create mode 100644 RedfishPkg/Documents/Media/EmualtorPlatformLibrary.svg
 create mode 100644 RedfishPkg/Documents/Media/PlatformWihtBmcLibrary.svg

-- 
2.37.1.windows.1



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




Re: [edk2-devel] [edk2-platforms][PATCH V2 3/8] ManageabilityPkg: Add NULL ManageabilityTransportLib

2023-03-20 Thread Nickle Wang via groups.io
Reviewed-by: Nickle Wang 

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com  
Sent: Wednesday, March 8, 2023 10:17 PM
To: devel@edk2.groups.io
Cc: Liming Gao ; Isaac Oram ; 
Nate DeSimone ; Nickle Wang 
; Igor Kulchytskyy ; Abdul Lateef Attar 

Subject: [edk2-platforms][PATCH V2 3/8] ManageabilityPkg: Add NULL 
ManageabilityTransportLib

External email: Use caution opening links or attachments


From: Abner Chang 

The NULL instance of ManageabilityTransportLib library.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Abdul Lateef Attar 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |   9 +
 .../ManageabilityPkg/ManageabilityPkg.dsc |   4 +-
 .../BaseManageabilityTransportNull.inf|  28 ++
 .../Library/ManageabilityTransportIpmiLib.h   |  24 ++
 .../Library/ManageabilityTransportLib.h   | 335 ++
 .../BaseManageabilityTransportNull.c  |  64 
 .../BaseManageabilityTransportNull.uni|  13 +
 7 files changed, 476 insertions(+), 1 deletion(-)  create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
 create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.c
 create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 8a0e28f50b..ebf6e6315e 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -16,3 +16,12 @@

 [Includes]
   Include
+
+[LibraryClasses]
+  ##  @libraryclass Manageability Transport Library
+  #   Manageability Transport Library definitions
+  ManageabilityTransportLib|Include/Library/ManageabilityTransportLib.h
+
+[Guids]
+  gManageabilityPkgTokenSpaceGuid = { 0xBDEFFF48, 0x1C31, 0x49CD, { 
+0xA7, 0x6D, 0x92, 0x9E, 0x60, 0xDB, 0xB9, 0xF8 } }
+
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index 46cc215a0f..0dd0ab41fc 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -36,5 +36,7 @@
 !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
 !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc

-!include Include/Dsc/Manageability.dsc
+[LibraryClasses]
+  
+ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTra
+nsportNullLib/BaseManageabilityTransportNull.inf

+!include Include/Dsc/Manageability.dsc
diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
new file mode 100644
index 00..3cb97afb8b
--- /dev/null
+++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLi
+++ b/BaseManageabilityTransportNull.inf
@@ -0,0 +1,28 @@
+## @file
+# Null instance of Manageability Transport Library # # Copyright (C) 
+2023 Advanced Micro Devices, Inc. All rights reserved. # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  INF_VERSION= 0x0001001B
+  BASE_NAME  = BaseManageabilityTransportNull
+  MODULE_UNI_FILE= BaseManageabilityTransportNull.uni
+  FILE_GUID  = B63DC070-FB44-44F3-8E9A-DA6CC712EF4F
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = ManageabilityTransportLib
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  BaseManageabilityTransportNull.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
new file mode 100644
index 00..7ca6acf6ef
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIp
+++ miLib.h
@@ -0,0 +1,24 @@
+/** @file
+
+  This file defines the manageability IPMI protocol specific transport data.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent **/
+
+#ifndef MANAGEABILITY_TRANSPORT_IPMI_LIB_H_
+#define MANAGEABILITY_TRANSPORT_IPMI_LIB_H_
+
+#include 
+
+///
+/// The IPMI command header which is apart from /// the payload.
+///
+typedef struct {
+  UINT8NetFn;
+  UINT8Lun;
+  UINT8Command;
+} MANAGEABILITY_IPMI_TRANSPORT_HEADER;
+
+#endif
diff --git 

Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo

2023-03-20 Thread Sheng Lean Tan
Hi Ray,Any feedback per Mic feedback?On 15. Mar 2023, at 16:35, Michael D Kinney  wrote:









HI Ray,
 
I think it is a reasonable request to have the EDK II logo driver support multiple standards for the logo location. 
Especially if they are documented in public specifications.
 
The additional conditions of supporting a logo larger than the display resolution also looks like a good corner case to cover
 no matter what logo location standard is used.
 
Perhaps a single PCD that is
a enum of logo locations. 
Default 0x00 can be EDK II default that is centered in the display. 
0x01 can be BGRT.  Leaves from for more if there are additional public standard logo locations.
 
Mike
 
 



From: Ni, Ray 

Sent: Wednesday, March 15, 2023 2:24 AM
To: devel@edk2.groups.io; Rhodes, Sean 
Cc: Kinney, Michael D ; Gao, Zhichao ; Wang, Jian J ; Gao, Liming 
Subject: RE: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo


 
What’s the meaning of “have both options”?
If you want to support two cases, put the logic in your platform specific Logo driver.
This Logo driver is just for reference.
 



From: 
devel@edk2.groups.io 
On Behalf Of Sean Rhodes
Sent: Friday, March 10, 2023 9:43 PM
To: Ni, Ray 
Cc: devel@edk2.groups.io; Kinney, Michael D ; Gao, Zhichao ; Wang,
 Jian J ; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo


 



Hi Ray


 


> You can return a carefully-calculated X/Y value to make the logo at MS preferred position.

As we discussed before, we need to have both options.


 


Thanks


 


Sean

 


On Wed, 8 Mar 2023 at 09:01, Ni, Ray  wrote:





Maybe I didn’t explain my idea clearly.
That is:
    You can get the screen resolution in the code that produces Logo protocol.
    You can return a carefully-calculated X/Y value to make the logo at MS preferred position.
 



From: devel@edk2.groups.io 
On Behalf Of Ni, Ray
Sent: Wednesday, October 26, 2022 10:32 AM
To: Kinney, Michael D ;
devel@edk2.groups.io; Rhodes, Sean 
Cc: Gao, Zhichao ; Wang, Jian J ; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo


 
Are you suggesting that the exiting logic be updated for this use case without adding a new enum?


yes. 
 




From: Kinney, Michael D 

Sent: Wednesday, October 26, 2022 12:21 AM
To: devel@edk2.groups.io; Ni, Ray ; Rhodes, Sean ;
 Kinney, Michael D 
Cc: Gao, Zhichao ; Wang, Jian J ; Gao, Liming 
Subject: RE: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo


 
Ray,
 
Are you suggesting that the exiting logic be updated for this use case without adding a new enum?
 
Sean, can you provide a revised patch that does this?
 
Thanks,
 
Mike
 



From: devel@edk2.groups.io 
On Behalf Of Ni, Ray
Sent: Tuesday, October 25, 2022 12:58 AM
To: devel@edk2.groups.io; Rhodes, Sean 
Cc: Gao, Zhichao ; Wang, Jian J ; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo


 
I need a reason of adding EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended.
In my opinion, without adding this new enum value, it’s still possible to support MS recommendation.
 




From: devel@edk2.groups.io 
On Behalf Of Sean Rhodes
Sent: Tuesday, October 25, 2022 3:27 PM
To: Ni, Ray 
Cc: devel@edk2.groups.io; Gao, Zhichao ; Wang, Jian J ;
 Gao, Liming 
Subject: Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo


 


Hi Ray


 


Where would you suggest this code goes? edk2 should support both Microsoft recommended and "normal". The original patch handled
 this well.


 


Thanks


 


Sean


 


On Mon, 10 Oct 2022 at 10:25, Ni, Ray  wrote:





The logic I shared below is from the LogoDxe driver which produces EDKII_PLATFORM_LOGO_PROTOCOL.
This driver should know the image size and it can account for the image size.
 
Thanks,
Ray
 




From: Sean Rhodes 

Sent: Monday, October 10, 2022 4:51 PM
To: Ni, Ray 
Cc: devel@edk2.groups.io; Gao, Zhichao ; Wang, Jian J ;
 Gao, Liming 

Re: [edk2-devel] [PATCH] Platform/Loongson: Allow building with stack protector support

2023-03-20 Thread Chao Li

Hi Xuerui,

I and Xianglai have reviewed this change a few days ago, you can create 
a PR in the edk2-platforms repo.



Thanks,
Chao
在 2023/3/8 11:17, xianglai 写道:


Reviewed-by: Xianglai Li 

On 2023/3/5 下午12:40, WANG Xuerui wrote:

Some toolchains have stack protection enabled by default, so without the
appropriate library included the build will fail with missing symbols
during link.

Cc: Bibo Mao
Cc: Xianglai li
Cc: Chao Li
Cc: Leif Lindholm
Cc: Michael D Kinney
Signed-off-by: WANG Xuerui
---
  Platform/Loongson/LoongArchQemuPkg/Loongson.dsc | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc 
b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
index d1162519cd..465e9229a2 100644
--- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
+++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
@@ -95,6 +95,9 @@
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
  !endif
  
+  # For stack protector support

+  NULL | 
MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+
BaseLib  | MdePkg/Library/BaseLib/BaseLib.inf
SafeIntLib   | 
MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
TimeBaseLib  | 
EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf





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




Re: [edk2-devel] [edk2-platforms][PATCH V2 2/8] ManageabilityPkg: Initial package

2023-03-20 Thread Nickle Wang via groups.io
Thanks for offline discussion with me, Abner.

Reviewed-by: Nickle Wang 

Regards,
Nickle

-Original Message-
From: abner.ch...@amd.com  
Sent: Wednesday, March 8, 2023 10:17 PM
To: devel@edk2.groups.io
Cc: Liming Gao ; Isaac Oram ; 
Nate DeSimone ; Abdul Lateef Attar 
; Nickle Wang ; Igor Kulchytskyy 
; Abdul Lateef Attar 
Subject: [edk2-platforms][PATCH V2 2/8] ManageabilityPkg: Initial package

External email: Use caution opening links or attachments


From: Abner Chang 

Initial commit of ManageabilityPkg

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Abdul Lateef Attar 
---
 .../ManageabilityPkg/ManageabilityPkg.dec | 18 +
 .../Include/Dsc/Manageability.dsc | 16 
 .../ManageabilityPkg/ManageabilityPkg.dsc | 40 +++
 3 files changed, 74 insertions(+)
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dec
 create mode 100644 Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dsc

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
new file mode 100644
index 00..8a0e28f50b
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -0,0 +1,18 @@
+## @file
+# Manageabilty Package
+# This is the package provides the edk2 drivers and libraries # those 
+are related to the platform management.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  DEC_SPECIFICATION = 0x0001001d
+  PACKAGE_NAME  = ManageabilityPkg
+  PACKAGE_GUID  = 36310119-4FB2-4BA3-959D-74C16B849F9E
+  PACKAGE_VERSION   = 1.0
+
+[Includes]
+  Include
diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
new file mode 100644
index 00..2cb63c1ca6
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -0,0 +1,16 @@
+## @file
+# Common libraries for Manageabilty Package # # Copyright (C) 2023 
+Advanced Micro Devices, Inc. All rights reserved. # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  #
+  # This library provides the instrinsic functions generated by a given 
compiler.
+  #
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
new file mode 100644
index 00..46cc215a0f
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -0,0 +1,40 @@
+## @file
+# Manageabilty Package
+# This is the package provides edk2 drivers and libraries # those are 
+related to the platform management.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  PLATFORM_NAME  = ManageabilityPkg
+  PLATFORM_GUID  = 7A98123A-B194-40B6-A863-A52192F6D65D
+  PLATFORM_VERSION   = 1.0
+  DSC_SPECIFICATION  = 0x0001001e
+  OUTPUT_DIRECTORY   = Build/ManageabilityPkg
+  SUPPORTED_ARCHITECTURES= IA32|X64|ARM|AARCH64|RISCV64
+  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
+  SKUID_IDENTIFIER   = DEFAULT
+
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[PcdsFeatureFlag]
+  #
+  # MinPlatform common include currently required PCD
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
+!include Include/Dsc/Manageability.dsc
+
--
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101402): https://edk2.groups.io/g/devel/message/101402
Mute This Topic: https://groups.io/mt/97473052/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] IntelFsp2Pkg: Fix NASM X64 build warnings.

2023-03-20 Thread Pedro Falcato
On Mon, Mar 20, 2023 at 6:03 AM Ni, Ray  wrote:
>
> >  ASM_PFX(FspInfoHeaderRelativeOff):
> >
> > DD0x12345678   ; This value must be patched by the 
> > build script
> >
> > -   and   rax, 0x
> >
> > +   mov   eax, eax ; equal to and rax, 0x
>
> Based on the discussion, we know "mov eax, eax" clears upper 32bits of RAX.
> But this code looks very confusing. Is there any other instruction that can 
> do the same thing?

Hi Ray,

Any instruction that writes to the lower 32-bits should zero the upper bits.
(Pardon my AT syntax, just reverse the operands for Intel syntax)

and $0x,%eax gets you a 3 byte opcode (since imm8 is signed,
you only need 0xff as the immediate)
and %eax, %eax gets you 2 bytes
mov %eax, %eax gets you 2 bytes

even something silly like adding 0 to EAX should work. But in a pure
efficiency+size POV, the last 2 instructions should be optimal.

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101400): https://edk2.groups.io/g/devel/message/101400
Mute This Topic: https://groups.io/mt/97678369/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] IntelFsp2Pkg: Fix NASM X64 build warnings.

2023-03-20 Thread Ni, Ray
>  ASM_PFX(FspInfoHeaderRelativeOff):
> 
> DD0x12345678   ; This value must be patched by the build 
> script
> 
> -   and   rax, 0x
> 
> +   mov   eax, eax ; equal to and rax, 0x

Based on the discussion, we know "mov eax, eax" clears upper 32bits of RAX.
But this code looks very confusing. Is there any other instruction that can do 
the same thing?



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