Re: [edk2-devel] [PATCH V2 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-09-01 Thread Gerd Hoffmann
  Hi,

> So the agreement in first stage is that:
> 1. Accept all memory below 4G.

Yes.

> 2. The PcdLazyAcceptPartialMemorySize is not needed in current stage.

Question is whenever we ever need PcdLazyAcceptPartialMemorySize.  When
accepting all memory below 4G works fast enough (which I think is the
case when using 2M large pages) I don't see a reason to ever change
that.

> 3. The patch of "Pool and page functions accept memory when OOM
> occurs" is not needed. Because OOM will not occur in the situation of
> accepting all memory below 4G.

Probably not in the vast majority of use cases, but there are
exceptions.  When unlocking luks-encrypted partitions the grub boot
loader might need alot of memory for decryption (depends on encryption
parameters).  So being able to accept memory above 4G if needed would be
good.  Skipping that for the first stage and do it later is fine I
think.

take care,
  Gerd



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




[edk2-devel] Event: TianoCore Community Meeting - APAC/NAMO - 09/01/2022 #cal-reminder

2022-09-01 Thread Group Notification
*Reminder: TianoCore Community Meeting - APAC/NAMO*

*When:*
09/01/2022
7:30pm to 8:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2%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:* Miki Demeter

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

*Description:*



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_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2%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
 )

Meeting ID: 283 318 374 436
Passcode: 633zLo

Download Teams ( https://www.microsoft.com/en-us/microsoft-teams/download-app ) 
| Join on the web ( https://www.microsoft.com/microsoft-teams/join-a-meeting )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 119 493 012 8

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

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=6e4ce4c4-1242-431b-9a51-92cd01a5df3c=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2@thread.v2=0=en-US
 )




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93084): https://edk2.groups.io/g/devel/message/93084
Mute This Topic: https://groups.io/mt/93387051/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] [PATCH v3 2/2] CloudHv/arm: switch PeiMemLib to its own

2022-09-01 Thread Jianyong Wu
As Cloud Hypervisor has its own PeiMemLib, change it in dsc file
accordingly.

Reviewed-by: Sami Mujawar 
Signed-off-by: Jianyong Wu 
---
 ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index 7559386a1d..7ca7a391d9 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -60,7 +60,7 @@
 !include MdePkg/MdeLibs.dsc.inc
 
 [LibraryClasses.common.PEIM]
-  
ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf
+  
ArmVirtMemInfoLib|ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf
 
 [LibraryClasses.common.DXE_DRIVER]
   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
-- 
2.17.1



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




[edk2-devel] [PATCH v3 1/2] CloudHv/arm: add PeiMemInfoLib

2022-09-01 Thread Jianyong Wu
Memory layout in CLoud Hypervisor for arm is changed and is different
with Qemu, thus we should build its own PeiMemInfoLib.
The main change in the memory layout is that normal ram may not contiguous.
The top 64M under 4G is reserved for 32bit device.

What this patch does:
1. get all of the memory node from DT;
2. Init page table for each memory node;
3. Add all of the memory nodes to Hob;

Reviewed-by: Sami Mujawar 
Signed-off-by: Jianyong Wu 
---
 .../CloudHvVirtMemInfoLib.c   | 230 ++
 .../CloudHvVirtMemInfoLib.h   |  42 
 .../CloudHvVirtMemInfoPeiLib.inf  |  46 
 3 files changed, 318 insertions(+)
 create mode 100644 
ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
 create mode 100644 
ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.h
 create mode 100644 
ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf

