Re: [edk2-devel] [PATCH 2/3] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-07-14 Thread Ni, Ray
The implementation looks good.
But it limits the usage of SerialPortRead/Write to be called only from BSP 
because GetFirstGuidHob() can not be called from APs.

An alternative implementation is to cache the UART instances data into a 
library global array so SerialPortRead/Write don't need to call 
GetFirstGuidHob() again. Such change allows APs call the APIs.


> -Original Message-
> From: Sravanthi, K KavyaX 
> Sent: Thursday, July 14, 2022 12:31 PM
> To: devel@edk2.groups.io
> Cc: Sravanthi, K KavyaX ; Dong, Guo 
> ; Ni, Ray ;
> Maurice Ma ; You, Benjamin ; 
> Rhodes, Sean
> 
> Subject: [PATCH 2/3] UefiPayloadPkg: Implement a new SerialPortLib instance
> 
> 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: Maurice Ma 
> Cc: Benjamin You 
> Cc: Sean Rhodes 
> Signed-off-by: Kavya 
> ---
>  UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 802
> +
> +
> +
> +
> +
> +
> +
> +
> ++
>  UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  39
> +++
>  2 files changed, 841 insertions(+)
> 
> diff --git 
> a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
> b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
> new file mode 100644
> index 00..6f62b2a5d2
> --- /dev/null
> +++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
> @@ -0,0 +1,802 @@
> +/** @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 
> +
> +//
> +// 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
> +
> +/**
> +  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.
> +
> +  @return The value read from the register.
> +
> +**/
> +UINT8
> +SerialPortReadRegister (
> +  UINTNBase,
> +  UINTNOffset,
> +  BOOLEAN  UseMmio
> +  )
> +{
> +  if (UseMmio) {
> +return MmioRead8 (Base + Offset/4);
> +  } else {
> +return IoRead8 (Base + Offset);
> +  }
> +}
> +
> +/**
> +  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.
> +
> +  @return The value written to the register.
> +
> +**/
> +UINT8
> +SerialPortWriteRegister (
> +  UINTNBase,
> +  UINTNOffset,
> +  UINT8Value

Re: [edk2-devel] [PATCH 1/3] UefiPayloadPkg: Implement a new DebugLib instance

2022-07-14 Thread Ni, Ray
Why need a separate DebugLib instance?

> -Original Message-
> From: Sravanthi, K KavyaX 
> Sent: Thursday, July 14, 2022 12:31 PM
> To: devel@edk2.groups.io
> Cc: Sravanthi, K KavyaX ; Dong, Guo 
> ; Ni, Ray ;
> Maurice Ma ; You, Benjamin ; 
> Rhodes, Sean
> 
> Subject: [PATCH 1/3] UefiPayloadPkg: Implement a new DebugLib instance
> 
> Add new Debug library instance to support multiple channel debug message.
> 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Cc: Sean Rhodes 
> Signed-off-by: Kavya 
> ---
>  UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.c   | 295
> +
> +
> +
> 
>  UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.inf |  37 
> +
>  2 files changed, 332 insertions(+)
> 
> diff --git a/UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.c
> b/UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.c
> new file mode 100644
> index 00..0fd9e795a3
> --- /dev/null
> +++ b/UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.c
> @@ -0,0 +1,295 @@
> +/** @file
> +  Instance of Debug Library based on Serial Port Library.
> +
> +  Copyright (c) 2022, Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +//
> +// Define the maximum debug and assert message length that this library 
> supports
> +//
> +#define MAX_DEBUG_MESSAGE_LENGTH  0x100
> +
> +/**
> +  Initialize the serial device hardware.
> +
> +  If no initialization is required, then return RETURN_SUCCESS.
> +  If the serial device was successfully initialized, then return 
> RETURN_SUCCESS.
> +  If the serial device could not be initialized, then return 
> RETURN_DEVICE_ERROR.
> +  If gUniversalPayloadSerialPortInfoGuid not found, then return 
> RETURN_NOT_FOUND.
> +
> +  @retval RETURN_SUCCESSThe serial device was initialized.
> +  @retval RETURN_DEVICE_ERROR   The serial device could not be initialized.
> +  @retval RETURN_NOT_FOUND  GuidHob not found.
> +
> +**/
> +RETURN_STATUS
> +EFIAPI
> +SerialPortInitialize (
> +  VOID
> +  );
> +
> +/**
> +  Write data from buffer to serial device.
> +
> +  Writes NumberOfBytes data bytes from Buffer to the serial device.
> +  The number of bytes actually written to the serial device is returned.
> +  If the return value is less than NumberOfBytes, then the write operation 
> failed.
> +  If Buffer is NULL, then return 0.
> +  If NumberOfBytes is zero, then return 0.
> +
> +  @param  Buffer   Pointer to the data buffer to be written.
> +  @param  NumberOfBytesNumber of bytes to written to the serial device.
> +
> +  @retval 0NumberOfBytes is 0.
> +  @retval >0   The number of bytes written to the serial device.
> +   If this value is less than NumberOfBytes, then 
> the write operation failed.
> +
> +**/
> +UINTN
> +EFIAPI
> +SerialPortWrite (
> +  IN UINT8  *Buffer,
> +  IN UINTN  NumberOfBytes
> +  );
> +
> +/**
> +  Prints a debug message to the debug output device if the specified error 
> level is enabled.
> +
> +  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
> +  GetDebugPrintErrorLevel (), then print the message specified by Format and 
> the
> +  associated variable argument list to the debug output device.
> +
> +  If Format is NULL, then ASSERT().
> +
> +  @param  ErrorLevel  The error level of the debug message.
> +  @param  Format  Format string for the debug message to print.
> +  @param  ... Variable argument list whose contents are accessed
> +  based on the format string specified by Format.
> +
> +**/
> +VOID
> +EFIAPI
> +DebugPrint (
> +  IN  UINTNErrorLevel,
> +  IN  CONST CHAR8  *Format,
> +  ...
> +  )
> +{
> +  CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
> +  VA_LIST   Marker;
> +
> +  //
> +  // If Format is NULL, then ASSERT().
> +  //
> +  ASSERT (Format != NULL);
> +
> +  //
> +  // Check driver debug mask value and global mask
> +  //
> +  if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) {
> +return;
> +  }
> +
> +  //
> +  // Convert the DEBUG() message to an ASCII String
> +  //
> +  VA_START (Marker, Format);
> +  AsciiVSPrint (Buffer, sizeof (Buffer), Format, Marker);
> +  VA_END (Marker);
> +
> +  SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer));
> +}
> +
> +/**
> +  Prints an assert message containing a filename, line number, and 
> description.
> +  This may be followed by a breakpoint or a dead loop.
> +
> +  Print a message of the form "ASSERT (): 
> \n"
>

Re: [edk2-devel] [PATCH edk2-platforms v3 08/12] Silicon/Ampere: Add VariableFlashInfoLib

2022-07-14 Thread Sami Mujawar

Hi Nhi,

I will do that no problem. However, we really need an edk2-platforms CI 
to catch such issues.


Regards,

Sami Mujawar

On 14/07/2022 04:34 am, Nhi Pham wrote:

Hi Sami,

Could you help update for 
Silicon/Ampere/AmpereAltraPkg/AmpereAltraLinuxBootPkg.dsc.inc as well?


Thanks,
Nhi

On 12/07/2022 21:40, Sami Mujawar wrote:

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

Add an instance for the library class VariableFlashInfoLib that
was recently introduced in MdeModulePkg. This allows the variable
driver to build successfully as it has a dependency on this
library class.

Signed-off-by: Sami Mujawar 
---
  Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc | 1 +
  1 file changed, 1 insertion(+)

diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc 
b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
index 
f4007d654ec81297d4bbe002b2671c211129d819..d4c29c3c338cc8abefd84cbb3ff14d1727bd4fe4 
100644

--- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
+++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
@@ -154,6 +154,7 @@ [LibraryClasses.common]
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
  !endif
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
+ 
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
      #



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91343): https://edk2.groups.io/g/devel/message/91343
Mute This Topic: https://groups.io/mt/92334318/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-platforms v3 00/12] Fix build breaks and update IORT revision macro

2022-07-14 Thread Sami Mujawar

Hi Masahisa,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 14/07/2022 07:38 am, Masahisa Kojima wrote:

Hi Sami,

Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
also requires the VariableFlashInfoLib library.
I have checked that the build error is fixed with the following modification.

--- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
@@ -111,7 +111,7 @@ [LibraryClasses]

NorFlashInfoLib|EmbeddedPkg/Library/NorFlashInfoLib/NorFlashInfoLib.inf

NorFlashPlatformLib|Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacerLib.inf
-
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf


[SAMI] I think this change should have been part of the series at 
https://edk2.groups.io/g/devel/message/89156. However, I will include 
this change im my series.


The platforms in edk2-platforms repository are frequently broken by 
changes in edk2 repository. I believe this is due to the lack of 
edk2-platforms CI and we really need to fix that.


[/SAMI]


Thanks,
Masahisa Kojima

On Wed, 13 Jul 2022 at 22:19, PierreGondois  wrote:

Hi Sami,
I think
Silicon/NXP/NxpQoriqLs.dsc.inc
also requires the VariableFlashInfoLib library. Otherwise:

Reviewed-by: Pierre Gondois 


On 7/12/22 16:40, Sami Mujawar wrote:

This v3 patch series renames the EFI_ACPI_IO_REMAPPING_TABLE_REV0
macro to EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 based on the
feedback received. It also includes an additional patch that fixes
the build break in CelloBoard due to missing VariablePolicyHelperLib
dependency.

The v2 patch series fixes the build break in Ampere/Jade and
Pythium/FT2000-4 due to missing VariableFlashInfoLib dependency
and also updates the IORT revision macro.

The IORT Rev E.d specification updates the IORT table revision
to 5. Following this the IORT table revision macro
EFI_ACPI_IO_REMAPPING_TABLE_REVISION which was at Rev 0 has
been renamed to EFI_ACPI_IO_REMAPPING_TABLE_REV0. Therefore,
this series updates the following platforms to reflect this
renaming:
   - FVP
   - Morello FVP
   - SGI
   - AMD/Styx
   - Socionext/SynQuacer
   - RaspberryPi
   - N1SDP
   - Ampere/Jade
   - Pythium/FT2000-4

Note: This patch series is dependent on the edk2 patch series:
"[PATCH v5 0/8] IORT Rev E.d specification updates"
(https://edk2.groups.io/g/devel/message/91264), which must
be merged in edk2 before this patch series can be integrated.

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/1527_iort_rev_ed_platforms_v3

Sami Mujawar (12):
Platform/ARM: FVP: Update for IORT revision macro renaming
Platform/ARM: Morello: Update for IORT revision macro renaming
Platform/ARM: SGI: Update for IORT revision macro renaming
Silicon/AMD/Styx: Update for IORT revision macro renaming
Silicon/Socionext/SynQuacer: Update for IORT revision macro renaming
Platform/RaspberryPi: Update for IORT revision macro renaming
Platform/ARM: N1SDP: Update for IORT revision macro renaming
Silicon/Ampere: Add VariableFlashInfoLib
Platform/Ampere: JadePkg: Update for IORT revision macro renaming
Silicon/Phytium: Add VariableFlashInfoLib
Silicon/Phytium: FT2000-4Pkg: Update for IORT revision macro renaming
Platform/LeMaker: Fix missing dependency on VariablePolicyHelperLib

   
Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerFvp.c
  | 2 +-
   
Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
   | 2 +-
   Platform/ARM/SgiPkg/AcpiTables/Iort.aslc 
| 2 +-
   
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 | 2 +-
   Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiIort.c   
| 2 +-
   Platform/LeMaker/CelloBoard/CelloBoard.dsc   
| 1 +
   Platform/RaspberryPi/AcpiTables/Iort.aslc
| 2 +-
   Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc   
| 2 +-
   Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc 
| 1 +
   Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Iort.aslc 
| 2 +-
   Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc
| 1 +
   Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc 
| 2 +-
   12 files changed, 12 insertions(+), 9 deletions(-)









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

Re: [edk2-devel] [PATCH edk2-platforms v3 00/12] Fix build breaks and update IORT revision macro

2022-07-14 Thread Sami Mujawar

Hi Pierre,

Thank you for the review.

I have some comments marked inline as [SAMI].

Regards,

Sami Mujawar

On 14/07/2022 09:01 am, Sami Mujawar wrote:

Hi Masahisa,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 14/07/2022 07:38 am, Masahisa Kojima wrote:

Hi Sami,

Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
also requires the VariableFlashInfoLib library.
I have checked that the build error is fixed with the following 
modification.


--- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
@@ -111,7 +111,7 @@ [LibraryClasses]

NorFlashInfoLib|EmbeddedPkg/Library/NorFlashInfoLib/NorFlashInfoLib.inf
NorFlashPlatformLib|Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacerLib.inf
-
+ 
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf

VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf


[SAMI] I think this change should have been part of the series at 
https://edk2.groups.io/g/devel/message/89156. However, I will include 
this change im my series.


The platforms in edk2-platforms repository are frequently broken by 
changes in edk2 repository. I believe this is due to the lack of 
edk2-platforms CI and we really need to fix that.


[/SAMI]


Thanks,
Masahisa Kojima

On Wed, 13 Jul 2022 at 22:19, PierreGondois  
wrote:

Hi Sami,
I think
    Silicon/NXP/NxpQoriqLs.dsc.inc
also requires the VariableFlashInfoLib library. Otherwise:

[SAMI] Looks like there is no end to this. I will fix this as well, but 
can we see what is blocking your series at 
https://edk2.groups.io/g/devel/message/83803, please?


Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3509

Ref: https://github.com/tianocore/edk2-pytool-extensions/pull/279

[/SAMI]


Reviewed-by: Pierre Gondois 


On 7/12/22 16:40, Sami Mujawar wrote:

This v3 patch series renames the EFI_ACPI_IO_REMAPPING_TABLE_REV0
macro to EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 based on the
feedback received. It also includes an additional patch that fixes
the build break in CelloBoard due to missing VariablePolicyHelperLib
dependency.

The v2 patch series fixes the build break in Ampere/Jade and
Pythium/FT2000-4 due to missing VariableFlashInfoLib dependency
and also updates the IORT revision macro.

The IORT Rev E.d specification updates the IORT table revision
to 5. Following this the IORT table revision macro
EFI_ACPI_IO_REMAPPING_TABLE_REVISION which was at Rev 0 has
been renamed to EFI_ACPI_IO_REMAPPING_TABLE_REV0. Therefore,
this series updates the following platforms to reflect this
renaming:
   - FVP
   - Morello FVP
   - SGI
   - AMD/Styx
   - Socionext/SynQuacer
   - RaspberryPi
   - N1SDP
   - Ampere/Jade
   - Pythium/FT2000-4

Note: This patch series is dependent on the edk2 patch series:
    "[PATCH v5 0/8] IORT Rev E.d specification updates"
    (https://edk2.groups.io/g/devel/message/91264), which must
    be merged in edk2 before this patch series can be integrated.

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/1527_iort_rev_ed_platforms_v3 



Sami Mujawar (12):
    Platform/ARM: FVP: Update for IORT revision macro renaming
    Platform/ARM: Morello: Update for IORT revision macro renaming
    Platform/ARM: SGI: Update for IORT revision macro renaming
    Silicon/AMD/Styx: Update for IORT revision macro renaming
    Silicon/Socionext/SynQuacer: Update for IORT revision macro 
renaming

    Platform/RaspberryPi: Update for IORT revision macro renaming
    Platform/ARM: N1SDP: Update for IORT revision macro renaming
    Silicon/Ampere: Add VariableFlashInfoLib
    Platform/Ampere: JadePkg: Update for IORT revision macro renaming
    Silicon/Phytium: Add VariableFlashInfoLib
    Silicon/Phytium: FT2000-4Pkg: Update for IORT revision macro 
renaming
    Platform/LeMaker: Fix missing dependency on 
VariablePolicyHelperLib


Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerFvp.c 
| 2 +-
Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c 
| 2 +-

Platform/ARM/SgiPkg/AcpiTables/Iort.aslc | 2 +-
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c 
| 2 +-

Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiIort.c | 2 +-
Platform/LeMaker/CelloBoard/CelloBoard.dsc | 1 +
Platform/RaspberryPi/AcpiTables/Iort.aslc | 2 +-
Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc | 2 +-
Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc | 1 +
Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Iort.aslc | 2 +-
Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc | 1 +
Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc | 2 +-
   12 files changed, 12 insertions(+), 9 deletions(-)









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91345): https://edk2.groups.io

Re: [edk2-devel] [PATCH edk2-platforms v3 00/12] Fix build breaks and update IORT revision macro

2022-07-14 Thread Masahisa Kojima
Hi Sami,

On Thu, 14 Jul 2022 at 17:01, Sami Mujawar  wrote:
>
> Hi Masahisa,
>
> Please find my response inline marked [SAMI].
>
> Regards,
>
> Sami Mujawar
>
> On 14/07/2022 07:38 am, Masahisa Kojima wrote:
> > Hi Sami,
> >
> > Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
> > also requires the VariableFlashInfoLib library.
> > I have checked that the build error is fixed with the following 
> > modification.
> >
> > --- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
> > +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
> > @@ -111,7 +111,7 @@ [LibraryClasses]
> >
> > NorFlashInfoLib|EmbeddedPkg/Library/NorFlashInfoLib/NorFlashInfoLib.inf
> > 
> > NorFlashPlatformLib|Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacerLib.inf
> > -
> > +  
> > VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
> > 
> > VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
>
> [SAMI] I think this change should have been part of the series at
> https://edk2.groups.io/g/devel/message/89156. However, I will include
> this change im my series.

Thank you very much for including the modification in your series.

Regards,
Masahisa Kojima

>
> The platforms in edk2-platforms repository are frequently broken by
> changes in edk2 repository. I believe this is due to the lack of
> edk2-platforms CI and we really need to fix that.
>
> [/SAMI]
>
> > Thanks,
> > Masahisa Kojima
> >
> > On Wed, 13 Jul 2022 at 22:19, PierreGondois  wrote:
> >> Hi Sami,
> >> I think
> >> Silicon/NXP/NxpQoriqLs.dsc.inc
> >> also requires the VariableFlashInfoLib library. Otherwise:
> >>
> >> Reviewed-by: Pierre Gondois 
> >>
> >>
> >> On 7/12/22 16:40, Sami Mujawar wrote:
> >>> This v3 patch series renames the EFI_ACPI_IO_REMAPPING_TABLE_REV0
> >>> macro to EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 based on the
> >>> feedback received. It also includes an additional patch that fixes
> >>> the build break in CelloBoard due to missing VariablePolicyHelperLib
> >>> dependency.
> >>>
> >>> The v2 patch series fixes the build break in Ampere/Jade and
> >>> Pythium/FT2000-4 due to missing VariableFlashInfoLib dependency
> >>> and also updates the IORT revision macro.
> >>>
> >>> The IORT Rev E.d specification updates the IORT table revision
> >>> to 5. Following this the IORT table revision macro
> >>> EFI_ACPI_IO_REMAPPING_TABLE_REVISION which was at Rev 0 has
> >>> been renamed to EFI_ACPI_IO_REMAPPING_TABLE_REV0. Therefore,
> >>> this series updates the following platforms to reflect this
> >>> renaming:
> >>>- FVP
> >>>- Morello FVP
> >>>- SGI
> >>>- AMD/Styx
> >>>- Socionext/SynQuacer
> >>>- RaspberryPi
> >>>- N1SDP
> >>>- Ampere/Jade
> >>>- Pythium/FT2000-4
> >>>
> >>> Note: This patch series is dependent on the edk2 patch series:
> >>> "[PATCH v5 0/8] IORT Rev E.d specification updates"
> >>> (https://edk2.groups.io/g/devel/message/91264), which must
> >>> be merged in edk2 before this patch series can be integrated.
> >>>
> >>> The changes can be seen at:
> >>> https://github.com/samimujawar/edk2-platforms/tree/1527_iort_rev_ed_platforms_v3
> >>>
> >>> Sami Mujawar (12):
> >>> Platform/ARM: FVP: Update for IORT revision macro renaming
> >>> Platform/ARM: Morello: Update for IORT revision macro renaming
> >>> Platform/ARM: SGI: Update for IORT revision macro renaming
> >>> Silicon/AMD/Styx: Update for IORT revision macro renaming
> >>> Silicon/Socionext/SynQuacer: Update for IORT revision macro renaming
> >>> Platform/RaspberryPi: Update for IORT revision macro renaming
> >>> Platform/ARM: N1SDP: Update for IORT revision macro renaming
> >>> Silicon/Ampere: Add VariableFlashInfoLib
> >>> Platform/Ampere: JadePkg: Update for IORT revision macro renaming
> >>> Silicon/Phytium: Add VariableFlashInfoLib
> >>> Silicon/Phytium: FT2000-4Pkg: Update for IORT revision macro renaming
> >>> Platform/LeMaker: Fix missing dependency on VariablePolicyHelperLib
> >>>
> >>>
> >>> Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerFvp.c
> >>>   | 2 +-
> >>>
> >>> Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
> >>>| 2 +-
> >>>Platform/ARM/SgiPkg/AcpiTables/Iort.aslc   
> >>>   | 2 +-
> >>>
> >>> Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
> >>>  | 2 +-
> >>>Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiIort.c 
> >>>   | 2 +-
> >>>Platform/LeMaker/CelloBoard/CelloBoard.dsc 
> >>>   | 1 +
> >>>Platform/RaspberryPi/AcpiTables/Iort.aslc  
> >>>   | 2 +-
> >>>Silicon/AMD/Styx/Drivers/AcpiPlatformD

Re: [edk2-devel] [PATCH edk2-platforms v3 08/12] Silicon/Ampere: Add VariableFlashInfoLib

2022-07-14 Thread Sami Mujawar

Hi Nhi,

Looks like the file 
Silicon/Ampere/AmpereAltraPkg/AmpereAltraLinuxBootPkg.dsc.inc is not in 
upstream edk2-platforms.


See 
https://github.com/tianocore/edk2-platforms/tree/master/Silicon/Ampere/AmpereAltraPkg


Regards,

Sami Mujawar

On 14/07/2022 08:40 am, Sami Mujawar via groups.io wrote:

Hi Nhi,

I will do that no problem. However, we really need an edk2-platforms 
CI to catch such issues.


Regards,

Sami Mujawar

On 14/07/2022 04:34 am, Nhi Pham wrote:

Hi Sami,

Could you help update for 
Silicon/Ampere/AmpereAltraPkg/AmpereAltraLinuxBootPkg.dsc.inc as well?


Thanks,
Nhi

On 12/07/2022 21:40, Sami Mujawar wrote:

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

Add an instance for the library class VariableFlashInfoLib that
was recently introduced in MdeModulePkg. This allows the variable
driver to build successfully as it has a dependency on this
library class.

Signed-off-by: Sami Mujawar 
---
  Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc | 1 +
  1 file changed, 1 insertion(+)

diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc 
b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
index 
f4007d654ec81297d4bbe002b2671c211129d819..d4c29c3c338cc8abefd84cbb3ff14d1727bd4fe4 
100644

--- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
+++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
@@ -154,6 +154,7 @@ [LibraryClasses.common]
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf 


  !endif
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf 

+ 
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf 


      #









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91347): https://edk2.groups.io/g/devel/message/91347
Mute This Topic: https://groups.io/mt/92334318/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-platforms v3 08/12] Silicon/Ampere: Add VariableFlashInfoLib

2022-07-14 Thread Nhi Pham via groups.io

Oops, sorry. I just realized :)

Reviewed-by: Nhi Pham 

Thanks,
-Nhi

On 14/07/2022 16:06, Sami Mujawar wrote:

Hi Nhi,

Looks like the file 
Silicon/Ampere/AmpereAltraPkg/AmpereAltraLinuxBootPkg.dsc.inc is not 
in upstream edk2-platforms.


See 
https://github.com/tianocore/edk2-platforms/tree/master/Silicon/Ampere/AmpereAltraPkg


Regards,

Sami Mujawar

On 14/07/2022 08:40 am, Sami Mujawar via groups.io wrote:

Hi Nhi,

I will do that no problem. However, we really need an edk2-platforms 
CI to catch such issues.


Regards,

Sami Mujawar

On 14/07/2022 04:34 am, Nhi Pham wrote:

Hi Sami,

Could you help update for 
Silicon/Ampere/AmpereAltraPkg/AmpereAltraLinuxBootPkg.dsc.inc as well?


Thanks,
Nhi

On 12/07/2022 21:40, Sami Mujawar wrote:

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

Add an instance for the library class VariableFlashInfoLib that
was recently introduced in MdeModulePkg. This allows the variable
driver to build successfully as it has a dependency on this
library class.

Signed-off-by: Sami Mujawar 
---
  Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc | 1 +
  1 file changed, 1 insertion(+)

diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc 
b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
index 
f4007d654ec81297d4bbe002b2671c211129d819..d4c29c3c338cc8abefd84cbb3ff14d1727bd4fe4 
100644

--- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
+++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
@@ -154,6 +154,7 @@ [LibraryClasses.common]
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf 


  !endif
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf 

+ 
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf 


      #









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91348): https://edk2.groups.io/g/devel/message/91348
Mute This Topic: https://groups.io/mt/92334318/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-platforms v3 03/12] Platform/ARM: SGI: Update for IORT revision macro renaming

2022-07-14 Thread Thomas Abraham




On 12/07/2022 15:40, Sami Mujawar wrote:

The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the IORT table for SGI platforms to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
---
  Platform/ARM/SgiPkg/AcpiTables/Iort.aslc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc 
b/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc
index 
fcc28a71c82eb0c78c96d60c9d9eb1554adb41a3..a7ad92622a905f5b1fd725d5d673a2643685f9af
 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc
+++ b/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc
@@ -50,7 +50,7 @@ ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort =
   (
 EFI_ACPI_6_2_IO_REMAPPING_TABLE_SIGNATURE,
 ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE,
-   EFI_ACPI_IO_REMAPPING_TABLE_REVISION
+   EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00
   ),
   3,  // NumNodes
   sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE),  // NodeOffset


Reviewed-by: Thomas Abraham 

Thanks.


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




Re: [edk2-devel] [edk2-test][PATCH v1 1/1] uefi-sct/SctPkg: Don't always check PixelInformation

2022-07-14 Thread Sunny Wang
Looks good to me. Thanks for fixing the issue, Dimitrije.
Add Chandni. She has run into this issue as well.

Reviewed-by: Sunny Wang 

-Original Message-
From: Dimitrije Pavlov 
Sent: 29 June 2022 16:59
To: devel@edk2.groups.io
Cc: G Edhaya Chandran ; Jeff Booher-Kaeding 
; Samer El-Haj-Mahmoud 
; Sunny Wang ; Jeremy Linton 

Subject: [edk2-test][PATCH v1 1/1] uefi-sct/SctPkg: Don't always check 
PixelInformation

According to UEFI 2.9 Section 12.9, the PixelInformation field of the
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure is valid only if
PixelFormat is PixelBitMask. The current implementation always checks
the contents of PixelInformation field of the
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure returned by QueryMode,
regardless of PixelFormat. Check PixelInformation only if
PixelFormat is PixelBitMask.

Cc: G Edhaya Chandran 
Cc: Jeff Booher-Kaeding 
Cc: Samer El-Haj-Mahmoud 
Cc: Sunny Wang 
Cc: Jeremy Linton 

Signed-off-by: Dimitrije Pavlov 
---
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c
 | 30 ++--
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c
| 19 +
 2 files changed, 35 insertions(+), 14 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c
index 13e7227f5845..b2bff9d756b1 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c
@@ -493,16 +493,28 @@ Returns:
  );
   if (Status != EFI_SUCCESS) {
 AssertionType = EFI_TEST_ASSERTION_FAILED;
-  }   else {
+  } else {
 AssertionType = EFI_TEST_ASSERTION_PASSED;
-  }
-
-  if (SctCompareMem (
-  (void *) info,
-  (void *) GraphicsOutput->Mode->Info,
-  sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)
-  ) != 0) {
-AssertionType = EFI_TEST_ASSERTION_FAILED;
+if (info != NULL) {
+  //
+  // PixelInformation is checked only if PixelFormat is PixelBitMask
+  //
+  if ( info->Version  != 
GraphicsOutput->Mode->Info->Version
+|| info->HorizontalResolution != 
GraphicsOutput->Mode->Info->HorizontalResolution
+|| info->VerticalResolution   != 
GraphicsOutput->Mode->Info->VerticalResolution
+|| info->PixelFormat  != 
GraphicsOutput->Mode->Info->PixelFormat
+|| info->PixelsPerScanLine!= 
GraphicsOutput->Mode->Info->PixelsPerScanLine
+|| ( info->PixelFormat == PixelBitMask
+  && ( info->PixelInformation.RedMask  != 
GraphicsOutput->Mode->Info->PixelInformation.RedMask
+|| info->PixelInformation.GreenMask!= 
GraphicsOutput->Mode->Info->PixelInformation.GreenMask
+|| info->PixelInformation.BlueMask != 
GraphicsOutput->Mode->Info->PixelInformation.BlueMask
+|| info->PixelInformation.ReservedMask != 
GraphicsOutput->Mode->Info->PixelInformation.ReservedMask)))
+  {
+AssertionType = EFI_TEST_ASSERTION_FAILED;
+  }
+} else {
+  AssertionType = EFI_TEST_ASSERTION_FAILED;
+}
   }

   if (info != NULL) {
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c
index da51fbc44596..f31ea8175af8 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c
@@ -125,11 +125,20 @@ Returns:
 } else {
   AssertionType = EFI_TEST_ASSERTION_PASSED;
   if (Info != NULL) {
-if (SctCompareMem (
-(void *) Info,
-(void *) GraphicsOutput->Mode->Info,
-sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)
-) != 0) {
+//
+// PixelInformation is checked only if PixelFormat is PixelBitMask
+//
+if ( Info->Version  != GraphicsOutput->Mode->Info->Version
+  || Info->HorizontalResolution != 
GraphicsOutput->Mode->Info->HorizontalResolution
+  || Info->VerticalResolution   != 
GraphicsOutput->Mode->Info->VerticalResolution
+  || Info->PixelFormat  != 
GraphicsOutput->Mode->Info->PixelFormat
+  || Info->PixelsPerScanLine!= 
GraphicsOutput->Mode->Info->PixelsPerScanLine
+  || ( Info->PixelFormat == PixelBitMask
+&& ( Info->PixelInformation

Re: [edk2-devel] [PATCH v1 1/1] OvmfPkg/QemuVideoDxe: Zero out PixelInformation in QueryMode

2022-07-14 Thread Sunny Wang
Looks good to me. Thanks for working on this, Dimitrije.
I had an offline discussion with Dimitrije. Either this patch or the patch for 
SCT (https://edk2.groups.io/g/devel/topic/92068027) can fix the inconsistent 
test failure issue mentioned in 
https://bugzilla.tianocore.org/show_bug.cgi?id=3601

Reviewed-by: Sunny Wang 

-Original Message-
From: Dimitrije Pavlov 
Sent: 28 June 2022 19:48
To: devel@edk2.groups.io
Cc: Ard Biesheuvel ; Jiewen Yao 
; Jordan Justen ; Gerd 
Hoffmann ; Jeff Booher-Kaeding 
; Samer El-Haj-Mahmoud 
; Sunny Wang ; Jeremy Linton 

Subject: [PATCH v1 1/1] OvmfPkg/QemuVideoDxe: Zero out PixelInformation in 
QueryMode

Ensure that the PixelInformation field of the
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure is zeroed out in
EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode() and
EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode() when PixelFormat is
PixelBlueGreenRedReserved8BitPerColor.

According to UEFI 2.9 Section 12.9, PixelInformation field of the
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure is valid only if
PixelFormat is PixelBitMask. This means that firmware is not required
to fill out the PixelInformation field for other PixelFormat types,
which implies that the QemuVideoDxe implementation is technically
correct.

However, not zeroing out those fields will leak the contents of the
memory returned by the memory allocator, so it is better to explicitly
set them to zero.

In addition, the SCT test suite relies on PixelInformation always
having a consistent value, which causes failures.

Cc: Ard Biesheuvel 
Cc: Jiewen Yao 
Cc: Jordan Justen 
Cc: Gerd Hoffmann 
Cc: Jeff Booher-Kaeding 
Cc: Samer El-Haj-Mahmoud 
Cc: Sunny Wang 
Cc: Jeremy Linton 

Signed-off-by: Dimitrije Pavlov 
---
 OvmfPkg/QemuVideoDxe/Gop.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
index 0c4dea7fb6f2..7a9fe208c99c 100644
--- a/OvmfPkg/QemuVideoDxe/Gop.c
+++ b/OvmfPkg/QemuVideoDxe/Gop.c
@@ -31,7 +31,14 @@ QemuVideoCompleteModeInfo (
 Info->PixelInformation.ReservedMask = 0;
   } else if (ModeData->ColorDepth == 32) {
 DEBUG ((DEBUG_INFO, "PixelBlueGreenRedReserved8BitPerColor\n"));
-Info->PixelFormat = PixelBlueGreenRedReserved8BitPerColor;
+Info->PixelFormat   = 
PixelBlueGreenRedReserved8BitPerColor;
+Info->PixelInformation.RedMask  = 0;
+Info->PixelInformation.GreenMask= 0;
+Info->PixelInformation.BlueMask = 0;
+Info->PixelInformation.ReservedMask = 0;
+  } else {
+DEBUG ((DEBUG_ERROR, "%a: Invalid ColorDepth %u", __FUNCTION__, 
ModeData->ColorDepth));
+ASSERT (FALSE);
   }

   Info->PixelsPerScanLine = Info->HorizontalResolution;
--
2.34.1

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 (#91351): https://edk2.groups.io/g/devel/message/91351
Mute This Topic: https://groups.io/mt/92050521/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] MdeModulePkg/Variable: SCT run AuthVar_conf is failed

2022-07-14 Thread Sunny Wang
Ah.. good catch. I was not aware that EFI_VARIABLE_ATTRIBUTES_MASK doesn't 
include EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS bit.
Thanks for fixing the issue, JunX1 Li and xueshengfeng.
Moreover, I assumed that you haven't got Edhaya's and Samer's review, right? If 
so, you should use "Cc:" instead of "Reviewed-by:" in your commit message.

The code change looks good to me.
Reviewed-by: Sunny Wang 

-Original Message-
From: xueshengfeng 
Sent: 04 July 2022 11:00
To: devel@edk2.groups.io
Cc: gaolim...@byosoft.com.cn; G Edhaya Chandran ; 
Samer El-Haj-Mahmoud ; Sunny Wang 
; Lijun10x 
Subject: [PATCH] MdeModulePkg/Variable: SCT run AuthVar_conf is failed

From: Lijun10x 

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

Attr are EFI_VARIABLE_NON_VOLATILE|VARIABLE_AUTHENTICATED_WRITE_ACCESS,
will return EFI_INVALID_PARAMETER.
Added one case, only when one attribute is EFI_VARIABLE_NON_VOLATILE
will EFI_INVALID_PARAMETER be returned.
If attr are EFI_VARIABLE_NON_VOLATILE|VARIABLE_AUTHENTICATED_WRITE_ACCESS
will return EFI_UNSUPPORTED.
In the UEFI2.7 spec, there is a description as below:
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should not be
used. Platforms should return EFI_UNSUPPORTED if a caller to
SetVariable() specifies this attribute.

Signed-off-by: JunX1 Li 
Reviewed-by: Liming Gao 
Reviewed-by: G Edhaya Chandran 
Reviewed-by: Samer El-Haj-Mahmoud 
Reviewed-by: Sunny Wang 
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 6c1a3440ac..14c176887a 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -2676,7 +2676,11 @@ VariableServiceSetVariable (
 //
 // Only EFI_VARIABLE_NON_VOLATILE attribute is invalid
 //
-return EFI_INVALID_PARAMETER;
+if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) {
+  return EFI_UNSUPPORTED;
+} else {
+  return EFI_INVALID_PARAMETER;
+}
   } else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
 if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) {
   //
--
2.26.2.windows.1


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 (#91352): https://edk2.groups.io/g/devel/message/91352
Mute This Topic: https://groups.io/mt/92188170/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 v1 1/7] RaspberryPi: Pipeline: Resolving newly introduced dependency

2022-07-14 Thread Jeremy Linton

Hi,

On 7/8/22 16:02, Kun Qin wrote:

The new changes in SecureBootVariableLib brought in a new dependency
of PlatformPKProtectionLib.

This change added the new library instance from SecurityPkg to resolve
RaspberryPi platforms build.


This applies cleanly, and fixes the build break when the rpis are built 
against the latest edk2 branch.


Thanks,

Reviewed-by: Jeremy Linton 




Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Jeremy Linton 

Signed-off-by: Kun Qin 
---
  Platform/RaspberryPi/RPi3/RPi3.dsc | 1 +
  Platform/RaspberryPi/RPi4/RPi4.dsc | 1 +
  2 files changed, 2 insertions(+)

diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc 
b/Platform/RaspberryPi/RPi3/RPi3.dsc
index 0eed03c097f8..4e7377a00036 100644
--- a/Platform/RaspberryPi/RPi3/RPi3.dsc
+++ b/Platform/RaspberryPi/RPi3/RPi3.dsc
@@ -169,6 +169,7 @@ [LibraryClasses.common]
PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf

SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf

SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf
+  
PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf
  !else

TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf

AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc 
b/Platform/RaspberryPi/RPi4/RPi4.dsc
index eabddd7382cf..8ba0ca61851e 100644
--- a/Platform/RaspberryPi/RPi4/RPi4.dsc
+++ b/Platform/RaspberryPi/RPi4/RPi4.dsc
@@ -166,6 +166,7 @@ [LibraryClasses.common]
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf

SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf

SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf
+  
PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf
  
# re-use the UserPhysicalPresent() dummy implementation from the ovmf tree

PlatformSecureLib|OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91353): https://edk2.groups.io/g/devel/message/91353
Mute This Topic: https://groups.io/mt/92260958/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 v1 3/7] VExpressPkg: Pipeline: Resolving newly introduced dependency

2022-07-14 Thread Sami Mujawar
Hi Kun,

Thank you for this 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 (#91354): https://edk2.groups.io/g/devel/message/91354
Mute This Topic: https://groups.io/mt/92260960/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/8] ShellPkg: Acpiview: Abbreviate field names to preserve alignment

2022-07-14 Thread Sami Mujawar
Some field names in the IORT table parser were longer than the
OUTPUT_FIELD_COLUMN_WIDTH plus indentation, resulting in loss of
the output print alignment. Therefore, abbreviate the field names.

Signed-off-by: Sami Mujawar 
Reviewed-by: Zhichao Gao 
Reviewed-by: Pierre Gondois 
---

Notes:
v6:
  - No code change since v1. Including r-b and resending   [SAMI]
with v6 series.

v5:
  - No code change since v1. Including r-b and resending   [SAMI]
with v5 series.

v4:
  - No code change since v1. Including r-b and resending   [SAMI]
with v4 series.

v3:
  - No code change since v1. Include r-b received  [SAMI]
from v2 series.
Ref: https://edk2.groups.io/g/devel/topic/83600717#7665
v2:
  - No code change since v1. Re-sending with v2 series.[SAMI]

 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 13 
-
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
index 
81bfacd83added87a867cf365a56d4b7a1410ef2..44d633c5282463078a4cc990bb24ca1992f95634
 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
@@ -1,11 +1,14 @@
 /** @file
   IORT table parser
 
-  Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
+  Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Reference(s):
-- IO Remapping Table, Platform Design Document, Revision D, March 2018
+  - IO Remapping Table, Platform Design Document, Revision D, March 2018
+
+  @par Glossary:
+- Ref  - Reference
 **/
 
 #include 