diff --git a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c 
b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
new file mode 100644
index 00..a75e357d8a
--- /dev/null
+++ b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
@@ -0,0 +1,230 @@
+/** @file
+
+  Copyright (c) 2022, Arm Limited. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "CloudHvVirtMemInfoLib.h"
+
+CLOUDHV_MEM_NODE_INFO CloudHvMemNode[CLOUDHV_MAX_MEM_NODE_NUM];
+
+RETURN_STATUS
+EFIAPI
+CloudHvVirtMemInfoPeiLibConstructor (
+  VOID
+  )
+{
+  VOID   *DeviceTreeBase;
+  EFI_RESOURCE_ATTRIBUTE_TYPE  ResourceAttributes;
+  INT32  Node, Prev;
+  UINT64 FirMemNodeBase, FirMemNodeSize;
+  UINT64 CurBase, MemBase;
+  UINT64 CurSize;
+  CONST CHAR8*Type;
+  INT32  Len;
+  CONST UINT64   *RegProp;
+  RETURN_STATUS  PcdStatus;
+  UINT8  Index;
+
+  ZeroMem (CloudHvMemNode, sizeof(CloudHvMemNode));
+
+  FirMemNodeBase = 0;
+  FirMemNodeSize = 0;
+  Index = 0;
+  MemBase = FixedPcdGet64 (PcdSystemMemoryBase);
+  ResourceAttributes = (
+EFI_RESOURCE_ATTRIBUTE_PRESENT |
+EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
+EFI_RESOURCE_ATTRIBUTE_TESTED
+);
+  DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);
+  if (DeviceTreeBase == NULL) {
+return EFI_NOT_FOUND;
+  }
+
+  //
+  // Make sure we have a valid device tree blob
+  //
+  if (fdt_check_header (DeviceTreeBase) != 0) {
+return EFI_NOT_FOUND;
+  }
+
+  //
+  // Look for the lowest memory node
+  //
+  for (Prev = 0; ; Prev = Node) {
+Node = fdt_next_node (DeviceTreeBase, Prev, NULL);
+if (Node < 0) {
+  break;
+}
+
+//
+// Check for memory node
+//
+Type = fdt_getprop (DeviceTreeBase, Node, "device_type", );
+if ((Type != 0) && (AsciiStrnCmp (Type, "memory", Len) == 0)) {
+  //
+  // Get the 'reg' property of this node. For now, we will assume
+  // two 8 byte quantities for base and size, respectively.
+  //
+  RegProp = fdt_getprop (DeviceTreeBase, Node, "reg", );
+  if ((RegProp != 0) && (Len == (2 * sizeof (UINT64 {
+CurBase = fdt64_to_cpu (ReadUnaligned64 (RegProp));
+CurSize = fdt64_to_cpu (ReadUnaligned64 (RegProp + 1));
+
+DEBUG ((
+  DEBUG_INFO,
+  "%a: System RAM @ 0x%lx - 0x%lx\n",
+  __FUNCTION__,
+  CurBase,
+  CurBase + CurSize - 1
+  ));
+
+// We should build Hob seperately for the memory node except the first 
one
+if (CurBase != MemBase) {
+  BuildResourceDescriptorHob (
+EFI_RESOURCE_SYSTEM_MEMORY,
+ResourceAttributes,
+CurBase,
+CurSize
+);
+} else {
+  FirMemNodeBase = CurBase;
+  FirMemNodeSize = CurSize;
+}
+
+CloudHvMemNode[Index].Base = CurBase;
+CloudHvMemNode[Index].Size = CurSize;
+Index++;
+
+if (Index >= CLOUDHV_MAX_MEM_NODE_NUM) {
+  DEBUG ((
+DEBUG_WARN,
+"%a: memory node larger than %d will not be included into Memory 
System\n",
+__FUNCTION__,
+CLOUDHV_MAX_MEM_NODE_NUM
+));
+  break;
+}
+  } else {
+DEBUG ((
+  DEBUG_ERROR,
+  "%a: Failed to parse FDT memory node\n",
+  __FUNCTION__
+  ));
+  }
+}
+  }
+
+  //
+  // Make sure the start of DRAM matches our expectation
+  //
+  if (FixedPcdGet64 (PcdSystemMemoryBase) != FirMemNodeBase) {
+return EFI_NOT_FOUND;
+  }
+  PcdStatus = PcdSet64S (PcdSystemMemorySize, FirMemNodeSize);
+  ASSERT_RETURN_ERROR (PcdStatus);
+  ASSERT (
+

[edk2-devel] [PATCH v3 0/2] CloudHv/arm: Add specific mem info lib

2022-09-01 Thread Jianyong Wu
Currently, the meminfo lib for CloudHv/arm is reusing QEMU's. As the memory
layout for cloud hypervisor is changed, it needs a new meminfo lib.

Signed-off-by: Jianyong Wu 

Jianyong Wu (2):
  CloudHv/arm: add PeiMemInfoLib
  CloudHv/arm: switch PeiMemLib to its own

 ArmVirtPkg/ArmVirtCloudHv.dsc |   2 +-
 .../CloudHvVirtMemInfoLib.c   | 230 ++
 .../CloudHvVirtMemInfoLib.h   |  42 
 .../CloudHvVirtMemInfoPeiLib.inf  |  46 
 4 files changed, 319 insertions(+), 1 deletion(-)
 create mode 100644 
ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
 create mode 100644 
ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.h
 create mode 100644 
ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf

-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93081): https://edk2.groups.io/g/devel/message/93081
Mute This Topic: https://groups.io/mt/93411012/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] MinPlatformPkg: Add FSP 2.4 MultiPhase library.

2022-09-01 Thread Chiu, Chasel


Patch pushed: 
https://github.com/tianocore/edk2-platforms/commit/07bcc0be8c1bcfbd88eb254ebd4f674217013dca

Thanks,
Chasel


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chiu,
> Chasel
> Sent: Thursday, September 1, 2022 4:55 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Oram, Isaac W
> ; Gao, Liming ; Dong,
> Eric 
> Subject: [edk2-devel] [edk2-platforms: PATCH v2] MinPlatformPkg: Add FSP
> 2.4 MultiPhase library.
> 
> FSP Wrapper has implemented FSP 2.4 MultiPhase support and required
> platform to include new library instance.
> 
> Cc: Nate DeSimone 
> Cc: Isaac Oram 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Signed-off-by: Chasel Chiu 
> ---
>  Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> index 8e91dba6ac..9bac751eaf 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> @@ -54,6 +54,8 @@
> 
> TpmPlatformHierarchyLib|MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatform
> HierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
> FspMeasurementLib|IntelFsp2WrapperPkg/Library/BaseFspMeasurementLi
> b/BaseFspMeasurementLib.inf+
> FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspW
> rapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibN
> ull.inf+
> FspWrapperMultiPhaseProcessLib|IntelFsp2WrapperPkg/Library/FspWrappe
> rMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf
> TcgEventLogRecordLib|SecurityPkg/Library/TcgEventLogRecordLib/TcgEventL
> ogRecordLib.inf
> TpmMeasurementLib|SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpm
> MeasurementLib.inf --
> 2.35.0.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#93077): https://edk2.groups.io/g/devel/message/93077
> Mute This Topic: https://groups.io/mt/93408670/1777047
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [chasel.c...@intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93080): https://edk2.groups.io/g/devel/message/93080
Mute This Topic: https://groups.io/mt/93408670/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/2] CloudHv/arm: add PeiMemInfoLib

2022-09-01 Thread Jianyong Wu
Thanks Sami, I will address all the comments in this patch in next version.

> -Original Message-
> From: Sami Mujawar 
> Sent: Thursday, September 1, 2022 11:43 PM
> To: Jianyong Wu ; devel@edk2.groups.io
> Cc: ardb+tianoc...@kernel.org; Justin He ; nd
> 
> Subject: Re: [PATCH v2 1/2] CloudHv/arm: add PeiMemInfoLib
> 
> Hi Jianyong,
> 
> Thank you for the updated patch.
> 
> I have one comment marked inline as [SAMI]. Other than that this patch
> looks good to me.
> 
> With that fixed.
> 
> Reviewed-by: Sami Mujawar 
> 
> Regards,
> 
> Sami Mujawar
> 
> On 19/08/2022 09:09 am, Jianyong Wu wrote:
> > Memory layout in CLoud Hypervisor for arm is changed and is different
> > with Qemu, thus we should build its own PeiMemInfoLib.
> > The main change in the memory layout is that normal ram may not
> > contiguous under 4G. The top 64M under 4G is reserved for 32bit device.
> >
> > What this patch does:
> > 1. get all of the memory node from DT; 2. Add all of the memory nodes
> > to Hob; 3. Init page table for each memory node;
> >
> > Signed-off-by: Jianyong Wu 
> > ---
> >   .../CloudHvVirtMemInfoLib.c   | 230 ++
> >   .../CloudHvVirtMemInfoLib.h   |  42 
> >   .../CloudHvVirtMemInfoPeiLib.inf  |  46 
> >   3 files changed, 318 insertions(+)
> >   create mode 100644
> ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
> >   create mode 100644
> ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.h
> >   create mode 100644
> >
> ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf
> >
> > diff --git
> > a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
> > b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
> > new file mode 100644
> > index 00..d9c434754e
> > --- /dev/null
> > +++
> b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
> > @@ -0,0 +1,230 @@
> > +/** @file
> > +
> > +  Copyright (c) 2022, Arm Limited. All rights reserved.
> > +
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include  #include 
> > +
> > +#include 
> > +
> > +#include "CloudHvVirtMemInfoLib.h"
> > +
> > +CLOUDHV_MEM_NODE_INFO
> CloudHvMemNode[CLOUDHV_MAX_MEM_NODE_NUM];
> > +
> > +RETURN_STATUS
> > +EFIAPI
> > +CloudHvVirtMemInfoPeiLibConstructor (
> > +  VOID
> > +  )
> > +{
> > +  VOID   *DeviceTreeBase;
> > +  EFI_RESOURCE_ATTRIBUTE_TYPE  ResourceAttributes;
> > +  INT32  Node, Prev;
> > +  UINT64 FirMemNodeBase, FirMemNodeSize;
> > +  UINT64 CurBase, MemBase;
> > +  UINT64 CurSize;
> > +  CONST CHAR8*Type;
> > +  INT32  Len;
> > +  CONST UINT64   *RegProp;
> > +  RETURN_STATUS  PcdStatus;
> > +  UINT8  Index;
> > +
> > +  ZeroMem (CloudHvMemNode, sizeof(CloudHvMemNode));
> > +
> > +  FirMemNodeBase = 0;
> > +  FirMemNodeSize = 0;
> > +  Index = 0;
> > +  MemBase = FixedPcdGet64 (PcdSystemMemoryBase);
> ResourceAttributes
> > + = (
> > +EFI_RESOURCE_ATTRIBUTE_PRESENT |
> > +EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
> > +EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
> > +EFI_RESOURCE_ATTRIBUTE_TESTED
> > +);
> > +  DeviceTreeBase = (VOID *)(UINTN)PcdGet64
> > + (PcdDeviceTreeInitialBaseAddress);
> > +  if (DeviceTreeBase == NULL) {
> > +return EFI_NOT_FOUND;
> > +  }
> > +
> > +  //
> > +  // Make sure we have a valid device tree blob  //  if
> > + (fdt_check_header (DeviceTreeBase) != 0) {
> > +return EFI_NOT_FOUND;
> > +  }
> > +
> > +  //
> > +  // Look for the lowest memory node
> > +  //
> > +  for (Prev = 0; ; Prev = Node) {
> > +Node = fdt_next_node (DeviceTreeBase, Prev, NULL);
> > +if (Node < 0) {
> > +  break;
> > +}
> > +
> > +//
> > +// Check for memory node
> > +//
> > +Type = fdt_getprop (DeviceTreeBase, Node, "device_type", );
> > +if (Type && (AsciiStrnCmp (Type, "memory", Len) == 0)) {
> 
> [SAMI] Apologies I missed this in my earlier review. The above check should
> be
> 
>   + if ((Type !=0) && (AsciiStrnCmp (Type, "memory", Len) == 0)) {
> 
> as Type is not boolean.
> 
> [/SAMI]
> 
> > +  //
> > +  // Get the 'reg' property of this node. For now, we will assume
> > +  // two 8 byte quantities for base and size, respectively.
> > +  //
> > +  RegProp = fdt_getprop (DeviceTreeBase, Node, "reg", );
> > +  if ((RegProp != 0) && (Len == (2 * sizeof (UINT64 {
> > +CurBase = fdt64_to_cpu (ReadUnaligned64 (RegProp));
> > +CurSize = fdt64_to_cpu (ReadUnaligned64 (RegProp + 1));
> > +
> > +DEBUG ((
> > +  DEBUG_INFO,
> > +  "%a: System RAM @ 0x%lx - 0x%lx\n",
> > +  __FUNCTION__,
> > +  CurBase,
> > +  CurBase + CurSize 

Re: [edk2-devel] [edk2-platforms: PATCH v2] MinPlatformPkg: Add FSP 2.4 MultiPhase library.

2022-09-01 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

> -Original Message-
> From: Chiu, Chasel 
> Sent: Thursday, September 1, 2022 4:55 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Oram, Isaac W
> ; Gao, Liming ;
> Dong, Eric 
> Subject: [edk2-platforms: PATCH v2] MinPlatformPkg: Add FSP 2.4
> MultiPhase library.
> 
> FSP Wrapper has implemented FSP 2.4 MultiPhase support and required
> platform to include new library instance.
> 
> Cc: Nate DeSimone 
> Cc: Isaac Oram 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Signed-off-by: Chasel Chiu 
> ---
>  Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> index 8e91dba6ac..9bac751eaf 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> @@ -54,6 +54,8 @@
> 
> TpmPlatformHierarchyLib|MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatform
> HierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
> FspMeasurementLib|IntelFsp2WrapperPkg/Library/BaseFspMeasurementLi
> b/BaseFspMeasurementLib.inf+
> FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspW
> rapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibN
> ull.inf+
> FspWrapperMultiPhaseProcessLib|IntelFsp2WrapperPkg/Library/FspWrappe
> rMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf
> TcgEventLogRecordLib|SecurityPkg/Library/TcgEventLogRecordLib/TcgEventL
> ogRecordLib.inf
> TpmMeasurementLib|SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpm
> MeasurementLib.inf --
> 2.35.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93078): https://edk2.groups.io/g/devel/message/93078
Mute This Topic: https://groups.io/mt/93408670/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 v2] MinPlatformPkg: Add FSP 2.4 MultiPhase library.

2022-09-01 Thread Chiu, Chasel
FSP Wrapper has implemented FSP 2.4 MultiPhase support
and required platform to include new library instance.

Cc: Nate DeSimone 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Chasel Chiu 
---
 Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc 
b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
index 8e91dba6ac..9bac751eaf 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
@@ -54,6 +54,8 @@
   
TpmPlatformHierarchyLib|MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
 
   
FspMeasurementLib|IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf
+  
FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibNull.inf
+  
FspWrapperMultiPhaseProcessLib|IntelFsp2WrapperPkg/Library/FspWrapperMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf
   
TcgEventLogRecordLib|SecurityPkg/Library/TcgEventLogRecordLib/TcgEventLogRecordLib.inf
   
TpmMeasurementLib|SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf
 
-- 
2.35.0.windows.1



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




Re: [edk2-devel] [PATCH] IntelFsp2WrapperPkg: Rename PlatformMultiPhaseLibSample.

2022-09-01 Thread Chiu, Chasel


Patch merged: 
https://github.com/tianocore/edk2/commit/ec87181192f013f4f7ff916b2a39ff2c87b079f3

Thanks,
Chasel



> -Original Message-
> From: Chiu, Chasel 
> Sent: Wednesday, August 31, 2022 11:00 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: [PATCH] IntelFsp2WrapperPkg: Rename
> PlatformMultiPhaseLibSample.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3916
> 
> Basing on offline feedbacks to rename
> FspWrapperPlatformMultiPhaseLibSample to
> FspWrapperPlatformMultiPhaseLibNull.
> 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Signed-off-by: Chasel Chiu 
> ---
> 
> IntelFsp2WrapperPkg/Library/{BaseFspWrapperPlatformMultiPhaseLibSampl
> e/FspWrapperPlatformMultiPhaseLibSample.c =>
> BaseFspWrapperPlatformMultiPhaseLibNull/FspWrapperPlatformMultiPhase
> LibNull.c} | 0
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> | 4 ++--
> 
> IntelFsp2WrapperPkg/Library/{BaseFspWrapperPlatformMultiPhaseLibSampl
> e/BaseFspWrapperPlatformMultiPhaseLibSample.inf =>
> BaseFspWrapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiP
> haseLibNull.inf} | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git
> a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSam
> ple/FspWrapperPlatformMultiPhaseLibSample.c
> b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull
> /FspWrapperPlatformMultiPhaseLibNull.c
> similarity index 100%
> rename from
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSampl
> e/FspWrapperPlatformMultiPhaseLibSample.c
> rename to
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/F
> spWrapperPlatformMultiPhaseLibNull.c
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> index 79a5c7f13d..b1fc2291c8 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> @@ -48,7 +48,7 @@
> 
> FspWrapperApiLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/Ba
> seFspWrapperApiLib.inf
> FspWrapperApiTestLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiTe
> stLibNull/BaseFspWrapperApiTestLibNull.inf
> FspMeasurementLib|IntelFsp2WrapperPkg/Library/BaseFspMeasurementLi
> b/BaseFspMeasurementLib.inf-
> FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspW
> rapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLi
> bSample.inf+
> FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspW
> rapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibN
> ull.inf
> FspWrapperMultiPhaseProcessLib|IntelFsp2WrapperPkg/Library/FspWrappe
> rMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf# FSP
> platform sample@@ -93,7 +93,7 @@
> 
> IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/BaseFspWrapperApiLi
> b.inf
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFsp
> WrapperPlatformLibSample.inf
> IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf-
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSampl
> e/BaseFspWrapperPlatformMultiPhaseLibSample.inf+
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/B
> aseFspWrapperPlatformMultiPhaseLibNull.inf
> IntelFsp2WrapperPkg/Library/FspWrapperMultiPhaseProcessLib/FspWrappe
> rMultiPhaseProcessLib.inf  [PcdsFixedAtBuild.common]diff --git
> a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSam
> ple/BaseFspWrapperPlatformMultiPhaseLibSample.inf
> b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull
> /BaseFspWrapperPlatformMultiPhaseLibNull.inf
> similarity index 90%
> rename from
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSampl
> e/BaseFspWrapperPlatformMultiPhaseLibSample.inf
> rename to
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/B
> aseFspWrapperPlatformMultiPhaseLibNull.inf
> index 607ad41a23..4580e80e2e 100644
> ---
> a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSam
> ple/BaseFspWrapperPlatformMultiPhaseLibSample.inf
> +++
> b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNul
> +++ l/BaseFspWrapperPlatformMultiPhaseLibNull.inf
> @@ -10,7 +10,7 @@
>   [Defines]   INF_VERSION= 0x00010005-  BASE_NAME 
>  =
> BaseFspWrapperPlatformMultiPhaseLibSample+  BASE_NAME  =
> BaseFspWrapperPlatformMultiPhaseLibNull   FILE_GUID  =
> DB63E5AA-21C6-40BB-879A-CD1762C8427B   MODULE_TYPE= BASE
> VERSION_STRING = 1.0@@ -23,7 +23,7 @@
>  #  [Sources]-  FspWrapperPlatformMultiPhaseLibSample.c+
> FspWrapperPlatformMultiPhaseLibNull.c  [Packages]   MdePkg/MdePkg.dec-
> -
> 2.35.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93076): https://edk2.groups.io/g/devel/message/93076
Mute This Topic: 

Re: [edk2-devel] [PATCH V2 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-09-01 Thread Min Xu
On September 1, 2022 11:56 PM, Gerd Hoffmann wrote:
> 
> > Lazy accept page can be controlled in build time like below:
> >   -D LAZY_ACCEPT_PARTIAL_MEM=512
> >
> > The unit is MB. If it is 0 then it means Lazy-accept is turned off.
> >
> > Lazy-accept is turned off by default in OvmfPkgX64.
> > Lazy-accept is turned on with 512MB by default in IntelTdxX64.
> 
> > +
> > +
> gUefiOvmfPkgTokenSpaceGuid.PcdLazyAcceptPartialMemorySize|$(LAZY_AC
> C
> > + EPT_PARTIAL_MEM)
> 
> Hmm, cover letter says 0 means accept all memory below 4G
> 
> Care to clarify?  Is the commit message outdated?
> 
> Also I think the discussion of the last revision ended with the agreement that
> accepting all memory below 4G is a good idea because it simplifies the
> workflow (no need to split low memory into accepted and unaccepted ranges
> for example).
> 
> So why we are again talking about accepting 512 MB ?
> 
I may mis-understand the discussion of the last revision.
So the agreement in first stage is that:
1. Accept all memory below 4G.
2. The PcdLazyAcceptPartialMemorySize is not needed in current stage.
3. The patch of "Pool and page functions accept memory when OOM occurs" is not 
needed. Because OOM will not occur in the situation of accepting all memory 
below 4G.

If that is correct, I will update the patches based on above agreements.

Thanks
Min


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93075): https://edk2.groups.io/g/devel/message/93075
Mute This Topic: https://groups.io/mt/93285605/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 01/14] MdeModulePkg: Add PrePiHob.h

2022-09-01 Thread Min Xu
On September 1, 2022 11:48 PM, Gerd Hoffmann wrote:
> 
> > EFI_RESOURCE_MEMORY_UNACCEPTED is defined for unaccepted memory.
> > But this defitinion has not been officially in the PI spec.
> 
> I think this has just changed with uefi spec 2.10 released in August.
> 
Thanks for reminder. I will check the spec.

Thanks
Min


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




Re: [edk2-devel] [PATCH 11/24] IntelFsp2WrapperPkg: Remove duplicated words

2022-09-01 Thread Nate DeSimone
Pushed: https://github.com/tianocore/edk2/commit/6edd2578

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of
> PierreGondois
> Sent: Tuesday, August 23, 2022 9:00 AM
> To: devel@edk2.groups.io
> Cc: Pierre Gondois ; Chiu, Chasel
> ; Desimone, Nathaniel L
> 
> Subject: [edk2-devel] [PATCH 11/24] IntelFsp2WrapperPkg: Remove
> duplicated words
> 
> From: Pierre Gondois 
> 
> In an effort to clean the documentation of the above package, remove
> duplicated words.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Signed-off-by: Pierre Gondois 
> ---
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index c43b0c2267a7..08af6d814ad1 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -87,7 +87,7 @@ [PcdsFixedAtBuild, PcdsPatchableInModule]
># We need a flag (PCD) to indicate if there is need to do such FSP
> measurement or NOT.
># 2) The FSP binary includes FSP code and FSP UPD region. The UPD region
> is considered
># as configuration block, and it may be updated by OEM by design.
> -  # This flag (PCD) is to indicate if we need isolate the the UPD region from
> the FSP code region.
> +  # This flag (PCD) is to indicate if we need isolate the UPD region from the
> FSP code region.
># BIT0: Need measure FSP. (for FSP1.x) - reserved in FSP2.
># BIT1: Need measure FSPT. (for FSP 2.x)
># BIT2: Need measure FSPM. (for FSP 2.x)
> --
> 2.25.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#92693): https://edk2.groups.io/g/devel/message/92693
> Mute This Topic: https://groups.io/mt/93207394/1767664
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [nathaniel.l.desim...@intel.com]
> -=-=-=-=-=-=
> 



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




Re: [edk2-devel] [PATCH] IntelFsp2WrapperPkg: Rename PlatformMultiPhaseLibSample.

2022-09-01 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

> -Original Message-
> From: Chiu, Chasel 
> Sent: Wednesday, August 31, 2022 11:00 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: [PATCH] IntelFsp2WrapperPkg: Rename
> PlatformMultiPhaseLibSample.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3916
> 
> Basing on offline feedbacks to rename
> FspWrapperPlatformMultiPhaseLibSample to
> FspWrapperPlatformMultiPhaseLibNull.
> 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Signed-off-by: Chasel Chiu 
> ---
>  
> IntelFsp2WrapperPkg/Library/{BaseFspWrapperPlatformMultiPhaseLibSample/FspWrapperPlatformMultiPhaseLibSample.c
>  => 
> BaseFspWrapperPlatformMultiPhaseLibNull/FspWrapperPlatformMultiPhaseLibNull.c}
>  | 0
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc  
>   
>   | 4 ++--
>  
> IntelFsp2WrapperPkg/Library/{BaseFspWrapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLibSample.inf
>  => 
> BaseFspWrapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibNull.inf}
>  | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git 
> a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/FspWrapperPlatformMultiPhaseLibSample.c
>  
> b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/FspWrapperPlatformMultiPhaseLibNull.c
> similarity index 100%
> rename from 
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/FspWrapperPlatformMultiPhaseLibSample.c
> rename to 
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/FspWrapperPlatformMultiPhaseLibNull.c
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc 
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> index 79a5c7f13d..b1fc2291c8 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> @@ -48,7 +48,7 @@
>
> FspWrapperApiLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/BaseFspWrapperApiLib.inf
>
> FspWrapperApiTestLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiTestLibNull/BaseFspWrapperApiTestLibNull.inf
>
> FspMeasurementLib|IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf
> -  
> FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLibSample.inf
> +  
> FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibNull.inf
>
> FspWrapperMultiPhaseProcessLib|IntelFsp2WrapperPkg/Library/FspWrapperMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf
>  
># FSP platform sample
> @@ -93,7 +93,7 @@
>IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/BaseFspWrapperApiLib.inf
>
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
>IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> -  
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLibSample.inf
> +  
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibNull.inf
>
> IntelFsp2WrapperPkg/Library/FspWrapperMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf
>  
>  [PcdsFixedAtBuild.common]
> diff --git 
> a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLibSample.inf
>  
> b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibNull.inf
> similarity index 90%
> rename from 
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLibSample.inf
> rename to 
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibNull.inf
> index 607ad41a23..4580e80e2e 100644
> --- 
> a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLibSample.inf
> +++ 
> b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/BaseFspWrapperPlatformMultiPhaseLibNull.inf
> @@ -10,7 +10,7 @@
>  
>  [Defines]
>INF_VERSION= 0x00010005
> -  BASE_NAME  = BaseFspWrapperPlatformMultiPhaseLibSample
> +  BASE_NAME  = BaseFspWrapperPlatformMultiPhaseLibNull
>FILE_GUID  = DB63E5AA-21C6-40BB-879A-CD1762C8427B
>MODULE_TYPE= BASE
>VERSION_STRING = 1.0
> @@ -23,7 +23,7 @@
>  #
>  
>  [Sources]
> -  FspWrapperPlatformMultiPhaseLibSample.c
> +  FspWrapperPlatformMultiPhaseLibNull.c
>  
>  [Packages]
>MdePkg/MdePkg.dec
> -- 
> 2.35.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all 

Re: [edk2-devel] [PATCH 11/24] IntelFsp2WrapperPkg: Remove duplicated words

2022-09-01 Thread Nate DeSimone
Good catch!
Reviewed-by: Nate DeSimone 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of
> PierreGondois
> Sent: Tuesday, August 23, 2022 9:00 AM
> To: devel@edk2.groups.io
> Cc: Pierre Gondois ; Chiu, Chasel
> ; Desimone, Nathaniel L
> 
> Subject: [edk2-devel] [PATCH 11/24] IntelFsp2WrapperPkg: Remove
> duplicated words
> 
> From: Pierre Gondois 
> 
> In an effort to clean the documentation of the above package, remove
> duplicated words.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Signed-off-by: Pierre Gondois 
> ---
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index c43b0c2267a7..08af6d814ad1 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -87,7 +87,7 @@ [PcdsFixedAtBuild, PcdsPatchableInModule]
># We need a flag (PCD) to indicate if there is need to do such FSP
> measurement or NOT.
># 2) The FSP binary includes FSP code and FSP UPD region. The UPD region
> is considered
># as configuration block, and it may be updated by OEM by design.
> -  # This flag (PCD) is to indicate if we need isolate the the UPD region from
> the FSP code region.
> +  # This flag (PCD) is to indicate if we need isolate the UPD region from the
> FSP code region.
># BIT0: Need measure FSP. (for FSP1.x) - reserved in FSP2.
># BIT1: Need measure FSPT. (for FSP 2.x)
># BIT2: Need measure FSPM. (for FSP 2.x)
> --
> 2.25.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#92693): https://edk2.groups.io/g/devel/message/92693
> Mute This Topic: https://groups.io/mt/93207394/1767664
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [nathaniel.l.desim...@intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93071): https://edk2.groups.io/g/devel/message/93071
Mute This Topic: https://groups.io/mt/93207394/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] MdePkg: Use ANSI colors to indicate debug message severity

2022-09-01 Thread Rebecca Cran

On 9/1/22 16:21, Andrew Fish via groups.io wrote:
I think this feature flag is going to control the output of edk2 
DEBUG. In an abstract sense DEBUG is not Terminal or ConOut. It could 
be mapped to the same device, but it does not have to be.


So maybe PcdDebugAnsiSeqSupport or DebugLibAnsiSeqSupport?


Thanks, that makes more sense. I'll send out a v3 patch with 
PcdDebugAnsiSeqSupport.


--
Rebecca Cran


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93070): https://edk2.groups.io/g/devel/message/93070
Mute This Topic: https://groups.io/mt/93337469/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] MdePkg: Use ANSI colors to indicate debug message severity

2022-09-01 Thread Andrew Fish via groups.io


> On Sep 1, 2022, at 4:52 PM, Rebecca Cran  wrote:
> 
> Thanks. I've just sent out a v2 that introduces a
> 
> PcdTerminalSupportsAnsiSequences FeatureFlag.
> 
> Let me know if you'd prefer a different name: I wondered about something like 
> PcdConOutAnsiSeqSupport for example.
> 

Rebecca,

I think this feature flag is going to control the output of edk2 DEBUG. In an 
abstract sense DEBUG is not Terminal or ConOut. It could be mapped to the same 
device, but it does not have to be. 

So maybe PcdDebugAnsiSeqSupport or DebugLibAnsiSeqSupport? 

Thanks,

Andrew Fish

> -- 
> Rebecca Cran
> 
> On 8/29/22 17:29, Kinney, Michael D wrote:
>> Hi Rebecca,
>> 
>> I think this is a good idea to improve readability.
>> 
>> However, I think there is an assumption today that debug
>> message output is just ASCII text with no assumptions on
>> a terminal type and no assumption on screen width or screen
>> height and no support for cursor control.
>> 
>> This change would only make sense if the device the
>> serial messages are sent supports ANSI color codes.
>> 
>> I think we should make this a build time configuration
>> option to add the ANSI sequences.  I suggest a FeatureFlag
>> PCD with a default of disabled to preserve current behavior
>> and platforms can opt into ANSI color coded debug messages
>> in their DSC file.
>> 
>> Thanks,
>> 
>> Mike
>> 
>>> -Original Message-
>>> From: Rebecca Cran 
>>> Sent: Monday, August 29, 2022 3:12 PM
>>> To: devel@edk2.groups.io; Kinney, Michael D ; 
>>> Gao, Liming ; Liu, Zhiguang
>>> 
>>> Cc: Rebecca Cran 
>>> Subject: [PATCH 1/1] MdePkg: Use ANSI colors to indicate debug message 
>>> severity
>>> 
>>> There currently isn't a way to differentiate the different
>>> levels of DEBUG output: DEBUG_ERROR, DEBUG_WARN, DEBUG_INFO
>>> etc.
>>> 
>>> To improve this, wrap DEBUG_ERROR and DEBUG_WARN level
>>> messages in ANSI color code escape sequences. DEBUG_ERROR
>>> messages will be displayed in red text, and DEBUG_WARN
>>> in orange (the escape code is for the yellow color palette
>>> entry, but it gets displayed as orange).
>>> 
>>> Signed-off-by: Rebecca Cran 
>>> ---
>>>  MdePkg/Include/Library/PrintLib.h|  39 ++
>>>  MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c |   2 +
>>>  MdePkg/Library/BasePrintLib/PrintLib.c   | 128 
>>>  MdePkg/Library/UefiDebugLibConOut/DebugLib.c |   2 +
>>>  4 files changed, 171 insertions(+)
>>> 
>>> diff --git a/MdePkg/Include/Library/PrintLib.h 
>>> b/MdePkg/Include/Library/PrintLib.h
>>> index 8d523cac528d..06d9761df897 100644
>>> --- a/MdePkg/Include/Library/PrintLib.h
>>> +++ b/MdePkg/Include/Library/PrintLib.h
>>> @@ -2,6 +2,7 @@
>>>Provides services to print a formatted string to a buffer. All 
>>> combinations of
>>>Unicode and ASCII strings are supported.
>>> 
>>> +Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights 
>>> reserved.
>>>  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>>>  SPDX-License-Identifier: BSD-2-Clause-Patent
>>> 
>>> @@ -931,4 +932,42 @@ SPrintLengthAsciiFormat (
>>>IN  VA_LIST  Marker
>>>);
>>> 
>>> +/**
>>> +  Wraps a message with ANSI color escape codes.
>>> +
>>> +  @param String The string to wrap.
>>> +  @param StringLen  The size of the String buffer in characters.
>>> +  @param ErrorLevel The error level.
>>> +
>>> +  @retval RETURN_SUCCESS  The string was successfully updated.
>>> +  @retval RETURN_BUFFER_TOO_SMALL The buffer is too small.
>>> +
>>> +**/
>>> +RETURN_STATUS
>>> +EFIAPI
>>> +AsciiDebugGetColorString (
>>> +  IN OUT CHAR8  *String,
>>> +  IN UINTN  StringLen,
>>> +  IN UINTN  ErrorLevel
>>> +  );
>>> +
>>> +/**
>>> +  Wraps a message with ANSI color escape codes.
>>> +
>>> +  @param String The string to wrap.
>>> +  @param StringLen  The size of the String buffer in Unicode characters.
>>> +  @param ErrorLevel The error level.
>>> +
>>> +  @retval RETURN_SUCCESS  The string was successfully updated.
>>> +  @retval RETURN_BUFFER_TOO_SMALL The buffer is too small.
>>> +
>>> +**/
>>> +RETURN_STATUS
>>> +EFIAPI
>>> +UnicodeDebugGetColorString (
>>> +  IN OUT CHAR16  *String,
>>> +  IN UINTN   StringLen,
>>> +  IN UINTN   ErrorLevel
>>> +  );
>>> +
>>>  #endif
>>> diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c 
>>> b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
>>> index bd5686947712..d599d16f5b7a 100644
>>> --- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
>>> +++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
>>> @@ -125,6 +125,8 @@ DebugPrintMarker (
>>>  AsciiBSPrint (Buffer, sizeof (Buffer), Format, BaseListMarker);
>>>}
>>> 
>>> +  AsciiDebugGetColorString (Buffer, MAX_DEBUG_MESSAGE_LENGTH, ErrorLevel);
>>> +
>>>//
>>>// Send the print string to a Serial Port
>>>//
>>> diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c 
>>> b/MdePkg/Library/BasePrintLib/PrintLib.c
>>> index 

Re: [edk2-devel] [PATCH 1/1] MdePkg: Use ANSI colors to indicate debug message severity

2022-09-01 Thread Rebecca Cran

Thanks. I've just sent out a v2 that introduces a

PcdTerminalSupportsAnsiSequences FeatureFlag.

Let me know if you'd prefer a different name: I wondered about something like 
PcdConOutAnsiSeqSupport for example.

--
Rebecca Cran

On 8/29/22 17:29, Kinney, Michael D wrote:

Hi Rebecca,

I think this is a good idea to improve readability.

However, I think there is an assumption today that debug
message output is just ASCII text with no assumptions on
a terminal type and no assumption on screen width or screen
height and no support for cursor control.

This change would only make sense if the device the
serial messages are sent supports ANSI color codes.

I think we should make this a build time configuration
option to add the ANSI sequences.  I suggest a FeatureFlag
PCD with a default of disabled to preserve current behavior
and platforms can opt into ANSI color coded debug messages
in their DSC file.

Thanks,

Mike


-Original Message-
From: Rebecca Cran 
Sent: Monday, August 29, 2022 3:12 PM
To: devel@edk2.groups.io; Kinney, Michael D ; Gao, Liming 
; Liu, Zhiguang

Cc: Rebecca Cran 
Subject: [PATCH 1/1] MdePkg: Use ANSI colors to indicate debug message severity

There currently isn't a way to differentiate the different
levels of DEBUG output: DEBUG_ERROR, DEBUG_WARN, DEBUG_INFO
etc.

To improve this, wrap DEBUG_ERROR and DEBUG_WARN level
messages in ANSI color code escape sequences. DEBUG_ERROR
messages will be displayed in red text, and DEBUG_WARN
in orange (the escape code is for the yellow color palette
entry, but it gets displayed as orange).

Signed-off-by: Rebecca Cran 
---
  MdePkg/Include/Library/PrintLib.h|  39 ++
  MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c |   2 +
  MdePkg/Library/BasePrintLib/PrintLib.c   | 128 
  MdePkg/Library/UefiDebugLibConOut/DebugLib.c |   2 +
  4 files changed, 171 insertions(+)

diff --git a/MdePkg/Include/Library/PrintLib.h 
b/MdePkg/Include/Library/PrintLib.h
index 8d523cac528d..06d9761df897 100644
--- a/MdePkg/Include/Library/PrintLib.h
+++ b/MdePkg/Include/Library/PrintLib.h
@@ -2,6 +2,7 @@
Provides services to print a formatted string to a buffer. All combinations 
of
Unicode and ASCII strings are supported.

+Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
  SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -931,4 +932,42 @@ SPrintLengthAsciiFormat (
IN  VA_LIST  Marker
);

+/**
+  Wraps a message with ANSI color escape codes.
+
+  @param String The string to wrap.
+  @param StringLen  The size of the String buffer in characters.
+  @param ErrorLevel The error level.
+
+  @retval RETURN_SUCCESS  The string was successfully updated.
+  @retval RETURN_BUFFER_TOO_SMALL The buffer is too small.
+
+**/
+RETURN_STATUS
+EFIAPI
+AsciiDebugGetColorString (
+  IN OUT CHAR8  *String,
+  IN UINTN  StringLen,
+  IN UINTN  ErrorLevel
+  );
+
+/**
+  Wraps a message with ANSI color escape codes.
+
+  @param String The string to wrap.
+  @param StringLen  The size of the String buffer in Unicode characters.
+  @param ErrorLevel The error level.
+
+  @retval RETURN_SUCCESS  The string was successfully updated.
+  @retval RETURN_BUFFER_TOO_SMALL The buffer is too small.
+
+**/
+RETURN_STATUS
+EFIAPI
+UnicodeDebugGetColorString (
+  IN OUT CHAR16  *String,
+  IN UINTN   StringLen,
+  IN UINTN   ErrorLevel
+  );
+
  #endif
diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c 
b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
index bd5686947712..d599d16f5b7a 100644
--- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
+++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
@@ -125,6 +125,8 @@ DebugPrintMarker (
  AsciiBSPrint (Buffer, sizeof (Buffer), Format, BaseListMarker);
}

+  AsciiDebugGetColorString (Buffer, MAX_DEBUG_MESSAGE_LENGTH, ErrorLevel);
+
//
// Send the print string to a Serial Port
//
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c 
b/MdePkg/Library/BasePrintLib/PrintLib.c
index e6f4042bb90b..95135d45aff9 100644
--- a/MdePkg/Library/BasePrintLib/PrintLib.c
+++ b/MdePkg/Library/BasePrintLib/PrintLib.c
@@ -1,12 +1,15 @@
  /** @file
Base Print Library instance implementation.

+  Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

  **/

+#include 
+
  #include "PrintLibInternal.h"

  //
@@ -19,6 +22,19 @@ VA_LIST  gNullVaList;

  #define ASSERT_UNICODE_BUFFER(Buffer)  ASSERT UINTN) (Buffer)) & 0x01) == 
0)

+//
+// Define the maximum debug and assert message length that this library 
supports
+//
+#define MAX_DEBUG_MESSAGE_LENGTH  0x100
+
+#define ASCII_RED_ESC_SEQ "\033[31m"
+#define 

[edk2-devel] [PATCH v2 1/1] MdePkg: Use ANSI colors to indicate debug message severity

2022-09-01 Thread Rebecca Cran
There currently isn't a way to differentiate the different
levels of DEBUG output: DEBUG_ERROR, DEBUG_WARN, DEBUG_INFO
etc.

To improve this, wrap DEBUG_ERROR and DEBUG_WARN level
messages in ANSI color code escape sequences. DEBUG_ERROR
messages will be displayed in red text, and DEBUG_WARN
in orange (the escape code is for the yellow color palette
entry, but it gets displayed as orange).

Only enable this new functionality if the FeatureFlag
gEfiMdePkgTokenSpaceGuid.PcdTerminalSupportsAnsiSequences
is set to TRUE. By default it's FALSE.

Signed-off-by: Rebecca Cran 
---
 MdePkg/MdePkg.dec|   6 +
 MdePkg/MdePkg.dsc|   2 +
 MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf |   2 +-
 MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf |   2 +-
 MdePkg/Include/Library/PrintLib.h|  39 ++
 MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c |   4 +
 MdePkg/Library/BasePrintLib/PrintLib.c   | 128 

 MdePkg/Library/UefiDebugLibConOut/DebugLib.c |   4 +
 8 files changed, 185 insertions(+), 2 deletions(-)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index f1ebf9e251c1..1370755944fc 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -4,6 +4,7 @@
 # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
 # EFI1.10/UEFI2.7/PI1.7 and some Industry Standards.
 #
+# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
 # Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
 # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP
@@ -1973,6 +1974,11 @@ [PcdsFeatureFlag]
   # @Prompt Validate ORDERED_COLLECTION structure
   
gEfiMdePkgTokenSpaceGuid.PcdValidateOrderedCollection|FALSE|BOOLEAN|0x002a
 
+  ## Indicates if the terminal supports ANSI sequences.
+  #   TRUE  - Supports ANSI sequences.
+  #   FALSE - Does not support ANSI sequences.
+  
gEfiMdePkgTokenSpaceGuid.PcdTerminalSupportsAnsiSequences|FALSE|BOOLEAN|0x002f
+
 [PcdsFixedAtBuild]
   ## Status code value for indicating a watchdog timer has expired.
   # EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_TIMER_EXPIRED
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index cc1ac196a931..fe6b476dac0e 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -1,6 +1,7 @@
 ## @file
 # EFI/PI MdePkg Package
 #
+# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
 # Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
 # (C) Copyright 2020 Hewlett Packard Enterprise Development LP