@@ -144,15 +147,15 @@ STATIC CONST ACPI_PARSER  IortNodeSmmuV1V2Parser[] = {
   { L"Span",  8,24,  L"0x%lx", NULL, NULL, NULL, 
NULL },
   { L"Model", 4,32,  L"%d",NULL, NULL, NULL, 
NULL },
   { L"Flags", 4,36,  L"0x%x",  NULL, NULL, NULL, 
NULL },
-  { L"Reference to Global Interrupt Array",4,40,  L"0x%x",  NULL, NULL, 
NULL,
+  { L"Global Interrupt Array Ref",4,40,  L"0x%x",  NULL, NULL, NULL,
 NULL },
   { L"Number of context interrupts",  4,44,  L"%d",NULL,
 (VOID **)&InterruptContextCount,  NULL, NULL },
-  { L"Reference to Context Interrupt Array",4,48,  L"0x%x",  NULL,
+  { L"Context Interrupt Array Ref",   4,48,  L"0x%x",  NULL,
 (VOID **)&InterruptContextOffset, NULL, NULL },
   { L"Number of PMU Interrupts",  4,52,  L"%d",NULL,
 (VOID **)&PmuInterruptCount,  NULL, NULL },
-  { L"Reference to PMU Interrupt Array",4,56,  L"0x%x",  NULL,
+  { L"PMU Interrupt Array Ref",   4,56,  L"0x%x",  NULL,
 (VOID **)&PmuInterruptOffset, NULL, NULL },
 
   // Interrupt Array
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH v6 5/8] MdePkg: IORT header update for IORT Rev E.d spec

2022-07-14 Thread Sami Mujawar
Bugzilla: 3458 - Add support IORT Rev E.d specification updates
  (https://bugzilla.tianocore.org/show_bug.cgi?id=3458)

The IO Remapping Table, Platform Design Document, Revision E.d,
Feb 2022 (https://developer.arm.com/documentation/den0049/)
introduces the following updates, collectively including the
updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c:
  - increments the IORT table revision to 5.
  - updates the node definition to add an 'Identifier' field.
  - adds definition of node type 6 - Reserved Memory Range node.
  - adds definition for Memory Range Descriptors.
  - adds flag to indicate PRI support for root complexes.
  - adds flag to indicate if the root complex supports forwarding
of PASID information on translated transactions to the SMMU.
  - adds flag to indicate if the root complex supports PASID.
  - adds flags to define access privilege and attributes for the
memory ranges.

Therefore, update the IORT header file to reflect these changes,
and also rename the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Also update the IORT generator in DynamicTablesPkg to fix the
compilation errors so that Git Bisect can work.

Signed-off-by: Sami Mujawar 
Reviewed-by: Liming Gao 
---

Notes:
v6:
 - Add definition for IORT Rev 4 and RMR Node Rev 2. [PIERRE]
 - Added definition for IORT Rev 4 and RMR Node 2 so that[SAMI]
   appropriate checks can be performed for deprecated
   table/node revisions.

v5:
 - Change IORT revision macro name to make it similar to [THOMAS]
   macro names for other ACPI tables.
 - Updated IORT revision macros from [SAMI]
   EFI_ACPI_IO_REMAPPING_TABLE_REVx to
   EFI_ACPI_IO_REMAPPING_TABLE_REVISION_0x
   Ref: https://edk2.groups.io/g/devel/message/91119
 - Keep EFI_ACPI_IO_REMAPPING_TABLE_REVISION and set to  [LIMING]
   EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05.
   Ref: https://edk2.groups.io/g/devel/message/91137
 - Added EFI_ACPI_IO_REMAPPING_TABLE_REVISION and set it [SAMI]
   to the latest IORT revision.
 - Updated IORT generator in DynamicTablesPkg and included   [SAMI]
   in this patch so that Git bisect does not break.

v4:
  - Updated patch series to IORT specification revision E.d. [SAMI]
  - Add flag to indicate if the root complex supports PASID. [SAMI]
  - Add flags to define access privilege and attributes for  [SAMI]
the memory ranges.
v3:
  - Submit patch series to update platform code to use the   [LIMING]
EFI_ACPI_IO_REMAPPING_TABLE_REV0 macro.
Ref: https://edk2.groups.io/g/devel/topic/83618423#76799
  - Removed definition of EFI_ACPI_IO_REMAPPING_TABLE_REVISION   [SAMI]
as EFI_ACPI_IO_REMAPPING_TABLE_REV0 has been provided for
representing Rev 0. Also, a corresponding patch series
for updating the platforms in edk2-platforms repository
shall be submitted to the edk2 mailing list.
  - Include r-b received from v2 series. [SAMI]
Ref: https://edk2.groups.io/g/devel/topic/83600724#76660

v2:
  - Set EFI_ACPI_IO_REMAPPING_TABLE_REVISION to Rev 0 as [SAMI]
setting to Rev 3 will break existing platforms. The
problem is that existing code would not be populating
the Identifier field in the nodes. This can lead to
non-unique values in the Identifier field.

 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 19 ++---
 MdePkg/Include/IndustryStandard/IoRemappingTable.h   | 86 
++--
 2 files changed, 87 insertions(+), 18 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index 
abef9e5a7f90a38e1d697227d3cd2c110db364a4..63381441e2d6515a7cc9731c89b9739a12c65599
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -766,7 +766,7 @@ AddItsGroupNodes (
 ItsGroupNode->Node.Type  = EFI_ACPI_IORT_TYPE_ITS_GROUP;
 ItsGroupNode->Node.Length= (UINT16)NodeLength;
 ItsGroupNode->Node.Revision  = 0;
-ItsGroupNode->Node.Reserved  = EFI_ACPI_RESERVED_DWORD;
+ItsGroupNode->Node.Identifier= EFI_ACPI_RESERVED_DWORD;
 ItsGroupNode->Node.NumIdMappings = 0;
 ItsGroupNode->Node.IdReference   = 0;
 
@@ -872,7 +872,7 @@ AddNamedComponentNodes (
 NcNode->Node.Type  = EFI_ACPI_IORT_TYPE_NAMED_COMP;
 NcNode->Node.Length= (UINT16)NodeLength;
 NcNode->Node.Revision  = 2;
-NcNode->Node.Reserved  = EFI_ACPI_RESERVED_DWORD;
+NcNode->Node.Identifier= EFI_ACPI_RESERVED_DWORD;
 NcNode->Node.NumIdMappings = NodeList->IdMappingCount;
 
 ObjectNam

[edk2-devel] [PATCH v6 2/8] DynamicTablesPkg: Handle error when IdMappingToken is NULL

2022-07-14 Thread Sami Mujawar
Add error handling when the IdMappingCount is not zero and the
IdMappingToken is NULL.

Signed-off-by: Sami Mujawar 
---

Notes:
v6:
 - No changes since v3. Resending with v6 series.  [SAMI]

v5:
 - No changes since v3. Resending with v5 series.  [SAMI]

v4:
 - No changes since v3. Resending with v4 series.  [SAMI]
v3:
 - New patch in this series. Moves error handling code for [SAMI]
   IdMappingToken from patch v2 6/8 and v2 8/8 into this
   patch.
   Ref: https://edk2.groups.io/g/devel/topic/83600728#76662
https://edk2.groups.io/g/devel/topic/83600726#76661

 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 82 

 1 file changed, 66 insertions(+), 16 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index 
0f13c32b838bf4fe42b53a1e9c3ce817d74681fb..daf9ff00c3deab4005814bbfcf1650469d1e7d92
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -1,7 +1,7 @@
 /** @file
   IORT Table Generator
 
-  Copyright (c) 2017 - 2020, ARM Limited. All rights reserved.
+  Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Reference(s):
@@ -905,9 +905,19 @@ AddNamedComponentNodes (
   return Status;
 }
 
-if ((NodeList->IdMappingCount > 0) &&
-(NodeList->IdMappingToken != CM_NULL_TOKEN))
-{
+if (NodeList->IdMappingCount > 0) {
+  if (NodeList->IdMappingToken == CM_NULL_TOKEN) {
+Status = EFI_INVALID_PARAMETER;
+DEBUG ((
+  DEBUG_ERROR,
+  "ERROR: IORT: Invalid Id Mapping token,"
+  " Token = 0x%x, Status =%r\n",
+  NodeList->IdMappingToken,
+  Status
+  ));
+return Status;
+  }
+
   // Ids for Named Component
   IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)NcNode +
   
NcNode->Node.IdReference);
@@ -1011,9 +1021,19 @@ AddRootComplexNodes (
 RcNode->Reserved1[1]  = EFI_ACPI_RESERVED_BYTE;
 RcNode->Reserved1[2]  = EFI_ACPI_RESERVED_BYTE;
 
-if ((NodeList->IdMappingCount > 0) &&
-(NodeList->IdMappingToken != CM_NULL_TOKEN))
-{
+if (NodeList->IdMappingCount > 0) {
+  if (NodeList->IdMappingToken == CM_NULL_TOKEN) {
+Status = EFI_INVALID_PARAMETER;
+DEBUG ((
+  DEBUG_ERROR,
+  "ERROR: IORT: Invalid Id Mapping token,"
+  " Token = 0x%x, Status =%r\n",
+  NodeList->IdMappingToken,
+  Status
+  ));
+return Status;
+  }
+
   // Ids for Root Complex
   IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)RcNode +
   
RcNode->Node.IdReference);
@@ -1242,9 +1262,19 @@ AddSmmuV1V2Nodes (
   }
 }
 
-if ((NodeList->IdMappingCount > 0) &&
-(NodeList->IdMappingToken != CM_NULL_TOKEN))
-{
+if (NodeList->IdMappingCount > 0) {
+  if (NodeList->IdMappingToken == CM_NULL_TOKEN) {
+Status = EFI_INVALID_PARAMETER;
+DEBUG ((
+  DEBUG_ERROR,
+  "ERROR: IORT: Invalid Id Mapping token,"
+  " Token = 0x%x, Status =%r\n",
+  NodeList->IdMappingToken,
+  Status
+  ));
+return Status;
+  }
+
   // Ids for SMMU v1/v2 Node
   IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)SmmuNode +
   
SmmuNode->Node.IdReference);
@@ -1361,9 +1391,19 @@ AddSmmuV3Nodes (
   SmmuV3Node->DeviceIdMappingIndex = NodeList->DeviceIdMappingIndex;
 }
 
-if ((NodeList->IdMappingCount > 0) &&
-(NodeList->IdMappingToken != CM_NULL_TOKEN))
-{
+if (NodeList->IdMappingCount > 0) {
+  if (NodeList->IdMappingToken == CM_NULL_TOKEN) {
+Status = EFI_INVALID_PARAMETER;
+DEBUG ((
+  DEBUG_ERROR,
+  "ERROR: IORT: Invalid Id Mapping token,"
+  " Token = 0x%x, Status =%r\n",
+  NodeList->IdMappingToken,
+  Status
+  ));
+return Status;
+  }
+
   // Ids for SMMUv3 node
   IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)SmmuV3Node +
   
SmmuV3Node->Node.IdReference);
@@ -1476,9 +1516,19 @@ AddPmcgNodes (
   return Status;
 }
 
-if ((NodeList->IdMappingCount > 0) &&
-(NodeList->IdMappingToken != CM_NULL_TOKEN))
-{
+if (NodeList->IdMappingCount > 0) {
+  if (NodeList->IdMappingToken == CM_NULL_TOKEN) {
+Status = EFI_INVALID_PARAMETER;
+DEBUG ((
+  DEBUG_ERROR,
+  "ERROR: IORT: Invalid Id Mappi

[edk2-devel] [PATCH v6 3/8] DynamicTablesPkg: IORT set reference to Id array only if present

2022-07-14 Thread Sami Mujawar
The IORT table generator is setting up a reference to ID array for
nodes even when the ID Mapping count is zero. This is not an issue as an
OS would only access the ID Reference if the ID mapping count is not zero.

However, it would be good to set the reference to ID array to zero when
the ID Mapping count is zero rather than populating it with an incorrect
value.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---

Notes:
v6:
 - No code change since v1. Re-sending with v6 series.[SAMI]

v5:
 - No code change since v1. Re-sending with v5 series.[SAMI]

v4:
 - No code change since v1. Re-sending with v4 series.[SAMI]

v3:
 - No code change since v1. Re-sending with v3 series.[SAMI]

v2:
 - No code change since v1. Re-sending with v2 series.[SAMI]

 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 27 
+++-
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index 
daf9ff00c3deab4005814bbfcf1650469d1e7d92..a4dd3d4a895e0a1ae305c937d9a413665fb8e171
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -876,9 +876,9 @@ AddNamedComponentNodes (
 NcNode->Node.NumIdMappings = NodeList->IdMappingCount;
 
 ObjectNameLength = AsciiStrLen (NodeList->ObjectName) + 1;
-NcNode->Node.IdReference =
-  (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) +
-   (ALIGN_VALUE (ObjectNameLength, 4)));
+NcNode->Node.IdReference = (NodeList->IdMappingCount == 0) ?
+   0 : ((UINT32)(sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) +
+ (ALIGN_VALUE (ObjectNameLength, 
4;
 
 // Named Component specific data
 NcNode->Flags = NodeList->Flags;
@@ -1007,7 +1007,8 @@ AddRootComplexNodes (
 RcNode->Node.Revision  = 1;
 RcNode->Node.Reserved  = EFI_ACPI_RESERVED_DWORD;
 RcNode->Node.NumIdMappings = NodeList->IdMappingCount;
-RcNode->Node.IdReference   = sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE);
+RcNode->Node.IdReference   = (NodeList->IdMappingCount == 0) ?
+ 0 : sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_RC_NODE);
 
 // Root Complex specific data
 RcNode->CacheCoherent = NodeList->CacheCoherent;
@@ -1188,11 +1189,12 @@ AddSmmuV1V2Nodes (
 SmmuNode->Node.Revision  = 0;
 SmmuNode->Node.Reserved  = EFI_ACPI_RESERVED_DWORD;
 SmmuNode->Node.NumIdMappings = NodeList->IdMappingCount;
-SmmuNode->Node.IdReference   = sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE) +
-   (NodeList->ContextInterruptCount *
-sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) +
-   (NodeList->PmuInterruptCount *
-sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT));
+SmmuNode->Node.IdReference   = (NodeList->IdMappingCount == 0) ?
+   0 : (sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE) +
+(NodeList->ContextInterruptCount *
+ sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) +
+(NodeList->PmuInterruptCount *
+ sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)));
 
 // SMMU v1/v2 specific data
 SmmuNode->Base  = NodeList->BaseAddress;
@@ -1360,8 +1362,8 @@ AddSmmuV3Nodes (
 SmmuV3Node->Node.Revision  = 2;
 SmmuV3Node->Node.Reserved  = EFI_ACPI_RESERVED_DWORD;
 SmmuV3Node->Node.NumIdMappings = NodeList->IdMappingCount;
-SmmuV3Node->Node.IdReference   =
-  sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE);
+SmmuV3Node->Node.IdReference   = (NodeList->IdMappingCount == 0) ?
+ 0 : sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE);
 
 // SMMUv3 specific data
 SmmuV3Node->Base = NodeList->BaseAddress;
@@ -1491,7 +1493,8 @@ AddPmcgNodes (
 PmcgNode->Node.Revision  = 1;
 PmcgNode->Node.Reserved  = EFI_ACPI_RESERVED_DWORD;
 PmcgNode->Node.NumIdMappings = NodeList->IdMappingCount;
-PmcgNode->Node.IdReference   = sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE);
+PmcgNode->Node.IdReference   = (NodeList->IdMappingCount == 0) ?
+   0 : sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE);
 
 // PMCG specific data
 PmcgNode->Base  = NodeList->BaseAddress;
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91359): https://edk2.gro

[edk2-devel] [PATCH v6 4/8] DynamicTablesPkg: IORT set reference to interrupt array if present

2022-07-14 Thread Sami Mujawar
The IORT generator is populating the reference field for Context and
PMU interrupts even if their count is zero.

Update the IORT generator to set the references only if the interrupt
count is not 0. Also add checks to ensure a valid reference token has
been provided.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---

Notes:
v6:
  - No code change since v4. Re-sending with v6 series.[SAMI]

v5:
  - No code change since v4. Re-sending with v5 series.[SAMI]

v4:
 - Minor reordering of code to group initialisation and[SAMI]
   checks for the number of Context and PMU interrupts.

v3:
  - Move error handling for IdMappingToken.[PIERRE]
  - Moved error handling for IdMappingToken in a separate  [SAMI]
patch in v3 series.
Ref: https://edk2.groups.io/g/devel/topic/83600728#76662

v2:
  - No code change since v1. Re-sending with v2 series.[SAMI]

 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 87 
+---
 1 file changed, 57 insertions(+), 30 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index 
a4dd3d4a895e0a1ae305c937d9a413665fb8e171..abef9e5a7f90a38e1d697227d3cd2c110db364a4
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -1164,6 +1164,7 @@ AddSmmuV1V2Nodes (
   EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT  *ContextInterruptArray;
   EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT  *PmuInterruptArray;
   UINT64  NodeLength;
+  UINT32  Offset;
 
   ASSERT (Iort != NULL);
 
@@ -1206,48 +1207,74 @@ AddSmmuV1V2Nodes (
 SmmuNode->GlobalInterruptArrayRef =
   OFFSET_OF (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE, SMMU_NSgIrpt);
 
+Offset = sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE);
 // Context Interrupt
-SmmuNode->NumContextInterrupts = NodeList->ContextInterruptCount;
-SmmuNode->ContextInterruptArrayRef =
-  sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE);
-ContextInterruptArray =
-  (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *)((UINT8 *)SmmuNode +
- sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE));
+SmmuNode->NumContextInterrupts = NodeList->ContextInterruptCount;
+if (NodeList->ContextInterruptCount != 0) {
+  SmmuNode->ContextInterruptArrayRef = Offset;
+  ContextInterruptArray  =
+(EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *)((UINT8 *)SmmuNode + Offset);
+  Offset += (NodeList->ContextInterruptCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT));
+}
 
 // PMU Interrupt
-SmmuNode->NumPmuInterrupts = NodeList->PmuInterruptCount;
-SmmuNode->PmuInterruptArrayRef = SmmuNode->ContextInterruptArrayRef +
- (NodeList->ContextInterruptCount *
-  sizeof 
(EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT));
-PmuInterruptArray =
-  (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *)((UINT8 *)SmmuNode +
- SmmuNode->PmuInterruptArrayRef);
+SmmuNode->NumPmuInterrupts = NodeList->PmuInterruptCount;
+if (NodeList->PmuInterruptCount != 0) {
+  SmmuNode->PmuInterruptArrayRef = Offset;
+  PmuInterruptArray  =
+(EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *)((UINT8 *)SmmuNode + Offset);
+}
 
 SmmuNode->SMMU_NSgIrpt = NodeList->SMMU_NSgIrpt;
 SmmuNode->SMMU_NSgIrptFlags= NodeList->SMMU_NSgIrptFlags;
 SmmuNode->SMMU_NSgCfgIrpt  = NodeList->SMMU_NSgCfgIrpt;
 SmmuNode->SMMU_NSgCfgIrptFlags = NodeList->SMMU_NSgCfgIrptFlags;
 
-// Add Context Interrupt Array
-Status = AddSmmuInterruptArray (
-   CfgMgrProtocol,
-   ContextInterruptArray,
-   SmmuNode->NumContextInterrupts,
-   NodeList->ContextInterruptToken
-   );
-if (EFI_ERROR (Status)) {
-  DEBUG ((
-DEBUG_ERROR,
-"ERROR: IORT: Failed to Context Interrupt Array. Status = %r\n",
-Status
-));
-  return Status;
+if (NodeList->ContextInterruptCount != 0) {
+  if (NodeList->ContextInterruptToken == CM_NULL_TOKEN) {
+Status = EFI_INVALID_PARAMETER;
+DEBUG ((
+  DEBUG_ERROR,
+  "ERROR: IORT: Invalid Context Interrupt token,"
+  " Token = 0x%x, Status =%r\n",
+  NodeList->ContextInterruptToken,
+  Status
+  ));
+return Status;
+  }
+
+  // Add Context Interrupt Array
+  Status = AddSmmuInterruptArray (
+ CfgMgrProtocol,
+ ContextInterruptArray,
+ SmmuNode->NumContextInterrupts,
+ NodeList->ContextInterruptToken
+ );
+

[edk2-devel] [PATCH v6 6/8] ShellPkg: Acpiview: IORT parser update for IORT Rev E.d spec

2022-07-14 Thread Sami Mujawar
Bugzilla: 3458 - Add support IORT Rev E.d specification updates
  (https://bugzilla.tianocore.org/show_bug.cgi?id=3458)

The IO Remapping Table, Platform Design Document, Revision E.d,
Feb 2022 (https://developer.arm.com/documentation/den0049/)
introduces the following updates, collectively including the
updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c:
 - increments the IORT table revision to 5.
 - updates the node definition to add an 'Identifier' field.
 - adds definition of node type 6 - Reserved Memory Range node.
 - adds definition for Memory Range Descriptors.
 - adds flag to indicate PRI support for root complexes.
 - adds flag to indicate if the root complex supports forwarding
   of PASID information on translated transactions to the SMMU.
 - adds flag to indicate if the root complex supports PASID.
 - adds flags to define access privilege and attributes for the
   memory ranges.

Therefore, update the IORT parser to:
  - parse the Identifier field.
  - parse Reserved Memory Range node.
  - parse Memory Range Descriptors.
  - add validations to check that the physical range base
and size of the Memory Range Descriptor is 64KB aligned.
  - add validation to check that the IORT Table Revision is
not 4 as IORT Rev E.c is deprecated.
  - add validation to check that the IORT RMR node revision
is not 2 as it breaks backward compatibility and was
deprecated as part of IORT Rev E.c.
  - skip parsing of IORT Rev E, Rev E.a, Rev E.b, Rev E.c as
some fields were deprecated in these revisions.

Signed-off-by: Sami Mujawar 
---

Notes:
v6:
 - Make output format for Flags filed consistent.   [PIERRE]
 - Define macro for IORT Rev E.c and RMR Node revision 2[PIERRE]
   and use these to check for deprecated table/node
   revisions.
 - Identifier field size changed between IORT revision E[PIERRE]
   and E.a. so extra checks should be needed.
 - Added check to skip parsing if IORT Rev E, E. [SAMI]
   as various fields were deprecated between revisions.

v5:
 - No code change since v4. Included r-b received for   [SAMI]
   v5 series.

v4:
 - Add validation to check that the IORT Table Revision is  [SAMI]
   not 4 as IORT Rev E.c is deprecated.
 - Add validation to check that the IORT RMR node revision  [SAMI]
   is not 2 as it breaks backward compatibility and was
   deprecated as part of IORT Rev E.c.

v3:
 - No code change since v1. Included r-b received for   [SAMI]
   v2 series.
   Ref: https://edk2.groups.io/g/devel/topic/83600720#7665

v2:
  - No code change since v1. Re-sending with v2 series. [SAMI]

 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 230 
++--
 1 file changed, 212 insertions(+), 18 deletions(-)

diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
index 
44d633c5282463078a4cc990bb24ca1992f95634..599cf0ee8f7e4c7ed398fa604602604d1955d2e6
 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
@@ -1,14 +1,16 @@
 /** @file
   IORT table parser
 
-  Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
+  Copyright (c) 2016 - 2022, Arm Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Reference(s):
-  - IO Remapping Table, Platform Design Document, Revision D, March 2018
+- IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022
+  (https://developer.arm.com/documentation/den0049/)
 
   @par Glossary:
 - Ref  - Reference
+- Desc - Descriptor
 **/
 
 #include 
@@ -26,6 +28,7 @@ STATIC CONST UINT32  *IortNodeOffset;
 
 STATIC CONST UINT8   *IortNodeType;
 STATIC CONST UINT16  *IortNodeLength;
+STATIC CONST UINT8   *IortNodeRevision;
 STATIC CONST UINT32  *IortIdMappingCount;
 STATIC CONST UINT32  *IortIdMappingOffset;
 
@@ -36,6 +39,9 @@ STATIC CONST UINT32  *PmuInterruptOffset;
 
 STATIC CONST UINT32  *ItsCount;
 
+STATIC CONST UINT32  *RmrMemDescCount;
+STATIC CONST UINT32  *RmrMemDescOffset;
+
 /**
   This function validates the ID Mapping array count for the ITS node.
 
@@ -100,6 +106,52 @@ ValidateItsIdArrayReference (
   }
 }
 
+/**
+  This function validates that the Physical Range address or length is not zero
+  and is 64K aligned.
+
+  @param [in] Ptr Pointer to the start of the field data.
+  @param [in] Context Pointer to context specific information e.g. this
+  could be a pointer to the ACPI table header.
+**/
+STATIC
+VOID
+EFIAPI
+ValidatePhysicalRange (
+  IN UINT8  *Ptr,
+  IN VOID   *Context
+  )
+{
+  UINT64  Value;
+
+  Value = *(UINT64 *)Ptr;
+  if ((Value == 0) || ((Value & (SIZE_64KB - 1)) != 0)) {
+IncrementErrorCount ();
+Print (L"\nERROR: P

[edk2-devel] [PATCH v6 0/8] IORT Rev E.d specification updates

2022-07-14 Thread Sami Mujawar
Bugzilla: 3458 - Add support IORT Rev E.d specification updates
  (https://bugzilla.tianocore.org/show_bug.cgi?id=3458)

The IO Remapping Table, Platform Design Document, Revision E.d,
Feb 2022 (https://developer.arm.com/documentation/den0049/)
introduces the following updates, collectively including the
updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c:
  - increments the IORT table revision to 5.
  - updates the node definition to add an 'Identifier' field.
  - adds definition of node type 6 - Reserved Memory Range node.
  - adds definition for Memory Range Descriptors.
  - adds flag to indicate PRI support for root complexes.
  - adds flag to indicate if the root complex supports forwarding
of PASID information on translated transactions to the SMMU.
  - adds flag to indicate if the root complex supports PASID.
  - adds flags to define access privilege and attributes for the
memory ranges.

This v6 series:
 * Updates teh IORT header to add definition for IORT Rev 4
and RMR Node 2 so that appropriate checks can be performed
for deprecated table/node revisions.
 * Adds checks to not generate IORT table Rev E, E..
 * Addresses the feedback received for Acpiview to:
   - Make output format for Flags filed consistent.
   - Define macro for IORT Rev E.c and RMR Node revision 2
 and use these to check for deprecated table/node
 revisions.
   - Added check to skip parsing if IORT Rev E, E.
 as various fields were deprecated between revisions.

The v5 series:
 * Addresses the feedback for IORT Revision macro.
 * Reorders the patches in the series and updates
   "MdePkg: IORT header update for IORT Rev E.d spec"
   patch to include changes for IORT generator to prevent
   git bisect from breaking.

The v4 series:
 * Updates the IORT header to reflect Rev E.d:
   - Add flag to indicate if the root complex supports PASID.
   - Add flags to define access privilege and attributes for the
 memory ranges.
 * Adds validations to Acpiview to:
   - Check that the IORT Table Revision is not 4 as IORT
 Rev E.c is deprecated.
   - Check that the IORT RMR node revision is not 2 as it
 breaks backward compatibility and was deprecated as
 part of IORT Rev E.c.
 * Updates Dynamic Tables Framework to support generation of
 IORT revision E.d.

The v3 series:
 - Dropped [PATCH v2 1/8] MdePkg: Fix IORT header file include
   guard as suggested at
   https://edk2.groups.io/g/devel/message/76656
 - Removed definition of EFI_ACPI_IO_REMAPPING_TABLE_REVISION as
   EFI_ACPI_IO_REMAPPING_TABLE_REV0 has been provided for
   representing Rev 0.
 - Moved error handling code for IdMappingToken from patch v2 6/8
   and v2 8/8 into a separate patch.
 - Moved Identifier field before Flags field in CM_ARM_RMR_NODE.
 - Added description for CM_ARM_MEMORY_RANGE_DESCRIPTOR field.

The v2 patch series includes all changes from v1 patch series
except the following 2 patches have been modified to set the
EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro to Rev 0 as setting
to Rev 3 will break existing platforms, the problem being that
the Identifier field in the IORT nodes would not be unique.
  - MdePkg: IORT header update for IORT Rev E.b spec
  - DynamicTablesPkg: IORT generator updates for Rev E.b spec

The v1 patch series:
  - Updates the IORT header file to match the Rev E.b specification.
  - Add support to parse IORT Rev E.b tables
  - Add support to generate IORT Rev E.b compliant ACPI tables
using Dynamic Tables Framework.

The changes for the v4 series can be seen at:
https://github.com/samimujawar/edk2/tree/1527_iort_rev_ed_v6
Sami Mujawar (8):
  ShellPkg: Acpiview: Abbreviate field names to preserve alignment
  DynamicTablesPkg: Handle error when IdMappingToken is NULL
  DynamicTablesPkg: IORT set reference to Id array only if present
  DynamicTablesPkg: IORT set reference to interrupt array if present
  MdePkg: IORT header update for IORT Rev E.d spec
  ShellPkg: Acpiview: IORT parser update for IORT Rev E.d spec
  DynamicTablesPkg: Update ArmNameSpaceObjects for IORT Rev E.d
  DynamicTablesPkg: IORT generator updates for Rev E.d spec

 DynamicTablesPkg/DynamicTablesPkg.ci.yaml  |   1 +
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h |  66 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c   | 854 
+---
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h   |   5 +-
 MdePkg/Include/IndustryStandard/IoRemappingTable.h |  86 +-
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 239 
+-
 6 files changed,  insertions(+), 140 deletions(-)

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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91361): https://edk2.groups.io/g/devel/message/91361
Mute This Topic: https://groups.io/mt/92383466/21656
Group Owner: devel+ow...@ed

[edk2-devel] [PATCH v6 8/8] DynamicTablesPkg: IORT generator updates for Rev E.d spec

2022-07-14 Thread Sami Mujawar
Bugzilla: 3458 - Add support IORT Rev E.d specification updates
  (https://bugzilla.tianocore.org/show_bug.cgi?id=3458)

The IO Remapping Table, Platform Design Document, Revision E.d,
Feb 2022 (https://developer.arm.com/documentation/den0049/)
introduces the following updates, collectively including the
updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c:
 - increments the IORT table revision to 5.
 - updates the node definition to add an 'Identifier' field.
 - adds definition of node type 6 - Reserved Memory Range node.
 - adds definition for Memory Range Descriptors.
 - adds flag to indicate PRI support for root complexes.
 - adds flag to indicate if the root complex supports forwarding
   of PASID information on translated transactions to the SMMU.
 - adds flag to indicate if the root complex supports PASID.
 - adds flags to define access privilege and attributes for the
   memory ranges.

Therefore, update the IORT generator to:
  - increment IORT table revision count to 5.
  - populate Identifier filed if revision is greater than 4.
  - add support to populate Reserved Memory Range nodes and
the Memory range descriptors.
  - add validation to check that the Identifier field is
unique.
  - Populate the PASID capabilities and Flags field of the
Root complex node.
 - Added checks to not generate IORT Rev E, Rev E..

Signed-off-by: Sami Mujawar 
---

Notes:
v6:
 - Add check to not generate IORT Rev E, E..  [PIERRE]
 - Added checks to not generate IORT table Rev E, E.. [SAMI]

v5:
 - Change IORT revision macro name to make it similar to [THOMAS]
   macro names for other ACPI tables.
 - Updated IORT revision macros from [SAMI]
   EFI_ACPI_IO_REMAPPING_TABLE_REVx to
   EFI_ACPI_IO_REMAPPING_TABLE_REVISION_0x
   Ref: https://edk2.groups.io/g/devel/message/91119
 - Minor updates initialise RcNode.PasidCapabilities in  [SAMI]
   case of EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 so that
   backward compatibility is maintained.

v4:
 - Update IORT generator to support spec revision E.d[SAMI]
 - Populate the PASID capabilities and Flags field of the[SAMI]
   Root complex node.

v3:
 - Move error handling for IdMappingToken.   [PIERRE]
 - Moved error handling for IdMappingToken in a separate [SAMI]
   patch in v3 series.
   Ref: https://edk2.groups.io/g/devel/topic/83600726#76661

v2:
 - The macro EFI_ACPI_IO_REMAPPING_TABLE_REVISION was set to [SAMI]
   Rev 0 as setting to Rev 3 will break existing platforms.
   Therefore, set the max supported IORT generator revision
   to 3.

 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 655 
++--
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h |   5 +-
 2 files changed, 610 insertions(+), 50 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index 
63381441e2d6515a7cc9731c89b9739a12c65599..40d99162cc610de2d0c2f0a5fff6e457c08d07fb
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -5,8 +5,8 @@
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Reference(s):
-  - IO Remapping Table, Platform Design Document,
-Document number: ARM DEN 0049D, Issue D, March 2018
+  - IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022
+(https://developer.arm.com/documentation/den0049/)
 
 **/
 
@@ -37,9 +37,11 @@ Requirements:
   - EArmObjSmmuV1SmmuV2
   - EArmObjSmmuV3
   - EArmObjPmcg
+  - EArmObjRmr
   - EArmObjGicItsIdentifierArray
   - EArmObjIdMappingArray
-  - EArmObjGicItsIdentifierArray
+  - EArmObjSmmuInterruptArray
+  - EArmObjMemoryRangeDescriptor
 */
 
 /** This macro expands to a function that retrieves the ITS
@@ -96,6 +98,24 @@ GET_OBJECT_LIST (
   CM_ARM_PMCG_NODE
   );
 
+/** This macro expands to a function that retrieves the
+RMR node information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjRmr,
+  CM_ARM_RMR_NODE
+  );
+
+/** This macro expands to a function that retrieves the
+Memory Range Descriptor Array information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjMemoryRangeDescriptor,
+  CM_ARM_MEMORY_RANGE_DESCRIPTOR
+  );
+
 /** This macro expands to a function that retrieves the
 ITS Identifier Array information from the Configuration Manager.
 */
@@ -174,16 +194,19 @@ GetSizeofItsGroupNodes (
 
   Size = 0;
   while (NodeCount-- != 0) {
-(*NodeIndexer)->Token  = NodeList->Token;
-(*NodeIndexer)->Object = (VOID *)NodeList;
-(*NodeIndexer)->Offset = (UINT32)(Size + NodeStartOffset);
+(*NodeIndexer)->Token  = NodeList->Token;
+

[edk2-devel] [PATCH v6 7/8] DynamicTablesPkg: Update ArmNameSpaceObjects for IORT Rev E.d

2022-07-14 Thread Sami Mujawar
Bugzilla: 3458 - Add support IORT Rev E.d specification updates
  (https://bugzilla.tianocore.org/show_bug.cgi?id=3458)

The IO Remapping Table, Platform Design Document, Revision E.d,
Feb 2022 (https://developer.arm.com/documentation/den0049/)
introduces the following updates, collectively including the
updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c:
 - increments the IORT table revision to 5.
 - updates the node definition to add an 'Identifier' field.
 - adds definition of node type 6 - Reserved Memory Range node.
 - adds definition for Memory Range Descriptors.
 - adds flag to indicate PRI support for root complexes.
 - adds flag to indicate if the root complex supports forwarding
   of PASID information on translated transactions to the SMMU.
 - adds flag to indicate if the root complex supports PASID.
 - adds flags to define access privilege and attributes for the
   memory ranges.

Therefore, update the Arm namespace objects to:
  - add Identifier field to IORT nodes.
  - introduce enums to represent RMR nodes and Memory Range
descriptors.
  - add definition of node type 6 - Reserved Memory Range node.
  - add definition for Memory Range Descriptors.
  - add PASID capabilities and flags field to Root Complex node.

Signed-off-by: Sami Mujawar 
---

Notes:
v6:
 - No code change since v4. Re-sending with v6 series.[SAMI]

v5:
 - No code change since v4. Re-sending with v5 series.[SAMI]

v4:
- Update ArmNameSpaceObjects to support IORT specification[SAMI]
  revision E.d.
- Add PASID capabilities and flags field to Root Complex node.[SAMI]
- Add flags to define access privilege and attributes for the [SAMI]
  memory ranges.
- Update DynamicTablesPkg.ci.yaml to add PASID to the ignore  [SAMI]
  list for the spell checker.

v3:
 - Move Identifier field before Flags field in[PIERRE]
   CM_ARM_RMR_NODE.
 - Add description for CM_ARM_MEMORY_RANGE_DESCRIPTOR [PIERRE]
   field.
 - Updated based on review feedback.  [SAMI]
   Ref: https://edk2.groups.io/g/devel/topic/83600723#76659

v2:
 - No code change since v1. Re-sending with v2 series.[SAMI]

 DynamicTablesPkg/DynamicTablesPkg.ci.yaml  |  1 +
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 66 +++-
 2 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml 
b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
index 
bfa282926e48c79ea748b12dee19a322197eaed1..5addf8626841fe35dd0d499a277cb7308787fee0
 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
+++ b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
@@ -108,6 +108,7 @@
"lgreater",
"lless",
"MPIDR",
+   "PASID",
"PERIPHBASE",
"phandle",
"pytool",
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
91bef9bccd1978b0e396f423cff81e621b05e0ea..102e0f96beb22cc2b93c1525bef62cd4173774eb
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
+  Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -61,6 +61,8 @@ typedef enum ArmObjectID {
   EArmObjLpiInfo,  ///< 37 - Lpi Info
   EArmObjPciAddressMapInfo,///< 38 - Pci Address Map Info
   EArmObjPciInterruptMapInfo,  ///< 39 - Pci Interrupt Map Info
+  EArmObjRmr,  ///< 40 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,///< 41 - Memory Range Descriptor
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -477,6 +479,9 @@ typedef struct CmArmItsGroupNode {
   UINT32 ItsIdCount;
   /// Reference token for the ITS identifier array
   CM_OBJECT_TOKENItsIdToken;
+
+  /// Unique identifier for this node.
+  UINT32 Identifier;
 } CM_ARM_ITS_GROUP_NODE;
 
 /** A structure that describes the
@@ -509,6 +514,9 @@ typedef struct CmArmNamedComponentNode {
   the entry in the namespace for this object.
   */
   CHAR8  *ObjectName;
+
+  /// Unique identifier for this node.
+  UINT32 Identifier;
 } CM_ARM_NAMED_COMPONENT_NODE;
 
 /** A structure that describes the
@@ -537,6 +545,13 @@ typedef struct CmArmRootComplexNode {
   UINT32 PciSegmentNumber;
   /// Memory address size limit
   UINT8  MemoryAddressSize;
+  /// PASID capabilities
+  UINT16 PasidCapabilities;
+  /// Flags
+  UINT32 Flags;
+
+  /// Unique identifier for this node.
+  UINT32 Identifier;
 } CM_ARM_ROOT_COMPLEX_NODE;
 
 /** A structure that describes the
@@ -579,6 

[edk2-devel] [PATCH edk2-platforms v4 00/17] Fix build breaks and update IORT revision macro

2022-07-14 Thread Sami Mujawar
This v4 series includes 5 additional patches (13-17) that
fix various build breaks caused by changes in edk2 repo.
The patches 1-12 have not changed between v3 series, except
updates to the r-b received.

The v3 patch series renames the EFI_ACPI_IO_REMAPPING_TABLE_REV0
macro to EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 based on the
feedback received. It also includes an additional patch that fixes
the build break in CelloBoard due to missing VariablePolicyHelperLib
dependency.

The v2 patch series fixes the build break in Ampere/Jade and
Pythium/FT2000-4 due to missing VariableFlashInfoLib dependency
and also updates the IORT revision macro.

The IORT Rev E.d specification updates the IORT table revision
to 5. Following this the IORT table revision macro 
EFI_ACPI_IO_REMAPPING_TABLE_REVISION which was at Rev 0 has
been renamed to EFI_ACPI_IO_REMAPPING_TABLE_REV0. Therefore,
this series updates the following platforms to reflect this
renaming:
 - FVP
 - Morello FVP
 - SGI
 - AMD/Styx
 - Socionext/SynQuacer
 - RaspberryPi
 - N1SDP
 - Ampere/Jade
 - Pythium/FT2000-4

Note: This patch series is dependent on the edk2 patch series:
  "[PATCH v6 0/8] IORT Rev E.d specification updates"
  (https://edk2.groups.io/g/devel/message/91361), which must
  be merged in edk2 before this patch series can be integrated.

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/1527_iort_rev_ed_platforms_v4

Sami Mujawar (17):
  Platform/ARM: FVP: Update for IORT revision macro renaming
  Platform/ARM: Morello: Update for IORT revision macro renaming
  Platform/ARM: SGI: Update for IORT revision macro renaming
  Silicon/AMD/Styx: Update for IORT revision macro renaming
  Silicon/Socionext/SynQuacer: Update for IORT revision macro renaming
  Platform/RaspberryPi: Update for IORT revision macro renaming
  Platform/ARM: N1SDP: Update for IORT revision macro renaming
  Silicon/Ampere: Add VariableFlashInfoLib
  Platform/Ampere: JadePkg: Update for IORT revision macro renaming
  Silicon/Phytium: Add VariableFlashInfoLib
  Silicon/Phytium: FT2000-4Pkg: Update for IORT revision macro renaming
  Platform/LeMaker: Fix missing dependency on VariablePolicyHelperLib
  Platform/Socionext: Fix missing dependency on VariableFlashInfoLib
  Silicon/NXP: Fix missing dependency on VariableFlashInfoLib
  Platform/NXP/LS1043aRdbPk: Fix build break due to change in
ARM_CORE_INFO
  Platform/NXP/LS1046aFrwyPkg: Fix build break due to change in
ARM_CORE_INFO
  Platform/NXP/LX2160aRdbPkg: Fix build break due to change in
ARM_CORE_INFO

 
Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerFvp.c
  | 2 +-
 
Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
   | 2 +-
 Platform/ARM/SgiPkg/AcpiTables/Iort.aslc   
  | 2 +-
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 | 2 +-
 Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiIort.c 
  | 2 +-
 Platform/LeMaker/CelloBoard/CelloBoard.dsc 
  | 1 +
 Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c 
  | 2 +-
 Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c
  | 2 +-
 Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c 
  | 2 +-
 Platform/RaspberryPi/AcpiTables/Iort.aslc  
  | 2 +-
 Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc   
  | 1 +
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc 
  | 2 +-
 Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc   
  | 1 +
 Silicon/NXP/NxpQoriqLs.dsc.inc 
  | 1 +
 Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Iort.aslc   
  | 2 +-
 Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc  
  | 1 +
 Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc   
  | 2 +-
 17 files changed, 17 insertions(+), 12 deletions(-)

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



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




[edk2-devel] [PATCH edk2-platforms v4 03/17] Platform/ARM: SGI: Update for IORT revision macro renaming

2022-07-14 Thread Sami Mujawar
The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the IORT table for SGI platforms to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
Reviewed-by: Thomas Abraham 
---
 Platform/ARM/SgiPkg/AcpiTables/Iort.aslc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc 
b/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc
index 
fcc28a71c82eb0c78c96d60c9d9eb1554adb41a3..a7ad92622a905f5b1fd725d5d673a2643685f9af
 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc
+++ b/Platform/ARM/SgiPkg/AcpiTables/Iort.aslc
@@ -50,7 +50,7 @@ ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE Iort =
  (
EFI_ACPI_6_2_IO_REMAPPING_TABLE_SIGNATURE,
ARM_EFI_ACPI_6_0_IO_REMAPPING_TABLE,
-   EFI_ACPI_IO_REMAPPING_TABLE_REVISION
+   EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00
  ),
  3,  // NumNodes
  sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE),  // NodeOffset
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 05/17] Silicon/Socionext/SynQuacer: Update for IORT revision macro renaming

2022-07-14 Thread Sami Mujawar
The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the IORT table for SynQuacer platform to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---
 Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc 
b/Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc
index 
4627347028132395de757ff7c81b00848057632d..293888cbbe21686e9061e988c036ff487d7b35cb
 100644
--- a/Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc
+++ b/Silicon/Socionext/SynQuacer/AcpiTables/Iort.aslc
@@ -56,7 +56,7 @@ STATIC SYNQUACER_IO_REMAPPING_STRUCTURE Iort = {
   {
 __ACPI_HEADER(EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE,
   SYNQUACER_IO_REMAPPING_STRUCTURE,
-  EFI_ACPI_IO_REMAPPING_TABLE_REVISION),
+  EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00),
 6,  // NumNodes
 sizeof(EFI_ACPI_6_0_IO_REMAPPING_TABLE),// NodeOffset
 0   // Reserved
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 07/17] Platform/ARM: N1SDP: Update for IORT revision macro renaming

2022-07-14 Thread Sami Mujawar
The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the IORT table for N1SDP platform to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---
 
Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 
f50623ae3faccc862eef1968674dee8bd33fbdd6..a6b4cb0ef482541da2c9244c1135f10ccbbfbaf9
 100644
--- 
a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ 
b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -90,7 +90,7 @@ EDKII_PLATFORM_REPOSITORY_INFO N1sdpRepositoryInfo = {
 // IORT Table
 {
   EFI_ACPI_6_3_IO_REMAPPING_TABLE_SIGNATURE,
-  EFI_ACPI_IO_REMAPPING_TABLE_REVISION,
+  EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00,
   CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdIort),
   NULL
 },
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 14/17] Silicon/NXP: Fix missing dependency on VariableFlashInfoLib

2022-07-14 Thread Sami Mujawar
The NXP platform firmware build breaks due to the missing
dependency on VariableFlashInfoLib.

Therefore, to satisfy the dependency include VariableFlashInfoLib
in the LibraryClasses.common section.

Signed-off-by: Sami Mujawar 
---
 Silicon/NXP/NxpQoriqLs.dsc.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc
index 
99a317aba7e687d2a30ee78443c2a3dfe085ac05..80b26fc643c412a4e22046918e3cf105f58db9f5
 100644
--- a/Silicon/NXP/NxpQoriqLs.dsc.inc
+++ b/Silicon/NXP/NxpQoriqLs.dsc.inc
@@ -91,6 +91,7 @@ [LibraryClasses.common]
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'

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 (#91368): https://edk2.groups.io/g/devel/message/91368
Mute This Topic: https://groups.io/mt/92383583/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH edk2-platforms v4 09/17] Platform/Ampere: JadePkg: Update for IORT revision macro renaming

2022-07-14 Thread Sami Mujawar
The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the IORT table for SynQuacer platform to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
Reviewed-by: Nhi Pham 
---
 Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiIort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiIort.c 
b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiIort.c
index 
97be85c51f253422851ba139ee60bc8fc681aa87..958708810a4918b1683ecc5fb021b59a7191e207
 100644
--- a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiIort.c
+++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiIort.c
@@ -87,7 +87,7 @@ EFI_ACPI_6_0_IO_REMAPPING_TABLE mIortHeader = {
   .Header = __ACPI_HEADER (
   EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE,
   AC01_IO_REMAPPING_STRUCTURE,
-  EFI_ACPI_IO_REMAPPING_TABLE_REVISION
+  EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00
   ),
   .NumNodes = 0,  // To be filled
   .NodeOffset = sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE),
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 11/17] Silicon/Phytium: FT2000-4Pkg: Update for IORT revision macro renaming

2022-07-14 Thread Sami Mujawar
The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the IORT table for SynQuacer platform to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---
 Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Iort.aslc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Iort.aslc 
b/Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Iort.aslc
index 
4239499b68e5923604625e05a0425fc11ab6664e..9c3a5eea72cbeb20ef48450789630a15094f0372
 100644
--- a/Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Iort.aslc
+++ b/Silicon/Phytium/FT2000-4Pkg/Drivers/AcpiTables/Iort.aslc
@@ -42,7 +42,7 @@ STATIC PHYTIUM_IO_REMAPPING_STRUCTURE Iort = {
   {
 PHYTIUM_ACPI_HEADER (EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE,
   PHYTIUM_IO_REMAPPING_STRUCTURE,
-  EFI_ACPI_IO_REMAPPING_TABLE_REVISION),
+  EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00),
 2,  // NumNodes
 sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE),   // NodeOffset
 0   // Reserved
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 15/17] Platform/NXP/LS1043aRdbPk: Fix build break due to change in ARM_CORE_INFO

2022-07-14 Thread Sami Mujawar
The edk2 patch at 103fa647d159e3d76be2634d2653c2d215dd0d46
updated the ARM_CORE_INFO structure to remove the ClusterId
and CoreId fields in the ARM_CORE_INFO structure in favor of
a new Mpidr field.

Therefore, fix the ArmPlatformLibrary instance for
Platform/NXP/LS1043aRdbPkg accordingly.

Signed-off-by: Sami Mujawar 
---
 Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c 
b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c
index 
dc81e7ba3101902799bf6b6301113caafb4e1c89..4e7d7741a00b2198817a72c06aa977cc4e02c0ad
 100644
--- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c
+++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c
@@ -94,7 +94,7 @@ ArmPlatformInitialize (
 ARM_CORE_INFO LS1043aMpCoreInfoCTA53x4[] = {
   {
 // Cluster 0, Core 0
-0x0, 0x0,
+0x0,

 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
 (EFI_PHYSICAL_ADDRESS)0,
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'

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 (#91371): https://edk2.groups.io/g/devel/message/91371
Mute This Topic: https://groups.io/mt/92383587/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH edk2-platforms v4 08/17] Silicon/Ampere: Add VariableFlashInfoLib

2022-07-14 Thread Sami Mujawar
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479

Add an instance for the library class VariableFlashInfoLib that
was recently introduced in MdeModulePkg. This allows the variable
driver to build successfully as it has a dependency on this
library class.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
Reviewed-by: Nhi Pham 
---
 Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc 
b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
index 
f4007d654ec81297d4bbe002b2671c211129d819..d4c29c3c338cc8abefd84cbb3ff14d1727bd4fe4
 100644
--- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
+++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
@@ -154,6 +154,7 @@ [LibraryClasses.common]
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 !endif
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
 
   #
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 12/17] Platform/LeMaker: Fix missing dependency on VariablePolicyHelperLib

2022-07-14 Thread Sami Mujawar
The CelloBoard platform firmware build breaks due to the missing
dependency on VariablePolicyHelperLib.

Therefore, to satisfy the dependency include VariablePolicyHelperLib
in the LibraryClasses.common section.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---
 Platform/LeMaker/CelloBoard/CelloBoard.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Platform/LeMaker/CelloBoard/CelloBoard.dsc 
b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
index 
6be8062e60f6a83a357edbdbbbdf7a35dc10f044..0b98d976f9c47da6864889ef558fc73f8a820498
 100644
--- a/Platform/LeMaker/CelloBoard/CelloBoard.dsc
+++ b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
@@ -121,6 +121,7 @@ [LibraryClasses.common]
 
   
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
+  
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
   
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
   BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 02/17] Platform/ARM: Morello: Update for IORT revision macro renaming

2022-07-14 Thread Sami Mujawar
The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the Configuration Manager for Morello FVP to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---
 
Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerFvp.c
 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerFvp.c
 
b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerFvp.c
index 
ed2fdfeff9a02b13729cdd5d6f334f7bcabe679f..85b0d390598ffd9739059d1ee1c7aae312aba48c
 100644
--- 
a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerFvp.c
+++ 
b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerFvp.c
@@ -76,7 +76,7 @@ EDKII_FVP_PLATFORM_REPOSITORY_INFO MorelloFvpRepositoryInfo = 
{
 // IORT Table
 {
   EFI_ACPI_6_3_IO_REMAPPING_TABLE_SIGNATURE,
-  EFI_ACPI_IO_REMAPPING_TABLE_REVISION,
+  EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00,
   CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdIort),
   NULL
 },
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 17/17] Platform/NXP/LX2160aRdbPkg: Fix build break due to change in ARM_CORE_INFO

2022-07-14 Thread Sami Mujawar
The edk2 patch at 103fa647d159e3d76be2634d2653c2d215dd0d46
updated the ARM_CORE_INFO structure to remove the ClusterId
and CoreId fields in the ARM_CORE_INFO structure in favor of
a new Mpidr field.

Therefore, fix the ArmPlatformLibrary instance for
Platform/NXP/LX2160aRdbPkg accordingly.

Signed-off-by: Sami Mujawar 
---
 Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c 
b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c
index 
f3f1e5b3f220a6b5c83a035539607d93c801260e..62e03daed6207668b98d12c5bd7c7ca4cef0184c
 100644
--- a/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c
+++ b/Platform/NXP/LX2160aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c
@@ -16,7 +16,7 @@
 ARM_CORE_INFO mLX2160aMpCoreInfoTable[] = {
   {
 // Cluster 0, Core 0
-0x0, 0x0,
+0x0,

 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
 (EFI_PHYSICAL_ADDRESS)0,
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'

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 (#91372): https://edk2.groups.io/g/devel/message/91372
Mute This Topic: https://groups.io/mt/92383588/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH edk2-platforms v4 16/17] Platform/NXP/LS1046aFrwyPkg: Fix build break due to change in ARM_CORE_INFO

2022-07-14 Thread Sami Mujawar
The edk2 patch at 103fa647d159e3d76be2634d2653c2d215dd0d46
updated the ARM_CORE_INFO structure to remove the ClusterId
and CoreId fields in the ARM_CORE_INFO structure in favor of
a new Mpidr field.

Therefore, fix the ArmPlatformLibrary instance for
Platform/NXP/LS1046aFrwyPkg accordingly.

Signed-off-by: Sami Mujawar 
---
 Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c 
b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c
index 
ef404991add8345b1c5520c8989558e78906f518..8b8524b28203b76932d0a1533ef09d088a88f0f7
 100644
--- a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c
+++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c
@@ -23,7 +23,7 @@
 ARM_CORE_INFO mLS1046aMpCoreInfoTable[] = {
   {
 // Cluster 0, Core 0
-0x0, 0x0,
+0x0,

 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
 (EFI_PHYSICAL_ADDRESS)0,
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'

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 (#91376): https://edk2.groups.io/g/devel/message/91376
Mute This Topic: https://groups.io/mt/92383595/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH edk2-platforms v4 01/17] Platform/ARM: FVP: Update for IORT revision macro renaming

2022-07-14 Thread Sami Mujawar
The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the Configuration Manager for FVP platform to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 
0ba854610becff7d2544e26ec67a331783bbe75f..58a4bf9890bc2a701dab558a1987f9a51662481a
 100644
--- 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -82,7 +82,7 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
 // IORT Table - FVP RevC
 {
   EFI_ACPI_6_3_IO_REMAPPING_TABLE_SIGNATURE,
-  EFI_ACPI_IO_REMAPPING_TABLE_REVISION,
+  EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00,
   CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdIort),
   NULL
 },
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 10/17] Silicon/Phytium: Add VariableFlashInfoLib

2022-07-14 Thread Sami Mujawar
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479

Add an instance for the library class VariableFlashInfoLib that
was recently introduced in MdeModulePkg. This allows the variable
driver to build successfully as it has a dependency on this
library class.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---
 Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc 
b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc
index 
2565b8ac626abc2073d201ad43e057f2fbbf4cbc..a7ca630be7b98e784261bc9a7543fdcc71151337
 100644
--- a/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc
+++ b/Silicon/Phytium/PhytiumCommonPkg/PhytiumCommonPkg.dsc.inc
@@ -98,6 +98,7 @@ [LibraryClasses.common]
   
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
 
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
 
   #
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 04/17] Silicon/AMD/Styx: Update for IORT revision macro renaming

2022-07-14 Thread Sami Mujawar
The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the IORT table for Styx platform to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
Reviewed-by: Pierre Gondois 
---
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc 
b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc
index 
b81f87b7794eec47042910d77efcb609563991a8..27d443494bd312ab7d96d8072a9f4c1e9a98b1ae
 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc
@@ -139,7 +139,7 @@ STATIC STYX_IO_REMAPPING_STRUCTURE AcpiIort = {
   {
 AMD_ACPI_HEADER(EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE,
 STYX_IO_REMAPPING_STRUCTURE,
-EFI_ACPI_IO_REMAPPING_TABLE_REVISION),
+EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00),
 11, // NumNodes
 sizeof(EFI_ACPI_6_0_IO_REMAPPING_TABLE),// NodeOffset
 0   // Reserved
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 06/17] Platform/RaspberryPi: Update for IORT revision macro renaming

2022-07-14 Thread Sami Mujawar
The IORT Specification E.d updates the IORT table revision to 5. To
reflect this change the IORT header file has been updated to rename
the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro which was at Rev 0 to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Therefore, update the usage of EFI_ACPI_IO_REMAPPING_TABLE_REVISION
macro in the IORT table for RaspberryPi platform to
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00.

Signed-off-by: Sami Mujawar 
Reviewed-by: Jeremy Linton 
Reviewed-by: Pierre Gondois 
---
 Platform/RaspberryPi/AcpiTables/Iort.aslc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/RaspberryPi/AcpiTables/Iort.aslc 
b/Platform/RaspberryPi/AcpiTables/Iort.aslc
index 
810307ae376f7d24790775f499daa09e3137fe6c..78efabb94739862275199bdac3d678f3586d9b94
 100644
--- a/Platform/RaspberryPi/AcpiTables/Iort.aslc
+++ b/Platform/RaspberryPi/AcpiTables/Iort.aslc
@@ -28,7 +28,7 @@ STATIC RPI4_IO_REMAPPING_STRUCTURE Iort = {
   {
 ACPI_HEADER (EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE,
  RPI4_IO_REMAPPING_STRUCTURE,
- EFI_ACPI_IO_REMAPPING_TABLE_REVISION),
+ EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00),
 3,  // NumNodes
 sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE),   // NodeOffset
 0   // Reserved
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




[edk2-devel] [PATCH edk2-platforms v4 13/17] Platform/Socionext: Fix missing dependency on VariableFlashInfoLib

2022-07-14 Thread Sami Mujawar
The DeveloperBox platform firmware build breaks due to the missing
dependency on VariableFlashInfoLib.

Therefore, to satisfy the dependency include VariableFlashInfoLib
in the LibraryClasses section.

Signed-off-by: Sami Mujawar 
---
 Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc 
b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
index 
c034c0a32cfdc9b30b169c7b051595dee1696ed6..d8524c438c2c64e9f4bb31a3f9b0127ecc1ddb2e
 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc
@@ -112,6 +112,7 @@ [LibraryClasses]
   NorFlashInfoLib|EmbeddedPkg/Library/NorFlashInfoLib/NorFlashInfoLib.inf
   
NorFlashPlatformLib|Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacerLib.inf
 
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
 
 [LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.MM_STANDALONE]
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




Re: [edk2-devel][PATCH v2 0/2] Update SEC_IDT_TABLE struct to reserve sufficient size in IdtTable for both IA32 and X64

2022-07-14 Thread Chiu, Chasel


This series has been merged:
https://github.com/tianocore/edk2/commit/9ab389c01b875869c6173557aa053d397aaf14f1
https://github.com/tianocore/edk2/commit/470206ba7f118aaa1153d66689cf3ee4d17051b7

Thanks,
Chasel


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Kuo, Ted
> Sent: Tuesday, July 12, 2022 2:31 AM
> To: devel@edk2.groups.io
> Subject: [edk2-devel][PATCH v2 0/2] Update SEC_IDT_TABLE struct to reserve
> sufficient size in IdtTable for both IA32 and X64
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3957
> The reserved IDT table size in SecCore is too small for X64. Changed the type 
> of
> IdtTable in SEC_IDT_TABLE from UINT64 to IA32_IDT_GATE_DESCRIPTOR to
> have sufficient size reserved in IdtTable for X64.
> 
> Ted Kuo (2):
>   UefiCpuPkg: Update SEC_IDT_TABLE struct
>   IntelFsp2Pkg: Update SEC_IDT_TABLE struct
> 
>  IntelFsp2Pkg/FspSecCore/SecFsp.c  |  9 +
> IntelFsp2Pkg/FspSecCore/SecFsp.h  |  2 +-  IntelFsp2Pkg/FspSecCore/SecMain.c
> | 16   IntelFsp2Pkg/FspSecCore/SecMain.h |  4 ++--
>  UefiCpuPkg/SecCore/SecMain.c  |  1 +
>  UefiCpuPkg/SecCore/SecMain.h  |  4 ++--
>  6 files changed, 19 insertions(+), 17 deletions(-)
> 
> --
> 2.35.3.windows.1
> 
> 
> 
> 
> 



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




[edk2-devel] [PATCH] IntelFsp2Pkg/FspSecCore: Add FSP-I API for SMM support.

2022-07-14 Thread Chiu, Chasel
From: Hongbin1 Zhang 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3993
Add FSP-I API entry point for SMM support.

Cc: Nate DeSimone 
Cc: Star Zeng 
Signed-off-by: Chasel Chiu 
Signed-off-by: Hongbin1 Zhang 
---
 IntelFsp2Pkg/FspSecCore/SecFspApiChk.c | 13 +
 IntelFsp2Pkg/FspSecCore/FspSecCoreI.inf| 54 
++
 IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryI.nasm | 44 

 IntelFsp2Pkg/FspSecCore/X64/FspApiEntryI.nasm  | 44 

 IntelFsp2Pkg/Include/FspEas/FspApi.h   | 57 
++---
 IntelFsp2Pkg/Include/FspGlobalData.h   | 53 
-
 IntelFsp2Pkg/Include/Guid/FspHeaderFile.h  | 22 +++---
 IntelFsp2Pkg/IntelFsp2Pkg.dsc  |  1 +
 IntelFsp2Pkg/Tools/GenCfgOpt.py| 26 --
 IntelFsp2Pkg/Tools/SplitFspBin.py  |  6 +++---
 10 files changed, 256 insertions(+), 64 deletions(-)

diff --git a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c 
b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
index e22a88cc84..35d223a404 100644
--- a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
+++ b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
@@ -71,6 +71,19 @@ FspApiCallingCheck (
 Status = EFI_INVALID_PARAMETER;
   }
 }
+  } else if (ApiIdx == FspSmmInitApiIndex) {
+//
+// FspSmmInitApiIndex check
+//
+if ((FspData == NULL) || ((UINTN)FspData == MAX_ADDRESS) || 
((UINTN)FspData == MAX_UINT32)) {
+  Status = EFI_UNSUPPORTED;
+} else {
+  if (FspData->Signature != FSP_GLOBAL_DATA_SIGNATURE) {
+Status = EFI_UNSUPPORTED;
+  } else if (EFI_ERROR (FspUpdSignatureCheck (FspSmmInitApiIndex, 
ApiParam))) {
+Status = EFI_INVALID_PARAMETER;
+  }
+}
   } else {
 Status = EFI_UNSUPPORTED;
   }
diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreI.inf 
b/IntelFsp2Pkg/FspSecCore/FspSecCoreI.inf
new file mode 100644
index 00..d31576c00b
--- /dev/null
+++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreI.inf
@@ -0,0 +1,54 @@
+## @file
+#  Sec Core for FSP
+#
+#  Copyright (c) 2022, Intel Corporation. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = FspSecCoreI
+  FILE_GUID  = 558782b5-782d-415e-ab9e-0ceb79dc3425
+  MODULE_TYPE= SEC
+  VERSION_STRING = 1.0
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES   = IA32 X64
+#
+
+[Sources]
+  SecFspApiChk.c
+  SecFsp.h
+
+[Sources.X64]
+  X64/FspApiEntryI.nasm
+  X64/FspApiEntryCommon.nasm
+  X64/FspHelper.nasm
+
+[Sources.IA32]
+  Ia32/FspApiEntryI.nasm
+  Ia32/FspApiEntryCommon.nasm
+  Ia32/FspHelper.nasm
+
+[Binaries.Ia32]
+  RAW|Vtf0/Bin/ResetVec.ia32.raw |GCC
+
+[Packages]
+  MdePkg/MdePkg.dec
+  IntelFsp2Pkg/IntelFsp2Pkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  BaseLib
+  PciCf8Lib
+  SerialPortLib
+  FspSwitchStackLib
+  FspCommonLib
+  FspSecPlatformLib
+
+
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryI.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryI.nasm
new file mode 100644
index 00..e9365d6832
--- /dev/null
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryI.nasm
@@ -0,0 +1,44 @@
+;; @file
+;  Provide FSP API entry points.
+;
+; Copyright (c) 2022, Intel Corporation. All rights reserved.
+; SPDX-License-Identifier: BSD-2-Clause-Patent
+;;
+
+SECTION .text
+
+;
+; Following functions will be provided in C
+;
+extern ASM_PFX(FspApiCommon)
+
+;
+; FspApiCommonContinue API
+;
+; This is the FSP API common entry point to resume the FSP execution
+;
+;
+global ASM_PFX(FspApiCommonContinue)
+ASM_PFX(FspApiCommonContinue):
+  jmp $
+
+;
+; FspSmmInit API
+;
+; This FSP API will notify the FSP about the different phases in the boot
+; process
+;
+;
+global ASM_PFX(FspSmmInitApi)
+ASM_PFX(FspSmmInitApi):
+  moveax,  7 ; FSP_API_INDEX.FspSmmInitApiIndex
+  jmpASM_PFX(FspApiCommon)
+
+;
+; Module Entrypoint API
+;
+global ASM_PFX(_ModuleEntryPoint)
+ASM_PFX(_ModuleEntryPoint):
+  jmp  $
+  ; Add reference to APIs so that it will not be optimized by compiler
+  jmp  ASM_PFX(FspSmmInitApi)
diff --git a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryI.nasm 
b/IntelFsp2Pkg/FspSecCore/

[edk2-devel] [PATCH v3 0/3] CryptoPkg bug fixes

2022-07-14 Thread Judah Vang
https://bugzilla.tianocore.org/show_bug.cgi?id=3990
https://bugzilla.tianocore.org/show_bug.cgi?id=3991
https://bugzilla.tianocore.org/show_bug.cgi?id=3992

There is a memory leak issue with BaseMemAllocation.
It calls AllocatePool() and FreePool() but FreePool()
is not supported in PEI phase so this can cause a memory leak.

There is a #define to deprecate Sha1 functions but not
all the Sha1 function are wrapped around this #define causing
a build error. The fix is to wrap all Sha1 functions with
the #define.

Need crypto AES to be supported for PEI phase and need
crypto KDF to be supported for SMM phase.

Judah Vang (3):
  CryptoPkg: Fix memoryleak in BaseMemAllocation
  CryptoPkg: Sha1 functions causing build errors
  CryptoPkg: Need to enable crypto functions

 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf |  2 +-
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf |  2 +-
 CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c | 11 ++-
 CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c  | 14 +-
 4 files changed, 21 insertions(+), 8 deletions(-)

--
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91384): https://edk2.groups.io/g/devel/message/91384
Mute This Topic: https://groups.io/mt/92389737/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/3] CryptoPkg: Fix memoryleak in BaseMemAllocation

2022-07-14 Thread Judah Vang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3990

Replace AllocatePool() with AllocatePages() and FreePool() with
FreePages() because FreePool() is not supported in PEI phase.
FreePool() does not free the allocated pool in PEI phase causing
a memory leak.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Cc: Nishant C Mistry 
Signed-off-by: Jian J Wang 
Signed-off-by: Nishant C Mistry 
Signed-off-by: Judah Vang 
---
 CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c 
b/CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c
index b7bed15c18df..d77e1f7de5e3 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c
@@ -2,13 +2,14 @@
   Base Memory Allocation Routines Wrapper for Crypto library over OpenSSL
   during PEI & DXE phases.
 
-Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2022, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
 #include 
 #include 
+#include 
 
 //
 // Extra header to record the memory buffer size from malloc routine.
@@ -41,7 +42,7 @@ malloc (
   //
   NewSize = (UINTN)(size) + CRYPTMEM_OVERHEAD;
 
-  Data = AllocatePool (NewSize);
+  Data = AllocatePages (EFI_SIZE_TO_PAGES (NewSize));
   if (Data != NULL) {
 PoolHdr = (CRYPTMEM_HEAD *)Data;
 //
@@ -73,7 +74,7 @@ realloc (
   VOID   *Data;
 
   NewSize = (UINTN)size + CRYPTMEM_OVERHEAD;
-  Data= AllocatePool (NewSize);
+  Data= AllocatePages (EFI_SIZE_TO_PAGES (NewSize));
   if (Data != NULL) {
 NewPoolHdr= (CRYPTMEM_HEAD *)Data;
 NewPoolHdr->Signature = CRYPTMEM_HEAD_SIGNATURE;
@@ -90,7 +91,7 @@ realloc (
   // Duplicate the buffer content.
   //
   CopyMem ((VOID *)(NewPoolHdr + 1), ptr, MIN (OldSize, size));
-  FreePool ((VOID *)OldPoolHdr);
+  FreePages (((VOID *)OldPoolHdr), EFI_SIZE_TO_PAGES (OldSize));
 }
 
 return (VOID *)(NewPoolHdr + 1);
@@ -117,6 +118,6 @@ free (
   if (ptr != NULL) {
 PoolHdr = (CRYPTMEM_HEAD *)ptr - 1;
 ASSERT (PoolHdr->Signature == CRYPTMEM_HEAD_SIGNATURE);
-FreePool (PoolHdr);
+FreePages (((VOID *)PoolHdr), EFI_SIZE_TO_PAGES (PoolHdr->Size));
   }
 }
-- 
2.35.1.windows.2



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




[edk2-devel] [PATCH v3 2/3] CryptoPkg: Sha1 functions causing build errors

2022-07-14 Thread Judah Vang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3991

Fix build issue when DiSABLE_SHA1_DEPRECATED_INTERFACES
is defined. Percolate the #ifndef DiSABLE_SHA1_DEPRECATED_INTERFACES
to all the Sha1 functions.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Cc: Nishant C Mistry 
Signed-off-by: Jian J Wang 
Signed-off-by: Nishant C Mistry 
Signed-off-by: Judah Vang 
---
 CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c 
b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
index f9796b215865..ede9fa8c09ec 100644
--- a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
+++ b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c
@@ -6,7 +6,7 @@
   This API, when called, will calculate the Hash using the
   hashing algorithm specified by PcdHashApiLibPolicy.
 
-  Copyright (c) 2020, Intel Corporation. All rights reserved.
+  Copyright (c) 2020-2022, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -33,9 +33,11 @@ HashApiGetContextSize (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1GetContextSize ();
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256GetContextSize ();
@@ -75,9 +77,11 @@ HashApiInit (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Init (HashContext);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Init (HashContext);
@@ -119,9 +123,11 @@ HashApiDuplicate (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Duplicate (HashContext, NewHashContext);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Duplicate (HashContext, NewHashContext);
@@ -165,9 +171,11 @@ HashApiUpdate (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Update (HashContext, DataToHash, DataToHashLen);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Update (HashContext, DataToHash, DataToHashLen);
@@ -209,9 +217,11 @@ HashApiFinal (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1Final (HashContext, Digest);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256Final (HashContext, Digest);
@@ -255,9 +265,11 @@ HashApiHashAll (
   )
 {
   switch (PcdGet32 (PcdHashApiLibPolicy)) {
+ #ifndef DISABLE_SHA1_DEPRECATED_INTERFACES
 case HASH_ALG_SHA1:
   return Sha1HashAll (DataToHash, DataToHashLen, Digest);
   break;
+ #endif
 
 case HASH_ALG_SHA256:
   return Sha256HashAll (DataToHash, DataToHashLen, Digest);
-- 
2.35.1.windows.2



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




[edk2-devel] [PATCH v3 3/3] CryptoPkg: Need to enable crypto functions

2022-07-14 Thread Judah Vang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3992

Enable CryptAes for PEI phase.
Enable CryptHkdf for SMM phase.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Cc: Nishant C Mistry 
Signed-off-by: Jian J Wang 
Signed-off-by: Nishant C Mistry 
Signed-off-by: Judah Vang 
---
 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 2 +-
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index 01de27e03747..40728af37822 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -43,7 +43,7 @@ [Sources]
   Hash/CryptParallelHashNull.c
   Hmac/CryptHmacSha256.c
   Kdf/CryptHkdf.c
-  Cipher/CryptAesNull.c
+  Cipher/CryptAes.c
   Pk/CryptRsaBasic.c
   Pk/CryptRsaExtNull.c
   Pk/CryptPkcs1OaepNull.c
diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
index 91a171509540..706b527338f0 100644
--- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
@@ -43,7 +43,7 @@ [Sources]
   Hash/CryptCShake256.c
   Hash/CryptParallelHash.c
   Hmac/CryptHmacSha256.c
-  Kdf/CryptHkdfNull.c
+  Kdf/CryptHkdf.c
   Cipher/CryptAes.c
   Pk/CryptRsaBasic.c
   Pk/CryptRsaExtNull.c
-- 
2.35.1.windows.2



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




Re: [edk2-devel] [edk2-staging][PATCH Kun,v1 0/7] Add TPM subclass definition

2022-07-14 Thread Kun Qin

Hi SecurityPkg maintainers and EDK2 stewards,

The updated patch series was sent here: 
https://edk2.groups.io/g/devel/message/91330


Please let me know if there is any other feedback on them.

Thanks,
Kun

On 7/13/2022 6:19 PM, Kun Qin via groups.io wrote:
Thanks, Mike. I will drop the applicable code change and send a v2 
series shortly.


Regards,
Kun

On 7/13/2022 5:47 PM, Michael D Kinney wrote:

Hi Kun,

I would prefer to focus on the spec issue with this patch set and only
update DEC and .H file.

The idea of removing all the status code related PCDs and updating 
all the
source files to use the #defines is a different change.  And that 
change may

impact many downstream modules/libs that currently use the PCDs.

Mike



-Original Message-
From: Kun Qin 
Sent: Wednesday, July 13, 2022 5:39 PM
To: devel@edk2.groups.io; Kinney, Michael D 

Cc: Yao, Jiewen ; Wang, Jian J 
; Zhang, Qi1 ; Kumar, 
Rahul1
; Andrew Fish ; Leif 
Lindholm ; Gao, Liming

; Liu, Zhiguang 
Subject: Re: [edk2-devel] [edk2-staging][PATCH v1 0/7] Add TPM 
subclass definition


Hi Mike,

The intention was to encourage the usage of new definition in .H file
once the definition
is updated. The PCD is left as is only to serve as backwards
compatibility purpose.

Do you think only updating the DEC and .H file is more ideal? I could
drop the other changes
if so desired.

Thanks,
Kun

On 7/13/2022 5:30 PM, Michael D Kinney wrote:

Hi Kun,

Why was the PCD usage not preserved and only the value updated in 
the DEC file and .H file?


Mike


-Original Message-
From: Kun Qin 
Sent: Wednesday, July 13, 2022 5:21 PM
To: devel@edk2.groups.io
Cc: Yao, Jiewen ; Wang, Jian J 
; Zhang, Qi1 ; Kumar,

Rahul1
; Andrew Fish ; Leif 
Lindholm ; Kinney, Michael D
; Gao, Liming 
; Liu, Zhiguang 
Subject: Re: [edk2-devel] [edk2-staging][PATCH v1 0/7] Add TPM 
subclass definition


Hi SecurityPkg maintainers & EDK2 stewards,

I sent out this patch series intending to update/fix the PI spec 
through

code first process.

Could you please shed some light on it and let me know if any 
feedback?


Thanks in advance!

Regards,
Kun

On 7/5/2022 8:38 PM, Kun Qin via groups.io wrote:

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

   From PI Specification v1.7 Errata A, EFI_PERIPHERAL_DOCKING is 
defined as

0xD (as well as included in PiStatusCode.h).

However, subclass employed as PCD for TPM peripheral in 
SecurityPkg is
also defined as 0xD. The TPM subclass code was used in 
TcgPei.c when

reporting error codes.

The collision of subclass definition could cause the parsing of 
reported

errors being ambiguous.

This patch series add EFI_PERIPHERAL_TPM as a spec-defined value and
removed potential usages in the SecurityPkg.

Patch v1 branch: 
https://github.com/kuqin12/edk2/tree/BZ3966-add_tpm_subclass


Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Qi Zhang 
Cc: Rahul Kumar 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 

Kun Qin (7):
 EDK2 Code First: PI Specification: New peripheral subclass 
for TPM

 MdePkg: MmCommunication: Add TPM subclass definition to MdePkg
 SecurityPkg: Tcg2Dxe: Replace PcdStatusCodeSubClassTpmDevice
 SecurityPkg: Tcg2Pei: Replace PcdStatusCodeSubClassTpmDevice
 SecurityPkg: TcgDxe: Replace PcdStatusCodeSubClassTpmDevice
 SecurityPkg: TcgPei: Replace PcdStatusCodeSubClassTpmDevice
 SecurityPkg: SubClassTpm: Updated default value

    SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c   |  4 +-
    SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c   |  4 +-
    SecurityPkg/Tcg/TcgDxe/TcgDxe.c |  2 +-
    SecurityPkg/Tcg/TcgPei/TcgPei.c |  4 +-
    CodeFirst/BZ3966-SpecChange.md  | 60 
    MdePkg/Include/Pi/PiStatusCode.h    |  1 +
    SecurityPkg/SecurityPkg.dec |  6 +-
    SecurityPkg/SecurityPkg.uni |  2 +-
    SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf |  1 -
    SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf |  1 -
    SecurityPkg/Tcg/TcgDxe/TcgDxe.inf   |  1 -
    SecurityPkg/Tcg/TcgPei/TcgPei.inf   |  1 -
    12 files changed, 72 insertions(+), 15 deletions(-)
    create mode 100644 CodeFirst/BZ3966-SpecChange.md



















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




[edk2-devel] [Patch v2 09/11] MdeModulePkg: Remove All UGA Support

2022-07-14 Thread Guomin Jiang
From: GuoMinJ 

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

Remove All UGA Support in MdeModulePkg, first remove from library.
Remove the PcdConOutGopSupport definition.

Signed-off-by: Guomin Jiang 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Zhichao Gao 
Cc: Ray Ni 
Cc: Hao A Wu 
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c   |   4 +-
 MdeModulePkg/Include/Library/BootLogoLib.h|   4 +-
 .../Library/BootLogoLib/BootLogoLib.c | 228 +-
 .../Library/BootLogoLib/BootLogoLib.inf   |   6 +-
 4 files changed, 61 insertions(+), 181 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c 
b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
index 337b2090d98e..50ce9a9eaff2 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
@@ -8,7 +8,7 @@
   PCI Root Bridges. So it means platform needs install PCI Root Bridge IO 
protocol for each
   PCI Root Bus and install PCI Host Bridge Resource Allocation Protocol.
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -49,7 +49,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED 
EFI_PCI_HOTPLUG_REQUEST_PROTOCOL  mPciHotPlugReque
   Installs driver module protocols and. Creates virtual device handles for 
ConIn,
   ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex 
protocol,
   Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers.
-  Installs Graphics Output protocol and/or UGA Draw protocol if needed.
+  Installs Graphics Output protocol if needed.
 
   @param[in] ImageHandleThe firmware allocated handle for the EFI image.
   @param[in] SystemTableA pointer to the EFI System Table.
diff --git a/MdeModulePkg/Include/Library/BootLogoLib.h 
b/MdeModulePkg/Include/Library/BootLogoLib.h
index 2d6209a2789b..854d5b636713 100644
--- a/MdeModulePkg/Include/Library/BootLogoLib.h
+++ b/MdeModulePkg/Include/Library/BootLogoLib.h
@@ -2,7 +2,7 @@
   This library is only intended to be used by PlatformBootManagerLib
   to show progress bar and LOGO.
 
-Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -26,7 +26,7 @@ BootLogoEnableLogo (
   Use SystemTable ConOut to turn on video based Simple Text Out consoles. The
   Simple Text Out screens will now be synced up with all non-video output 
devices.
 
-  @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
+  @retval EFI_SUCCESS Graphic device are back in text mode and synced up.
 
 **/
 EFI_STATUS
diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c 
b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
index 478ec2d40e2b..4a823912e014 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
@@ -2,7 +2,7 @@
   This library is only intended to be used by PlatformBootManagerLib
   to show progress bar and LOGO.
 
-Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
 Copyright (c) 2016, Microsoft Corporation
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -12,7 +12,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -47,9 +46,6 @@ BootLogoEnableLogo (
   UINT32 Instance;
   EFI_IMAGE_INPUTImage;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL  *Blt;
-  EFI_UGA_DRAW_PROTOCOL  *UgaDraw;
-  UINT32 ColorDepth;
-  UINT32 RefreshRate;
   EFI_GRAPHICS_OUTPUT_PROTOCOL   *GraphicsOutput;
   EFI_BOOT_LOGO_PROTOCOL *BootLogo;
   EDKII_BOOT_LOGO2_PROTOCOL  *BootLogo2;
@@ -68,21 +64,10 @@ BootLogoEnableLogo (
 return EFI_UNSUPPORTED;
   }
 
-  UgaDraw = NULL;
   //
   // Try to open GOP first
   //
   Status = gBS->HandleProtocol (gST->ConsoleOutHandle, 
&gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-GraphicsOutput = NULL;
-//
-// Open GOP failed, try to open UGA
-//
-Status = gBS->HandleProtocol (gST->ConsoleOutHandle, 
&gEfiUgaDrawProtocolGuid, (VOID **)&UgaDraw);
-if (EFI_ERROR (Status)) {
-  UgaDraw = NULL;
-}
-  }
 
   if (EFI_ERROR (Status)) {
 return EFI_UNSUPPORTED;
@@ -109,16 +94,8 @@ BootLogoEnableLogo (
   //
   gST->ConOut->EnableCursor (gST->ConOut, FALSE);
 
-  if (GraphicsOutput != NULL) {
-SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
-SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
-  } else {
-ASSERT (UgaDraw != NULL);
-Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY,

[edk2-devel] [Patch v2 08/11] MdeModulePkg/GraphicsConsoleDxe: Remove All UGA Support

2022-07-14 Thread Guomin Jiang
From: GuoMinJ 

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

Remove All UGA Support in GraphicsConsoleDxe, remove comment about UGA
in HiiDatabaseDxe.

Signed-off-by: Guomin Jiang 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Zhichao Gao 
Cc: Ray Ni 
Cc: Dandan Bi 
Cc: Eric Dong 
---
 .../GraphicsConsoleDxe/GraphicsConsole.c  | 300 +-
 .../GraphicsConsoleDxe/GraphicsConsole.h  |  21 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf |   8 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.uni |   6 +-
 MdeModulePkg/Universal/HiiDatabaseDxe/Image.c |   4 +-
 5 files changed, 23 insertions(+), 316 deletions(-)

diff --git 
a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c 
b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
index b895dafedeaa..facb813276cd 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
@@ -14,7 +14,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 GRAPHICS_CONSOLE_DEV  mGraphicsConsoleDevTemplate = {
   GRAPHICS_CONSOLE_DEV_SIGNATURE,
   (EFI_GRAPHICS_OUTPUT_PROTOCOL *)NULL,
-  (EFI_UGA_DRAW_PROTOCOL *)NULL,
   {
 GraphicsConsoleConOutReset,
 GraphicsConsoleConOutOutputString,
@@ -104,9 +103,8 @@ EFI_DRIVER_BINDING_PROTOCOL  gGraphicsConsoleDriverBinding 
= {
 /**
   Test to see if Graphics Console could be supported on the Controller.
 
-  Graphics Console could be supported if Graphics Output Protocol or UGA Draw
-  Protocol exists on the Controller. (UGA Draw Protocol could be skipped
-  if PcdUgaConsumeSupport is set to FALSE.)
+  Graphics Console could be supported if Graphics Output Protocol
+  exists on the Controller.
 
   @param  ThisProtocol instance pointer.
   @param  Controller  Handle of device to test.
@@ -127,11 +125,9 @@ GraphicsConsoleControllerDriverSupported (
 {
   EFI_STATUSStatus;
   EFI_GRAPHICS_OUTPUT_PROTOCOL  *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL *UgaDraw;
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
 
   GraphicsOutput = NULL;
-  UgaDraw= NULL;
   //
   // Open the IO Abstraction(s) needed to perform the supported test
   //
@@ -143,21 +139,6 @@ GraphicsConsoleControllerDriverSupported (
   Controller,
   EFI_OPEN_PROTOCOL_BY_DRIVER
   );
-
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-//
-// Open Graphics Output Protocol failed, try to open UGA Draw Protocol
-//
-Status = gBS->OpenProtocol (
-Controller,
-&gEfiUgaDrawProtocolGuid,
-(VOID **)&UgaDraw,
-This->DriverBindingHandle,
-Controller,
-EFI_OPEN_PROTOCOL_BY_DRIVER
-);
-  }
-
   if (EFI_ERROR (Status)) {
 return Status;
   }
@@ -202,13 +183,6 @@ Error:
This->DriverBindingHandle,
Controller
);
-  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-gBS->CloseProtocol (
-   Controller,
-   &gEfiUgaDrawProtocolGuid,
-   This->DriverBindingHandle,
-   Controller
-   );
   }
 
   return Status;
@@ -369,9 +343,8 @@ InitializeGraphicsConsoleTextMode (
 }
 
 /**
-  Start this driver on Controller by opening Graphics Output protocol or
-  UGA Draw protocol, and installing Simple Text Out protocol on Controller.
-  (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
+  Start this driver on Controller by opening Graphics Output protocol
+  and installing Simple Text Out protocol on Controller.
 
   @param  This Protocol instance pointer.
   @param  Controller   Handle of device to bind driver to
@@ -394,8 +367,6 @@ GraphicsConsoleControllerDriverStart (
   GRAPHICS_CONSOLE_DEV  *Private;
   UINT32HorizontalResolution;
   UINT32VerticalResolution;
-  UINT32ColorDepth;
-  UINT32RefreshRate;
   UINT32ModeIndex;
   UINTN MaxMode;
   UINT32ModeNumber;
@@ -432,18 +403,6 @@ GraphicsConsoleControllerDriverStart (
   Controller,
   EFI_OPEN_PROTOCOL_BY_DRIVER
   );
-
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-Status = gBS->OpenProtocol (
-Controller,
-&gEfiUgaDrawProtocolGuid,
-(VOID **)&Private->UgaDraw,
-This->DriverBindingHandle,
-Controller,
-EFI_OPEN_PROTOCOL_BY_DRIVER
-);
-  }
-
   if (EFI_ERROR (Status)) {
 goto Error;
   }
@@ -534,43 +493,6 @@ GraphicsConsoleControllerDriver

[edk2-devel] [Patch v2 10/11] BaseTools: Remove all UGA support

2022-07-14 Thread Guomin Jiang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove UGA code in BaseTools

Signed-off-by: Guomin Jiang 
Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 .../Source/C/Include/Protocol/HiiFramework.h  |  53 +-
 BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 --
 2 files changed, 1 insertion(+), 213 deletions(-)
 delete mode 100644 BaseTools/Source/C/Include/Protocol/UgaDraw.h

diff --git a/BaseTools/Source/C/Include/Protocol/HiiFramework.h 
b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
index 448350967bbf..4c651f89e0eb 100644
--- a/BaseTools/Source/C/Include/Protocol/HiiFramework.h
+++ b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
@@ -6,7 +6,7 @@
   @par Revision Reference:
   This protocol is defined in HII spec 0.92.
 
-  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -28,20 +28,6 @@
 0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 
0xe1} \
   }
 
-// BugBug:
-//
-// If UGA goes away we need to put this some place. I'm not sure where?
-//
-//typedef struct {
-//  UINT8 Blue;
-//  UINT8 Green;
-//  UINT8 Red;
-//  UINT8 Reserved;
-//} EFI_UGA_PIXEL;
-
-//
-//
-
 typedef struct _EFI_HII_PROTOCOL  EFI_HII_PROTOCOL;
 
 //
@@ -575,39 +561,6 @@ EFI_STATUS
   IN OUT UINT32*InternalStatus
   );
 
-/**
-  Translates a glyph into the format required for input to the Universal
-  Graphics Adapter (UGA) Block Transfer (BLT) routines.
-
-  @param  This  A pointer to the EFI_HII_PROTOCOL instance.
-  @param  GlyphBuffer   A pointer to the buffer that contains glyph 
data.
-  @param  ForegroundThe foreground setting requested to be used 
for the
-generated BltBuffer data.
-  @param  BackgroundThe background setting requested to be used 
for the
-generated BltBuffer data.
-  @param  Count The entry in the BltBuffer upon which to act.
-  @param  Width The width in bits of the glyph being converted.
-  @param  HeightThe height in bits of the glyph being converted
-  @param  BltBuffer A pointer to the buffer that contains the data 
that is
-ready to be used by the UGA BLT routines.
-
-  @retval EFI_SUCCESS   It worked.
-  @retval EFI_NOT_FOUND A glyph for a character was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GLYPH_TO_BLT) (
-  IN EFI_HII_PROTOCOL *This,
-  IN UINT8*GlyphBuffer,
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
-  IN UINTN Count,
-  IN UINTN Width,
-  IN UINTN Height,
-  IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
-  );
-
 /**
   Allows a new string to be added to an already existing string package.
 
@@ -878,9 +831,6 @@ EFI_STATUS
   @param GetGlyph
   Translates a Unicode character into the corresponding font glyph.
 
-  @param GlyphToBlt
-  Converts a glyph value into a format that is ready for a UGA BLT command.
-
   @param NewString
   Allows a new string to be added to an already existing string package.
 
@@ -924,7 +874,6 @@ struct _EFI_HII_PROTOCOL {
 
   EFI_HII_TEST_STRING TestString;
   EFI_HII_GET_GLYPH   GetGlyph;
-  EFI_HII_GLYPH_TO_BLTGlyphToBlt;
 
   EFI_HII_NEW_STRING  NewString;
   EFI_HII_GET_PRI_LANGUAGES   GetPrimaryLanguages;
diff --git a/BaseTools/Source/C/Include/Protocol/UgaDraw.h 
b/BaseTools/Source/C/Include/Protocol/UgaDraw.h
deleted file mode 100644
index 412b000aeb6b..
--- a/BaseTools/Source/C/Include/Protocol/UgaDraw.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file
-  UGA Draw protocol from the EFI 1.1 specification.
-
-  Abstraction of a very simple graphics device.
-
-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __UGA_DRAW_H__
-#define __UGA_DRAW_H__
-
-#define EFI_UGA_DRAW_PROTOCOL_GUID \
-  { \
-0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 
0x39 } \
-  }
-
-typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
-
-/**
-  Return the current video mode information.
-
-  @param  This  Protocol instance pointer.
-  @param  HorizontalResolution  Current video horizontal resolution in pixels
-  @param  VerticalResolutionCurrent video vertical resolution in pixels
-  @param  ColorDepthCurrent video color depth in bits per pixel
-  @param  RefreshRate   Current video refresh rate i

[edk2-devel] [Patch v2 11/11] MdePkg/UefiLib: Remove all UGA support

2022-07-14 Thread Guomin Jiang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

Remove all UGA code in MdePkg except the definition

The reason why keep definition is because downstream need it to pass
build.
It will be removed when all downstream remove UGA support

Signed-off-by: Guomin Jiang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
---
 MdePkg/Library/UefiLib/UefiLib.inf   |  4 +-
 MdePkg/Library/UefiLib/UefiLibInternal.h |  3 +-
 MdePkg/Library/UefiLib/UefiLibPrint.c| 91 +---
 MdePkg/MdePkg.dsc|  3 -
 4 files changed, 3 insertions(+), 98 deletions(-)

diff --git a/MdePkg/Library/UefiLib/UefiLib.inf 
b/MdePkg/Library/UefiLib/UefiLib.inf
index 01ed92092da2..ac9d68907261 100644
--- a/MdePkg/Library/UefiLib/UefiLib.inf
+++ b/MdePkg/Library/UefiLib/UefiLib.inf
@@ -7,7 +7,7 @@
 #  EFI Driver Model related protocols, manage Unicode string tables for UEFI 
Drivers,
 #  and print messages on the console output and standard error devices.
 #
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -67,7 +67,6 @@
   gEfiGraphicsOutputProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiHiiFontProtocolGuid ## SOMETIMES_CONSUMES
   gEfiSimpleFileSystemProtocolGuid## SOMETIMES_CONSUMES
-  gEfiUgaDrawProtocolGuid | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport  
   ## SOMETIMES_CONSUMES # Consumes if gEfiGraphicsOutputProtocolGuid 
uninstalled
   gEfiComponentNameProtocolGuid  | NOT 
gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable   ## SOMETIMES_PRODUCES # User 
chooses to produce it
   gEfiComponentName2ProtocolGuid | NOT 
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable  ## SOMETIMES_PRODUCES # User 
chooses to produce it
   gEfiDriverConfigurationProtocolGuid## 
SOMETIMES_PRODUCES # User chooses to produce it
@@ -84,5 +83,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable   ## CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable   ## CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport   ## CONSUMES
 
diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h 
b/MdePkg/Library/UefiLib/UefiLibInternal.h
index 4365282cf213..be5c9ddcdde8 100644
--- a/MdePkg/Library/UefiLib/UefiLibInternal.h
+++ b/MdePkg/Library/UefiLib/UefiLibInternal.h
@@ -1,7 +1,7 @@
 /** @file
   Internal include file for UefiLib.
 
-  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -18,7 +18,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/MdePkg/Library/UefiLib/UefiLibPrint.c 
b/MdePkg/Library/UefiLib/UefiLibPrint.c
index 39edeb7283dd..2451775aeb90 100644
--- a/MdePkg/Library/UefiLib/UefiLibPrint.c
+++ b/MdePkg/Library/UefiLib/UefiLibPrint.c
@@ -2,7 +2,7 @@
   Mde UEFI library API implementation.
   Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE
 
-  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -344,20 +344,14 @@ InternalPrintGraphic (
   EFI_STATUS   Status;
   UINT32   HorizontalResolution;
   UINT32   VerticalResolution;
-  UINT32   ColorDepth;
-  UINT32   RefreshRate;
   EFI_HII_FONT_PROTOCOL*HiiFont;
   EFI_IMAGE_OUTPUT *Blt;
   EFI_FONT_DISPLAY_INFOFontInfo;
   EFI_HII_ROW_INFO *RowInfoArray;
   UINTNRowInfoArraySize;
   EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL*UgaDraw;
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *Sto;
   EFI_HANDLE   ConsoleHandle;
-  UINTNWidth;
-  UINTNHeight;
-  UINTNDelta;
 
   HorizontalResolution = 0;
   VerticalResolution   = 0;
@@ -374,20 +368,6 @@ InternalPrintGraphic (
   (VOID **)&GraphicsOutput
   );
 
-  UgaDraw = NULL;
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-//
-// If no GOP available, try to open UGA Draw protocol if supported.
-//
-GraphicsOutput = NULL;
-
-Status = gBS->HandleProtocol (
-ConsoleHandle,
-&gEfiUgaDrawProtocolGuid,
-(VOID **)&UgaDraw
-);
-  }
-
   if (EFI_ERROR (Status)) {
 goto Error;
   }
@@ -405,8 +385,6 @@ InternalPrintGraphic (
   if (GraphicsOutput != NULL) {
 HorizontalResolut

[edk2-devel] [Patch v2 07/11] MdeModulePkg/ConSplitterDxe: Remove All UGA Support

2022-07-14 Thread Guomin Jiang
From: GuoMinJ 

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

Remove the PcdConOutGopSupport, it is unnecessary any more.
Remove All UGA Support in ConSplitterDxe component.

Signed-off-by: Guomin Jiang 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Zhichao Gao 
Cc: Ray Ni 
---
 .../Console/ConSplitterDxe/ConSplitter.c  | 405 +++---
 .../Console/ConSplitterDxe/ConSplitter.h  | 138 +-
 .../Console/ConSplitterDxe/ConSplitterDxe.inf |  17 +-
 .../Console/ConSplitterDxe/ConSplitterDxe.uni |  12 +-
 .../ConSplitterDxe/ConSplitterGraphics.c  | 310 +-
 5 files changed, 80 insertions(+), 802 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c 
b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
index 8b5e62e3a883..663fccff046d 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
@@ -16,7 +16,7 @@
   never removed. Such design ensures system function well during none console
   device situation.
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -107,15 +107,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED 
TEXT_IN_SPLITTER_PRIVATE_DATA  mConIn = {
   FALSE
 };
 
-//
-// Uga Draw Protocol Private Data template
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UGA_DRAW_PROTOCOL  mUgaDrawProtocolTemplate 
= {
-  ConSplitterUgaDrawGetMode,
-  ConSplitterUgaDrawSetMode,
-  ConSplitterUgaDrawBlt
-};
-
 //
 // Graphics Output Protocol Private Data template
 //
@@ -153,16 +144,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED 
TEXT_OUT_SPLITTER_PRIVATE_DATA  mConOut = {
 FALSE,
   },
 
-  {
-NULL,
-NULL,
-NULL
-  },
-  0,
-  0,
-  0,
-  0,
-
   {
 NULL,
 NULL,
@@ -171,7 +152,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED 
TEXT_OUT_SPLITTER_PRIVATE_DATA  mConOut = {
   },
   (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *)NULL,
   0,
-  0,
 
   0,
   (TEXT_OUT_AND_GOP_DATA *)NULL,
@@ -209,16 +189,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED 
TEXT_OUT_SPLITTER_PRIVATE_DATA  mStdErr = {
 FALSE,
   },
 
-  {
-NULL,
-NULL,
-NULL
-  },
-  0,
-  0,
-  0,
-  0,
-
   {
 NULL,
 NULL,
@@ -227,7 +197,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED 
TEXT_OUT_SPLITTER_PRIVATE_DATA  mStdErr = {
   },
   (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *)NULL,
   0,
-  0,
 
   0,
   (TEXT_OUT_AND_GOP_DATA *)NULL,
@@ -422,7 +391,7 @@ ToggleStateSyncReInitialization (
   Installs driver module protocols and. Creates virtual device handles for 
ConIn,
   ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex 
protocol,
   Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers.
-  Installs Graphics Output protocol and/or UGA Draw protocol if needed.
+  Installs Graphics Output protocol if need.
 
   @param[in] ImageHandleThe firmware allocated handle for the EFI image.
   @param[in] SystemTableA pointer to the EFI System Table.
@@ -493,14 +462,6 @@ ConSplitterDriverEntry (
  );
   ASSERT_EFI_ERROR (Status);
 
-  //
-  // Either Graphics Output protocol or UGA Draw protocol must be supported.
-  //
-  ASSERT (
-FeaturePcdGet (PcdConOutGopSupport) ||
-FeaturePcdGet (PcdConOutUgaSupport)
-);
-
   //
   // The driver creates virtual handles for ConIn, ConOut, StdErr.
   // The virtual handles will always exist even if no console exist in the
@@ -757,13 +718,7 @@ ConSplitterTextOutConstructor (
   //
   // Copy protocols template
   //
-  if (FeaturePcdGet (PcdConOutUgaSupport)) {
-CopyMem (&ConOutPrivate->UgaDraw, &mUgaDrawProtocolTemplate, sizeof 
(EFI_UGA_DRAW_PROTOCOL));
-  }
-
-  if (FeaturePcdGet (PcdConOutGopSupport)) {
-CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplate, 
sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));
-  }
+  CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplate, 
sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));
 
   //
   // Initialize console output splitter's private data.
@@ -806,56 +761,47 @@ ConSplitterTextOutConstructor (
   ConOutPrivate->TextOutQueryData[0].Rows= 25;
   TextOutSetMode (ConOutPrivate, 0);
 
-  if (FeaturePcdGet (PcdConOutUgaSupport)) {
-//
-// Setup the UgaDraw to 800 x 600 x 32 bits per pixel, 60Hz.
-//
-ConSplitterUgaDrawSetMode (&ConOutPrivate->UgaDraw, 800, 600, 32, 60);
+  //
+  // Setup resource for mode information in Graphics Output Protocol interface
+  //
+  if ((ConOutPrivate->GraphicsOutput.Mode = AllocateZeroPool (sizeof 
(EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE))) == NULL) {
+return EFI_OUT_OF_RESOURCES;
   }
 
-  if (FeaturePcdGet (PcdConOutGopSupport)) {
-//
-// Setup resource for mode information in Graphics Output Protocol 
interface
-//
-if ((ConOutPrivate->GraphicsOutput.Mode = AllocateZeroPool (sizeof 
(EFI_GRAPHICS_O

[edk2-devel] [Patch v2 02/11] ArmVirtPkg: Remove All UGA Support

2022-07-14 Thread Guomin Jiang
From: GuoMinJ 

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

Remove PcdConOutGopSupport, it is unnecessary any more.
Remove All UGA Support in ArmVirtPkg

Signed-off-by: Guomin Jiang 
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Sami Mujawar 
Cc: Gerd Hoffmann 
---
 ArmVirtPkg/ArmVirtQemu.dsc   | 7 +--
 ArmVirtPkg/ArmVirtQemuKernel.dsc | 7 +--
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 9369a88858fd..dc87050f3f3a 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -1,7 +1,7 @@
 #
 #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
 #  Copyright (c) 2014, Linaro Limited. All rights reserved.
-#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -125,11 +125,6 @@
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
 
-  ## If TRUE, Graphics Output Protocol will be installed on virtual handle 
created by ConsplitterDxe.
-  #  It could be set FALSE to save size.
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
-
   gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
 
   gArmVirtTokenSpaceGuid.PcdTpm2SupportEnabled|$(TPM2_ENABLE)
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 7f7d15d6eee3..0d13d8edb407 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -1,7 +1,7 @@
 #
 #  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
 #  Copyright (c) 2014, Linaro Limited. All rights reserved.
-#  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -107,11 +107,6 @@
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
   gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
 
-  ## If TRUE, Graphics Output Protocol will be installed on virtual handle 
created by ConsplitterDxe.
-  #  It could be set FALSE to save size.
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
-
   gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
 
 [PcdsFixedAtBuild.common]
-- 
2.26.2.windows.1



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




[edk2-devel] [Patch v2 00/11] Remove all UGA support

2022-07-14 Thread Guomin Jiang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368

The Plan:
1. Remove the upstream UGA code first but keep definition in Edk2 at
first
2. Then downstream owner to remove UGA related code
3. Remove Edk2 definition last.

GuoMinJ (9):
  UefiPayloadPkg: Remove All UGA Support
  ArmVirtPkg: Remove All UGA Support
  ArmPkg: Remove All UGA Support
  EmulatorPkg: Remove All UGA Support
  ShellPkg: Remove All UGA Support
  OvmfPkg: Remove All UGA Support
  MdeModulePkg/ConSplitterDxe: Remove All UGA Support
  MdeModulePkg/GraphicsConsoleDxe: Remove All UGA Support
  MdeModulePkg: Remove All UGA Support

Guomin Jiang (2):
  BaseTools: Remove all UGA support
  MdePkg/UefiLib: Remove all UGA support

 .../PlatformBootManagerLib/PlatformBm.h   |   4 +-
 .../PlatformBootManagerLib.inf|   5 +-
 ArmVirtPkg/ArmVirtQemu.dsc|   7 +-
 ArmVirtPkg/ArmVirtQemuKernel.dsc  |   7 +-
 .../Source/C/Include/Protocol/HiiFramework.h  |  53 +--
 BaseTools/Source/C/Include/Protocol/UgaDraw.h | 161 ---
 EmulatorPkg/EmuGopDxe/Gop.h   |  10 +-
 EmulatorPkg/EmuGopDxe/GopScreen.c |  14 +-
 EmulatorPkg/Include/Protocol/EmuFileSystem.h  |  24 +-
 .../Include/Protocol/EmuGraphicsWindow.h  |  18 +-
 .../Library/PlatformBmLib/PlatformBm.h|   4 +-
 .../Library/PlatformBmLib/PlatformBmData.c|   6 +-
 EmulatorPkg/Unix/Host/Gasket.h|  12 +-
 EmulatorPkg/Unix/Host/Host.h  |   3 +-
 EmulatorPkg/Unix/Host/Ia32/Gasket.S   |   2 +-
 EmulatorPkg/Unix/Host/X11GraphicsWindow.c |  82 ++--
 EmulatorPkg/Unix/Host/X64/Gasket.S|   2 +-
 EmulatorPkg/Win/Host/WinGopScreen.c   |  10 +-
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c   |   4 +-
 MdeModulePkg/Include/Library/BootLogoLib.h|   4 +-
 .../Library/BootLogoLib/BootLogoLib.c | 228 +++---
 .../Library/BootLogoLib/BootLogoLib.inf   |   6 +-
 .../Console/ConSplitterDxe/ConSplitter.c  | 405 +++---
 .../Console/ConSplitterDxe/ConSplitter.h  | 138 +-
 .../Console/ConSplitterDxe/ConSplitterDxe.inf |  17 +-
 .../Console/ConSplitterDxe/ConSplitterDxe.uni |  12 +-
 .../ConSplitterDxe/ConSplitterGraphics.c  | 310 +-
 .../GraphicsConsoleDxe/GraphicsConsole.c  | 300 +
 .../GraphicsConsoleDxe/GraphicsConsole.h  |  21 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.inf |   8 +-
 .../GraphicsConsoleDxe/GraphicsConsoleDxe.uni |   6 +-
 MdeModulePkg/Universal/HiiDatabaseDxe/Image.c |   4 +-
 MdePkg/Library/UefiLib/UefiLib.inf|   4 +-
 MdePkg/Library/UefiLib/UefiLibInternal.h  |   3 +-
 MdePkg/Library/UefiLib/UefiLibPrint.c |  91 +---
 MdePkg/MdePkg.dsc |   3 -
 OvmfPkg/AmdSev/AmdSevX64.dsc  |   4 +-
 OvmfPkg/Bhyve/BhyveX64.dsc|   4 +-
 OvmfPkg/Microvm/MicrovmX64.dsc|   4 +-
 OvmfPkg/OvmfPkgIa32.dsc   |   2 -
 OvmfPkg/OvmfPkgIa32X64.dsc|   2 -
 OvmfPkg/OvmfPkgX64.dsc|   2 -
 OvmfPkg/OvmfXen.dsc   |   4 +-
 .../UefiHandleParsingLib.c|   4 +-
 .../UefiHandleParsingLib.h|   4 +-
 .../UefiHandleParsingLib.inf  |   4 +-
 .../UefiHandleParsingLib.uni  |   4 +-
 .../PlatformBootManager.h |   4 +-
 .../PlatformBootManagerLib.inf|   4 +-
 UefiPayloadPkg/UefiPayloadPkg.dsc |   2 -
 50 files changed, 276 insertions(+), 1760 deletions(-)
 delete mode 100644 BaseTools/Source/C/Include/Protocol/UgaDraw.h

-- 
2.26.2.windows.1



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




[edk2-devel] [Patch v2 04/11] EmulatorPkg: Remove All UGA Support

2022-07-14 Thread Guomin Jiang
From: GuoMinJ 

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

Remove All UGA Support in EmulatorPkg.

Signed-off-by: Guomin Jiang 
Cc: Andrew Fish 
Cc: Ray Ni 
---
 EmulatorPkg/EmuGopDxe/Gop.h   | 10 +--
 EmulatorPkg/EmuGopDxe/GopScreen.c | 14 ++--
 EmulatorPkg/Include/Protocol/EmuFileSystem.h  | 24 +++---
 .../Include/Protocol/EmuGraphicsWindow.h  | 18 ++--
 .../Library/PlatformBmLib/PlatformBm.h|  4 +-
 .../Library/PlatformBmLib/PlatformBmData.c|  6 +-
 EmulatorPkg/Unix/Host/Gasket.h| 12 +--
 EmulatorPkg/Unix/Host/Host.h  |  3 +-
 EmulatorPkg/Unix/Host/Ia32/Gasket.S   |  2 +-
 EmulatorPkg/Unix/Host/X11GraphicsWindow.c | 82 +--
 EmulatorPkg/Unix/Host/X64/Gasket.S|  2 +-
 EmulatorPkg/Win/Host/WinGopScreen.c   | 10 +--
 12 files changed, 92 insertions(+), 95 deletions(-)

diff --git a/EmulatorPkg/EmuGopDxe/Gop.h b/EmulatorPkg/EmuGopDxe/Gop.h
index 7f7dc4e8eb9f..59ebfda912eb 100644
--- a/EmulatorPkg/EmuGopDxe/Gop.h
+++ b/EmulatorPkg/EmuGopDxe/Gop.h
@@ -1,13 +1,13 @@
 /*++ @file
 
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 Portions copyright (c) 2010,Apple Inc. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#ifndef __UGA_H_
-#define __UGA_H_
+#ifndef GOP_H_
+#define GOP_H_
 
 #include 
 
@@ -60,8 +60,6 @@ typedef struct {
 extern EFI_DRIVER_BINDING_PROTOCOL  gEmuGopDriverBinding;
 extern EFI_COMPONENT_NAME_PROTOCOL  gEmuGopComponentName;
 
-#define EMU_UGA_CLASS_NAME  L"EmuGopWindow"
-
 #define GOP_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('G', 'o', 'p', 'N')
 typedef struct {
   UINT64   Signature;
@@ -83,7 +81,7 @@ typedef struct {
   GOP_MODE_DATA*ModeData;
 
   //
-  // UGA Private Data knowing when to start hardware
+  // Private Data knowing when to start hardware
   //
   BOOLEAN  HardwareNeedsStarting;
 
diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c 
b/EmulatorPkg/EmuGopDxe/GopScreen.c
index 88d95b88e162..113b496861b4 100644
--- a/EmulatorPkg/EmuGopDxe/GopScreen.c
+++ b/EmulatorPkg/EmuGopDxe/GopScreen.c
@@ -10,7 +10,7 @@ Module Name:
 
 Abstract:
 
-  This file produces the graphics abstration of UGA. It is called by
+  This file produces the graphics abstration of GOP. It is called by
   EmuGopDriver.c file which deals with the EFI 1.1 driver model.
   This file just does graphics.
 
@@ -209,7 +209,7 @@ EmuGopBlt (
   // the number of bytes in each row can be computed.
   //
   if (Delta == 0) {
-Delta = Width * sizeof (EFI_UGA_PIXEL);
+Delta = Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
   }
 
   //
@@ -220,8 +220,8 @@ EmuGopBlt (
   OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
 
   //
-  // Pack UGA Draw protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS 
structure to adapt to
-  // GopBlt() API of Unix UGA IO protocol.
+  // Pack GOP protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS structure 
to adapt to
+  // GopBlt() API of GOP protocol.
   //
   GopBltArgs.DestinationX = DestinationX;
   GopBltArgs.DestinationY = DestinationY;
@@ -232,8 +232,8 @@ EmuGopBlt (
   GopBltArgs.Delta= Delta;
   Status  = Private->EmuGraphicsWindow->Blt (
   
Private->EmuGraphicsWindow,
-  (EFI_UGA_PIXEL 
*)BltBuffer,
-  
(EFI_UGA_BLT_OPERATION)BltOperation,
+  BltBuffer,
+  BltOperation,
   &GopBltArgs
   );
 
@@ -384,7 +384,7 @@ ShutdownGopEvent (
 
 Routine Description:
 
-  This is the UGA screen's callback notification function for 
exit-boot-services.
+  This is the screen's callback notification function for exit-boot-services.
   All we do here is call EmuGopDestructor().
 
 Arguments:
diff --git a/EmulatorPkg/Include/Protocol/EmuFileSystem.h 
b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
index 15de43ac022e..062508fafc9d 100644
--- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
+++ b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
@@ -7,19 +7,19 @@
 
   UEFI 2.0 can boot from any valid EFI image contained in a SimpleFileSystem.
 
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 Portions copyright (c) 2011, Apple Inc. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#ifndef _EMU_UGA_IO_H_
-#define _EMU_UGA_IO_H_
+#ifndef EMU_GRAPHICS_WINDOW_H_
+#define EMU_GRAPHICS_WINDOW_H_
 
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #define EM

[edk2-devel] [Patch v2 06/11] OvmfPkg: Remove All UGA Support

2022-07-14 Thread Guomin Jiang
From: GuoMinJ 

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

Delete PcdConOutGopSupport, it is unnecessary any more.

Signed-off-by: Guomin Jiang 
Cc: Ard Biesheuvel 
Cc: Jiewen Yao 
Cc: Jordan Justen 
Cc: Gerd Hoffmann 
Cc: Brijesh Singh 
Cc: Erdem Aktas 
Cc: James Bottomley 
Cc: Min Xu 
Cc: Tom Lendacky 
Cc: Rebecca Cran 
Cc: Peter Grehan 
Cc: Anthony Perard 
Cc: Julien Grall 
---
 OvmfPkg/AmdSev/AmdSevX64.dsc   | 4 +---
 OvmfPkg/Bhyve/BhyveX64.dsc | 4 +---
 OvmfPkg/Microvm/MicrovmX64.dsc | 4 +---
 OvmfPkg/OvmfPkgIa32.dsc| 2 --
 OvmfPkg/OvmfPkgIa32X64.dsc | 2 --
 OvmfPkg/OvmfPkgX64.dsc | 2 --
 OvmfPkg/OvmfXen.dsc| 4 +---
 7 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index 726521c94381..8fc1f85ad012 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -3,7 +3,7 @@
 #  virtual machine remote attestation and secret injection
 #
 #  Copyright (c) 2020 James Bottomley, IBM Corporation.
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -379,8 +379,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 
 [PcdsFixedAtBuild]
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index d4f0c90b8e00..d827adec363c 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -1,6 +1,6 @@
 #
 #  Copyright (c) 2020, Rebecca Cran 
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #  Copyright (c) 2014, Pluribus Networks, Inc.
 #
@@ -419,8 +419,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 
 [PcdsFixedAtBuild]
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index 61db9b6e4c83..bea69475387d 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
 #
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #  Copyright (c) Microsoft Corporation.
 #
@@ -454,8 +454,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 
 [PcdsFixedAtBuild]
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index e708411076ca..92355f67aa50 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -458,8 +458,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 0b036d8bb53f..a73e52701d17 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -464,8 +464,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
 !ifdef $(CSM_ENABLE)
   gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable|TRUE
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 8ad04b50f74f..8c4e4d9ec578 100644

[edk2-devel] [Patch v2 05/11] ShellPkg: Remove All UGA Support

2022-07-14 Thread Guomin Jiang
From: GuoMinJ 

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

Remove All UGA Support in ShellPkg.

Signed-off-by: Guomin Jiang 
Cc: Ray Ni 
Cc: Zhichao Gao 
---
 ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c  | 4 +---
 ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h  | 4 +---
 .../Library/UefiHandleParsingLib/UefiHandleParsingLib.inf | 4 +---
 .../Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 4 +---
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index aa0115bdd498..08215ab8039c 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -1,7 +1,7 @@
 /** @file
   Provides interface to advanced shell functionality for parsing both handle 
and protocol database.
 
-  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved.
   (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
   (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -2238,8 +2238,6 @@ STATIC CONST GUID_INFO_BLOCK  mGuidStringList[] = {
   { STRING_TOKEN (STR_SHELL_ENV2),  &gEfiShellEnvironment2Guid,
NULL },
   { STRING_TOKEN (STR_SHELL_ENV),   &gEfiShellEnvironment2Guid,
NULL },
   { STRING_TOKEN (STR_DEVICE_IO),   &gEfiDeviceIoProtocolGuid, 
NULL },
-  { STRING_TOKEN (STR_UGA_DRAW),&gEfiUgaDrawProtocolGuid,  
NULL },
-  { STRING_TOKEN (STR_UGA_IO),  &gEfiUgaIoProtocolGuid,
NULL },
   { STRING_TOKEN (STR_ESP), &gEfiPartTypeSystemPartGuid,   
NULL },
   { STRING_TOKEN (STR_GPT_NBR), &gEfiPartTypeLegacyMbrGuid,
NULL },
   { STRING_TOKEN (STR_DRIVER_CONFIG),   
&gEfiDriverConfigurationProtocolGuid,  NULL 
},
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
index 6be0d78c4c5a..b3433eda029b 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
@@ -1,7 +1,7 @@
 /** @file
   Provides interface to advanced shell functionality for parsing both handle 
and protocol database.
 
-  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP
   (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -94,8 +94,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
index 0d483805e712..af16569b07bd 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
@@ -1,6 +1,6 @@
 ##  @file
 #  Provides interface to advanced shell functionality for parsing both handle 
and protocol database.
-#  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. 
+#  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved. 
 #  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
 #  (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP
 #
@@ -129,8 +129,6 @@
   gEfiHiiConfigAccessProtocolGuid ## UNDEFINED
   gEfiFormBrowser2ProtocolGuid## UNDEFINED
   gEfiDeviceIoProtocolGuid## UNDEFINED
-  gEfiUgaDrawProtocolGuid ## UNDEFINED
-  gEfiUgaIoProtocolGuid   ## UNDEFINED
   gEfiDriverConfigurationProtocolGuid ## UNDEFINED
   gEfiDriverConfiguration2ProtocolGuid## UNDEFINED
   gEfiSimpleTextInputExProtocolGuid   ## UNDEFINED
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index aa3396cea94d..04beea8e7f3e 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.

[edk2-devel] [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support

2022-07-14 Thread Guomin Jiang
From: GuoMinJ 

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

Remove PcdConOutGopSupport, it is unnecessary any more.
Remove All UGA Support in UefiPayloadPkg.

Signed-off-by: Guomin Jiang 
Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
---
 .../Library/PlatformBootManagerLib/PlatformBootManager.h  | 4 ++--
 .../Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 4 +---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 --
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
index 5614aadafb98..0f93287ac1f7 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
@@ -1,7 +1,7 @@
 /** @file
Head file for BDS Platform specific code
 
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -98,7 +98,7 @@ PlatformBootManagerEnableQuietBoot (
   Use SystemTable Conout to turn on video based Simple Text Out consoles. The
   Simple Text Out screens will now be synced up with all non video output 
devices
 
-  @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
+  @retval EFI_SUCCESS Graphic devices are back in text mode and synced up.
 
 **/
 EFI_STATUS
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9f58c460cd6b..2ebe7b3fd960 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Include all platform action which can be customized by IBV/OEM.
 #
-#  Copyright (c) 2012 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -55,7 +55,6 @@
 [Protocols]
   gEfiGenericMemTestProtocolGuid  ## CONSUMES
   gEfiGraphicsOutputProtocolGuid  ## CONSUMES
-  gEfiUgaDrawProtocolGuid ## CONSUMES
   gEfiBootLogoProtocolGuid## CONSUMES
   gEfiDxeSmmReadyToLockProtocolGuid
   gEfiSmmAccess2ProtocolGuid
@@ -65,7 +64,6 @@
 
 [Pcd]
   gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
   gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 2428bb2ce9a9..50b9b017588d 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -373,8 +373,6 @@
 

 [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   ## This PCD specified whether ACPI SDT protocol is installed.
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
-- 
2.26.2.windows.1



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




[edk2-devel] [Patch v2 03/11] ArmPkg: Remove All UGA Support

2022-07-14 Thread Guomin Jiang
From: GuoMinJ 

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

Remove All UGA Support in ArmPkg.

Signed-off-by: Guomin Jiang 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Sami Mujawar 
---
 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h   | 4 ++--
 .../PlatformBootManagerLib/PlatformBootManagerLib.inf| 5 +
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h 
b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
index a40a2ff5cb4f..a2ec4c4ad6c7 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
@@ -2,7 +2,7 @@
   Head file for BDS Platform specific code
 
   Copyright (C) 2015-2016, Red Hat, Inc.
-  Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.
+  Copyright (c) 2004 - 2022, Intel Corporation. All rights reserved.
   Copyright (c) 2016, Linaro Ltd. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -43,7 +43,7 @@ EnableQuietBoot (
   Simple Text Out screens will now be synced up with all non video output
   devices
 
-  @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
+  @retval EFI_SUCCESS Graphic devices are back in text mode and synced up.
 **/
 EFI_STATUS
 DisableQuietBoot (
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 86751b45f82b..63d1d83ab0ef 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -3,7 +3,7 @@
 #
 #  Copyright (C) 2015-2016, Red Hat, Inc.
 #  Copyright (c) 2014, ARM Ltd. All rights reserved.
-#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+#  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
 #  Copyright (c) 2016, Linaro Ltd. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -51,9 +51,6 @@
   UefiLib
   UefiRuntimeServicesTableLib
 
-[FeaturePcd]
-  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
-
 [FixedPcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
-- 
2.26.2.windows.1



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




[edk2-devel] [staging/crypto-new-api PATCH] CryptoPkg: Fix issues from crypto code review.

2022-07-14 Thread yi1 li
Details:
1. Some APIs need more detail comment.
2. Correct BnRShift() param order.
3. Remove unsecure ECC curve from GroupToNid().
4. Add full public key validating procedures to EcDhDeriveSecret().

Cc: Ming Tan 
Cc: Heng Luo 
Signed-off-by: Yi Li 

---
 CryptoPkg/Driver/Crypto.c  | 31 
---
 CryptoPkg/Include/Library/BaseCryptLib.h   | 31 
---
 CryptoPkg/Library/BaseCryptLib/Bn/CryptBn.c|  7 ---
 CryptoPkg/Library/BaseCryptLib/Bn/CryptBnNull.c|  4 +++-
 CryptoPkg/Library/BaseCryptLib/Ec/CryptEc.c| 61 
++---
 CryptoPkg/Library/BaseCryptLib/Ec/CryptEcNull.c| 27 
+--
 CryptoPkg/Library/BaseCryptLibNull/Bn/CryptBnNull.c|  4 +++-
 CryptoPkg/Library/BaseCryptLibNull/Ec/CryptEcNull.c| 27 
+--
 CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c | 31 
---
 CryptoPkg/Private/Protocol/Crypto.h| 31 
---
 10 files changed, 158 insertions(+), 96 deletions(-)

diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c
index de422b7f53..10a0ce8800 100644
--- a/CryptoPkg/Driver/Crypto.c
+++ b/CryptoPkg/Driver/Crypto.c
@@ -4962,7 +4962,6 @@ CryptoServiceBigNumValueOne (
   @param[out]  BnRes   The result.
 
   @retval EFI_SUCCESS  On success.
-  @retval EFI_OUT_OF_RESOURCES In case of internal allocation failures.
   @retval EFI_PROTOCOL_ERROR   Otherwise.
 **/
 EFI_STATUS
@@ -5051,6 +5050,9 @@ CryptoServiceBigNumContextFree (
 
   @param[in]   Bn Big number to set.
   @param[in]   ValValue to set.
+
+  @retval EFI_SUCCESS  On success.
+  @retval EFI_PROTOCOL_ERROR   Otherwise.
 **/
 EFI_STATUS
 EFIAPI
@@ -5092,7 +5094,7 @@ CryptoServiceBigNumAddMod (
   using EcGroupFree() function.
 
   @param[in]  Group  Identifying number for the ECC group (IANA "Group
- Description" attribute registrty for RFC 2409).
+ Description" attribute registry for RFC 2409).
 
   @retval EcGroup object  On success.
   @retval NULLOn failure.
@@ -5114,8 +5116,8 @@ CryptoServiceEcGroupInit (
 
   @param[in]  EcGroupEC group object.
   @param[out] BnPrimeGroup prime number.
-  @param[out] BnAA coofecient.
-  @param[out] BnBB coofecient.
+  @param[out] BnAA coefficient.
+  @param[out] BnBB coefficient.
   @param[in]  BnCtx  BN context.
 
   @retval EFI_SUCCESSOn success.
@@ -5426,13 +5428,14 @@ CryptoServiceEcPointSetCompressedCoordinates (
 /**
   Generate a key using ECDH algorithm. Please note, this function uses
   pseudo random number generator. The caller must make sure RandomSeed()
-  funtion was properly called before.
+  function was properly called before.
 
   @param[in]  GroupIdentifying number for the ECC group (IANA "Group
-   Description" attribute registrty for RFC 2409).
+   Description" attribute registry for RFC 2409).
   @param[out] PKey Pointer to an object that will hold the ECDH key.
 
   @retval EFI_SUCCESSOn success.
+  @retval EFI_UNSUPPORTEDECC group not supported.
   @retval EFI_PROTOCOL_ERROR On failure.
 **/
 EFI_STATUS
@@ -5466,8 +5469,9 @@ CryptoServiceEcDhKeyFree (
   @param[in]  PKey ECDH Key object.
   @param[out] EcPoint  Properly initialized EC Point to hold the public key.
 
-  @retval EFI_SUCCESSOn success.
-  @retval EFI_PROTOCOL_ERROR On failure.
+  @retval EFI_SUCCESS   On success.
+  @retval EFI_INVALID_PARAMETER EcPoint should be initialized properly.
+  @retval EFI_PROTOCOL_ERROROn failure.
 **/
 EFI_STATUS
 EFIAPI
@@ -5484,15 +5488,20 @@ CryptoServiceEcDhGetPubKey (
 
   @param[in]  PKey   ECDH Key object.
   @param[in]  Group  Identifying number for the ECC group (IANA "Group
- Description" attribute registrty for RFC 2409).
+ Description" attribute registry for RFC 2409).
   @param[in]  EcPointPublic  Peer public key.
   @param[out] SecretSize On success, holds secret size.
   @param[out] Secret On success, holds the derived secret.
  Should be freed by caller using FreePool()
  function.
 
-  @retval EFI_SUCCESSOn success.
-  @retval EFI_PROTOCOL_ERROR On failure.
+  @retval EFI_SUCCESS   On success.
+  @retval EFI_UNSUPPORTED   ECC group not supported.
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is 
TRUE:
+Secret is NULL.
+SecretSize is NULL.
+Public key in EcPointPublic is invalid.
+  @retval EFI_PROTOCOL_ERROROn failure.
 **/
 EFI_STATUS
 EFIAPI
diff --git a/CryptoPkg/Incl

Re: [edk2-devel] [staging/crypto-new-api PATCH] CryptoPkg: Fix issues from crypto code review.

2022-07-14 Thread Heng Luo
Reviewed-by: Heng Luo 

> -Original Message-
> From: Li, Yi1 
> Sent: Friday, July 15, 2022 10:07 AM
> To: devel@edk2.groups.io
> Cc: Li, Yi1 ; Tan, Ming ; Luo, Heng
> 
> Subject: [staging/crypto-new-api PATCH] CryptoPkg: Fix issues from crypto code
> review.
> 
> Details:
> 1. Some APIs need more detail comment.
> 2. Correct BnRShift() param order.
> 3. Remove unsecure ECC curve from GroupToNid().
> 4. Add full public key validating procedures to EcDhDeriveSecret().
> 
> Cc: Ming Tan 
> Cc: Heng Luo 
> Signed-off-by: Yi Li 
> 
> ---
>  CryptoPkg/Driver/Crypto.c  | 31 
> -
> --
>  CryptoPkg/Include/Library/BaseCryptLib.h   | 31
> ---
>  CryptoPkg/Library/BaseCryptLib/Bn/CryptBn.c|  7 ---
>  CryptoPkg/Library/BaseCryptLib/Bn/CryptBnNull.c|  4 +++-
>  CryptoPkg/Library/BaseCryptLib/Ec/CryptEc.c| 61
> ++---
>  CryptoPkg/Library/BaseCryptLib/Ec/CryptEcNull.c| 27
> +--
>  CryptoPkg/Library/BaseCryptLibNull/Bn/CryptBnNull.c|  4 +++-
>  CryptoPkg/Library/BaseCryptLibNull/Ec/CryptEcNull.c| 27
> +--
>  CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c | 31
> ---
>  CryptoPkg/Private/Protocol/Crypto.h| 31 
> --
> -
>  10 files changed, 158 insertions(+), 96 deletions(-)
> 
> diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c index
> de422b7f53..10a0ce8800 100644
> --- a/CryptoPkg/Driver/Crypto.c
> +++ b/CryptoPkg/Driver/Crypto.c
> @@ -4962,7 +4962,6 @@ CryptoServiceBigNumValueOne (
>@param[out]  BnRes   The result.
> 
>@retval EFI_SUCCESS  On success.
> -  @retval EFI_OUT_OF_RESOURCES In case of internal allocation failures.
>@retval EFI_PROTOCOL_ERROR   Otherwise.
>  **/
>  EFI_STATUS
> @@ -5051,6 +5050,9 @@ CryptoServiceBigNumContextFree (
> 
>@param[in]   Bn Big number to set.
>@param[in]   ValValue to set.
> +
> +  @retval EFI_SUCCESS  On success.
> +  @retval EFI_PROTOCOL_ERROR   Otherwise.
>  **/
>  EFI_STATUS
>  EFIAPI
> @@ -5092,7 +5094,7 @@ CryptoServiceBigNumAddMod (
>using EcGroupFree() function.
> 
>@param[in]  Group  Identifying number for the ECC group (IANA "Group
> - Description" attribute registrty for RFC 2409).
> + Description" attribute registry for RFC 2409).
> 
>@retval EcGroup object  On success.
>@retval NULLOn failure.
> @@ -5114,8 +5116,8 @@ CryptoServiceEcGroupInit (
> 
>@param[in]  EcGroupEC group object.
>@param[out] BnPrimeGroup prime number.
> -  @param[out] BnAA coofecient.
> -  @param[out] BnBB coofecient.
> +  @param[out] BnAA coefficient.
> +  @param[out] BnBB coefficient.
>@param[in]  BnCtx  BN context.
> 
>@retval EFI_SUCCESSOn success.
> @@ -5426,13 +5428,14 @@ CryptoServiceEcPointSetCompressedCoordinates (
>  /**
>Generate a key using ECDH algorithm. Please note, this function uses
>pseudo random number generator. The caller must make sure RandomSeed()
> -  funtion was properly called before.
> +  function was properly called before.
> 
>@param[in]  GroupIdentifying number for the ECC group (IANA "Group
> -   Description" attribute registrty for RFC 2409).
> +   Description" attribute registry for RFC 2409).
>@param[out] PKey Pointer to an object that will hold the ECDH key.
> 
>@retval EFI_SUCCESSOn success.
> +  @retval EFI_UNSUPPORTEDECC group not supported.
>@retval EFI_PROTOCOL_ERROR On failure.
>  **/
>  EFI_STATUS
> @@ -5466,8 +5469,9 @@ CryptoServiceEcDhKeyFree (
>@param[in]  PKey ECDH Key object.
>@param[out] EcPoint  Properly initialized EC Point to hold the public key.
> 
> -  @retval EFI_SUCCESSOn success.
> -  @retval EFI_PROTOCOL_ERROR On failure.
> +  @retval EFI_SUCCESS   On success.
> +  @retval EFI_INVALID_PARAMETER EcPoint should be initialized properly.
> +  @retval EFI_PROTOCOL_ERROROn failure.
>  **/
>  EFI_STATUS
>  EFIAPI
> @@ -5484,15 +5488,20 @@ CryptoServiceEcDhGetPubKey (
> 
>@param[in]  PKey   ECDH Key object.
>@param[in]  Group  Identifying number for the ECC group (IANA 
> "Group
> - Description" attribute registrty for RFC 2409).
> + Description" attribute registry for RFC 2409).
>@param[in]  EcPointPublic  Peer public key.
>@param[out] SecretSize On success, holds secret size.
>@param[out] Secret On success, holds the derived secret.
>   Should be freed by caller using FreePool()
>   function.
> 
> -  @retval EFI_SUCCESSOn success.
> -  @re

Re: [edk2-devel] [Patch v2 05/11] ShellPkg: Remove All UGA Support

2022-07-14 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Jiang, Guomin 
> Sent: Friday, July 15, 2022 9:51 AM
> To: devel@edk2.groups.io
> Cc: GuoMinJ ; Ni, Ray ; Gao, 
> Zhichao 
> Subject: [Patch v2 05/11] ShellPkg: Remove All UGA Support
> 
> From: GuoMinJ 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove All UGA Support in ShellPkg.
> 
> Signed-off-by: Guomin Jiang 
> Cc: Ray Ni 
> Cc: Zhichao Gao 
> ---
>  ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c  | 4 +---
>  ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h  | 4 +---
>  .../Library/UefiHandleParsingLib/UefiHandleParsingLib.inf | 4 +---
>  .../Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 4 +---
>  4 files changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> index aa0115bdd498..08215ab8039c 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> @@ -1,7 +1,7 @@
>  /** @file
>Provides interface to advanced shell functionality for parsing both handle 
> and protocol database.
> 
> -  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
> +  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved.
>(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
>(C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP
>SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -2238,8 +2238,6 @@ STATIC CONST GUID_INFO_BLOCK  mGuidStringList[] = {
>{ STRING_TOKEN (STR_SHELL_ENV2),  &gEfiShellEnvironment2Guid,  
>   NULL },
>{ STRING_TOKEN (STR_SHELL_ENV),   &gEfiShellEnvironment2Guid,  
>   NULL },
>{ STRING_TOKEN (STR_DEVICE_IO),   &gEfiDeviceIoProtocolGuid,   
>   NULL },
> -  { STRING_TOKEN (STR_UGA_DRAW),&gEfiUgaDrawProtocolGuid,
>   NULL },
> -  { STRING_TOKEN (STR_UGA_IO),  &gEfiUgaIoProtocolGuid,  
>   NULL },
>{ STRING_TOKEN (STR_ESP), &gEfiPartTypeSystemPartGuid, 
>   NULL },
>{ STRING_TOKEN (STR_GPT_NBR), &gEfiPartTypeLegacyMbrGuid,  
>   NULL },
>{ STRING_TOKEN (STR_DRIVER_CONFIG),   
> &gEfiDriverConfigurationProtocolGuid,
> NULL },
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
> index 6be0d78c4c5a..b3433eda029b 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
> @@ -1,7 +1,7 @@
>  /** @file
>Provides interface to advanced shell functionality for parsing both handle 
> and protocol database.
> 
> -  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
> +  Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
>(C) Copyright 2016 Hewlett Packard Enterprise Development LP
>(C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.
>SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -94,8 +94,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
> -#include 
>  #include 
>  #include 
>  #include 
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> index 0d483805e712..af16569b07bd 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> @@ -1,6 +1,6 @@
>  ##  @file
>  #  Provides interface to advanced shell functionality for parsing both 
> handle and protocol database.
> -#  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. 
> +#  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved. 
>  #  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
>  #  (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP
>  #
> @@ -129,8 +129,6 @@
>gEfiHiiConfigAccessProtocolGuid ## UNDEFINED
>gEfiFormBrowser2ProtocolGuid## UNDEFINED
>gEfiDeviceIoProtocolGuid## UNDEFINED
> -  gEfiUgaDrawProtocolGuid ## UNDEFINED
> -  gEfiUgaIoProtocolGuid   ## UNDEFINED
>gEfiDriverConfigurationProtocolGuid  

Re: [edk2-devel] [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support

2022-07-14 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Jiang, Guomin 
> Sent: Friday, July 15, 2022 9:51 AM
> To: devel@edk2.groups.io
> Cc: GuoMinJ ; Dong, Guo ; Ni, Ray 
> ; Maurice Ma
> ; You, Benjamin ; Rhodes, Sean 
> 
> Subject: [Patch v2 01/11] UefiPayloadPkg: Remove All UGA Support
> 
> From: GuoMinJ 
> 
> REF: https//bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove PcdConOutGopSupport, it is unnecessary any more.
> Remove All UGA Support in UefiPayloadPkg.
> 
> Signed-off-by: Guomin Jiang 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Cc: Sean Rhodes 
> ---
>  .../Library/PlatformBootManagerLib/PlatformBootManager.h  | 4 ++--
>  .../Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 4 +---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 2 --
>  3 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git 
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> index 5614aadafb98..0f93287ac1f7 100644
> --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> @@ -1,7 +1,7 @@
>  /** @file
> Head file for BDS Platform specific code
> 
> -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.
>  SPDX-License-Identifier: BSD-2-Clause-Patent
>  **/
> 
> @@ -98,7 +98,7 @@ PlatformBootManagerEnableQuietBoot (
>Use SystemTable Conout to turn on video based Simple Text Out consoles. The
>Simple Text Out screens will now be synced up with all non video output 
> devices
> 
> -  @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
> +  @retval EFI_SUCCESS Graphic devices are back in text mode and synced 
> up.
> 
>  **/
>  EFI_STATUS
> diff --git 
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> index 9f58c460cd6b..2ebe7b3fd960 100644
> --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Include all platform action which can be customized by IBV/OEM.
>  #
> -#  Copyright (c) 2012 - 2021, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2012 - 2022, Intel Corporation. All rights reserved.
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
>  ##
> @@ -55,7 +55,6 @@
>  [Protocols]
>gEfiGenericMemTestProtocolGuid  ## CONSUMES
>gEfiGraphicsOutputProtocolGuid  ## CONSUMES
> -  gEfiUgaDrawProtocolGuid ## CONSUMES
>gEfiBootLogoProtocolGuid## CONSUMES
>gEfiDxeSmmReadyToLockProtocolGuid
>gEfiSmmAccess2ProtocolGuid
> @@ -65,7 +64,6 @@
> 
>  [Pcd]
>gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
> -  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
>gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 2428bb2ce9a9..50b9b017588d 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -373,8 +373,6 @@
>  
> 
>  [PcdsFeatureFlag]
>gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
>## This PCD specified whether ACPI SDT protocol is installed.
>gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
>gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
> --
> 2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91404): https://edk2.groups.io/g/devel/message/91404
Mute This Topic: https://groups.io/mt/92393242/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 04/11] EmulatorPkg: Remove All UGA Support

2022-07-14 Thread Ni, Ray
Guomin,
Did you try booting the Emulator Win and Linux with this change?

> -Original Message-
> From: Jiang, Guomin 
> Sent: Friday, July 15, 2022 9:51 AM
> To: devel@edk2.groups.io
> Cc: GuoMinJ ; Andrew Fish ; Ni, Ray 
> 
> Subject: [Patch v2 04/11] EmulatorPkg: Remove All UGA Support
> 
> From: GuoMinJ 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove All UGA Support in EmulatorPkg.
> 
> Signed-off-by: Guomin Jiang 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> ---
>  EmulatorPkg/EmuGopDxe/Gop.h   | 10 +--
>  EmulatorPkg/EmuGopDxe/GopScreen.c | 14 ++--
>  EmulatorPkg/Include/Protocol/EmuFileSystem.h  | 24 +++---
>  .../Include/Protocol/EmuGraphicsWindow.h  | 18 ++--
>  .../Library/PlatformBmLib/PlatformBm.h|  4 +-
>  .../Library/PlatformBmLib/PlatformBmData.c|  6 +-
>  EmulatorPkg/Unix/Host/Gasket.h| 12 +--
>  EmulatorPkg/Unix/Host/Host.h  |  3 +-
>  EmulatorPkg/Unix/Host/Ia32/Gasket.S   |  2 +-
>  EmulatorPkg/Unix/Host/X11GraphicsWindow.c | 82 +--
>  EmulatorPkg/Unix/Host/X64/Gasket.S|  2 +-
>  EmulatorPkg/Win/Host/WinGopScreen.c   | 10 +--
>  12 files changed, 92 insertions(+), 95 deletions(-)
> 
> diff --git a/EmulatorPkg/EmuGopDxe/Gop.h b/EmulatorPkg/EmuGopDxe/Gop.h
> index 7f7dc4e8eb9f..59ebfda912eb 100644
> --- a/EmulatorPkg/EmuGopDxe/Gop.h
> +++ b/EmulatorPkg/EmuGopDxe/Gop.h
> @@ -1,13 +1,13 @@
>  /*++ @file
> 
> -Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
>  Portions copyright (c) 2010,Apple Inc. All rights reserved.
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> 
> -#ifndef __UGA_H_
> -#define __UGA_H_
> +#ifndef GOP_H_
> +#define GOP_H_
> 
>  #include 
> 
> @@ -60,8 +60,6 @@ typedef struct {
>  extern EFI_DRIVER_BINDING_PROTOCOL  gEmuGopDriverBinding;
>  extern EFI_COMPONENT_NAME_PROTOCOL  gEmuGopComponentName;
> 
> -#define EMU_UGA_CLASS_NAME  L"EmuGopWindow"
> -
>  #define GOP_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('G', 'o', 'p', 'N')
>  typedef struct {
>UINT64   Signature;
> @@ -83,7 +81,7 @@ typedef struct {
>GOP_MODE_DATA*ModeData;
> 
>//
> -  // UGA Private Data knowing when to start hardware
> +  // Private Data knowing when to start hardware
>//
>BOOLEAN  HardwareNeedsStarting;
> 
> diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c 
> b/EmulatorPkg/EmuGopDxe/GopScreen.c
> index 88d95b88e162..113b496861b4 100644
> --- a/EmulatorPkg/EmuGopDxe/GopScreen.c
> +++ b/EmulatorPkg/EmuGopDxe/GopScreen.c
> @@ -10,7 +10,7 @@ Module Name:
> 
>  Abstract:
> 
> -  This file produces the graphics abstration of UGA. It is called by
> +  This file produces the graphics abstration of GOP. It is called by
>EmuGopDriver.c file which deals with the EFI 1.1 driver model.
>This file just does graphics.
> 
> @@ -209,7 +209,7 @@ EmuGopBlt (
>// the number of bytes in each row can be computed.
>//
>if (Delta == 0) {
> -Delta = Width * sizeof (EFI_UGA_PIXEL);
> +Delta = Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
>}
> 
>//
> @@ -220,8 +220,8 @@ EmuGopBlt (
>OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
> 
>//
> -  // Pack UGA Draw protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS 
> structure to adapt to
> -  // GopBlt() API of Unix UGA IO protocol.
> +  // Pack GOP protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS 
> structure to adapt to
> +  // GopBlt() API of GOP protocol.
>//
>GopBltArgs.DestinationX = DestinationX;
>GopBltArgs.DestinationY = DestinationY;
> @@ -232,8 +232,8 @@ EmuGopBlt (
>GopBltArgs.Delta= Delta;
>Status  = Private->EmuGraphicsWindow->Blt (
>
> Private->EmuGraphicsWindow,
> -  (EFI_UGA_PIXEL 
> *)BltBuffer,
> -  
> (EFI_UGA_BLT_OPERATION)BltOperation,
> +  BltBuffer,
> +  BltOperation,
>&GopBltArgs
>);
> 
> @@ -384,7 +384,7 @@ ShutdownGopEvent (
> 
>  Routine Description:
> 
> -  This is the UGA screen's callback notification function for 
> exit-boot-services.
> +  This is the screen's callback notification function for exit-boot-services.
>All we do here is call EmuGopDestructor().
> 
>  Arguments:
> diff --git a/EmulatorPkg/Include/Protocol/EmuFileSystem.h 
> b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> index 15de43ac022e..062508fafc9d 100644
> --- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
> +++ b/EmulatorPkg/Include/Protocol/EmuFileSystem

Re: [edk2-devel] [staging/crypto-new-api PATCH] CryptoPkg: Fix issues from crypto code review.

2022-07-14 Thread Tan, Ming
Yi:
  I have the following suggestion.
  1. Suggest to split the patch to several patchs. Special the code which 
modify the logical.
  2. Change the commit title, "fix the issues the code review" sounds like show 
that the reviewers did not good job at before 😉

  BR/Tan Ming.

-Original Message-
From: Luo, Heng  
Sent: Friday, July 15, 2022 10:13 AM
To: Li, Yi1 ; devel@edk2.groups.io
Cc: Tan, Ming 
Subject: RE: [staging/crypto-new-api PATCH] CryptoPkg: Fix issues from crypto 
code review.

Reviewed-by: Heng Luo 

> -Original Message-
> From: Li, Yi1 
> Sent: Friday, July 15, 2022 10:07 AM
> To: devel@edk2.groups.io
> Cc: Li, Yi1 ; Tan, Ming ; Luo, 
> Heng 
> Subject: [staging/crypto-new-api PATCH] CryptoPkg: Fix issues from 
> crypto code review.
> 
> Details:
> 1. Some APIs need more detail comment.
> 2. Correct BnRShift() param order.
> 3. Remove unsecure ECC curve from GroupToNid().
> 4. Add full public key validating procedures to EcDhDeriveSecret().
> 
> Cc: Ming Tan 
> Cc: Heng Luo 
> Signed-off-by: Yi Li 
> 
> ---
>  CryptoPkg/Driver/Crypto.c  | 31 
> -
> --
>  CryptoPkg/Include/Library/BaseCryptLib.h   | 31
> ---
>  CryptoPkg/Library/BaseCryptLib/Bn/CryptBn.c|  7 ---
>  CryptoPkg/Library/BaseCryptLib/Bn/CryptBnNull.c|  4 +++-
>  CryptoPkg/Library/BaseCryptLib/Ec/CryptEc.c| 61
> ++---
>  CryptoPkg/Library/BaseCryptLib/Ec/CryptEcNull.c| 27
> +--
>  CryptoPkg/Library/BaseCryptLibNull/Bn/CryptBnNull.c|  4 +++-
>  CryptoPkg/Library/BaseCryptLibNull/Ec/CryptEcNull.c| 27
> +--
>  CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c | 31
> ---
>  CryptoPkg/Private/Protocol/Crypto.h| 31 
> --
> -
>  10 files changed, 158 insertions(+), 96 deletions(-)
> 
> diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c 
> index
> de422b7f53..10a0ce8800 100644
> --- a/CryptoPkg/Driver/Crypto.c
> +++ b/CryptoPkg/Driver/Crypto.c
> @@ -4962,7 +4962,6 @@ CryptoServiceBigNumValueOne (
>@param[out]  BnRes   The result.
> 
>@retval EFI_SUCCESS  On success.
> -  @retval EFI_OUT_OF_RESOURCES In case of internal allocation failures.
>@retval EFI_PROTOCOL_ERROR   Otherwise.
>  **/
>  EFI_STATUS
> @@ -5051,6 +5050,9 @@ CryptoServiceBigNumContextFree (
> 
>@param[in]   Bn Big number to set.
>@param[in]   ValValue to set.
> +
> +  @retval EFI_SUCCESS  On success.
> +  @retval EFI_PROTOCOL_ERROR   Otherwise.
>  **/
>  EFI_STATUS
>  EFIAPI
> @@ -5092,7 +5094,7 @@ CryptoServiceBigNumAddMod (
>using EcGroupFree() function.
> 
>@param[in]  Group  Identifying number for the ECC group (IANA "Group
> - Description" attribute registrty for RFC 2409).
> + Description" attribute registry for RFC 2409).
> 
>@retval EcGroup object  On success.
>@retval NULLOn failure.
> @@ -5114,8 +5116,8 @@ CryptoServiceEcGroupInit (
> 
>@param[in]  EcGroupEC group object.
>@param[out] BnPrimeGroup prime number.
> -  @param[out] BnAA coofecient.
> -  @param[out] BnBB coofecient.
> +  @param[out] BnAA coefficient.
> +  @param[out] BnBB coefficient.
>@param[in]  BnCtx  BN context.
> 
>@retval EFI_SUCCESSOn success.
> @@ -5426,13 +5428,14 @@ CryptoServiceEcPointSetCompressedCoordinates (
>  /**
>Generate a key using ECDH algorithm. Please note, this function uses
>pseudo random number generator. The caller must make sure 
> RandomSeed()
> -  funtion was properly called before.
> +  function was properly called before.
> 
>@param[in]  GroupIdentifying number for the ECC group (IANA "Group
> -   Description" attribute registrty for RFC 2409).
> +   Description" attribute registry for RFC 2409).
>@param[out] PKey Pointer to an object that will hold the ECDH key.
> 
>@retval EFI_SUCCESSOn success.
> +  @retval EFI_UNSUPPORTEDECC group not supported.
>@retval EFI_PROTOCOL_ERROR On failure.
>  **/
>  EFI_STATUS
> @@ -5466,8 +5469,9 @@ CryptoServiceEcDhKeyFree (
>@param[in]  PKey ECDH Key object.
>@param[out] EcPoint  Properly initialized EC Point to hold the public key.
> 
> -  @retval EFI_SUCCESSOn success.
> -  @retval EFI_PROTOCOL_ERROR On failure.
> +  @retval EFI_SUCCESS   On success.
> +  @retval EFI_INVALID_PARAMETER EcPoint should be initialized properly.
> +  @retval EFI_PROTOCOL_ERROROn failure.
>  **/
>  EFI_STATUS
>  EFIAPI
> @@ -5484,15 +5488,20 @@ CryptoServiceEcDhGetPubKey (
> 
>@param[in]  PKey   ECDH Key object.
>@param[in]  Group  Identifying number for the ECC group (IANA 
> "Group

[edk2-devel] [staging/crypto-new-api PATCH] CryptoPkg: Fixed possible security implications in ECDH and BN.

2022-07-14 Thread yi1 li
1. Origenal code mixes up the input/output parameters for the BN_rshift()
function - the output is actually the first parameter and not the second
one. Now we correct BnRShift() param order.

2. NID_X9_62_prime192v1() and NID_secp224r1 prohibited by Intel Crypto/TLS
Guidelines (due to being insufficiently secure). Now we remove those curve.

3. ECDH pubilc key check is insufficient and therefore opens the
implementation up to invalid curve attacks (see e.g.Dragonblood attack
report). Need to perform the checks described by Appendix D of the NIST
SP800-186, or Section 5.6.2.3 of NIST SP800-56Ar3. Now we add full public
key validating procedures to EcDhDeriveSecret().

4. Some APIs need more detail comment. Fix some typos and add more
detail discription for return value.

Cc: Ming Tan 
Cc: Heng Luo 
Signed-off-by: Yi Li 

---
 CryptoPkg/Driver/Crypto.c  | 31 
---
 CryptoPkg/Include/Library/BaseCryptLib.h   | 31 
---
 CryptoPkg/Library/BaseCryptLib/Bn/CryptBn.c|  7 ---
 CryptoPkg/Library/BaseCryptLib/Bn/CryptBnNull.c|  4 +++-
 CryptoPkg/Library/BaseCryptLib/Ec/CryptEc.c| 61 
++---
 CryptoPkg/Library/BaseCryptLib/Ec/CryptEcNull.c| 27 
+--
 CryptoPkg/Library/BaseCryptLibNull/Bn/CryptBnNull.c|  4 +++-
 CryptoPkg/Library/BaseCryptLibNull/Ec/CryptEcNull.c| 27 
+--
 CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c | 31 
---
 CryptoPkg/Private/Protocol/Crypto.h| 31 
---
 10 files changed, 158 insertions(+), 96 deletions(-)

diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c
index de422b7f53..10a0ce8800 100644
--- a/CryptoPkg/Driver/Crypto.c
+++ b/CryptoPkg/Driver/Crypto.c
@@ -4962,7 +4962,6 @@ CryptoServiceBigNumValueOne (
   @param[out]  BnRes   The result.
 
   @retval EFI_SUCCESS  On success.
-  @retval EFI_OUT_OF_RESOURCES In case of internal allocation failures.
   @retval EFI_PROTOCOL_ERROR   Otherwise.
 **/
 EFI_STATUS
@@ -5051,6 +5050,9 @@ CryptoServiceBigNumContextFree (
 
   @param[in]   Bn Big number to set.
   @param[in]   ValValue to set.
+
+  @retval EFI_SUCCESS  On success.
+  @retval EFI_PROTOCOL_ERROR   Otherwise.
 **/
 EFI_STATUS
 EFIAPI
@@ -5092,7 +5094,7 @@ CryptoServiceBigNumAddMod (
   using EcGroupFree() function.
 
   @param[in]  Group  Identifying number for the ECC group (IANA "Group
- Description" attribute registrty for RFC 2409).
+ Description" attribute registry for RFC 2409).
 
   @retval EcGroup object  On success.
   @retval NULLOn failure.
@@ -5114,8 +5116,8 @@ CryptoServiceEcGroupInit (
 
   @param[in]  EcGroupEC group object.
   @param[out] BnPrimeGroup prime number.
-  @param[out] BnAA coofecient.
-  @param[out] BnBB coofecient.
+  @param[out] BnAA coefficient.
+  @param[out] BnBB coefficient.
   @param[in]  BnCtx  BN context.
 
   @retval EFI_SUCCESSOn success.
@@ -5426,13 +5428,14 @@ CryptoServiceEcPointSetCompressedCoordinates (
 /**
   Generate a key using ECDH algorithm. Please note, this function uses
   pseudo random number generator. The caller must make sure RandomSeed()
-  funtion was properly called before.
+  function was properly called before.
 
   @param[in]  GroupIdentifying number for the ECC group (IANA "Group
-   Description" attribute registrty for RFC 2409).
+   Description" attribute registry for RFC 2409).
   @param[out] PKey Pointer to an object that will hold the ECDH key.
 
   @retval EFI_SUCCESSOn success.
+  @retval EFI_UNSUPPORTEDECC group not supported.
   @retval EFI_PROTOCOL_ERROR On failure.
 **/
 EFI_STATUS
@@ -5466,8 +5469,9 @@ CryptoServiceEcDhKeyFree (
   @param[in]  PKey ECDH Key object.
   @param[out] EcPoint  Properly initialized EC Point to hold the public key.
 
-  @retval EFI_SUCCESSOn success.
-  @retval EFI_PROTOCOL_ERROR On failure.
+  @retval EFI_SUCCESS   On success.
+  @retval EFI_INVALID_PARAMETER EcPoint should be initialized properly.
+  @retval EFI_PROTOCOL_ERROROn failure.
 **/
 EFI_STATUS
 EFIAPI
@@ -5484,15 +5488,20 @@ CryptoServiceEcDhGetPubKey (
 
   @param[in]  PKey   ECDH Key object.
   @param[in]  Group  Identifying number for the ECC group (IANA "Group
- Description" attribute registrty for RFC 2409).
+ Description" attribute registry for RFC 2409).
   @param[in]  EcPointPublic  Peer public key.
   @param[out] SecretSize On success, holds secret size.
   @param[out] Secret On success, holds the derived secret.
  Should be freed by caller using FreePool()
   

Re: [edk2-devel] [staging/crypto-new-api PATCH] CryptoPkg: Fixed possible security implications in ECDH and BN.

2022-07-14 Thread Tan, Ming
Reviewed-by: Ming Tan 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of yi1 li
Sent: Friday, July 15, 2022 1:30 PM
To: devel@edk2.groups.io
Cc: Li, Yi1 ; Tan, Ming ; Luo, Heng 

Subject: [edk2-devel] [staging/crypto-new-api PATCH] CryptoPkg: Fixed possible 
security implications in ECDH and BN.

1. Origenal code mixes up the input/output parameters for the BN_rshift() 
function - the output is actually the first parameter and not the second one. 
Now we correct BnRShift() param order.

2. NID_X9_62_prime192v1() and NID_secp224r1 prohibited by Intel Crypto/TLS 
Guidelines (due to being insufficiently secure). Now we remove those curve.

3. ECDH pubilc key check is insufficient and therefore opens the implementation 
up to invalid curve attacks (see e.g.Dragonblood attack report). Need to 
perform the checks described by Appendix D of the NIST SP800-186, or Section 
5.6.2.3 of NIST SP800-56Ar3. Now we add full public key validating procedures 
to EcDhDeriveSecret().

4. Some APIs need more detail comment. Fix some typos and add more detail 
discription for return value.

Cc: Ming Tan 
Cc: Heng Luo 
Signed-off-by: Yi Li 

---
 CryptoPkg/Driver/Crypto.c  | 31 
---
 CryptoPkg/Include/Library/BaseCryptLib.h   | 31 
---
 CryptoPkg/Library/BaseCryptLib/Bn/CryptBn.c|  7 ---
 CryptoPkg/Library/BaseCryptLib/Bn/CryptBnNull.c|  4 +++-
 CryptoPkg/Library/BaseCryptLib/Ec/CryptEc.c| 61 
++---
 CryptoPkg/Library/BaseCryptLib/Ec/CryptEcNull.c| 27 
+--
 CryptoPkg/Library/BaseCryptLibNull/Bn/CryptBnNull.c|  4 +++-
 CryptoPkg/Library/BaseCryptLibNull/Ec/CryptEcNull.c| 27 
+--
 CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c | 31 
---
 CryptoPkg/Private/Protocol/Crypto.h| 31 
---
 10 files changed, 158 insertions(+), 96 deletions(-)

diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c index 
de422b7f53..10a0ce8800 100644
--- a/CryptoPkg/Driver/Crypto.c
+++ b/CryptoPkg/Driver/Crypto.c
@@ -4962,7 +4962,6 @@ CryptoServiceBigNumValueOne (
   @param[out]  BnRes   The result.
 
   @retval EFI_SUCCESS  On success.
-  @retval EFI_OUT_OF_RESOURCES In case of internal allocation failures.
   @retval EFI_PROTOCOL_ERROR   Otherwise.
 **/
 EFI_STATUS
@@ -5051,6 +5050,9 @@ CryptoServiceBigNumContextFree (
 
   @param[in]   Bn Big number to set.
   @param[in]   ValValue to set.
+
+  @retval EFI_SUCCESS  On success.
+  @retval EFI_PROTOCOL_ERROR   Otherwise.
 **/
 EFI_STATUS
 EFIAPI
@@ -5092,7 +5094,7 @@ CryptoServiceBigNumAddMod (
   using EcGroupFree() function.
 
   @param[in]  Group  Identifying number for the ECC group (IANA "Group
- Description" attribute registrty for RFC 2409).
+ Description" attribute registry for RFC 2409).
 
   @retval EcGroup object  On success.
   @retval NULLOn failure.
@@ -5114,8 +5116,8 @@ CryptoServiceEcGroupInit (
 
   @param[in]  EcGroupEC group object.
   @param[out] BnPrimeGroup prime number.
-  @param[out] BnAA coofecient.
-  @param[out] BnBB coofecient.
+  @param[out] BnAA coefficient.
+  @param[out] BnBB coefficient.
   @param[in]  BnCtx  BN context.
 
   @retval EFI_SUCCESSOn success.
@@ -5426,13 +5428,14 @@ CryptoServiceEcPointSetCompressedCoordinates (
 /**
   Generate a key using ECDH algorithm. Please note, this function uses
   pseudo random number generator. The caller must make sure RandomSeed()
-  funtion was properly called before.
+  function was properly called before.
 
   @param[in]  GroupIdentifying number for the ECC group (IANA "Group
-   Description" attribute registrty for RFC 2409).
+   Description" attribute registry for RFC 2409).
   @param[out] PKey Pointer to an object that will hold the ECDH key.
 
   @retval EFI_SUCCESSOn success.
+  @retval EFI_UNSUPPORTEDECC group not supported.
   @retval EFI_PROTOCOL_ERROR On failure.
 **/
 EFI_STATUS
@@ -5466,8 +5469,9 @@ CryptoServiceEcDhKeyFree (
   @param[in]  PKey ECDH Key object.
   @param[out] EcPoint  Properly initialized EC Point to hold the public key.
 
-  @retval EFI_SUCCESSOn success.
-  @retval EFI_PROTOCOL_ERROR On failure.
+  @retval EFI_SUCCESS   On success.
+  @retval EFI_INVALID_PARAMETER EcPoint should be initialized properly.
+  @retval EFI_PROTOCOL_ERROROn failure.
 **/
 EFI_STATUS
 EFIAPI
@@ -5484,15 +5488,20 @@ CryptoServiceEcDhGetPubKey (
 
   @param[in]  PKey   ECDH Key object.
   @param[in]  Group  Identifying number for the ECC group (IANA "Group
- Description" attribute registrty for RFC 2409).
+  

Re: [edk2-devel] [staging/crypto-new-api PATCH] CryptoPkg: Fixed possible security implications in ECDH and BN.

2022-07-14 Thread Heng Luo
Reviewed-by: Heng Luo 

> -Original Message-
> From: Tan, Ming 
> Sent: Friday, July 15, 2022 1:35 PM
> To: devel@edk2.groups.io; Li, Yi1 
> Cc: Luo, Heng 
> Subject: RE: [edk2-devel] [staging/crypto-new-api PATCH] CryptoPkg: Fixed
> possible security implications in ECDH and BN.
> 
> Reviewed-by: Ming Tan 
> 
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of yi1 li
> Sent: Friday, July 15, 2022 1:30 PM
> To: devel@edk2.groups.io
> Cc: Li, Yi1 ; Tan, Ming ; Luo, Heng
> 
> Subject: [edk2-devel] [staging/crypto-new-api PATCH] CryptoPkg: Fixed possible
> security implications in ECDH and BN.
> 
> 1. Origenal code mixes up the input/output parameters for the BN_rshift()
> function - the output is actually the first parameter and not the second one.
> Now we correct BnRShift() param order.
> 
> 2. NID_X9_62_prime192v1() and NID_secp224r1 prohibited by Intel Crypto/TLS
> Guidelines (due to being insufficiently secure). Now we remove those curve.
> 
> 3. ECDH pubilc key check is insufficient and therefore opens the 
> implementation
> up to invalid curve attacks (see e.g.Dragonblood attack report). Need to
> perform the checks described by Appendix D of the NIST SP800-186, or Section
> 5.6.2.3 of NIST SP800-56Ar3. Now we add full public key validating procedures
> to EcDhDeriveSecret().
> 
> 4. Some APIs need more detail comment. Fix some typos and add more detail
> discription for return value.
> 
> Cc: Ming Tan 
> Cc: Heng Luo 
> Signed-off-by: Yi Li 
> 
> ---
>  CryptoPkg/Driver/Crypto.c  | 31 
> -
> --
>  CryptoPkg/Include/Library/BaseCryptLib.h   | 31
> ---
>  CryptoPkg/Library/BaseCryptLib/Bn/CryptBn.c|  7 ---
>  CryptoPkg/Library/BaseCryptLib/Bn/CryptBnNull.c|  4 +++-
>  CryptoPkg/Library/BaseCryptLib/Ec/CryptEc.c| 61
> ++---
>  CryptoPkg/Library/BaseCryptLib/Ec/CryptEcNull.c| 27
> +--
>  CryptoPkg/Library/BaseCryptLibNull/Bn/CryptBnNull.c|  4 +++-
>  CryptoPkg/Library/BaseCryptLibNull/Ec/CryptEcNull.c| 27
> +--
>  CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c | 31
> ---
>  CryptoPkg/Private/Protocol/Crypto.h| 31 
> --
> -
>  10 files changed, 158 insertions(+), 96 deletions(-)
> 
> diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c index
> de422b7f53..10a0ce8800 100644
> --- a/CryptoPkg/Driver/Crypto.c
> +++ b/CryptoPkg/Driver/Crypto.c
> @@ -4962,7 +4962,6 @@ CryptoServiceBigNumValueOne (
>@param[out]  BnRes   The result.
> 
>@retval EFI_SUCCESS  On success.
> -  @retval EFI_OUT_OF_RESOURCES In case of internal allocation failures.
>@retval EFI_PROTOCOL_ERROR   Otherwise.
>  **/
>  EFI_STATUS
> @@ -5051,6 +5050,9 @@ CryptoServiceBigNumContextFree (
> 
>@param[in]   Bn Big number to set.
>@param[in]   ValValue to set.
> +
> +  @retval EFI_SUCCESS  On success.
> +  @retval EFI_PROTOCOL_ERROR   Otherwise.
>  **/
>  EFI_STATUS
>  EFIAPI
> @@ -5092,7 +5094,7 @@ CryptoServiceBigNumAddMod (
>using EcGroupFree() function.
> 
>@param[in]  Group  Identifying number for the ECC group (IANA "Group
> - Description" attribute registrty for RFC 2409).
> + Description" attribute registry for RFC 2409).
> 
>@retval EcGroup object  On success.
>@retval NULLOn failure.
> @@ -5114,8 +5116,8 @@ CryptoServiceEcGroupInit (
> 
>@param[in]  EcGroupEC group object.
>@param[out] BnPrimeGroup prime number.
> -  @param[out] BnAA coofecient.
> -  @param[out] BnBB coofecient.
> +  @param[out] BnAA coefficient.
> +  @param[out] BnBB coefficient.
>@param[in]  BnCtx  BN context.
> 
>@retval EFI_SUCCESSOn success.
> @@ -5426,13 +5428,14 @@ CryptoServiceEcPointSetCompressedCoordinates (
>  /**
>Generate a key using ECDH algorithm. Please note, this function uses
>pseudo random number generator. The caller must make sure RandomSeed()
> -  funtion was properly called before.
> +  function was properly called before.
> 
>@param[in]  GroupIdentifying number for the ECC group (IANA "Group
> -   Description" attribute registrty for RFC 2409).
> +   Description" attribute registry for RFC 2409).
>@param[out] PKey Pointer to an object that will hold the ECDH key.
> 
>@retval EFI_SUCCESSOn success.
> +  @retval EFI_UNSUPPORTEDECC group not supported.
>@retval EFI_PROTOCOL_ERROR On failure.
>  **/
>  EFI_STATUS
> @@ -5466,8 +5469,9 @@ CryptoServiceEcDhKeyFree (
>@param[in]  PKey ECDH Key object.
>@param[out] EcPoint  Properly initialized EC Point to hold the public key.
> 
> -  @retval EFI_SUCCESS   

Re: [edk2-devel] [PATCH v3] UefiPayloadPkg: Add macro to support selective driver in UPL

2022-07-14 Thread Lu, James
Created PR, please help to push
UefiPayloadPkg: Add macro to support selective driver in UPL by jameslu8 * Pull 
Request #3065 * tianocore/edk2 
(github.com)


Thanks,
James

From: Ni, Ray 
Sent: Friday, July 8, 2022 12:47 AM
To: Lu, James ; devel@edk2.groups.io
Cc: Lu, James ; Dong, Guo ; Guo, Gua 

Subject: Re: [PATCH v3] UefiPayloadPkg: Add macro to support selective driver 
in UPL

Reviewed-by: Ray Ni mailto:ray...@intel.com>>

thanks,
ray

From: Lu, James mailto:james...@intel.com>>
Sent: Friday, July 8, 2022 12:15:09 AM
To: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>
Cc: Lu, James mailto:james...@intel.com>>; Dong, Guo 
mailto:guo.d...@intel.com>>; Ni, Ray 
mailto:ray...@intel.com>>; Guo, Gua 
mailto:gua@intel.com>>
Subject: [PATCH v3] UefiPayloadPkg: Add macro to support selective driver in UPL

From: James Lu mailto:james...@intel.com>>

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

Add macros to decide modules built into UPL.elf.

Macro list:
 - GENERIC_MEMORY_TEST_ENABLE: GenericMemoryTestDxe
 - MEMORY_TEST: NullMemoryTestDxe or GenericMemoryDxe
 - ATA_ENABLE: SataControllerDxe, AtaBusDxe
 - SD_ENABLE: SdMmcPciDxe, EmmcDxe, SdDxe
 - PS2_MOUSE_ENABLE: Ps2MouseDxe

Cc: Guo Dong mailto:guo.d...@intel.com>>
Cc: Ray Ni mailto:ray...@intel.com>>
Cc: Gua Guo mailto:gua@intel.com>>
Signed-off-by: James Lu mailto:james...@intel.com>>
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 21 
 UefiPayloadPkg/UefiPayloadPkg.fdf | 14 -
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index cfcf38578d..ec79914f45 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -36,7 +36,16 @@
   DEFINE PLATFORM_BOOT_TIMEOUT= 3

   DEFINE ABOVE_4G_MEMORY  = TRUE

   DEFINE BOOT_MANAGER_ESCAPE  = FALSE

+  DEFINE ATA_ENABLE   = TRUE

+  DEFINE SD_ENABLE= TRUE

+  DEFINE PS2_MOUSE_ENABLE = TRUE

   DEFINE SD_MMC_TIMEOUT   = 100

+

+  #

+  # NULL:NullMemoryTestDxe

+  # GENERIC: GenericMemoryTestDxe

+  #

+  DEFINE MEMORY_TEST  = NULL

   #

   # SBL:  UEFI payload for Slim Bootloader

   # COREBOOT: UEFI payload for coreboot

@@ -596,7 +605,11 @@
   
MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf

   UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf

   MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf

+!if $(MEMORY_TEST) == "GENERIC"

+  
MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/GenericMemoryTestDxe.inf

+!elseif $(MEMORY_TEST) == "NULL"

   MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf

+!endif

   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf

   MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf

   MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf

@@ -631,8 +644,10 @@
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf

   MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf

   FatPkg/EnhancedFatDxe/Fat.inf

+!if $(ATA_ENABLE) == TRUE

   MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf

   MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf

+!endif

   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf

   MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf

   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf

@@ -644,9 +659,11 @@
   #

   # SD/eMMC Support

   #

+!if $(SD_ENABLE) == TRUE

   MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf

   MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf

   MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf

+!endif



   #

   # Usb Support

@@ -671,7 +688,9 @@
 !if $(PS2_KEYBOARD_ENABLE) == TRUE

   MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf

 !endif

+!if $(PS2_MOUSE_ENABLE) == TRUE

   MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf

+!endif



   #

   # Console Support

@@ -742,12 +761,14 @@
   #  This should be FALSE for compiling the dynamic command.

   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE

   }

+!if $(PERFORMANCE_MEASUREMENT_ENABLE) == TRUE

   ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf {

 

   ## This flag is used to control initialization of the shell library

   #  This should be FALSE for compiling the dynamic command.

   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE

   }

+!endif

   ShellPkg/Application/Shell/Shell.inf {

 

   ## This flag is used to control initialization of the shell library

diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf 
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index c7b04978ad..35f79be2f0 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -149,7 +149,11 @@ INF 
PcAtChipsetPkg/PcatRealTimeClockRuntimeD