@@ -25,6 +26,7 @@ [Defines]
 
 [PcdsFeatureFlag]
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE
+  gEfiMdePkgTokenSpaceGuid.PcdTerminalSupportsAnsiSequences|FALSE
 
 [PcdsFixedAtBuild]
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
diff --git a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf 
b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
index 7504faee67f0..c759547cd662 100644
--- a/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+++ b/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
@@ -41,4 +41,4 @@ [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue  ## SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask  ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
-
+  gEfiMdePkgTokenSpaceGuid.PcdTerminalSupportsAnsiSequences ## CONSUMES
diff --git a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf 
b/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
index 53bbc8ce3f65..fb7bc1f8e728 100644
--- a/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
+++ b/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
@@ -50,4 +50,4 @@ [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue## 
SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel## CONSUMES
-
+  gEfiMdePkgTokenSpaceGuid.PcdTerminalSupportsAnsiSequences ## CONSUMES
diff --git a/MdePkg/Include/Library/PrintLib.h 
b/MdePkg/Include/Library/PrintLib.h
index 8d523cac528d..06d9761df897 100644
--- a/MdePkg/Include/Library/PrintLib.h
+++ b/MdePkg/Include/Library/PrintLib.h
@@ -2,6 +2,7 @@
   Provides services to print a formatted string to a buffer. All combinations 
of
   Unicode and ASCII strings are supported.
 
+Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -931,4 +932,42 @@ SPrintLengthAsciiFormat (
   IN  VA_LIST  Marker
   );
 
+/**

[edk2-devel] [PATCH v2 0/1] MdePkg: Use ANSI colors to indicate debug message severity

2022-09-01 Thread Rebecca Cran
Changes in v2:

Introduced a new FeatureFlag
gEfiMdePkgTokenSpaceGuid.PcdTerminalSupportsAnsiSequences
which defaults to FALSE, and which controls whether to use
ANSI color sequences.

Rebecca Cran (1):
  MdePkg: Use ANSI colors to indicate debug message severity

 MdePkg/MdePkg.dec|   6 +
 MdePkg/MdePkg.dsc|   2 +
 MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf |   2 +-
 MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf |   2 +-
 MdePkg/Include/Library/PrintLib.h|  39 ++
 MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c |   4 +
 MdePkg/Library/BasePrintLib/PrintLib.c   | 128 

 MdePkg/Library/UefiDebugLibConOut/DebugLib.c |   4 +
 8 files changed, 185 insertions(+), 2 deletions(-)

-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93066): https://edk2.groups.io/g/devel/message/93066
Mute This Topic: https://groups.io/mt/93406438/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] MinPlatformPkg: Add FSP 2.4 MultiPhase library.

2022-09-01 Thread Tim Lewis via groups.io
Is the FSP 2.4 specification available publicly? It is hard to understand the 
impact of this without referencing the specification. From the FSP page on 
https://www.intel.com/content/www/us/en/intelligent-systems/intel-firmware-support-package/intel-fsp-overview.html,
 only 2.3 is available.

Thanks,
Tim

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chiu, Chasel via 
groups.io
Sent: Wednesday, August 31, 2022 11:19 AM
To: devel@edk2.groups.io
Cc: Chasel Chiu ; Nate DeSimone 
; Isaac Oram ; Liming 
Gao ; Eric Dong 
Subject: [edk2-devel] [edk2-platforms: PATCH] MinPlatformPkg: Add FSP 2.4 
MultiPhase library.

FSP Wrapper has implemented FSP 2.4 MultiPhase support and required platform to 
include new library instance.

Cc: Nate DeSimone 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Chasel Chiu 
---
 Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc 
b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
index 8e91dba6ac..d4191c4b01 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
@@ -54,6 +54,8 @@
   
TpmPlatformHierarchyLib|MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf

FspMeasurementLib|IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf+
  
FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLibSample.inf+
  
FspWrapperMultiPhaseProcessLib|IntelFsp2WrapperPkg/Library/FspWrapperMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf
   
TcgEventLogRecordLib|SecurityPkg/Library/TcgEventLogRecordLib/TcgEventLogRecordLib.inf
   
TpmMeasurementLib|SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpmMeasurementLib.inf
 -- 
2.35.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93013): https://edk2.groups.io/g/devel/message/93013
Mute This Topic: https://groups.io/mt/93377589/1760553
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [tim.le...@insyde.com] 
-=-=-=-=-=-=




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




[edk2-devel] Building ShellBinPkg for stable tags/releases

2022-09-01 Thread Rebecca Cran

Has there been any progress on fixing the following Bugzilla tickets?

Enhance CI process to generate the release contents for each stable tag
https://bugzilla.tianocore.org/show_bug.cgi?id=3176

UEFI shell rebuild for edk2-stable202102
https://bugzilla.tianocore.org/show_bug.cgi?id=3178

ShellBinPkg was last built with a release for edk2-stable202002.

--
Rebecca Cran


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




Re: [edk2-devel] [PATCH v4 0/6] Enhance DynamicTablesPkg modules

2022-09-01 Thread Kun Qin

Hi Sami,

Thank you so much the test and help!

Regards,
Kun

On 9/1/2022 3:17 AM, Sami Mujawar wrote:
Dropped last patch in this series as discussed at 
https://edk2.groups.io/g/devel/topic/92947269#92984 and tested using 
guest firmware for Kvmtool.


For this series.

Tested-by: Sami Mujawar 

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 10/08/2022 11:28 pm, Kun Qin wrote:

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998

This patch series is a follow-up of previous submission:
https://edk2.groups.io/g/devel/message/91995

The main changes between v3 and v4 patches are:
   - Added reviewed-by collected from previous iteration
   - Fixed an error where the ACPI verification will fail incorrectly
   - Updated ECAM reservation routine with config space based look-up

Current DynamicTablesPkg provide great support for creating dynamic ACPI
tables during boot time.

However, there are some modules needs minor tweaks to expand support and
compatibility for OS requirements and platform needs.

This patch series proposes a few fixes to resolve minor issues 
discovered

in DynamicPlatRepoLib, AcpiSsdtPcieLibArm and DynamicTableManagerDxe.

Patch v4 branch: https://github.com/kuqin12/edk2/tree/dynamic_update_v4

Cc: Joe Lopez 
Cc: Sami Mujawar 
Cc: Alexei Fedorov 
Cc: Pierre Gondois 

Kun Qin (6):
   DynamicTablesPkg: DynamicPlatRepoLib: Added MemoryAllocationLib to 
inf

   DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing
   DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers
   DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed
 tables
   DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM
 space
   DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI
 config

DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c 
| 216 
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
| 140 +
DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c 
|  80 +++-
DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf 
|   4 +
DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf 
|   1 +

  5 files changed, 357 insertions(+), 84 deletions(-)




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




Re: [edk2-devel] [PATCH v6 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new SerialPortLib

2022-09-01 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Sravanthi, K KavyaX  
Sent: Thursday, September 1, 2022 3:13 AM
To: devel@edk2.groups.io
Cc: Sravanthi, K KavyaX ; Dong, Guo 
; Ni, Ray ; Rhodes, Sean 
; Lu, James ; Guo, Gua 

Subject: [PATCH v6 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new 
SerialPortLib

Let DxeMain.inf consume new SerialPortLib to support multiple channel debug 
message on early DXE if the macro MULTIPLE_DEBUG_PORT_SUPPORT is TRUE.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1b23ff3dbc..70828ea633 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -132,6 +132,8 @@
   # Note: for emulation platform such as QEMU, this may not work and should 
set it as FALSE
   DEFINE CPU_TIMER_LIB_ENABLE  = TRUE
 
+  DEFINE MULTIPLE_DEBUG_PORT_SUPPORT = FALSE
+
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
 !if $(USE_CBMEM_FOR_CONSOLE) == FALSE
@@ -615,6 +617,10 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  !if $(MULTIPLE_DEBUG_PORT_SUPPORT) == TRUE
+
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
+  !endif
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
--
2.30.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93062): https://edk2.groups.io/g/devel/message/93062
Mute This Topic: https://groups.io/mt/93391293/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] OvmfPkg: Add BUILD_SHELL flag for IA32, IA32X64, X64

2022-09-01 Thread Gerd Hoffmann
On Tue, Aug 30, 2022 at 06:13:54PM +0200, Oliver Steffen wrote:
> Add BUILD_SHELL flag, similar to the one in OvmfPkg/AmdSev,
> to enable/disable building of the UefiShell as part of
> the firmware image. The UefiShell should not be included for
> secure production systems (e.g. SecureBoot) because it can be
> used to circumvent security features.
> 
> The default value for BUILD_SHELL is TRUE to keep the default
> behavior of the Ovmf build.
> Note: the default for AmdSev is FALSE.
> 
> The BUILD_SHELL flag for AmdSev was introduced in b261a30c900a8.

Looks good to me and makes the files more consistent.

Acked-by: Gerd Hoffmann 

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93061): https://edk2.groups.io/g/devel/message/93061
Mute This Topic: https://groups.io/mt/93352403/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 13/14] OvmfPkg: Call gEdkiiMemoryAcceptProtocolGuid to accept pages

2022-09-01 Thread Gerd Hoffmann
On Sat, Aug 27, 2022 at 02:21:20PM +0800, Min Xu wrote:
> From: Min M Xu 
> 
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937
> 
> After EdkiiMemoryAcceptProtocol is implemented in TdxDxe driver, we can
> call it to accept pages in DXE phase.
> 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Gerd Hoffmann 
> Cc: Tom Lendacky 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93060): https://edk2.groups.io/g/devel/message/93060
Mute This Topic: https://groups.io/mt/93285611/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 12/14] OvmfPkg: Realize EdkiiMemoryAcceptProtocol in TdxDxe

2022-09-01 Thread Gerd Hoffmann
On Sat, Aug 27, 2022 at 02:21:19PM +0800, Min Xu wrote:
> From: Min M Xu 
> 
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937
> 
> Memory usage may exceed the amount accepted at the begining (SEC), TDVF
> needs to accept memory dynamically when OUT_OF_RESOURCE occurs.
> 
> EdkiiMemoryAcceptProtocol is defined in MdePkg and is implementated /
> installed in TdxDxe for Intel TDX memory acceptance.
> 
> Cc: Erdem Aktas 
> Cc: Gerd Hoffmann 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93059): https://edk2.groups.io/g/devel/message/93059
Mute This Topic: https://groups.io/mt/93285610/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 11/14] MdePkg: The prototype definition of EdkiiMemoryAcceptProtocol

2022-09-01 Thread Gerd Hoffmann
On Sat, Aug 27, 2022 at 02:21:18PM +0800, Min Xu wrote:
> From: Jiaqi Gao 
> 
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937
> 
> EdkiiMemoryAcceptProtocol is defined in MdePkg, the method AcceptMemory()
> can be called when memory needs to be accepted.
> 
> EdkiiMemoryAcceptProtocol can be installed by architecture-specific
> drivers such as TdxDxe. This allows different isolation architectures
> to realize their own low-level methods to accept memory.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Erdem Aktas 
> Cc: Gerd Hoffmann 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Signed-off-by: Jiaqi Gao 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93058): https://edk2.groups.io/g/devel/message/93058
Mute This Topic: https://groups.io/mt/93285609/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 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-09-01 Thread Gerd Hoffmann
> Lazy accept page can be controlled in build time like below:
>   -D LAZY_ACCEPT_PARTIAL_MEM=512
> 
> The unit is MB. If it is 0 then it means Lazy-accept is turned off.
> 
> Lazy-accept is turned off by default in OvmfPkgX64.
> Lazy-accept is turned on with 512MB by default in IntelTdxX64.

> +  
> gUefiOvmfPkgTokenSpaceGuid.PcdLazyAcceptPartialMemorySize|$(LAZY_ACCEPT_PARTIAL_MEM)

Hmm, cover letter says 0 means accept all memory below 4G

Care to clarify?  Is the commit message outdated?

Also I think the discussion of the last revision ended with the
agreement that accepting all memory below 4G is a good idea because it
simplifies the workflow (no need to split low memory into accepted and
unaccepted ranges for example).

So why we are again talking about accepting 512 MB ?

take care,
  Gerd



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




[edk2-devel] [PATCH] MdeModulePkg/UefiHiiLib: Fix typo

2022-09-01 Thread Konstantin Aladyshev
Fix typo in the set default value action define name:
DEFAUTL -> DEFAULT

Signed-off-by: Konstantin Aladyshev 
---
 MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c 
b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index 63a37ab59a..5821bd5488 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -12,7 +12,7 @@
 #define NAME_CONFIG_STRING_TYPE  0x01
 #define PATH_CONFIG_STRING_TYPE  0x02
 
-#define ACTION_SET_DEFAUTL_VALUE  0x01
+#define ACTION_SET_DEFAULT_VALUE  0x01
 #define ACTION_VALIDATE_SETTING   0x02
 
 #define HII_LIB_DEFAULT_VARSTORE_SIZE  0x200
@@ -2350,7 +2350,7 @@ InternalHiiIfrValueAction (
   //
   // Only support set default and validate setting action.
   //
-  if ((ActionType != ACTION_SET_DEFAUTL_VALUE) && (ActionType != 
ACTION_VALIDATE_SETTING)) {
+  if ((ActionType != ACTION_SET_DEFAULT_VALUE) && (ActionType != 
ACTION_VALIDATE_SETTING)) {
 return FALSE;
   }
 
@@ -2511,7 +2511,7 @@ InternalHiiIfrValueAction (
   VarGuid,
   VarName,
   DevicePath,
-  (ActionType == ACTION_SET_DEFAUTL_VALUE) ? 
 : NULL,  // it can be NULL to get the current setting.
+  (ActionType == ACTION_SET_DEFAULT_VALUE) ? 
 : NULL,  // it can be NULL to get the current setting.
   
   );
 
@@ -2534,7 +2534,7 @@ InternalHiiIfrValueAction (
 // 4. Set the default configuration information or Validate current 
setting by parse IFR code.
 //Current Setting is in ConfigResp, will be set into buffer, then 
check it again.
 //
-if (ActionType == ACTION_SET_DEFAUTL_VALUE) {
+if (ActionType == ACTION_SET_DEFAULT_VALUE) {
   //
   // Set the default configuration information.
   //
@@ -2716,7 +2716,7 @@ HiiSetToDefaults (
   IN UINT16DefaultId
   )
 {
-  return InternalHiiIfrValueAction (Request, DefaultId, 
ACTION_SET_DEFAUTL_VALUE);
+  return InternalHiiIfrValueAction (Request, DefaultId, 
ACTION_SET_DEFAULT_VALUE);
 }
 
 /**
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93056): https://edk2.groups.io/g/devel/message/93056
Mute This Topic: https://groups.io/mt/93398909/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 06/14] ShellPkg: Update shell command memmap to show unaccepted memory

2022-09-01 Thread Gerd Hoffmann
On Sat, Aug 27, 2022 at 02:21:13PM +0800, Min Xu wrote:
> From: Min M Xu 
> 
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937
> 
> ShellCommandRunMemMap() is updated to handle the case of unaccepted
> memory type.

Acked-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93055): https://edk2.groups.io/g/devel/message/93055
Mute This Topic: https://groups.io/mt/93285604/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 01/14] MdeModulePkg: Add PrePiHob.h

2022-09-01 Thread Gerd Hoffmann
  Hi,

> EFI_RESOURCE_MEMORY_UNACCEPTED is defined for unaccepted memory.
> But this defitinion has not been officially in the PI spec.

I think this has just changed with uefi spec 2.10 released
in August.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93054): https://edk2.groups.io/g/devel/message/93054
Mute This Topic: https://groups.io/mt/93285598/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] CloudHv/arm: switch PeiMemLib to its own

2022-09-01 Thread Sami Mujawar

Hi Jianyong,

Please prefix the patch series version for this patch.

Regards,

Sami Mujawar

On 19/08/2022 09:09 am, Jianyong Wu wrote:

As Cloud Hypervisor has its own PeiMemLib, change it in dsc file
accordingly.

Signed-off-by: Jianyong Wu 
Reviewed-by: Sami Mujawar 
---
  ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index 7559386a1d..7ca7a391d9 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -60,7 +60,7 @@
  !include MdePkg/MdeLibs.dsc.inc
  
  [LibraryClasses.common.PEIM]

-  
ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoPeiLib.inf
+  
ArmVirtMemInfoLib|ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf
  
  [LibraryClasses.common.DXE_DRIVER]


ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93053): https://edk2.groups.io/g/devel/message/93053
Mute This Topic: https://groups.io/mt/93120532/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/2] CloudHv/arm: add PeiMemInfoLib

2022-09-01 Thread Sami Mujawar

Hi Jianyong,

Thank you for the updated patch.

I have one comment marked inline as [SAMI]. Other than that this patch 
looks good to me.


With that fixed.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 19/08/2022 09:09 am, Jianyong Wu wrote:

Memory layout in CLoud Hypervisor for arm is changed and is different
with Qemu, thus we should build its own PeiMemInfoLib.
The main change in the memory layout is that normal ram may not contiguous
under 4G. The top 64M under 4G is reserved for 32bit device.

What this patch does:
1. get all of the memory node from DT;
2. Add all of the memory nodes to Hob;
3. Init page table for each memory node;

Signed-off-by: Jianyong Wu 
---
  .../CloudHvVirtMemInfoLib.c   | 230 ++
  .../CloudHvVirtMemInfoLib.h   |  42 
  .../CloudHvVirtMemInfoPeiLib.inf  |  46 
  3 files changed, 318 insertions(+)
  create mode 100644 
ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
  create mode 100644 
ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.h
  create mode 100644 
ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoPeiLib.inf

diff --git a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c 
b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
new file mode 100644
index 00..d9c434754e
--- /dev/null
+++ b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
@@ -0,0 +1,230 @@
+/** @file
+
+  Copyright (c) 2022, Arm Limited. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "CloudHvVirtMemInfoLib.h"
+
+CLOUDHV_MEM_NODE_INFO CloudHvMemNode[CLOUDHV_MAX_MEM_NODE_NUM];
+
+RETURN_STATUS
+EFIAPI
+CloudHvVirtMemInfoPeiLibConstructor (
+  VOID
+  )
+{
+  VOID   *DeviceTreeBase;
+  EFI_RESOURCE_ATTRIBUTE_TYPE  ResourceAttributes;
+  INT32  Node, Prev;
+  UINT64 FirMemNodeBase, FirMemNodeSize;
+  UINT64 CurBase, MemBase;
+  UINT64 CurSize;
+  CONST CHAR8*Type;
+  INT32  Len;
+  CONST UINT64   *RegProp;
+  RETURN_STATUS  PcdStatus;
+  UINT8  Index;
+
+  ZeroMem (CloudHvMemNode, sizeof(CloudHvMemNode));
+
+  FirMemNodeBase = 0;
+  FirMemNodeSize = 0;
+  Index = 0;
+  MemBase = FixedPcdGet64 (PcdSystemMemoryBase);
+  ResourceAttributes = (
+EFI_RESOURCE_ATTRIBUTE_PRESENT |
+EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
+EFI_RESOURCE_ATTRIBUTE_TESTED
+);
+  DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress);
+  if (DeviceTreeBase == NULL) {
+return EFI_NOT_FOUND;
+  }
+
+  //
+  // Make sure we have a valid device tree blob
+  //
+  if (fdt_check_header (DeviceTreeBase) != 0) {
+return EFI_NOT_FOUND;
+  }
+
+  //
+  // Look for the lowest memory node
+  //
+  for (Prev = 0; ; Prev = Node) {
+Node = fdt_next_node (DeviceTreeBase, Prev, NULL);
+if (Node < 0) {
+  break;
+}
+
+//
+// Check for memory node
+//
+Type = fdt_getprop (DeviceTreeBase, Node, "device_type", );
+if (Type && (AsciiStrnCmp (Type, "memory", Len) == 0)) {


[SAMI] Apologies I missed this in my earlier review. The above check 
should be


 + if ((Type !=0) && (AsciiStrnCmp (Type, "memory", Len) == 0)) {

as Type is not boolean.

[/SAMI]


+  //
+  // Get the 'reg' property of this node. For now, we will assume
+  // two 8 byte quantities for base and size, respectively.
+  //
+  RegProp = fdt_getprop (DeviceTreeBase, Node, "reg", );
+  if ((RegProp != 0) && (Len == (2 * sizeof (UINT64 {
+CurBase = fdt64_to_cpu (ReadUnaligned64 (RegProp));
+CurSize = fdt64_to_cpu (ReadUnaligned64 (RegProp + 1));
+
+DEBUG ((
+  DEBUG_INFO,
+  "%a: System RAM @ 0x%lx - 0x%lx\n",
+  __FUNCTION__,
+  CurBase,
+  CurBase + CurSize - 1
+  ));
+
+// We should build Hob seperately for the memory node except the first 
one
+if (CurBase != MemBase) {
+  BuildResourceDescriptorHob (
+EFI_RESOURCE_SYSTEM_MEMORY,
+ResourceAttributes,
+CurBase,
+CurSize
+);
+} else {
+  FirMemNodeBase = CurBase;
+  FirMemNodeSize = CurSize;
+}
+
+CloudHvMemNode[Index].Base = CurBase;
+CloudHvMemNode[Index].Size = CurSize;
+Index++;
+
+if (Index >= CLOUDHV_MAX_MEM_NODE_NUM) {
+  DEBUG ((
+DEBUG_WARN,
+"%a: memory node larger than %d will not be included into Memory 
System\n",
+__FUNCTION__,
+CLOUDHV_MAX_MEM_NODE_NUM
+));
+  break;
+}
+  } else {
+DEBUG ((
+ 

Re: [edk2-devel] [PATCH 1/1] DynamicTablesPkg: Fix typo in AmlCodeGenRdMemory32Fixed doxygen comment

2022-09-01 Thread Sami Mujawar
Merged as 7719bc3f716e..ac55fcb051e4

Thanks.

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93051): https://edk2.groups.io/g/devel/message/93051
Mute This Topic: https://groups.io/mt/93374776/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] DynamicTablesPkg: Fix nested processor containers

2022-09-01 Thread Sami Mujawar
Merged as 0a4079ad86f5..7719bc3f716e

Thanks.

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93050): https://edk2.groups.io/g/devel/message/93050
Mute This Topic: https://groups.io/mt/93107401/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] DynamicTablesPkg: Fix typo in AmlCodeGenRdMemory32Fixed doxygen comment

2022-09-01 Thread Sami Mujawar

Hi Rebecca,

Thank you for this fix.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 31/08/2022 05:20 pm, Rebecca Cran wrote:

Fix typo of "Address".

Signed-off-by: Rebecca Cran 
---
  DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c 
b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
index dafbd19fde15..32c3ab534d0b 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
@@ -619,7 +619,7 @@ AmlCodeGenRdDWordMemory (
See ACPI 6.4 spec, s19.2.8 for more.

@param [in]  IsReadWrite  ReadAndWrite parameter.
-  @param [in]  Addres   AddressBase parameter.
+  @param [in]  Address  AddressBase parameter.
@param [in]  RangeLength  Range length.
@param [in]  NameOpNode   NameOp object node defining a named 
object.
  If provided, append the new resource data

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93049): https://edk2.groups.io/g/devel/message/93049
Mute This Topic: https://groups.io/mt/93374776/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] DynamicTablesPkg: AcpiSsdtPcieLibArm : Add UID to slot creation

2022-09-01 Thread Sami Mujawar

Merged as  b9bb27e1ff40..0a4079ad86f5

Thanks.

Regards,

Sami Mujawar

On 24/08/2022 05:35 am, Jeff Brasen wrote:

Expose the UID value to GeneratePciSlots().

This is needed for some cases for example:

https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#identifying-externally-exposed-pcie-root-ports



Name (_DSD, Package () {

   ToUUID("EFCC06CC-73AC-4BC3-BFF0-76143807C389"),

   Package () {

 Package (2) {"ExternalFacingPort", 1},

 Package (2) {"UID", 0},

   }

})



Signed-off-by: Jeff Brasen 

---

  DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h | 8 +---

  .../Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c   | 5 -

  .../Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c| 8 +---

  3 files changed, 14 insertions(+), 7 deletions(-)



diff --git a/DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h 
b/DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h

index 85e283a994..4171dabc33 100644

--- a/DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h

+++ b/DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h

@@ -54,9 +54,10 @@ AddOscMethod (

used. It should be possible to enumerate them, but this is additional

information.

  


-  @param [in]   PciInfo Pci device information.

-  @param [in]  MappingTable The mapping table structure.

-  @param [in, out]  PciNode Pci node to amend.

+  @param [in]   PciInfo   Pci device information.

+  @param [in]   MappingTable  The mapping table structure.

+  @param [in]   Uid   Unique Id of the Pci device.

+  @param [in, out]  PciNode   Pci node to amend.

  


@retval EFI_SUCCESSSuccess.

@retval EFI_INVALID_PARAMETER  Invalid parameter.

@@ -67,6 +68,7 @@ EFIAPI

  GeneratePciSlots (

IN  CONST CM_ARM_PCI_CONFIG_SPACE_INFO  *PciInfo,

IN  CONST MAPPING_TABLE *MappingTable,

+  INUINT32Uid,

IN  OUT   AML_OBJECT_NODE_HANDLEPciNode

);

  


diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c

index ceffe2838c..24e074ea90 100644

--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c

+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c

@@ -295,6 +295,7 @@ GeneratePciDeviceInfo (

@param [in]   CfgMgrProtocol  Pointer to the Configuration Manager

  Protocol interface.

@param [in]   PciInfo Pci device information.

+  @param [in]   Uid Unique Id of the Pci device.

@param [in, out]  PciNode Pci node to amend.

  


@retval EFI_SUCCESS The function completed successfully.

@@ -308,6 +309,7 @@ GeneratePrt (

INACPI_PCI_GENERATOR*Generator,

IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,

IN  CONST CM_ARM_PCI_CONFIG_SPACE_INFO  *PciInfo,

+  INUINT32Uid,

IN  OUT   AML_OBJECT_NODE_HANDLEPciNode

)

  {

@@ -416,7 +418,7 @@ GeneratePrt (

PrtNode = NULL;

  


// Generate the Pci slots once all the device have been added.

-  Status = GeneratePciSlots (PciInfo, >DeviceTable, PciNode);

+  Status = GeneratePciSlots (PciInfo, >DeviceTable, Uid, PciNode);

if (EFI_ERROR (Status)) {

  ASSERT (0);

  goto exit_handler;

@@ -687,6 +689,7 @@ GeneratePciDevice (

 Generator,

 CfgMgrProtocol,

 PciInfo,

+   Uid,

 PciNode

 );

  if (EFI_ERROR (Status)) {

diff --git 
a/DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c 
b/DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c

index e5ab3a3ca8..b35fb6a7dd 100644

--- a/DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c

+++ b/DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c

@@ -41,9 +41,10 @@

used. It should be possible to enumerate them, but this is additional

information.

  


-  @param [in]   PciInfo Pci device information.

-  @param [in]  MappingTable The mapping table structure.

-  @param [in, out]  PciNode Pci node to amend.

+  @param [in]   PciInfo   Pci device information.

+  @param [in]   MappingTable  The mapping table structure.

+  @param [in]   Uid   Unique Id of the Pci device.

+  @param [in, out]  PciNode   Pci node to amend.

  


@retval EFI_SUCCESSSuccess.

@retval EFI_INVALID_PARAMETER  Invalid parameter.

@@ -54,6 +55,7 @@ EFIAPI

  GeneratePciSlots (

IN  CONST CM_ARM_PCI_CONFIG_SPACE_INFO  *PciInfo,

IN  CONST 

Re: [edk2-devel] [PATCH v2] DynamicTablesPkg: AcpiSsdtPcieLibArm : Add UID to slot creation

2022-09-01 Thread Sami Mujawar
Hi Jeff,

Thank you for this patch.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


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




[edk2-devel] Now: TianoCore edk2-test Bug Triage Meeting - 09/01/2022 #cal-notice

2022-09-01 Thread Group Notification
*TianoCore edk2-test Bug Triage Meeting*

*When:*
09/01/2022
10:00pm to 11:00pm
(UTC+08:00) Asia/Shanghai

*Where:*
https://armltd.zoom.us/j/93809865843?pwd=dU1hSzk4NHM2RGhaRDRyWWZxUzY5dz09=addon

*Organizer:* Edhaya Chandran edhaya.chand...@arm.com ( 
edhaya.chand...@arm.com?subject=Re:%20Event:%20TianoCore%20edk2-test%20Bug%20Triage%20Meeting
 )

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

*Description:*


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93046): https://edk2.groups.io/g/devel/message/93046
Mute This Topic: https://groups.io/mt/93395825/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: TianoCore edk2-test Bug Triage Meeting - 09/01/2022 #cal-reminder

2022-09-01 Thread Group Notification
*Reminder: TianoCore edk2-test Bug Triage Meeting*

*When:*
09/01/2022
10:00pm to 11:00pm
(UTC+08:00) Asia/Shanghai

*Where:*
https://armltd.zoom.us/j/93809865843?pwd=dU1hSzk4NHM2RGhaRDRyWWZxUzY5dz09=addon

*Organizer:* Edhaya Chandran edhaya.chand...@arm.com ( 
edhaya.chand...@arm.com?subject=Re:%20Event:%20TianoCore%20edk2-test%20Bug%20Triage%20Meeting
 )

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

*Description:*


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93045): https://edk2.groups.io/g/devel/message/93045
Mute This Topic: https://groups.io/mt/93371494/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 v3] DynamicTablesPkg: Add support to build _DSD

2022-09-01 Thread Sami Mujawar
Merged as 033ba8bb2976..b9bb27e1ff40

Thanks.

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93044): https://edk2.groups.io/g/devel/message/93044
Mute This Topic: https://groups.io/mt/93085812/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] RedfishPkg/RedfishDiscoverDxe: Install EFI_DISCOVER_PROTOCOL on each network interface

2022-09-01 Thread Igor Kulchytskyy via groups.io
Reviewed-by:  Igor Kulchytskyy 

Thank you,
Igor

-Original Message-
From: abner.ch...@amd.com 
Sent: Thursday, September 01, 2022 12:02 AM
To: devel@edk2.groups.io
Cc: Nickle Wang ; Igor Kulchytskyy 
Subject: [EXTERNAL] [PATCH V2] RedfishPkg/RedfishDiscoverDxe: Install 
EFI_DISCOVER_PROTOCOL on each network interface


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

From: Abner Chang 

BZ 4037:
Install EFI_DISCOVER_PROTOCOL on each network interface.

This fixes the issue that causes the high-level Redfish driver on the network 
interface is stopped when:
1. EFI_DISCOVER_PROTOCOL is reinstalled on a new-found network
   interface, or
2. EFI_DISCOVER_PROTOCOL is stopped on the network interface
   other than the one which is used to communicate with Redfish
   service.

Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Signed-off-by: Abner Chang 
---
 .../RedfishDiscoverInternal.h |   7 +
 .../RedfishDiscoverDxe/RedfishDiscoverDxe.c   | 140 ++
 2 files changed, 88 insertions(+), 59 deletions(-)

diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h 
b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
index 4d1319b2641..04fa09e1cc2 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
@@ -2,6 +2,7 @@
   This file defines the EFI Redfish Discover Protocol interface.

   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2022, AMD Incorporated. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -107,6 +108,12 @@ typedef struct {

///< NETWORK_INTERFACE_PROTOCOL_TYPE.
   REDFISH_DISCOVER_NETWORK_INTERFACE_PROTOCOLNetworkInterfaceProtocolInfo; 
///< Network interface protocol information.
   EFI_HANDLE RestExHandle; 
///< REST EX handle associated with this network interface.
+  //
+  // EFI_REDFISH_DISCOVER_PROTOCOL instance installed  // on this
+ network interface.
+  //
+  EFI_HANDLE 
EfiRedfishDiscoverProtocolHandle; ///< EFI_REDFISH_DISCOVER_PROTOTOCOL instance 
installed
+   
///< on this network interface.
 } EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL;

 //
diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c 
b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
index bf50c78c928..a271f6e942d 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
@@ -3,6 +3,7 @@
   The implementation of EFI Redfidh Discover Protocol.

   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2022, AMD Incorporated. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -23,8 +24,6 @@ EFI_GUID  mRedfishDiscoverTcp4InstanceGuid   = 
EFI_REDFISH_DISCOVER_TCP4_INSTANC
 EFI_GUID  mRedfishDiscoverTcp6InstanceGuid   = 
EFI_REDFISH_DISCOVER_TCP6_INSTANCE_GUID;
 EFI_GUID  mRedfishDiscoverRestExInstanceGuid = 
EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_GUID;

-EFI_HANDLE  EfiRedfishDiscoverProtocolHandle = NULL;
-
 EFI_STATUS
 EFIAPI
 Tcp4GetSubnetInfo (
@@ -325,6 +324,38 @@ GetTargetNetworkInterfaceInternal (
   return NULL;
 }

+/**
+  This function searches
+EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL
+  instance with the given  Controller handle.
+
+  @param[in] ControllerHandle  The controller handle associated with network 
interface.
+
+  @retval Non-NULL  EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL is 
returned.
+  @retval NULL  Non of EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL 
instance is returned.
+**/
+EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *
+GetTargetNetworkInterfaceInternalByController (
+  IN EFI_HANDLE  ControllerHandle
+  )
+{
+  EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL
+*ThisNetworkInterface;
+
+  ThisNetworkInterface =
+ (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetFirstNode
+ ();
+  while (TRUE) {
+if (ThisNetworkInterface->OpenDriverControllerHandle == ControllerHandle) {
+  return ThisNetworkInterface;
+}
+
+if (IsNodeAtEnd (, 
>Entry)) {
+  return NULL;
+}
+
+ThisNetworkInterface =
+ (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetNextNode
+ (, >Entry);
+ }
+
+  return NULL;
+}
+
 /**
   This function validate if target network interface is ready for discovering
   Redfish service.
@@ -1619,29 +1650,30 @@ BuildupNetworkInterface (
   EFI_OPEN_PROTOCOL_BY_DRIVER
   );
   if (!EFI_ERROR (Status)) {
-if ((EfiRedfishDiscoverProtocolHandle == NULL) &&
-(gRequiredProtocol[Index].ProtocolType == ProtocolTypeRestEx) &&
-

Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support

2022-09-01 Thread Rebecca Cran
You don't need a TianoCore account: if you have a personal GitHub 
account you could push to a fork there.
For example, I have https://github.com/bcran/edk2 which I forked from 
https://github.com/tianocore/edk2 .


--
Rebecca Cran

On 8/31/22 20:51, RichardHo [何明忠] wrote:

Hi Rebecca,

All files are new. I sent it with "git send-email".
I don't have account to push the code into branch.

Thanks,
Richard

-Original Message-
From: Rebecca Cran 
Sent: 2022年8月31日 9:28 PM
To: devel@edk2.groups.io; RichardHo [何明忠] 
Cc: Andrew Fish ; Leif Lindholm ; Michael D Kinney 
; Michael Kubacki ; Zhiguang Liu 
; Liming Gao ; TonyLo [羅金松] 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network 
devices support


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

Do you have a public branch somewhere I could pull this code from?
Much of the patch appears to have been mangled during sending, with extra blank 
lines.

--

Rebecca Cran


On 8/31/22 01:51, RichardHo [何明忠] via groups.io wrote:

new file mode 100644
index 00..1c1a450920
--- /dev/null
+++ b/UsbNetworkPkg/Include/Protocol/UsbEthernetProtocol.h
@@ -0,0 +1,872 @@
+/** @file

+  Header file contains code for USB Ethernet Protocol

+  definitions

+

+  Copyright (c) 2022, American Megatrends International LLC. All rights 
reserved.

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#ifndef _USB_ETHERNET_PROTOCOL_H

+#define _USB_ETHERNET_PROTOCOL_H

+

+#define USB_ETHERNET_PROTOCOL_GUID \

+{0x8d8969cc, 0xfeb0, 0x4303, {0xb2, 0x1a, 0x1f, 0x11, 0x6f, 0x38, 0x56, 
0x43}}

+

-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93042): https://edk2.groups.io/g/devel/message/93042
Mute This Topic: https://groups.io/mt/93121092/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] DynamicTablesPkg: Add support to build _DSD

2022-09-01 Thread Sami Mujawar
Hi Jeff,

Thank you for this patch.

There are some minor documentation changes that I will fix before pushing. 
Other than that this patch looks good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


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




Re: [edk2-devel] [PATCH v4 0/6] Enhance DynamicTablesPkg modules

2022-09-01 Thread Sami Mujawar
Merged as 9ca7ece8b3b1..033ba8bb2976

Thanks.

Regards,

Sami Mujawar


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




Re: [edk2-devel] [PATCH] [edk2-basetools]GenCrc32:Convert the C tool of calculating the crc32 into a python tool

2022-09-01 Thread Michael Brown

On 01/09/2022 07:57, liwenzha wrote:

This patch converts the C tool of calculating the crc32 value of file into
a python file. To realize this,after reading the data into the file in
binary form from an original file,a lookup table is listed to do XOR and
shifting calculation for each bit in the file.


Python has binascii.crc32 as part of the standard library.  You can 
throw away the mCrcTable and all of the open-coded CRC32 calculation 
logic, and just do:


  from binascii import crc32

  CrcOut = crc32(filebytes)

HTH,

Michael


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93039): https://edk2.groups.io/g/devel/message/93039
Mute This Topic: https://groups.io/mt/93391061/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/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib

2022-09-01 Thread Sami Mujawar
Hi Nhi,

Thank you for the updated patch. These changes look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


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




Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support

2022-09-01 Thread RichardHo [何明忠] via groups . io
Hi Abner,

OK, I will using "--transfer-encoding=8bit " to resend it next.

Thanks,
Richard


-Original Message-
From: Chang, Abner 
Sent: 2022年9月1日 5:06 PM
To: devel@edk2.groups.io; RichardHo [何明忠] ; Rebecca Cran 

Cc: Andrew Fish ; Leif Lindholm ; 
Michael D Kinney ; Michael Kubacki 
; Zhiguang Liu ; Liming 
Gao ; TonyLo [羅金松] 
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network 
devices support


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

[AMD Official Use Only - General]

Hi Richard,
Not sure if you can fix the extra lines using "--transfer-encoding=8bit" option 
to git send-email. Would you like to resend it?

Thanks
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of
> RichardHo [???] via groups.io
> Sent: Thursday, September 1, 2022 10:52 AM
> To: Rebecca Cran ; devel@edk2.groups.io
> Cc: Andrew Fish ; Leif Lindholm
> ; Michael D Kinney
> ; Michael Kubacki
> ; Zhiguang Liu
> ; Liming Gao ;
> TonyLo [羅金松]
> 
> Subject: Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network
> devices support
>
> [CAUTION: External Email]
>
> Hi Rebecca,
>
> All files are new. I sent it with "git send-email".
> I don't have account to push the code into branch.
>
> Thanks,
> Richard
>
> -Original Message-
> From: Rebecca Cran 
> Sent: 2022年8月31日 9:28 PM
> To: devel@edk2.groups.io; RichardHo [何明忠] 
> Cc: Andrew Fish ; Leif Lindholm
> ; Michael D Kinney
> ; Michael Kubacki
> ; Zhiguang Liu
> ; Liming Gao ;
> TonyLo [羅金松]
> 
> Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB
> network devices support
>
>
> **CAUTION: The e-mail below is from an external source. Please
> exercise caution before opening attachments, clicking links, or
> following guidance.**
>
> Do you have a public branch somewhere I could pull this code from?
> Much of the patch appears to have been mangled during sending, with
> extra blank lines.
>
> --
>
> Rebecca Cran
>
>
> On 8/31/22 01:51, RichardHo [何明忠] via groups.io wrote:
> > new file mode 100644
> > index 00..1c1a450920
> > --- /dev/null
> > +++ b/UsbNetworkPkg/Include/Protocol/UsbEthernetProtocol.h
> > @@ -0,0 +1,872 @@
> > +/** @file
> >
> > +  Header file contains code for USB Ethernet Protocol
> >
> > +  definitions
> >
> > +
> >
> > +  Copyright (c) 2022, American Megatrends International LLC. All
> > + rights
> reserved.
> >
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +**/
> >
> > +
> >
> > +#ifndef _USB_ETHERNET_PROTOCOL_H
> >
> > +#define _USB_ETHERNET_PROTOCOL_H
> >
> > +
> >
> > +#define USB_ETHERNET_PROTOCOL_GUID \
> >
> > +{0x8d8969cc, 0xfeb0, 0x4303, {0xb2, 0x1a, 0x1f, 0x11, 0x6f,
> > + 0x38, 0x56,
> 0x43}}
> >
> > +
> -The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI). This communication is
> intended to be read only by the individual or entity to whom it is
> addressed or by their designee. If the reader of this message is not
> the intended recipient, you are on notice that any distribution of
> this message, in any form, is strictly prohibited. Please promptly
> notify the sender by reply e-mail or by telephone at 770-246-8600, and
> then delete or destroy all copies of the transmission.
>
>
> 
>
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93037): https://edk2.groups.io/g/devel/message/93037
Mute This Topic: https://groups.io/mt/93121092/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 6/8] DynamicTablesPkg/AcpiPpttLibArm: Fix debug macro arguments

2022-09-01 Thread Sami Mujawar

Hi Michael,

Thank you for this fix.

These changes look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 25/08/2022 04:48 am, mikub...@linux.microsoft.com wrote:

From: Michael Kubacki 

Cc: Sami Mujawar 
Cc: Alexei Fedorov 
Signed-off-by: Michael Kubacki 
---
  DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
index 59001378c4e0..78fa63ff47e5 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
@@ -436,7 +436,6 @@ IsGicCTokenEqual (
"the same GICC Info object. ACPI Processor IDs are not unique. " \
"GicCToken = %p.\n",
Index1,
-  IndexedObject1->Token,
Index2,
ProcNode1->GicCToken
));
@@ -566,7 +565,7 @@ AddProcHierarchyNodes (
  DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: Failed to get parent processor hierarchy node " \
-  "reference. Token = %p, Status = %r\n",
+  "reference. ParentToken = %p. ChildToken = %p. Status = %r\n",
ProcInfoNode->ParentToken,
ProcInfoNode->Token,
Status



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




Re: [edk2-devel] [PATCH v4 0/6] Enhance DynamicTablesPkg modules

2022-09-01 Thread Sami Mujawar
Dropped last patch in this series as discussed at 
https://edk2.groups.io/g/devel/topic/92947269#92984 and tested using 
guest firmware for Kvmtool.


For this series.

Tested-by: Sami Mujawar 

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 10/08/2022 11:28 pm, Kun Qin wrote:

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998

This patch series is a follow-up of previous submission:
https://edk2.groups.io/g/devel/message/91995

The main changes between v3 and v4 patches are:
   - Added reviewed-by collected from previous iteration
   - Fixed an error where the ACPI verification will fail incorrectly
   - Updated ECAM reservation routine with config space based look-up

Current DynamicTablesPkg provide great support for creating dynamic ACPI
tables during boot time.

However, there are some modules needs minor tweaks to expand support and
compatibility for OS requirements and platform needs.

This patch series proposes a few fixes to resolve minor issues discovered
in DynamicPlatRepoLib, AcpiSsdtPcieLibArm and DynamicTableManagerDxe.

Patch v4 branch: https://github.com/kuqin12/edk2/tree/dynamic_update_v4

Cc: Joe Lopez 
Cc: Sami Mujawar 
Cc: Alexei Fedorov 
Cc: Pierre Gondois 

Kun Qin (6):
   DynamicTablesPkg: DynamicPlatRepoLib: Added MemoryAllocationLib to inf
   DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing
   DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers
   DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed
 tables
   DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM
 space
   DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI
 config

  DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c   | 
216 
  DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c   | 
140 +
  DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c|  
80 +++-
  DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf |  
 4 +
  DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepoLib.inf  |  
 1 +
  5 files changed, 357 insertions(+), 84 deletions(-)




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




[edk2-devel] [PATCH v6 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new SerialPortLib

2022-09-01 Thread Kavya
Let DxeMain.inf consume new SerialPortLib to support multiple
channel debug message on early DXE if the macro
MULTIPLE_DEBUG_PORT_SUPPORT is TRUE.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1b23ff3dbc..70828ea633 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -132,6 +132,8 @@
   # Note: for emulation platform such as QEMU, this may not work and should 
set it as FALSE
   DEFINE CPU_TIMER_LIB_ENABLE  = TRUE
 
+  DEFINE MULTIPLE_DEBUG_PORT_SUPPORT = FALSE
+
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
 !if $(USE_CBMEM_FOR_CONSOLE) == FALSE
@@ -615,6 +617,10 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  !if $(MULTIPLE_DEBUG_PORT_SUPPORT) == TRUE
+
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
+  !endif
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH v6 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-09-01 Thread Kavya
Add new Serial port library instance that consumes the HOB defined
in MdeModulePkg/Include/UniversalPayload/SerialPortInfo.h to support
multiple UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 808 

 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  39 
+++
 2 files changed, 847 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
new file mode 100644
index 00..90634cc602
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -0,0 +1,808 @@
+/** @file
+  UART Serial Port library functions.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// 16550 UART register offsets and bitfields
+//
+#define R_UART_RXBUF 0// LCR_DLAB = 0
+#define R_UART_TXBUF 0// LCR_DLAB = 0
+#define R_UART_BAUD_LOW  0// LCR_DLAB = 1
+#define R_UART_BAUD_HIGH 1// LCR_DLAB = 1
+#define R_UART_IER   1// LCR_DLAB = 0
+#define R_UART_FCR   2
+#define   B_UART_FCR_FIFOE   BIT0
+#define   B_UART_FCR_FIFO64  BIT5
+#define R_UART_LCR   3
+#define   B_UART_LCR_DLABBIT7
+#define R_UART_MCR   4
+#define   B_UART_MCR_DTRCBIT0
+#define   B_UART_MCR_RTS BIT1
+#define R_UART_LSR   5
+#define   B_UART_LSR_RXRDY   BIT0
+#define   B_UART_LSR_TXRDY   BIT5
+#define   B_UART_LSR_TEMTBIT6
+#define R_UART_MSR   6
+#define   B_UART_MSR_CTS BIT4
+#define   B_UART_MSR_DSR BIT5
+#define   B_UART_MSR_RI  BIT6
+#define   B_UART_MSR_DCD BIT7
+
+#define MAX_SIZE 16
+
+typedef struct {
+  UINTNBaseAddress;
+  BOOLEAN  UseMmio;
+  UINT32   BaudRate;
+  UINT8RegisterStride;
+} UART_INFO;
+
+UART_INFO   mUartInfo[MAX_SIZE];
+UINT8   mUartCount = 0;
+
+/**
+  Reads an 8-bit register. If UseMmio is TRUE, then the value is read from
+  MMIO space. If UseMmio is FALSE, then the value is read from I/O space. The
+  parameter Offset is added to the base address of the register.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to read.
+  @param  UseMmio  Check if value has to be read from MMIO space or IO 
space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value read from the register.
+
+**/
+UINT8
+SerialPortReadRegister (
+  UINTNBase,
+  UINTNOffset,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioRead8 (Base + Offset * RegisterStride);
+  } else {
+return IoRead8 (Base + Offset * RegisterStride);
+  }
+}
+
+/**
+  Writes an 8-bit register.. If UseMmio is TRUE, then the value is written to
+  MMIO space. If UseMmio is FALSE, then the value is written to I/O space. The
+  parameter Offset is added to the base address of the registers.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to write.
+  @param  ValueValue to be written.
+  @param  UseMmio  Check if value has to be written to MMIO space or 
IO space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value written to the register.
+
+**/
+UINT8
+SerialPortWriteRegister (
+  UINTNBase,
+  UINTNOffset,
+  UINT8Value,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioWrite8 (Base + Offset * RegisterStride, Value);
+  } else {
+return IoWrite8 (Base + Offset * RegisterStride, Value);
+  }
+}
+
+/**
+  Initialize the serial device hardware.
+
+  If no initialization is required, then return RETURN_SUCCESS.
+  If the 

[edk2-devel] [PATCH] [edk2-basetools]GenCrc32:Convert the C tool of calculating the crc32 into a python tool

2022-09-01 Thread liwenzha
description

This patch converts the C tool of calculating the crc32 value of file into

a python file. To realize this,after reading the data into the file in

binary form from an original file,a lookup table is listed to do XOR and

shifting calculation for each bit in the file.The 32-bit result is placed

at the beginning of the file as the header.The verification part will

recalculate the crc32 value of the data behind the header again.When header

is equal to the recalculating result,which means the crc32 value of this file

is correct and the file is valid.In the unit testing part,some files which

have been preprocessed by C tool are placed in a folder.The file after 
processing

by python tool will be compared with these files to check whether the result is 
correct.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 

---
 edk2basetools/GenCrc32/GenCrc32.py| 373 ++
 edk2basetools/GenCrc32/__init__.py|  10 +
 edk2basetools/tests/GenCrc32/decode/PcdPeim   | Bin 0 -> 18912 bytes
 .../tests/GenCrc32/decode/PcdPeim_crc32   | Bin 0 -> 18916 bytes
 .../tests/GenCrc32/decode/S3Resume2Pei| Bin 0 -> 18272 bytes
 .../tests/GenCrc32/decode/S3Resume2Pei_crc32  | Bin 0 -> 18276 bytes
 edk2basetools/tests/GenCrc32/decode/demo  |   1 +
 edk2basetools/tests/GenCrc32/decode/demo_crc  |   1 +
 .../tests/GenCrc32/encode/PcdPeim.efi | Bin 0 -> 18912 bytes
 .../tests/GenCrc32/encode/PcdPeim_crc32   | Bin 0 -> 18916 bytes
 .../tests/GenCrc32/encode/S3Resume2Pei.efi| Bin 0 -> 18272 bytes
 .../tests/GenCrc32/encode/S3Resume2Pei_crc32  | Bin 0 -> 18276 bytes
 edk2basetools/tests/GenCrc32/encode/demo.bin  |   1 +
 edk2basetools/tests/GenCrc32/encode/demo_crc  |   1 +
 edk2basetools/tests/GenCrc32/test_gencrc32.py | 124 ++
 15 files changed, 511 insertions(+)
 create mode 100644 edk2basetools/GenCrc32/GenCrc32.py
 create mode 100644 edk2basetools/GenCrc32/__init__.py
 create mode 100644 edk2basetools/tests/GenCrc32/decode/PcdPeim
 create mode 100644 edk2basetools/tests/GenCrc32/decode/PcdPeim_crc32
 create mode 100644 edk2basetools/tests/GenCrc32/decode/S3Resume2Pei
 create mode 100644 edk2basetools/tests/GenCrc32/decode/S3Resume2Pei_crc32
 create mode 100644 edk2basetools/tests/GenCrc32/decode/demo
 create mode 100644 edk2basetools/tests/GenCrc32/decode/demo_crc
 create mode 100644 edk2basetools/tests/GenCrc32/encode/PcdPeim.efi
 create mode 100644 edk2basetools/tests/GenCrc32/encode/PcdPeim_crc32
 create mode 100644 edk2basetools/tests/GenCrc32/encode/S3Resume2Pei.efi
 create mode 100644 edk2basetools/tests/GenCrc32/encode/S3Resume2Pei_crc32
 create mode 100644 edk2basetools/tests/GenCrc32/encode/demo.bin
 create mode 100644 edk2basetools/tests/GenCrc32/encode/demo_crc
 create mode 100644 edk2basetools/tests/GenCrc32/test_gencrc32.py

diff --git a/edk2basetools/GenCrc32/GenCrc32.py 
b/edk2basetools/GenCrc32/GenCrc32.py
new file mode 100644
index 000..e27e4b0
--- /dev/null
+++ b/edk2basetools/GenCrc32/GenCrc32.py
@@ -0,0 +1,373 @@
+#@file
+#Calculate Crc32 value and Verify Crc32 value for input data.
+#
+#Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+#SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+#
+#Import Modules
+#
+import io
+import logging
+import argparse
+import os
+import sys
+
+mCrcTable=[0x,
+  0x77073096,
+  0xEE0E612C,
+  0x990951BA,
+  0x076DC419,
+  0x706AF48F,
+  0xE963A535,
+  0x9E6495A3,
+  0x0EDB8832,
+  0x79DCB8A4,
+  0xE0D5E91E,
+  0x97D2D988,
+  0x09B64C2B,
+  0x7EB17CBD,
+  0xE7B82D07,
+  0x90BF1D91,
+  0x1DB71064,
+  0x6AB020F2,
+  0xF3B97148,
+  0x84BE41DE,
+  0x1ADAD47D,
+  0x6DDDE4EB,
+  0xF4D4B551,
+  0x83D385C7,
+  0x136C9856,
+  0x646BA8C0,
+  0xFD62F97A,
+  0x8A65C9EC,
+  0x14015C4F,
+  0x63066CD9,
+  0xFA0F3D63,
+  0x8D080DF5,
+  0x3B6E20C8,
+  0x4C69105E,
+  0xD56041E4,
+  0xA2677172,
+  0x3C03E4D1,
+  0x4B04D447,
+  0xD20D85FD,
+  0xA50AB56B,
+  0x35B5A8FA,
+  0x42B2986C,
+  0xDBBBC9D6,
+  0xACBCF940,
+  0x32D86CE3,
+  0x45DF5C75,
+  0xDCD60DCF,
+  0xABD13D59,
+  0x26D930AC,
+  0x51DE003A,
+  0xC8D75180,
+  0xBFD06116,
+  0x21B4F4B5,
+  0x56B3C423,
+  0xCFBA9599,
+  0xB8BDA50F,
+  0x2802B89E,
+  0x5F058808,
+  0xC60CD9B2,
+  0xB10BE924,
+  0x2F6F7C87,
+  0x58684C11,
+  0xC1611DAB,
+  0xB6662D3D,
+  0x76DC4190,
+  0x01DB7106,
+  0x98D220BC,
+  0xEFD5102A,
+  0x71B18589,
+  0x06B6B51F,
+  0x9FBFE4A5,
+  0xE8B8D433,
+  0x7807C9A2,
+  0x0F00F934,
+  0x9609A88E,
+  0xE10E9818,
+  0x7F6A0DBB,
+  0x086D3D2D,
+  0x91646C97,
+  0xE6635C01,
+  0x6B6B51F4,
+  0x1C6C6162,
+  0x856530D8,
+  0xF262004E,
+  0x6C0695ED,
+  0x1B01A57B,
+  0x8208F4C1,
+  0xF50FC457,
+  0x65B0D9C6,
+  0x12B7E950,
+  0x8BBEB8EA,
+  0xFCB9887C,
+  0x62DD1DDF,
+  0x15DA2D49,
+  0x8CD37CF3,
+  0xFBD44C65,
+  0x4DB26158,
+  0x3AB551CE,
+  0xA3BC0074,
+  0xD4BB30E2,
+  0x4ADFA541,
+  0x3DD895D7,
+  0xA4D1C46D,
+  0xD3D6F4FB,
+  0x4369E96A,
+  0x346ED9FC,
+  0xAD678846,
+  0xDA60B8D0,
+  0x44042D73,
+  

Re: [edk2-devel] [PATCH V2] RedfishPkg/RedfishDiscoverDxe: Install EFI_DISCOVER_PROTOCOL on each network interface

2022-09-01 Thread NickleLa
Reviewed-by:  Nickle Wang 


Thanks,

Nickle

 於 2022年9月1日 週四 中午12:02寫道:

> From: Abner Chang 
>
> BZ 4037:
> Install EFI_DISCOVER_PROTOCOL on each network interface.
>
> This fixes the issue that causes the high-level Redfish driver
> on the network interface is stopped when:
> 1. EFI_DISCOVER_PROTOCOL is reinstalled on a new-found network
>interface, or
> 2. EFI_DISCOVER_PROTOCOL is stopped on the network interface
>other than the one which is used to communicate with Redfish
>service.
>
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Signed-off-by: Abner Chang 
> ---
>  .../RedfishDiscoverInternal.h |   7 +
>  .../RedfishDiscoverDxe/RedfishDiscoverDxe.c   | 140 ++
>  2 files changed, 88 insertions(+), 59 deletions(-)
>
> diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
> b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
> index 4d1319b2641..04fa09e1cc2 100644
> --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
> +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
> @@ -2,6 +2,7 @@
>This file defines the EFI Redfish Discover Protocol interface.
>
>(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +  Copyright (c) 2022, AMD Incorporated. All rights reserved.
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -107,6 +108,12 @@ typedef struct {
>
>   ///< NETWORK_INTERFACE_PROTOCOL_TYPE.
>REDFISH_DISCOVER_NETWORK_INTERFACE_PROTOCOL
> NetworkInterfaceProtocolInfo; ///< Network interface protocol information.
>EFI_HANDLE RestExHandle;
>  ///< REST EX handle associated with this network interface.
> +  //
> +  // EFI_REDFISH_DISCOVER_PROTOCOL instance installed
> +  // on this network interface.
> +  //
> +  EFI_HANDLE
>  EfiRedfishDiscoverProtocolHandle; ///< EFI_REDFISH_DISCOVER_PROTOTOCOL
> instance installed
> +
>  ///< on this network interface.
>  } EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL;
>
>  //
> diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> index bf50c78c928..a271f6e942d 100644
> --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> @@ -3,6 +3,7 @@
>The implementation of EFI Redfidh Discover Protocol.
>
>(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +  Copyright (c) 2022, AMD Incorporated. All rights reserved.
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -23,8 +24,6 @@ EFI_GUID  mRedfishDiscoverTcp4InstanceGuid   =
> EFI_REDFISH_DISCOVER_TCP4_INSTANC
>  EFI_GUID  mRedfishDiscoverTcp6InstanceGuid   =
> EFI_REDFISH_DISCOVER_TCP6_INSTANCE_GUID;
>  EFI_GUID  mRedfishDiscoverRestExInstanceGuid =
> EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_GUID;
>
> -EFI_HANDLE  EfiRedfishDiscoverProtocolHandle = NULL;
> -
>  EFI_STATUS
>  EFIAPI
>  Tcp4GetSubnetInfo (
> @@ -325,6 +324,38 @@ GetTargetNetworkInterfaceInternal (
>return NULL;
>  }
>
> +/**
> +  This function searches EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL
> +  instance with the given  Controller handle.
> +
> +  @param[in] ControllerHandle  The controller handle associated with
> network interface.
> +
> +  @retval Non-NULL  EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL is
> returned.
> +  @retval NULL  Non of
> EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instance is returned.
> +**/
> +EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *
> +GetTargetNetworkInterfaceInternalByController (
> +  IN EFI_HANDLE  ControllerHandle
> +  )
> +{
> +  EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL  *ThisNetworkInterface;
> +
> +  ThisNetworkInterface = (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL
> *)GetFirstNode ();
> +  while (TRUE) {
> +if (ThisNetworkInterface->OpenDriverControllerHandle ==
> ControllerHandle) {
> +  return ThisNetworkInterface;
> +}
> +
> +if (IsNodeAtEnd (,
> >Entry)) {
> +  return NULL;
> +}
> +
> +ThisNetworkInterface =
> (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetNextNode
> (, >Entry);
> +  }
> +
> +  return NULL;
> +}
> +
>  /**
>This function validate if target network interface is ready for
> discovering
>Redfish service.
> @@ -1619,29 +1650,30 @@ BuildupNetworkInterface (
>EFI_OPEN_PROTOCOL_BY_DRIVER
>);
>if (!EFI_ERROR (Status)) {
> -if ((EfiRedfishDiscoverProtocolHandle == NULL) &&
> -(gRequiredProtocol[Index].ProtocolType == ProtocolTypeRestEx)
> &&
> -!IsListEmpty ()
> -)
> -{
> -  // Install the fisrt Redfish Discover Protocol when EFI REST EX
> protcol is discovered.
> -  // This ensures EFI REST EX is ready while
> EFI_REDFISH_DISCOVER_PROTOCOL consumer acquires
> -  // Redfish serivce over network interface.
> -
> -  Status = gBS->InstallProtocolInterface (
> -   

[edk2-devel] [PATCH] [edk2-basetools]GenCrc32:Convert the C tool of calculating the crc32 into a python tool

2022-09-01 Thread liwenzha
description

This patch converts the C tool of calculating the crc32 value of file into

a python file. To realize this,after reading the data into the file in

binary form from an original file,a lookup table is listed to do XOR and

shifting calculation for each bit in the file.The 32-bit result is placed

at the beginning of the file as the header.The verification part will

recalculate the crc32 value of the data behind the header again.When header

is equal to the recalculating result,which means the crc32 value of this file

is correct and the file is valid.In the unit testing part,some files which

have been preprocessed by C tool are placed in a folder.The file after 
processing

by python tool will be compared with these files to check whether the result is 
correct.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Yuwei Chen 

---
 edk2basetools/GenCrc32/GenCrc32.py| 373 ++
 edk2basetools/GenCrc32/__init__.py|  10 +
 edk2basetools/tests/GenCrc32/decode/PcdPeim   | Bin 0 -> 18912 bytes
 .../tests/GenCrc32/decode/PcdPeim_crc32   | Bin 0 -> 18916 bytes
 .../tests/GenCrc32/decode/S3Resume2Pei| Bin 0 -> 18272 bytes
 .../tests/GenCrc32/decode/S3Resume2Pei_crc32  | Bin 0 -> 18276 bytes
 edk2basetools/tests/GenCrc32/decode/demo  |   1 +
 edk2basetools/tests/GenCrc32/decode/demo_crc  |   1 +
 .../tests/GenCrc32/encode/PcdPeim.efi | Bin 0 -> 18912 bytes
 .../tests/GenCrc32/encode/PcdPeim_crc32   | Bin 0 -> 18916 bytes
 .../tests/GenCrc32/encode/S3Resume2Pei.efi| Bin 0 -> 18272 bytes
 .../tests/GenCrc32/encode/S3Resume2Pei_crc32  | Bin 0 -> 18276 bytes
 edk2basetools/tests/GenCrc32/encode/demo.bin  |   1 +
 edk2basetools/tests/GenCrc32/encode/demo_crc  |   1 +
 edk2basetools/tests/GenCrc32/test_gencrc32.py | 124 ++
 15 files changed, 511 insertions(+)
 create mode 100644 edk2basetools/GenCrc32/GenCrc32.py
 create mode 100644 edk2basetools/GenCrc32/__init__.py
 create mode 100644 edk2basetools/tests/GenCrc32/decode/PcdPeim
 create mode 100644 edk2basetools/tests/GenCrc32/decode/PcdPeim_crc32
 create mode 100644 edk2basetools/tests/GenCrc32/decode/S3Resume2Pei
 create mode 100644 edk2basetools/tests/GenCrc32/decode/S3Resume2Pei_crc32
 create mode 100644 edk2basetools/tests/GenCrc32/decode/demo
 create mode 100644 edk2basetools/tests/GenCrc32/decode/demo_crc
 create mode 100644 edk2basetools/tests/GenCrc32/encode/PcdPeim.efi
 create mode 100644 edk2basetools/tests/GenCrc32/encode/PcdPeim_crc32
 create mode 100644 edk2basetools/tests/GenCrc32/encode/S3Resume2Pei.efi
 create mode 100644 edk2basetools/tests/GenCrc32/encode/S3Resume2Pei_crc32
 create mode 100644 edk2basetools/tests/GenCrc32/encode/demo.bin
 create mode 100644 edk2basetools/tests/GenCrc32/encode/demo_crc
 create mode 100644 edk2basetools/tests/GenCrc32/test_gencrc32.py

diff --git a/edk2basetools/GenCrc32/GenCrc32.py 
b/edk2basetools/GenCrc32/GenCrc32.py
new file mode 100644
index 000..e27e4b0
--- /dev/null
+++ b/edk2basetools/GenCrc32/GenCrc32.py
@@ -0,0 +1,373 @@
+#@file
+#Calculate Crc32 value and Verify Crc32 value for input data.
+#
+#Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+#SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+#
+#Import Modules
+#
+import io
+import logging
+import argparse
+import os
+import sys
+
+mCrcTable=[0x,
+  0x77073096,
+  0xEE0E612C,
+  0x990951BA,
+  0x076DC419,
+  0x706AF48F,
+  0xE963A535,
+  0x9E6495A3,
+  0x0EDB8832,
+  0x79DCB8A4,
+  0xE0D5E91E,
+  0x97D2D988,
+  0x09B64C2B,
+  0x7EB17CBD,
+  0xE7B82D07,
+  0x90BF1D91,
+  0x1DB71064,
+  0x6AB020F2,
+  0xF3B97148,
+  0x84BE41DE,
+  0x1ADAD47D,
+  0x6DDDE4EB,
+  0xF4D4B551,
+  0x83D385C7,
+  0x136C9856,
+  0x646BA8C0,
+  0xFD62F97A,
+  0x8A65C9EC,
+  0x14015C4F,
+  0x63066CD9,
+  0xFA0F3D63,
+  0x8D080DF5,
+  0x3B6E20C8,
+  0x4C69105E,
+  0xD56041E4,
+  0xA2677172,
+  0x3C03E4D1,
+  0x4B04D447,
+  0xD20D85FD,
+  0xA50AB56B,
+  0x35B5A8FA,
+  0x42B2986C,
+  0xDBBBC9D6,
+  0xACBCF940,
+  0x32D86CE3,
+  0x45DF5C75,
+  0xDCD60DCF,
+  0xABD13D59,
+  0x26D930AC,
+  0x51DE003A,
+  0xC8D75180,
+  0xBFD06116,
+  0x21B4F4B5,
+  0x56B3C423,
+  0xCFBA9599,
+  0xB8BDA50F,
+  0x2802B89E,
+  0x5F058808,
+  0xC60CD9B2,
+  0xB10BE924,
+  0x2F6F7C87,
+  0x58684C11,
+  0xC1611DAB,
+  0xB6662D3D,
+  0x76DC4190,
+  0x01DB7106,
+  0x98D220BC,
+  0xEFD5102A,
+  0x71B18589,
+  0x06B6B51F,
+  0x9FBFE4A5,
+  0xE8B8D433,
+  0x7807C9A2,
+  0x0F00F934,
+  0x9609A88E,
+  0xE10E9818,
+  0x7F6A0DBB,
+  0x086D3D2D,
+  0x91646C97,
+  0xE6635C01,
+  0x6B6B51F4,
+  0x1C6C6162,
+  0x856530D8,
+  0xF262004E,
+  0x6C0695ED,
+  0x1B01A57B,
+  0x8208F4C1,
+  0xF50FC457,
+  0x65B0D9C6,
+  0x12B7E950,
+  0x8BBEB8EA,
+  0xFCB9887C,
+  0x62DD1DDF,
+  0x15DA2D49,
+  0x8CD37CF3,
+  0xFBD44C65,
+  0x4DB26158,
+  0x3AB551CE,
+  0xA3BC0074,
+  0xD4BB30E2,
+  0x4ADFA541,
+  0x3DD895D7,
+  0xA4D1C46D,
+  0xD3D6F4FB,
+  0x4369E96A,
+  0x346ED9FC,
+  0xAD678846,
+  0xDA60B8D0,
+  0x44042D73,
+  

Re: [edk2-devel] [PATCH] RedfishPkg/RedfishDiscoverDxe: Install EFI_DISCOVER_PROTOCOL on each network interface

2022-09-01 Thread NickleLa
Hi Abner,

I see that the comment is in the middle of function parameters. I suggest
that we can move the comment to the position before function call.

+Status = CloseProtocolService (
+   // Close protocol and destroy
service.
+   ThisBindingProtocol,
+   ControllerHandle,
+   [Index],

Thanks,
Nickle

 於 2022年8月30日 週二 中午12:22寫道:

> From: Abner Chang 
>
> BZ 4037:
> Install EFI_DISCOVER_PROTOCOL on each network interface.
>
> This fixes the issue that causes the high-level Redfish driver
> on the network interface is stopped when:
> 1. EFI_DISCOVER_PROTOCOL is reinstalled on a new-found network
>interface, or
> 2. EFI_DISCOVER_PROTOCOL is stopped on the network interface
>other than the one which is used to communicate with Redfish
>service.
>
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Signed-off-by: Abner Chang 
> ---
>  .../RedfishDiscoverInternal.h |   7 +
>  .../RedfishDiscoverDxe/RedfishDiscoverDxe.c   | 138 ++
>  2 files changed, 86 insertions(+), 59 deletions(-)
>
> diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
> b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
> index 4d1319b2641..04fa09e1cc2 100644
> --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
> +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h
> @@ -2,6 +2,7 @@
>This file defines the EFI Redfish Discover Protocol interface.
>
>(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +  Copyright (c) 2022, AMD Incorporated. All rights reserved.
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -107,6 +108,12 @@ typedef struct {
>
>   ///< NETWORK_INTERFACE_PROTOCOL_TYPE.
>REDFISH_DISCOVER_NETWORK_INTERFACE_PROTOCOL
> NetworkInterfaceProtocolInfo; ///< Network interface protocol information.
>EFI_HANDLE RestExHandle;
>  ///< REST EX handle associated with this network interface.
> +  //
> +  // EFI_REDFISH_DISCOVER_PROTOCOL instance installed
> +  // on this network interface.
> +  //
> +  EFI_HANDLE
>  EfiRedfishDiscoverProtocolHandle; ///< EFI_REDFISH_DISCOVER_PROTOTOCOL
> instance installed
> +
>  ///< on this network interface.
>  } EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL;
>
>  //
> diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> index bf50c78c928..b5e91cb3469 100644
> --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c
> @@ -3,6 +3,7 @@
>The implementation of EFI Redfidh Discover Protocol.
>
>(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +  Copyright (c) 2022, AMD Incorporated. All rights reserved.
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -23,8 +24,6 @@ EFI_GUID  mRedfishDiscoverTcp4InstanceGuid   =
> EFI_REDFISH_DISCOVER_TCP4_INSTANC
>  EFI_GUID  mRedfishDiscoverTcp6InstanceGuid   =
> EFI_REDFISH_DISCOVER_TCP6_INSTANCE_GUID;
>  EFI_GUID  mRedfishDiscoverRestExInstanceGuid =
> EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_GUID;
>
> -EFI_HANDLE  EfiRedfishDiscoverProtocolHandle = NULL;
> -
>  EFI_STATUS
>  EFIAPI
>  Tcp4GetSubnetInfo (
> @@ -325,6 +324,38 @@ GetTargetNetworkInterfaceInternal (
>return NULL;
>  }
>
> +/**
> +  This function searches EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL
> +  instance with the given  Controller handle.
> +
> +  @param[in] ControllerHandle  The controller handle associated with
> network interface.
> +
> +  @retval Non-NULL  EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL is
> returned.
> +  @retval NULL  Non of
> EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instance is returned.
> +**/
> +EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *
> +GetTargetNetworkInterfaceInternalByController (
> +  IN EFI_HANDLE  ControllerHandle
> +  )
> +{
> +  EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL  *ThisNetworkInterface;
> +
> +  ThisNetworkInterface = (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL
> *)GetFirstNode ();
> +  while (TRUE) {
> +if (ThisNetworkInterface->OpenDriverControllerHandle ==
> ControllerHandle) {
> +  return ThisNetworkInterface;
> +}
> +
> +if (IsNodeAtEnd (,
> >Entry)) {
> +  return NULL;
> +}
> +
> +ThisNetworkInterface =
> (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetNextNode
> (, >Entry);
> +  }
> +
> +  return NULL;
> +}
> +
>  /**
>This function validate if target network interface is ready for
> discovering
>Redfish service.
> @@ -1619,29 +1650,30 @@ BuildupNetworkInterface (
>EFI_OPEN_PROTOCOL_BY_DRIVER
>);
>if (!EFI_ERROR (Status)) {
> -if ((EfiRedfishDiscoverProtocolHandle == NULL) &&
> -

Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support

2022-09-01 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Richard,
Not sure if you can fix the extra lines using "--transfer-encoding=8bit" option 
to git send-email. Would you like to resend it? 

Thanks
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of
> RichardHo [???] via groups.io
> Sent: Thursday, September 1, 2022 10:52 AM
> To: Rebecca Cran ; devel@edk2.groups.io
> Cc: Andrew Fish ; Leif Lindholm
> ; Michael D Kinney
> ; Michael Kubacki
> ; Zhiguang Liu ;
> Liming Gao ; TonyLo [羅金松]
> 
> Subject: Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network
> devices support
> 
> [CAUTION: External Email]
> 
> Hi Rebecca,
> 
> All files are new. I sent it with "git send-email".
> I don't have account to push the code into branch.
> 
> Thanks,
> Richard
> 
> -Original Message-
> From: Rebecca Cran 
> Sent: 2022年8月31日 9:28 PM
> To: devel@edk2.groups.io; RichardHo [何明忠] 
> Cc: Andrew Fish ; Leif Lindholm
> ; Michael D Kinney
> ; Michael Kubacki
> ; Zhiguang Liu ;
> Liming Gao ; TonyLo [羅金松]
> 
> Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB
> network devices support
> 
> 
> **CAUTION: The e-mail below is from an external source. Please exercise
> caution before opening attachments, clicking links, or following guidance.**
> 
> Do you have a public branch somewhere I could pull this code from?
> Much of the patch appears to have been mangled during sending, with extra
> blank lines.
> 
> --
> 
> Rebecca Cran
> 
> 
> On 8/31/22 01:51, RichardHo [何明忠] via groups.io wrote:
> > new file mode 100644
> > index 00..1c1a450920
> > --- /dev/null
> > +++ b/UsbNetworkPkg/Include/Protocol/UsbEthernetProtocol.h
> > @@ -0,0 +1,872 @@
> > +/** @file
> >
> > +  Header file contains code for USB Ethernet Protocol
> >
> > +  definitions
> >
> > +
> >
> > +  Copyright (c) 2022, American Megatrends International LLC. All rights
> reserved.
> >
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +**/
> >
> > +
> >
> > +#ifndef _USB_ETHERNET_PROTOCOL_H
> >
> > +#define _USB_ETHERNET_PROTOCOL_H
> >
> > +
> >
> > +#define USB_ETHERNET_PROTOCOL_GUID \
> >
> > +{0x8d8969cc, 0xfeb0, 0x4303, {0xb2, 0x1a, 0x1f, 0x11, 0x6f, 0x38, 0x56,
> 0x43}}
> >
> > +
> -The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI). This communication is intended
> to be read only by the individual or entity to whom it is addressed or by 
> their
> designee. If the reader of this message is not the intended recipient, you are
> on notice that any distribution of this message, in any form, is strictly
> prohibited. Please promptly notify the sender by reply e-mail or by
> telephone at 770-246-8600, and then delete or destroy all copies of the
> transmission.
> 
> 
> 
> 


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




Re: [edk2-devel] [PATCH] UefiPayloadPkg: To replace the libraries for the capsule driver.

2022-09-01 Thread Lu, James
Reviewed-by: James Lu 

Thanks,
James

-Original Message-
From: Liu, KasimX  
Sent: Thursday, August 25, 2022 11:22 AM
To: devel@edk2.groups.io
Cc: Liu, KasimX ; Dong, Guo ; Ni, Ray 
; Lu, James ; Guo, Gua 
Subject: [PATCH] UefiPayloadPkg: To replace the libraries for the capsule 
driver.

From: KasimX Liu 

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

For the system support the Capsule function in UPL, we replace the libraries 
for the Capsule driver.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: KasimX Liu 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1b23ff3dbc..d40db90631 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -228,7 +228,8 @@
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf   
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf-
  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf+  
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf+  
BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
   
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
   BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf-- 
2.32.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93027): https://edk2.groups.io/g/devel/message/93027
Mute This Topic: https://groups.io/mt/93244422/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] MinPlatformPkg: Add FSP 2.4 MultiPhase library.

2022-09-01 Thread Chiu, Chasel


Agree. I'm sending patch to rename this lib from edk2 and will send patch to 
rename this lib from MinPlatformPkg dsc too.

Thanks,
Chasel


> -Original Message-
> From: Oram, Isaac W 
> Sent: Wednesday, August 31, 2022 4:10 PM
> To: Chiu, Chasel ; devel@edk2.groups.io
> Cc: Desimone, Nathaniel L ; Gao, Liming
> ; Dong, Eric 
> Subject: RE: [edk2-platforms: PATCH] MinPlatformPkg: Add FSP 2.4
> MultiPhase library.
> 
> This sample library does not do anything.  If the design is such that a NULL
> library is functional, then a NULL library should be implemented.  Having a
> sample library that has the same function as a NULL library doesn't make
> sense to me.
> It looks like a NULL library would work fine in this design.  If you update to
> IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibNull/B
> aseFspWrapperPlatformMultiPhaseLibNull.inf, that would be acceptable to
> me.
> 
> Regards,
> Isaac
> 
> -Original Message-
> From: Chiu, Chasel 
> Sent: Wednesday, August 31, 2022 11:19 AM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Oram, Isaac W
> ; Gao, Liming ; Dong,
> Eric 
> Subject: [edk2-platforms: PATCH] MinPlatformPkg: Add FSP 2.4 MultiPhase
> library.
> 
> FSP Wrapper has implemented FSP 2.4 MultiPhase support and required
> platform to include new library instance.
> 
> Cc: Nate DeSimone 
> Cc: Isaac Oram 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Signed-off-by: Chasel Chiu 
> ---
>  Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> index 8e91dba6ac..d4191c4b01 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
> @@ -54,6 +54,8 @@
> 
> TpmPlatformHierarchyLib|MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatform
> HierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
> FspMeasurementLib|IntelFsp2WrapperPkg/Library/BaseFspMeasurementLi
> b/BaseFspMeasurementLib.inf+
> FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspW
> rapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLi
> bSample.inf+
> FspWrapperMultiPhaseProcessLib|IntelFsp2WrapperPkg/Library/FspWrappe
> rMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf
> TcgEventLogRecordLib|SecurityPkg/Library/TcgEventLogRecordLib/TcgEventL
> ogRecordLib.inf
> TpmMeasurementLib|SecurityPkg/Library/PeiTpmMeasurementLib/PeiTpm
> MeasurementLib.inf --
> 2.35.0.windows.1



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