Re: [edk2-devel] [PATCH 2/2] UefiPayloadPkg: Hook up RNG support

2022-02-23 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Sean
> Rhodes
> Sent: Wednesday, February 23, 2022 14:44
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Patrick Rudolph
> ; Yao, Jiewen ;
> Wang, Jian J ; Ni, Ray ; Ma,
> Maurice ; You, Benjamin
> 
> Subject: [edk2-devel] [PATCH 2/2] UefiPayloadPkg: Hook up RNG support
> 
> From: Patrick Rudolph 
> 
> Hoop Up RNG from SecurityPkg.
> 
> Cc: Jiewen Yao 
> Cc: Jian J Wang 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Patrick Rudolph 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 8 
> UefiPayloadPkg/UefiPayloadPkg.fdf | 4 
>  2 files changed, 12 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 1ce96a51c1..0d4b4da24f 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -703,6 +703,14 @@
> 
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.i
> nf !endif +  #+  # Random Number Generator+  #+
> SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf {+
> +
> RngLib|SecurityPkg/Library/BaseRngLib/BaseRngLib.inf+  }+   
> #--
>    #  Build the shell   #--diff --git
> a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
> index c7b04978ad..6af1a8c8aa 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.fdf
> +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
> @@ -229,6 +229,10 @@ INF
> MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
>  # INF  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf +#
> Random Number Generator+#+INF
> SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf+ # # UEFI
> network modules #--
> 2.32.0
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#86923): https://edk2.groups.io/g/devel/message/86923
> Mute This Topic: https://groups.io/mt/89353219/1773972
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [maurice...@intel.com]
> -=-=-=-=-=-=
> 



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




Re: [edk2-devel] [PATCH] IntelFsp2Pkg: BaseFspSwitchStackLib Support for X64 Build

2022-02-22 Thread Ma, Maurice
Several comments as below:

1.  Need to ensure sufficient space to save IDT
 The following will only reserve 8 bytes on stack to save IDT. It is fine 
for x86, but for x64 mode, the SIDT needs at least 80 bits.  So we might want 
to reserve 16 byte for the changes listed below to void buffer overflow.
 Also it needs to use rsp instead.  
  +sub esp, 8
  +sidt[esp]
  .
  +lidt[esp]
  +add esp, 8

2.  Ensure rsp is always aligned at 8.
 Change:
  +add esp, 4
 To:
  +add rsp, 8

3.  Function prototype needs to be 64bit.  The following comments will need to 
be updated from "UINT32" to "UINTN" to match both x86 and x64 mode.

 
+;--
 +; UINT32
 +; EFIAPI
 +; Pei2LoaderSwitchStack (
 +;   VOID
 +;   )
 +;---

 +
 
+;--
 +; UINT32
 +; EFIAPI
 +; Loader2PeiSwitchStack (
 +;   VOID
 +;   )
 
+;--

 
+;--
 +; UINT32
 +; EFIAPI
 +; FspSwitchStack (
 +;   VOID
 +;   )
 +;-

4.  Need to ensure UEFI x64 calling convention is followed.  UEFI x64 calling 
convention requires "A caller must always call with the stack 16 bytes aligned."
 So before calling SwapStack C function, the rsp needs to be aligned at 16 
bytes.  So please verify if the changes satisfy this requirement.


Regards
Maurice

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ashraf
> Ali S
> Sent: Sunday, February 13, 2022 8:02
> To: devel@edk2.groups.io
> Cc: S, Ashraf Ali ; Chiu, Chasel
> ; Desimone, Nathaniel L
> ; Zeng, Star ; Kuo,
> Ted ; Duggapu, Chinni B
> ; Chaganty, Rangasai V
> ; Solanki, Digant H
> ; V, Sangeetha 
> Subject: [edk2-devel] [PATCH] IntelFsp2Pkg: BaseFspSwitchStackLib Support
> for X64 Build
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3832
> 
> BaseFspSwitchStackLib Currently Support for IA32 build only, adding support
> for X64 build, fix typecasting issues for X64 build.
> 0x_ will be replaced by MAX_ADDRESS which is set based on the
> type of Library which is it building.
> if it's a IA32 MAX_ADDRESS = 0x_
> for X64MAX_ADDRESS = 0x___ULL
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Cc: Kuo Ted 
> Cc: Duggapu Chinni B 
> Cc: Rangasai V Chaganty 
> Cc: Digant H Solanki 
> Cc: Sangeetha V 
> 
> Signed-off-by: Ashraf Ali S 
> ---
>  IntelFsp2Pkg/FspSecCore/SecFsp.h  |   3 +-
>  IntelFsp2Pkg/FspSecCore/SecFspApiChk.c|  10 +-
>  .../BaseFspSwitchStackLib.inf |   7 +-
>  .../BaseFspSwitchStackLib/X64/Stack.nasm  | 124 ++
>  4 files changed, 136 insertions(+), 8 deletions(-)  create mode 100644
> IntelFsp2Pkg/Library/BaseFspSwitchStackLib/X64/Stack.nasm
> 
> diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.h
> b/IntelFsp2Pkg/FspSecCore/SecFsp.h
> index aacd32f7f7..9a6fc14d23 100644
> --- a/IntelFsp2Pkg/FspSecCore/SecFsp.h
> +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.h
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
> +  Copyright (c) 2014 - 2022, Intel Corporation. All rights
> + reserved.
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -10,6 +10,7 @@
> 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
> b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
> index 7d6ef11fe7..b70d3ffcf1 100644
> --- a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
> +++ b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -  Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.
> +  Copyright (c) 2016 - 2022, Intel Corporation. All rights
> + reserved.
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -31,7 +31,7 @@ FspApiCallingCheck (
>  //
>  // NotifyPhase check
>  //
> -if ((FspData == NULL) || ((UINT32)FspData == 0x)) {
> +if ((FspData == NULL) || ((UINTN)FspData == MAX_ADDRESS)) {
>Status = EFI_UNSUPPORTED;
>  } else {
>if (FspData->Signature != FSP_GLOBAL_DATA_SIGNATURE) { @@ -42,7
> +42,7 @@ FspApiCallingCheck (
>  //
>  // FspMemoryInit check
>  //
> -if ((UINT32)FspData != 0x) {
> +if ((UINTN)FspData != MAX_ADDRESS) {
>Status = EFI_UNSUPPORTED;
>  } else if (EFI_ERROR (FspUpdSignatureCheck (ApiIdx, ApiParam))) {
>Status = EFI_INVALID_PARAMETER;
> @@ -51,7 +51,7 @@ FspApiCallingCheck (
>  //
>  // TempRamExit check
>  //
> -if ((FspData == NULL) || ((UINT32)FspData == 0x)) {
> +if ((FspData == NULL) || 

Re: [edk2-devel] [PATCH 2/2] UefiPayloadPkg: Hookup SD/MMC timeout

2022-02-18 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: Sean Rhodes 
> Sent: Friday, February 18, 2022 6:52
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Rhodes, Sean ;
> Ni, Ray ; Ma, Maurice ; You,
> Benjamin 
> Subject: [PATCH 2/2] UefiPayloadPkg: Hookup SD/MMC timeout
> 
> Hook SD_MMC_TIMEOUT build option to SdMmcGenericTimeoutValue PCD.
> 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Sean Rhodes 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 1ce96a51c1..23c2787a94 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -33,6 +33,7 @@
>DEFINE UNIVERSAL_PAYLOAD= FALSE
> 
>DEFINE SECURITY_STUB_ENABLE = TRUE
> 
>DEFINE SMM_SUPPORT  = FALSE
> 
> +  DEFINE SD_MMC_TIMEOUT   = 100
> 
>#
> 
># SBL:  UEFI payload for Slim Bootloader
> 
># COREBOOT: UEFI payload for coreboot
> 
> @@ -398,6 +399,7 @@
>  !if $(PERFORMANCE_MEASUREMENT_ENABLE)
> 
>gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask   | 0x1
> 
>  !endif
> 
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|$(SD_MM
> C_TIMEOUT)
> 
> 
> 
>  [PcdsPatchableInModule.X64]
> 
> 
> gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)
> 
> --
> 2.32.0



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




Re: [edk2-devel] [PATCH 2/2] UefiPayloadPkg: Hookup SD Card timeout

2022-02-18 Thread Ma, Maurice
This patch depends on other changes in MdeModulePkg to add a new 
SdMmcGenericTimeoutValue PCD.   
The changes for UefiPayloadPkg look fine to me.

One minor comment is about the macro name.  Is this new introduced timeout PCD 
applicable to both SD and MMC device?
If so, "SD_CARD_TIMEOUT" might not be accurate to cover the MMC device.  Maybe 
use "SD_MMC_TIMEOUT" ?

Thanks,
Maurice

> -Original Message-
> From: Sean Rhodes 
> Sent: Thursday, February 17, 2022 23:24
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Rhodes, Sean ;
> Ni, Ray ; Ma, Maurice ; You,
> Benjamin 
> Subject: [PATCH 2/2] UefiPayloadPkg: Hookup SD Card timeout
> 
> Hook SD_CARD_TIMEOUT build option to SdMmcGenericTimeoutValue PCD.
> 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Sean Rhodes 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 1ce96a51c1..d75fe26426 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -33,6 +33,7 @@
>DEFINE UNIVERSAL_PAYLOAD= FALSE
> 
>DEFINE SECURITY_STUB_ENABLE = TRUE
> 
>DEFINE SMM_SUPPORT  = FALSE
> 
> +  DEFINE SD_CARD_TIMEOUT  = 100
> 
>#
> 
># SBL:  UEFI payload for Slim Bootloader
> 
># COREBOOT: UEFI payload for coreboot
> 
> @@ -398,6 +399,7 @@
>  !if $(PERFORMANCE_MEASUREMENT_ENABLE)
> 
>gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask   | 0x1
> 
>  !endif
> 
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|$(SD_CAR
> D_TIMEOUT)
> 
> 
> 
>  [PcdsPatchableInModule.X64]
> 
> 
> gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)
> 
> --
> 2.32.0



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




Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add i801 SMBus controller DXE

2022-02-17 Thread Ma, Maurice
This vendor specific device driver implementation does not seem to fit into 
UEFI payload package scope well.   

Do you think https://github.com/tianocore/edk2-platforms/tree/master/Silicon 
could be a better location ?

Thanks
Maurice
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Sean
> Rhodes
> Sent: Thursday, February 17, 2022 9:51
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Patrick Rudolph
> ; Ni, Ray ; Ma,
> Maurice ; You, Benjamin
> 
> Subject: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add i801 SMBus
> controller DXE
> 
> From: Patrick Rudolph 
> 
> Implement a subset of the gEfiSmbusHcProtocolGuid using a generic PCI i801
> SMBus controller.
> 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Patrick Rudolph 
> ---
>  .../Library/BrotliCustomDecompressLib/brotli  |   2 +-
>  UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c| 556
> ++
>  UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.h|  17 +
>  UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.inf  |  45 ++
>  UefiPayloadPkg/UefiPayloadPkg.dsc |   7 +
>  UefiPayloadPkg/UefiPayloadPkg.fdf |   5 +
>  6 files changed, 631 insertions(+), 1 deletion(-)  create mode 100644
> UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
>  create mode 100644 UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.h
>  create mode 100644 UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.inf
> 
> diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> index f4153a09f8..666c3280cc 16
> --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> @@ -1 +1 @@
> -Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
> +Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
> diff --git a/UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> b/UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> new file mode 100644
> index 00..7bf7b893ad
> --- /dev/null
> +++ b/UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> @@ -0,0 +1,556 @@
> +/** @file+  Implementation for a generic i801 SMBus driver.++Copyright (c)
> 2016, Intel Corporation. All rights reserved.+SPDX-License-Identifier:
> BSD-2-Clause-Patent+++**/++#include "SMBusi801Dxe.h"+#include
> +#include +#include
> +#include +#include
> +#include
> ++EFI_HANDLE  mDriverHandle =
> NULL;+UINT32  PciDevice = 0;++/* SMBus register offsets. */+#define
> SMBHSTSTAT  0x0+#define SMBHSTCTL   0x2+#define SMBHSTCMD
> 0x3+#define SMBXMITADD  0x4+#define SMBHSTDAT0  0x5+#define
> SMBHSTDAT1  0x6+#define SMBBLKDAT   0x7+#define SMBTRNSADD
> 0x9+#define SMBSLVDATA  0xa+#define SMLINK_PIN_CTL  0xe+#define
> SMBUS_PIN_CTL   0xf+#define SMBSLVCMD   0x11++/* I801 command
> constants */+#define I801_QUICK   (0 << 2)+#define I801_BYTE  
>   (1
> << 2)+#define I801_BYTE_DATA   (2 << 2)+#define I801_WORD_DATA   (3
> << 2)+#define I801_PROCESS_CALL(4 << 2)+#define I801_BLOCK_DATA
> (5 << 2)+#define I801_I2C_BLOCK_DATA  (6 << 2) /* ICH5 and later */++/*
> I801 Host Control register bits */+#define SMBHSTCNT_INTREN (1 <<
> 0)+#define SMBHSTCNT_KILL   (1 << 1)+#define SMBHSTCNT_LAST_BYTE
> (1 << 5)+#define SMBHSTCNT_START  (1 << 6)+#define
> SMBHSTCNT_PEC_EN (1 << 7)/* ICH3 and later */++/* I801 Hosts Status
> register bits */+#define SMBHSTSTS_BYTE_DONE (1 << 7)+#define
> SMBHSTSTS_INUSE_STS (1 << 6)+#define SMBHSTSTS_SMBALERT_STS  (1
> << 5)+#define SMBHSTSTS_FAILED(1 << 4)+#define
> SMBHSTSTS_BUS_ERR   (1 << 3)+#define SMBHSTSTS_DEV_ERR   (1 <<
> 2)+#define SMBHSTSTS_INTR  (1 << 1)+#define SMBHSTSTS_HOST_BUSY
> (1 << 0)++/* For SMBXMITADD register. */+#define XMIT_WRITE(dev)
> (((dev) << 1) | 0)+#define XMIT_READ(dev)   (((dev) << 1) |
> 1)++STATIC+UINT16+EFIAPI+SmbusGetSMBaseAddress (+  IN VOID+  )+{+
> UINT16  Cmd;+  UINT32  Reg32;+  UINT16  IoBase;++  IoBase = 0;+  //+  // Test
> if I/O decoding is enabled+  //+  Cmd = PciRead16 (PciDevice + 0x4);+  if
> (!(Cmd & 1)) {+goto CloseAndReturn;+  }++  //+  // Test if BAR0 is I/O bar
> and enabled+  //+  Reg32 = PciRead16 (PciDevice + 0x20);+  if (!(Reg32 & 1)
> || !(Reg32 & 0xfffc) || ((Reg32 & 0xfffc) == 0xfffc)) {+goto
> CloseAndReturn;+  }++  IoBase = Reg32 & 0xfffc;++CloseAndReturn:+  return
> IoBase;+}++STATIC+EFI_STATUS+SmbusSetupCommand (+  IN UINT16
> IoBase,+  IN UINT8   Ctrl,+  IN UINT8   Xmitadd+  )+{+  UINTN  Loops = 1;+
> UINT8  host_busy;++  do {+MicroSecond

Re: [edk2-devel] [edk2-platform][PATCH] UefiPayloadPkg: Fix PciHostBridgeLib

2022-02-16 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: Patrick Rudolph 
> Sent: Monday, February 7, 2022 2:01
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Ma, Maurice ; You,
> Benjamin ; Dong, Guo 
> Subject: [edk2-platform][PATCH] UefiPayloadPkg: Fix PciHostBridgeLib
> 
> On modern platforms with TBT devices the coreboot resource allocator
> opens large PCI bridge MMIO windows above 4GiB to place hotplugable PCI
> BARs there as they won't fit below 4GiB. In addition modern GPGPU devices
> have very big PCI bars that doesn't fit below 4GiB.
> 
> The PciHostBridgeLib made lots of assumptions about the coreboot resource
> allocator that were not verified at runtime and are no longer true.
> 
> Remove all of the 'coreboot specific' code and implement the same logic as
> OvmfPkg's ScanForRootBridges.
> 
> Fixes assertion
> "ASSERT [PciHostBridgeDxe] Bridge->Mem.Limit < 0x0001ULL".
> 
> Tested with coreboot as bootloader on platforms that have PCI resources
> above 4GiB and on platforms that don't have resources above 4GiB.
> 
> Signed-off-by: Patrick Rudolph 
> ---
>  UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c | 137 +++-
> 
>  1 file changed, 18 insertions(+), 119 deletions(-)
> 
> diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
> b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
> index bf2d10f4bf..8a890b6b53 100644
> --- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
> +++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
> @@ -18,92 +18,6 @@
>  #include  #include "PciHostBridge.h" -/**-  Adjust the
> collected PCI resource.--  @param[in]  Io   IO aperture.--  
> @param[in]
> Mem  MMIO aperture.--  @param[in]  MemAbove4G   MMIO
> aperture above 4G.--  @param[in]  PMem Prefetchable MMIO
> aperture.--  @param[in]  PMemAbove4G  Prefetchable MMIO aperture
> above 4G.-**/-VOID-AdjustRootBridgeResource (-  IN
> PCI_ROOT_BRIDGE_APERTURE  *Io,-  IN  PCI_ROOT_BRIDGE_APERTURE
> *Mem,-  IN  PCI_ROOT_BRIDGE_APERTURE  *MemAbove4G,-  IN
> PCI_ROOT_BRIDGE_APERTURE  *PMem,-  IN  PCI_ROOT_BRIDGE_APERTURE
> *PMemAbove4G-  )-{-  UINT64  Mask;--  //-  // For now try to downgrade
> everything into MEM32 since-  // - coreboot does not assign resource above
> 4GB-  // - coreboot might allocate interleaved MEM32 and PMEM32
> resource-  //   in some cases-  //-  if (PMem->Base < Mem->Base) {-Mem-
> >Base = PMem->Base;-  }--  if (PMem->Limit > Mem->Limit) {-Mem->Limit
> = PMem->Limit;-  }--  PMem->Base  = MAX_UINT64;-  PMem->Limit = 0;--  if
> (MemAbove4G->Base < 0x1ULL) {-if (MemAbove4G->Base <
> Mem->Base) {-  Mem->Base = MemAbove4G->Base;-}--if
> (MemAbove4G->Limit > Mem->Limit) {-  Mem->Limit = MemAbove4G-
> >Limit;-}--MemAbove4G->Base  = MAX_UINT64;-MemAbove4G->Limit
> = 0;-  }--  if (PMemAbove4G->Base < 0x1ULL) {-if
> (PMemAbove4G->Base < Mem->Base) {-  Mem->Base = PMemAbove4G-
> >Base;-}--if (PMemAbove4G->Limit > Mem->Limit) {-  Mem->Limit =
> PMemAbove4G->Limit;-}--PMemAbove4G->Base  = MAX_UINT64;-
> PMemAbove4G->Limit = 0;-  }--  //-  // Align IO  resource at 4K  boundary-  
> //-
> Mask  = 0xFFFULL;-  Io->Limit = ((Io->Limit + Mask) & ~Mask) - 1;-  if 
> (Io-
> >Base != MAX_UINT64) {-Io->Base &= ~Mask;-  }--  //-  // Align MEM
> resource at 1MB boundary-  //-  Mask   = 0xFULL;-  Mem->Limit =
> ((Mem->Limit + Mask) & ~Mask) - 1;-  if (Mem->Base != MAX_UINT64) {-
> Mem->Base &= ~Mask;-  }-}- /**   Probe a bar is existed or not. @@ -114,28
> +28,24 @@ AdjustRootBridgeResource (
>  STATIC VOID PcatPciRootBridgeBarExisted (-  IN  UINT64  Address,+  IN
> UINTN   Address,   OUT UINT32  *OriginalValue,   OUT UINT32  *Value   ) {-
> UINTN  PciAddress;--  PciAddress = (UINTN)Address;-   //   // Preserve the
> original value   //-  *OriginalValue = PciRead32 (PciAddress);+  
> *OriginalValue
> = PciRead32 (Address);//   // Disable timer interrupt while the BAR is
> probed   //   DisableInterrupts (); -  PciWrite32 (PciAddress, 0x);-
> *Value = PciRead32 (PciAddress);-  PciWrite32 (PciAddress, *OriginalValue);+
> PciWrite32 (Address, 0x);+  *Value = PciRead32 (Address);+
> PciWrite32 (Address, *OriginalValue);//   // Enable interrupt@@ -179,9
> +89,7 @@ PcatPciRootBridgeParseBars (
>IN UINTN BarOffsetEnd,   IN PCI_ROOT_BRIDGE_APERTURE  
> *Io,
> IN PCI_ROOT_BRIDGE_APERTU

Re: [edk2-devel] [Patch V2 1/1] UefiPayloadPkg/PayloadLoaderPeim: Force UINTN before save Ptr

2022-02-10 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: Jiang, Guomin 
> Sent: Wednesday, February 9, 2022 19:03
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Ni, Ray ; Ma,
> Maurice ; You, Benjamin 
> Subject: [Patch V2 1/1] UefiPayloadPkg/PayloadLoaderPeim: Force UINTN
> before save Ptr
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3818
> 
> It will have some potential issue when memory larger than 2G because the high
> memory address will be fill with 0x when do the operation of UINT64 +
> INTN.
> 
> V2:
> 1. Force the data type to UINTN to avoid high dword be filled with 0x 
> 2.
> Keep INTN because the offset may postive or negative.
> 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Guomin Jiang 
> ---
>  UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> index dc47a05c6e4a..68200fcadd3f 100644
> --- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> +++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> @@ -143,7 +143,7 @@ ProcessRelocation64 (
>DEBUG ((DEBUG_INFO, "Unsupported relocation type %02X\n", Type));
>ASSERT (FALSE);
>  } else {
> -  *Ptr += Delta;
> +  *Ptr = *(UINTN *)Ptr + Delta;
>  }
> 
>  break;
> @@ -177,12 +177,12 @@ ProcessRelocation64 (
>// Calculation: B + A
>//
>if (RelaType == SHT_RELA) {
> -*Ptr = Delta + Rela->r_addend;
> +*Ptr = Delta + (UINTN)Rela->r_addend;
>} else {
>  //
>  // A is stored in the field of relocation for REL type.
>  //
> -*Ptr = Delta + *Ptr;
> +*Ptr = Delta + *(UINTN *)Ptr;
>}
>  } else {
>//
> --
> 2.30.0.windows.2



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




Re: [edk2-devel] [PATCH 1/1] UefiPayloadPkg/PayloadLoaderPeim: Replace Delta type INTN with UINTN

2022-02-01 Thread Ma, Maurice
Shouldn't "Delta" be INTN type ?  It can be either positive or negative, right ?

For the case you explained below,  I think the caller should pass in INTN type 
instead of UINTN.  
So maybe a better fix is to change  "UINTNDelta" to "INTN   Delta" in the 
caller function RelocateElf64Sections() inside file 
UefiPayloadPkg\PayloadLoaderPeim\ElfLib\Elf64Lib.c.

Thanks
Maurice

> -Original Message-
> From: Jiang, Guomin 
> Sent: Saturday, January 29, 2022 0:31
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Ni, Ray ; Ma,
> Maurice ; You, Benjamin
> 
> Subject: [PATCH 1/1] UefiPayloadPkg/PayloadLoaderPeim: Replace Delta
> type INTN with UINTN
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3818
> 
> ProcessRelocation64 use INTN  Delta. However it force it to UINTN when call
> it.
> 
> It will have some potential issue when memory larger than 2G because the
> high memory address will be fill with 0x if use INTN.
> 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Guomin Jiang 
> ---
>  UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> index dc47a05c6e4a..ee530322d7ed 100644
> --- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> +++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
> @@ -108,7 +108,7 @@ ProcessRelocation64 (
>IN  UINT64  RelaSize,
>IN  UINT64  RelaEntrySize,
>IN  UINT64  RelaType,
> -  IN  INTNDelta,
> +  IN  UINTN   Delta,
>IN  BOOLEAN DynamicLinking
>)
>  {
> --
> 2.30.0.windows.2



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




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default.

2022-01-14 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: Liu, Zhiguang 
> Sent: Thursday, January 13, 2022 22:15
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Ni, Ray ; Ma,
> Maurice ; You, Benjamin
> 
> Subject: [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default.
> 
> For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter.
> This is recommended way to get the time, and also how BaseCpuTimerLib
> works However, some CPU doesn't support this feature, so disable it by
> default.
> 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Zhiguang Liu 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 3d08edfe31..65c1bd610e 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -111,6 +111,11 @@
>DEFINE SERIAL_DRIVER_ENABLE = TRUE   DEFINE
> PERFORMANCE_MEASUREMENT_ENABLE  = FALSE +  # For recent X86 CPU,
> 0x15 CPUID instruction will return Time Stamp Counter.+  # This is
> recommended way to get the time, and also how BaseCpuTimerLib works.+
> # However, some CPU doesn't support this feature, so disable it by default.+
> DEFINE CPU_TIMER_LIB_ENABLE  = FALSE+ [BuildOptions]
> *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
> GCC:*_UNIXGCC_*_CC_FLAGS   = -DMDEPKG_NDEBUG@@ -217,7 +222,7
> @@
>#   # Platform   #-!if $(UNIVERSAL_PAYLOAD) == TRUE+!if
> $(CPU_TIMER_LIB_ENABLE) == TRUE
> TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf !else
> TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf--
> 2.32.0.windows.2



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




Re: [edk2-devel] [PATCH] UefiPayloadPkg/PayloadEntry: Inherit 4/5-level paging from bootloader

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


> -Original Message-
> From: Ni, Ray 
> Sent: Friday, August 6, 2021 1:16
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Ma, Maurice
> ; You, Benjamin 
> Subject: [PATCH] UefiPayloadPkg/PayloadEntry: Inherit 4/5-level paging from
> bootloader
> 
> The patch removes the dep on PcdUse5LevelPageTable.
> Now the payload inherits the 5-level paging setting from bootloader in IA-32e
> mode and uses 4-level paging in legacy protected mode.
> 
> This fix the potential issue when bootloader enables 5-level paging but 64bit
> payload sets 4-level page table to CR3 resulting CPU exception because
> PcdUse5LevelPageTable is FALSE.
> 
> Signed-off-by: Ray Ni 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> ---
>  .../UefiPayloadEntry/UefiPayloadEntry.inf |  1 -
>  .../UniversalPayloadEntry.inf |  1 -
>  .../UefiPayloadEntry/X64/VirtualMemory.c  | 38 ---
>  3 files changed, 16 insertions(+), 24 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> index 8d42925fcd..9b6fab66a1 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
> @@ -80,7 +80,6 @@
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask
> ## CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask   ##
> CONSUMES   gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard
> ## CONSUMES-
> gEfiMdeModulePkgTokenSpaceGuid.PcdUse5LevelPageTable  ##
> SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase##
> CONSUMES   gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize
> ## CONSUMES diff --git
> a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> index 416a620598..aae62126e9 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
> @@ -85,7 +85,6 @@
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask
> ## CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask   ##
> CONSUMES   gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard
> ## CONSUMES-
> gEfiMdeModulePkgTokenSpaceGuid.PcdUse5LevelPageTable  ##
> SOMETIMES_CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase##
> CONSUMES   gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize
> ## CONSUMES diff --git
> a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
> b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
> index a1c4ad6ff4..9daa46c12c 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
> @@ -15,7 +15,7 @@
>  2) IA-32 Intel(R) Architecture Software Developer's Manual Volume
> 2:Instruction Set Reference, Intel 3) IA-32 Intel(R) Architecture Software
> Developer's Manual Volume 3:System Programmer's Guide, Intel -Copyright
> (c) 2006 - 2020, Intel Corporation. All rights reserved.+Copyright (c) 
> 2006
> - 2021, Intel Corporation. All rights reserved. Copyright (c) 2017, AMD
> Incorporated. All rights reserved.  SPDX-License-Identifier: BSD-2-
> Clause-Patent@@ -668,7 +668,6 @@ CreateIdentityMappingPageTables (
>) {   UINT32RegEax;-
> CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX   EcxFlags;   UINT32
> RegEdx;   UINT8 PhysicalAddressBits;
> EFI_PHYSICAL_ADDRESS  PageAddress;@@ -687,7 +686,7 @@
> CreateIdentityMappingPageTables (
>UINTN TotalPagesNum;   UINTN
> BigPageAddress;   VOID  *Hob;-  
> BOOLEAN
> Page5LevelSupport;+  BOOLEAN   
> Enable5LevelPaging;
> BOOLEAN   Page1GSupport;   
> PAGE_TABLE_1G_ENTRY
> *PageDirectory1GEntry;   UINT64
> AddressEncMask;@@ -
> 730,18 +729,16 @@ CreateIdentityMappingPageTables (
>  }   } -  Page5LevelSupport = FALSE;-  if (PcdGetBool
> (PcdUse5LevelPageTable)) {-AsmCpuidEx (-
> CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS,
> CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO, NULL,-
> , NULL, NULL-  );-if (EcxFlags.Bits.FiveLevelPage != 
> 0) {-
> Page5LevelSupport = TRUE;-}-  }+  //+  // Check CR4.LA57[bit12] to
> determin whether 5-Level Paging is enabled.+  // Because this code runs at
> both IA-32e (64bi

Re: [edk2-devel] [PATCH V3 10/29] UefiPayloadPkg: PreparePrepare UefiPayloadPkg to use TdxLib

2021-11-01 Thread Ma, Maurice
Minor comment on the subject "PreparePrepare UefiPayloadPkg to use TdxLib".
Duplicated "Prepare" ?  
Otherwise, looks good to me.

Reviewed-by: Maurice Ma 

> -Original Message-
> From: Xu, Min M 
> Sent: Monday, November 1, 2021 6:16
> To: devel@edk2.groups.io
> Cc: Xu, Min M ; Dong, Guo ; Ni,
> Ray ; Ma, Maurice ; You,
> Benjamin ; Yao, Jiewen ;
> Gerd Hoffmann 
> Subject: [PATCH V3 10/29] UefiPayloadPkg: PreparePrepare UefiPayloadPkg
> to use TdxLib
> 
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429
> 
> TdxLib is included in BaseXApicX2ApicLib. To prevent any build breakage,
> update the UefiPayloadPkg.dsc to include the TdxLib library.
> 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Cc: Jiewen Yao 
> Cc: Gerd Hoffmann 
> Signed-off-by: Min Xu 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 0df5f827c903..e3b6135382ee 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -260,6 +260,7 @@
> 
> VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLi
> b.inf
> 
> VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Va
> riablePolicyHelperLib.inf
>VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
> +  TdxLib|MdePkg/Library/TdxLib/TdxLib.inf
> 
>  [LibraryClasses.common.SEC]
>HobLib|UefiPayloadPkg/Library/PayloadEntryHobLib/HobLib.inf
> --
> 2.29.2.windows.2



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




Re: [edk2-devel] [PATCH] IntelFsp2Pkg/SplitFspBin.py: adopt FSP 2.3 specification.

2021-10-26 Thread Ma, Maurice
Reviewed-by: Maurice Ma 


> -Original Message-
> From: Chiu, Chasel 
> Sent: Tuesday, October 26, 2021 1:06
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Ma, Maurice
> ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: [PATCH] IntelFsp2Pkg/SplitFspBin.py: adopt FSP 2.3 specification.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3705
> 
> FSP 2.3 has updated FSP_INFO_HEADER to support ExtendedImageRevision
> and SplitFspBin.py needs to support it.
> 
> Also updated script to display integer value basing on length.
> 
> Cc: Maurice Ma 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Signed-off-by: Chasel Chiu 
> ---
>  IntelFsp2Pkg/Tools/SplitFspBin.py | 66
> --
>  1 file changed, 44 insertions(+), 22 deletions(-)
> 
> diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py
> b/IntelFsp2Pkg/Tools/SplitFspBin.py
> index 24272e82af..20e329a76e 100644
> --- a/IntelFsp2Pkg/Tools/SplitFspBin.py
> +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py
> @@ -1,6 +1,6 @@
>  ## @ FspTool.py #-# Copyright (c) 2015 - 2020, Intel Corporation. All rights
> reserved.+# Copyright (c) 2015 - 2021, Intel Corporation. All rights
> reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##@@ -
> 103,26 +103,29 @@ class FSP_COMMON_HEADER(Structure):
>   class FSP_INFORMATION_HEADER(Structure):  _fields_ = [-
> ('Signature',ARRAY(c_char, 4)),-('HeaderLength', 
> c_uint32),-
> ('Reserved1',c_uint16),-('SpecVersion',  
> c_uint8),-
> ('HeaderRevision',   c_uint8),-('ImageRevision',
> c_uint32),-
> ('ImageId',  ARRAY(c_char, 8)),-('ImageSize',
> c_uint32),-
> ('ImageBase',c_uint32),-('ImageAttribute',   
> c_uint16),-
> ('ComponentAttribute',   c_uint16),-('CfgRegionOffset',  
> c_uint32),-
> ('CfgRegionSize',c_uint32),-('Reserved2',
> c_uint32),-
> ('TempRamInitEntryOffset', c_uint32),-('Reserved3',
> c_uint32),-('NotifyPhaseEntryOffset', c_uint32),-
> ('FspMemoryInitEntryOffset',   c_uint32),-('TempRamExitEntryOffset',
> c_uint32),-('FspSiliconInitEntryOffset',  c_uint32)+
> ('Signature',
> ARRAY(c_char, 4)),+('HeaderLength',   c_uint32),+
> ('Reserved1',  c_uint16),+('SpecVersion', 
>c_uint8),+
> ('HeaderRevision', c_uint8),+('ImageRevision',
> c_uint32),+('ImageId',ARRAY(c_char, 8)),+ 
>('ImageSize',
> c_uint32),+('ImageBase',  c_uint32),+
> ('ImageAttribute',
> c_uint16),+('ComponentAttribute', c_uint16),+
> ('CfgRegionOffset',c_uint32),+('CfgRegionSize',
> c_uint32),+('Reserved2',  c_uint32),+
> ('TempRamInitEntryOffset', c_uint32),+('Reserved3',
> c_uint32),+('NotifyPhaseEntryOffset', c_uint32),+
> ('FspMemoryInitEntryOffset',   c_uint32),+
> ('TempRamExitEntryOffset',
> c_uint32),+('FspSiliconInitEntryOffset',  c_uint32),+
> ('FspMultiPhaseSiInitEntryOffset', c_uint32),+
> ('ExtendedImageRevision',
> c_uint16),+('Reserved4',  c_uint16) ]  class
> FSP_PATCH_TABLE(Structure):@@ -390,7 +393,26 @@ def OutputStruct (obj,
> indent = 0, plen = 0):
>  if IsStrType (val): rep = HandleNameStr (val)
>  elif
> IsIntegerType (val):-rep = '0x%X' % val+if 
> (key ==
> 'ImageRevision'):+FspImageRevisionMajor   = ((val >> 
> 24) &
> 0xFF)+FspImageRevisionMinor   = ((val >> 16) & 0xFF)+
> FspImageRevisionRevision= ((val >> 8) & 0xFF)+
> FspImageRevisionBuildNumber = (val & 0xFF)+rep = '0x%08X' 
> %
> val+elif (key == 'ExtendedImageRevision'):+
> FspImageRevisionRevision|= (val & 0xFF00)+
> FspImageRevisionBuildNumber |= ((val << 8) & 0xFF00)+rep =
> "0x%04X ('%02X.%02X.%04X.%04X')" % (val, FspImageRevisionMajor,
> FspImageRevisionMinor, FspImageRevisionRevision,
> FspImageRevisionBuildNumber)+elif field[1] == c_uint64:+
> rep = '0x%016X' % val+elif field[1] == c_uint32:+ 
>rep =
> '0x%08X' % val+elif field[1] == c_uint16:+
> rep = '0x%04X' %
> val+elif field[1] == c_uint8:+rep = 
&

Re: [edk2-devel] [`edk2-devel][PATCH v2] UefiPayloadPkg: Fix ECC reported issues

2021-10-18 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Guo
> Dong
> Sent: Friday, October 15, 2021 16:35
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Ni, Ray ; Ma,
> Maurice ; You, Benjamin
> 
> Subject: [edk2-devel] [`edk2-devel][PATCH v2] UefiPayloadPkg: Fix ECC
> reported issues
> 
> From: Guo Dong 
> 
> V2: Fix more header files on #ifdef variable
> 
> ECC reported some issues on UefiPayloadPkg, this patch fixed most of them
> except several files including ElfLib\Elf32.h, coreboot.h, CbParseLib.c, etc.
> It also removed unused functions in ResetSystemLib and Hob.c.
> 
> Signed-off-by: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> ---
>  UefiPayloadPkg/Include/Coreboot.h   |  1 +
>  UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h |  4 ++--
>  UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h |  4 ++--
>  UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h|  4 ++--
>  UefiPayloadPkg/Include/Guid/SystemTableInfoGuid.h   |  4 ++--
>  UefiPayloadPkg/Include/Library/BlParseLib.h |  8 
> 
>  UefiPayloadPkg/Include/Library/DxeHobListLib.h  |  4 ++--
>  UefiPayloadPkg/Include/Library/PlatformSupportLib.h |  4 ++--
>  UefiPayloadPkg/Library/CbParseLib/CbParseLib.c  | 22
> +++---
>  UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c|  6
> ++
>  UefiPayloadPkg/Library/PayloadEntryHobLib/Hob.c | 28 
> ++-
> -
>  UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h |  4 ++--
>  UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c  |  4 ++--
>  UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c  | 15
> ++-
>  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c |
> 4 
> UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h |
> 6 +++---
>  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h |  4
> ++--
>  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c|  2 +-
>  UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c  | 16 
> ---
> -
>  UefiPayloadPkg/Library/SblParseLib/SblParseLib.c|  2 +-
>  UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c   |  2 +-
>  UefiPayloadPkg/UefiPayloadEntry/PrintHob.c  | 17
> -
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c  |  2 ++
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h  | 10 
> +--
> ---
>  UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 20
> +---
>  25 files changed, 98 insertions(+), 99 deletions(-)
> 
> diff --git a/UefiPayloadPkg/Include/Coreboot.h
> b/UefiPayloadPkg/Include/Coreboot.h
> index 8a6c300cde..86e14a1a4d 100644
> --- a/UefiPayloadPkg/Include/Coreboot.h
> +++ b/UefiPayloadPkg/Include/Coreboot.h
> @@ -245,5 +245,6 @@ struct cb_cbmem_tab {
>(void *)(((UINT8 *) (_rec)) + sizeof(*(_rec)) \ + 
> (sizeof((_rec)->map[0]) *
> (_idx))) +typedef struct cb_memory  CB_MEMORY;  #endif //
> _COREBOOT_PEI_H_INCLUDED_diff --git
> a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> b/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> index 043b748ae4..2ff0677165 100644
> --- a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> +++ b/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> @@ -6,8 +6,8 @@
>   **/ -#ifndef __ACPI_BOARD_INFO_GUID_H__-#define
> __ACPI_BOARD_INFO_GUID_H__+#ifndef
> ACPI_BOARD_INFO_GUID_H_+#define ACPI_BOARD_INFO_GUID_H_  ///
> /// Board information GUIDdiff --git
> a/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
> b/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
> index 99187e8037..a62002ebbe 100644
> --- a/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
> +++ b/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
> @@ -6,8 +6,8 @@
>   **/ -#ifndef __MEMORY_MAP_INFO_GUID_H__-#define
> __MEMORY_MAP_INFO_GUID_H__+#ifndef
> MEMORY_MAP_INFO_GUID_H_+#define MEMORY_MAP_INFO_GUID_H_
> #include  diff --git
> a/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
> b/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
> index a15d5b8671..10197134a3 100644
> --- a/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
> +++ b/UefiPayloadPkg/Include/Guid/SerialPortInfoGuid.h
> @@ -6,8 +6,8 @@
>   **/ -#ifndef __SERIAL_PORT_INFO_GUID_H__-#define
> __SERIAL_PORT_INFO_GUID_H__+#ifndef
> SERIAL_PORT_INFO_GUID_H_+#def

Re: [edk2-devel] [`edk2-devel][PATCH V2] UefiPayloadPkg: Fix the build issue for coreboot

2021-10-15 Thread Ma, Maurice
There is a typo ' failue' in the commit message.   Other than that, looks good.

Reviewed-by: Maurice Ma 

> -Original Message-
> From: Dong, Guo 
> Sent: Thursday, October 14, 2021 22:08
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Ni, Ray ; Ma,
> Maurice ; You, Benjamin
> 
> Subject: [`edk2-devel][PATCH V2] UefiPayloadPkg: Fix the build issue for
> coreboot
> 
> From: Guo Dong 
> 
> V2: Fix GCC build issue.
> 
> There is typo in previous change caused coreboot build failue.
> This patch fixed the build issue.
> 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Guo Dong 
> ---
>  UefiPayloadPkg/Library/CbParseLib/CbParseLib.c | 4 ++--
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 4 +++-
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> index f81aa0f301..4be5d66ba5 100644
> --- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> +++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> @@ -194,8 +194,8 @@ GetParameterBase (
>  return NULL;
> 
>}
> 
> 
> 
> -  PcdSet64S (PcdBootloaderParameter, (UINTN)CbTablePtr);
> 
> -  ASSERT_EFI_STATUS (Status);
> 
> +  Status = PcdSet64S (PcdBootloaderParameter, (UINTN)CbTablePtr);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> 
> 
>return CbTablePtr;
> 
>  }
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> index 5a1e578668..0e6dcf10f9 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> @@ -406,7 +406,9 @@ _ModuleEntryPoint (
>SERIAL_PORT_INFO  SerialPortInfo;
> 
>UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO  *UniversalSerialPort;
> 
> 
> 
> -  PcdSet64S (PcdBootloaderParameter, BootloaderParameter);
> 
> +  Status = PcdSet64S (PcdBootloaderParameter, BootloaderParameter);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
>// Initialize floating point operating environment to be compliant with 
> UEFI
> spec.
> 
>InitializeFloatingPointUnits ();
> 
> 
> 
> --
> 2.32.0.windows.2



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




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Remove SystemTableInfo GUID.

2021-10-11 Thread Ma, Maurice
Reviewed-by: Maurice Ma 


> -Original Message-
> From: Kesavan Balakrishnan, ThiyaguX
> 
> Sent: Sunday, October 10, 2021 21:30
> To: devel@edk2.groups.io
> Cc: Kesavan Balakrishnan, ThiyaguX
> ; Ma, Maurice
> ; Dong, Guo ; Ni, Ray
> ; You, Benjamin ; Liu,
> Zhiguang 
> Subject: [PATCH] UefiPayloadPkg: Remove SystemTableInfo GUID.
> 
> SystemTableInfo GUID is not a Spec defined GUID.
> But the latest SBL uses SystemTableInfo to get ACPI and SMBIOS table
> information. So moving the SystemTableInfo GUID implementation to
> SblParseLib.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Benjamin You 
> Cc: Zhiguang Liu 
> 
> Signed-off-by: Guo Dong 
> Signed-off-by: Thiyagu Kesavan Balakrishnan
> 
> ---
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf  |  1 -
>  UefiPayloadPkg/Include/Library/BlParseLib.h   |  2 ++
>  UefiPayloadPkg/Library/CbParseLib/CbParseLib.c| 40
> +++-
>  UefiPayloadPkg/Library/SblParseLib/SblParseLib.c  | 38
> +-
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c| 22 +--
> ---
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h|  1 -
>  UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf |  1 -
>  7 files changed, 75 insertions(+), 30 deletions(-)
> 
> diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> index 1ccb250991..96d85d2b1d 100644
> --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> @@ -42,7 +42,6 @@
>HobLib
> 
>  [Guids]
> -  gUefiSystemTableInfoGuid
>gUefiAcpiBoardInfoGuid
>gEfiGraphicsInfoHobGuid
> 
> diff --git a/UefiPayloadPkg/Include/Library/BlParseLib.h
> b/UefiPayloadPkg/Include/Library/BlParseLib.h
> index 1244190d4e..de1da356e5 100644
> --- a/UefiPayloadPkg/Include/Library/BlParseLib.h
> +++ b/UefiPayloadPkg/Include/Library/BlParseLib.h
> @@ -12,6 +12,8 @@
>  #include 
>  #include 
>  #include 
> +#include  #include
> +
> 
>  #ifndef __BOOTLOADER_PARSE_LIB__
>  #define __BOOTLOADER_PARSE_LIB__
> diff --git a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> index 4f90687e40..b260cfa04e 100644
> --- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> +++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> @@ -410,9 +410,9 @@ ParseMemoryInfo (
> 
> 
>  /**
> -  Acquire acpi table and smbios table from coreboot
> +  Acquire SMBIOS table from coreboot.
> 
> -  @param  SystemTableInfo  Pointer to the system table info
> +  @param  SmbiosTable   Pointer to the SMBIOS table info.
> 
>@retval RETURN_SUCCESSSuccessfully find out the tables.
>@retval RETURN_NOT_FOUND  Failed to find the tables.
> @@ -420,8 +420,8 @@ ParseMemoryInfo (
>  **/
>  RETURN_STATUS
>  EFIAPI
> -ParseSystemTable (
> -  OUT SYSTEM_TABLE_INFO *SystemTableInfo
> +ParseSmbiosTable (
> +  OUT UNIVERSAL_PAYLOAD_SMBIOS_TABLE *SmbiosTable
>)
>  {
>EFI_STATUS   Status;
> @@ -432,17 +432,39 @@ ParseSystemTable (
>if (EFI_ERROR (Status)) {
>  return EFI_NOT_FOUND;
>}
> -  SystemTableInfo->SmbiosTableBase = (UINT64) (UINTN)MemTable;
> -  SystemTableInfo->SmbiosTableSize = MemTableSize;
> +  SmbiosTable->SmBiosEntryPoint = (UINT64) (UINTN)MemTable;
> 
> +  return RETURN_SUCCESS;
> +}
> +
> +
> +/**
> +  Acquire ACPI table from coreboot.
> +
> +  @param  AcpiTableHob  Pointer to the ACPI table info.
> +
> +  @retval RETURN_SUCCESSSuccessfully find out the tables.
> +  @retval RETURN_NOT_FOUND  Failed to find the tables.
> +
> +**/
> +
> +RETURN_STATUS
> +EFIAPI
> +ParseAcpiTableInfo (
> +  OUT UNIVERSAL_PAYLOAD_ACPI_TABLE*AcpiTableHob
> +  )
> +{
> +  EFI_STATUS   Status;
> +  VOID *MemTable;
> +  UINT32   MemTableSize;
> +
>Status = ParseCbMemTable (SIGNATURE_32 ('I', 'P', 'C', 'A'), ,
> );
>if (EFI_ERROR (Status)) {
>  return EFI_NOT_FOUND;
>}
> -  SystemTableInfo->AcpiTableBase = (UINT64) (UINTN)MemTable;
> -  SystemTableInfo->AcpiTableSize = MemTableSize;
> +  AcpiTableHob->Rsdp = (UINT64) (UINTN)MemTable;
> 
> -  return Status;
> +  return RETURN_SUCCESS;
>  }
> 
> 
> diff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
> b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
> index 7214fd87d2..0f83771e6e 100644
> --- a/UefiPayloadPkg/Library/SblParseLib/SblP

Re: [edk2-devel] [PATCH 1/1] UefiPayloadPkg: Add PCI root bridge info hob support for SBL

2021-09-30 Thread Ma, Maurice
Sorry for the duplicated msg.  Please ignore the duplicated one.

Thanks,
-Maurice

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ma,
> Maurice
> Sent: Thursday, September 30, 2021 9:59
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Ni, Ray ; Dong,
> Guo ; You, Benjamin 
> Subject: [edk2-devel] [PATCH 1/1] UefiPayloadPkg: Add PCI root bridge info
> hob support for SBL
> 
> Current UefiPayloadPkg can suport PCI root bridge info HOB provided by
> bootloader. For UniversalPayload, bootloader can directly provide this HOB
> for payload consumption. However, for legacy UEFI payload, it is required to
> migrate the HOB information from bootloader HOB space to UEFI payload
> HOB space. This patch added the missing part for the bootloader ParseLib in
> order to support both legacy and universal UEFI payload.
> 
> This patch was tested on Slim Bootloader with latest UEFI payload, and it
> worked as expected.
> 
> Cc: Ray Ni 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Signed-off-by: Maurice Ma 
> ---
>  UefiPayloadPkg/Include/Library/BlParseLib.h   | 14 ++
>  .../Library/CbParseLib/CbParseLib.c   | 16 +++
>  .../Library/SblParseLib/SblParseLib.c | 47 ++-
>  .../Library/SblParseLib/SblParseLib.inf   |  1 +
>  .../UefiPayloadEntry/UefiPayloadEntry.c   |  8 
>  5 files changed, 84 insertions(+), 2 deletions(-)
> 
> diff --git a/UefiPayloadPkg/Include/Library/BlParseLib.h
> b/UefiPayloadPkg/Include/Library/BlParseLib.h
> index 1244190d4e87..49eac3124818 100644
> --- a/UefiPayloadPkg/Include/Library/BlParseLib.h
> +++ b/UefiPayloadPkg/Include/Library/BlParseLib.h
> @@ -116,4 +116,18 @@ ParseGfxDeviceInfo (
>OUT EFI_PEI_GRAPHICS_DEVICE_INFO_HOB   *GfxDeviceInfo   ); +/**+
> Parse and handle the misc info provided by bootloader++  @retval
> RETURN_SUCCESS   The misc information was parsed successfully.+
> @retval RETURN_NOT_FOUND Could not find required misc info.+
> @retval RETURN_OUT_OF_RESOURCES  Insufficant memory
> space.++**/+RETURN_STATUS+EFIAPI+ParseMiscInfo (+  VOID+  );+
> #endifdiff --git a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> index 4f90687e407e..f81aa0f301d8 100644
> --- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> +++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
> @@ -560,3 +560,19 @@ ParseGfxDeviceInfo (
>return RETURN_NOT_FOUND; } +/**+  Parse and handle the misc info
> provided by bootloader++  @retval RETURN_SUCCESS   The misc
> information was parsed successfully.+  @retval RETURN_NOT_FOUND
> Could not find required misc info.+  @retval RETURN_OUT_OF_RESOURCES
> Insufficant memory space.++**/+RETURN_STATUS+EFIAPI+ParseMiscInfo
> (+  VOID+  )+{+  return RETURN_SUCCESS;+}diff --git
> a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
> b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
> index 7214fd87d20c..ccdcbfc07db9 100644
> --- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
> +++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
> @@ -1,7 +1,7 @@
>  /** @file   This library will parse the Slim Bootloader to get required
> information. -  Copyright (c) 2014 - 2019, Intel Corporation. All rights
> reserved.+  Copyright (c) 2014 - 2021, Intel Corporation. All rights
> reserved.   SPDX-License-Identifier: BSD-2-Clause-Patent  **/@@ -15,7
> +15,7 @@
>  #include  #include  #include
> -+#include 
> /**   This function retrieves the parameter base address from boot
> loader.@@ -221,3 +221,46 @@ ParseGfxDeviceInfo (
>return RETURN_SUCCESS; } +/**+  Parse and handle the misc info provided
> by bootloader++  @retval RETURN_SUCCESS   The misc information was
> parsed successfully.+  @retval RETURN_NOT_FOUND Could not find
> required misc info.+  @retval RETURN_OUT_OF_RESOURCES  Insufficant
> memory space.++**/+RETURN_STATUS+EFIAPI+ParseMiscInfo (+
> VOID+  )+{+  RETURN_STATUS  Status;+
> UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *BlRootBridgesHob;+
> UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *PldRootBridgesHob;++
> Status = RETURN_NOT_FOUND;+  BlRootBridgesHob =
> (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *) GetGuidHobDataFromSbl (+
> + );+  if
> (BlRootBridgesHob != NULL) {+//+// Migrate bootloader root bridge info
> hob from bootloader to payload.+//+PldRootBridgesHob = BuildGuidHob
> (+  
> ,+
> BlRootBridgesHob->Header.Length+ );+
> ASSERT
> (PldRootBridgesHob != NULL);+if (PldRootBridgesHob != NULL) {+
> CopyMem (PldRootBridgesHob, BlRootBridgesHob, BlRootBridgesHob-
> >Header.Length);+  DEBUG (

[edk2-devel] [PATCH 1/1] UefiPayloadPkg: Add PCI root bridge info hob support for SBL

2021-09-30 Thread Ma, Maurice
Current UefiPayloadPkg can suport PCI root bridge info HOB
provided by bootloader. For UniversalPayload, bootloader can
directly provide this HOB for payload consumption. However,
for legacy UEFI payload, it is required to migrate the HOB
information from bootloader HOB space to UEFI payload HOB
space. This patch added the missing part for the bootloader
ParseLib in order to support both legacy and universal UEFI
payload.

This patch was tested on Slim Bootloader with latest UEFI
payload, and it worked as expected.

Cc: Ray Ni 
Cc: Guo Dong 
Cc: Benjamin You 
Signed-off-by: Maurice Ma 
---
 UefiPayloadPkg/Include/Library/BlParseLib.h   | 14 ++
 .../Library/CbParseLib/CbParseLib.c   | 16 +++
 .../Library/SblParseLib/SblParseLib.c | 47 ++-
 .../Library/SblParseLib/SblParseLib.inf   |  1 +
 .../UefiPayloadEntry/UefiPayloadEntry.c   |  8 
 5 files changed, 84 insertions(+), 2 deletions(-)

diff --git a/UefiPayloadPkg/Include/Library/BlParseLib.h 
b/UefiPayloadPkg/Include/Library/BlParseLib.h
index 1244190d4e87..49eac3124818 100644
--- a/UefiPayloadPkg/Include/Library/BlParseLib.h
+++ b/UefiPayloadPkg/Include/Library/BlParseLib.h
@@ -116,4 +116,18 @@ ParseGfxDeviceInfo (
   OUT EFI_PEI_GRAPHICS_DEVICE_INFO_HOB   *GfxDeviceInfo
   );
 
+/**
+  Parse and handle the misc info provided by bootloader
+
+  @retval RETURN_SUCCESS   The misc information was parsed 
successfully.
+  @retval RETURN_NOT_FOUND Could not find required misc info.
+  @retval RETURN_OUT_OF_RESOURCES  Insufficant memory space.
+
+**/
+RETURN_STATUS
+EFIAPI
+ParseMiscInfo (
+  VOID
+  );
+
 #endif
diff --git a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c 
b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
index 4f90687e407e..f81aa0f301d8 100644
--- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
+++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
@@ -560,3 +560,19 @@ ParseGfxDeviceInfo (
   return RETURN_NOT_FOUND;
 }
 
+/**
+  Parse and handle the misc info provided by bootloader
+
+  @retval RETURN_SUCCESS   The misc information was parsed 
successfully.
+  @retval RETURN_NOT_FOUND Could not find required misc info.
+  @retval RETURN_OUT_OF_RESOURCES  Insufficant memory space.
+
+**/
+RETURN_STATUS
+EFIAPI
+ParseMiscInfo (
+  VOID
+  )
+{
+  return RETURN_SUCCESS;
+}
diff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c 
b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
index 7214fd87d20c..ccdcbfc07db9 100644
--- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
+++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
@@ -1,7 +1,7 @@
 /** @file
   This library will parse the Slim Bootloader to get required information.
 
-  Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-
+#include 
 
 /**
   This function retrieves the parameter base address from boot loader.
@@ -221,3 +221,46 @@ ParseGfxDeviceInfo (
   return RETURN_SUCCESS;
 }
 
+/**
+  Parse and handle the misc info provided by bootloader
+
+  @retval RETURN_SUCCESS   The misc information was parsed 
successfully.
+  @retval RETURN_NOT_FOUND Could not find required misc info.
+  @retval RETURN_OUT_OF_RESOURCES  Insufficant memory space.
+
+**/
+RETURN_STATUS
+EFIAPI
+ParseMiscInfo (
+  VOID
+  )
+{
+  RETURN_STATUS  Status;
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *BlRootBridgesHob;
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *PldRootBridgesHob;
+
+  Status = RETURN_NOT_FOUND;
+  BlRootBridgesHob = (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *) 
GetGuidHobDataFromSbl (
+   
+ );
+  if (BlRootBridgesHob != NULL) {
+//
+// Migrate bootloader root bridge info hob from bootloader to payload.
+//
+PldRootBridgesHob = BuildGuidHob (
+  ,
+  BlRootBridgesHob->Header.Length
+ );
+ASSERT (PldRootBridgesHob != NULL);
+if (PldRootBridgesHob != NULL) {
+  CopyMem (PldRootBridgesHob, BlRootBridgesHob, 
BlRootBridgesHob->Header.Length);
+  DEBUG ((DEBUG_INFO, "Create PCI root bridge info guid hob\n"));
+  Status = RETURN_SUCCESS;
+} else {
+  Status = RETURN_OUT_OF_RESOURCES;
+}
+  }
+
+  return Status;
+}
+
diff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf 
b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf
index 665a5a8adcef..535cca58a63c 100644
--- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf
+++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf
@@ -41,6 +41,7 @@
   gLoaderMemoryMapInfoGuid
   gEfiGraphicsInfoHobGuid
   gEfiGraphicsDeviceInfoHobGuid
+  gUniversalPayloadPciRootBridgeInfoGuid
 
 [Pcd]
   gUefiPayloadPkgTokenSpaceGuid.PcdBootloaderParameter
diff 

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add Macro to enable or diable some drivers.

2021-09-20 Thread Ma, Maurice
Reviewed-by: Maurice Ma 


> -Original Message-
> From: Liu, Zhiguang 
> Sent: Saturday, September 18, 2021 0:49
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Ni, Ray ; Ma,
> Maurice ; You, Benjamin
> 
> Subject: [PATCH] UefiPayloadPkg: Add Macro to enable or diable some
> drivers.
> 
> Add Macro to enable or diable RamDiskDxe and SioBusDxe drivers.
> 
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> 
> Signed-off-by: Zhiguang Liu 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 10 --
> UefiPayloadPkg/UefiPayloadPkg.fdf |  7 +--
>  2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 9d7f311343..fb805dc772 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -28,6 +28,8 @@
> DEFINE SOURCE_DEBUG_ENABLE  = FALSE   DEFINE
> PS2_KEYBOARD_ENABLE  = FALSE+  DEFINE RAM_DISK_ENABLE  =
> FALSE+  DEFINE SIO_BUS_ENABLE   = FALSE   DEFINE
> UNIVERSAL_PAYLOAD= FALSE#@@ -536,8 +538,10 @@
>MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
> MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
> MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf-
> MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf +!if
> $(RAM_DISK_ENABLE) == TRUE+
> MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf+!endif   #   #
> SD/eMMC Support   #@@ -562,8 +566,10 @@
>  !if $(SERIAL_DRIVER_ENABLE) == TRUE
> MdeModulePkg/Universal/SerialDxe/SerialDxe.inf !endif-!if
> $(PS2_KEYBOARD_ENABLE) == TRUE+!if $(SIO_BUS_ENABLE) == TRUE
> OvmfPkg/SioBusDxe/SioBusDxe.inf+!endif+!if $(PS2_KEYBOARD_ENABLE)
> == TRUE
> MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf !endif
> MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.infdiff --git
> a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
> index 6caa134081..6b48bfc869 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.fdf
> +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
> @@ -142,8 +142,10 @@ INF
> MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>  !if $(SERIAL_DRIVER_ENABLE) == TRUE INF
> MdeModulePkg/Universal/SerialDxe/SerialDxe.inf !endif-!if
> $(PS2_KEYBOARD_ENABLE) == TRUE+!if $(SIO_BUS_ENABLE) == TRUE INF
> OvmfPkg/SioBusDxe/SioBusDxe.inf+!endif+!if $(PS2_KEYBOARD_ENABLE)
> == TRUE INF
> MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf !endif INF
> MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf@@ -171,8 +173,9
> @@ INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
>  INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf INF
> MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf INF
> MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf+!if
> $(RAM_DISK_ENABLE) == TRUE INF
> MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf-+!endif INF
> FatPkg/EnhancedFatDxe/Fat.inf  #--
> 2.32.0.windows.2



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




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix the build failure

2021-07-01 Thread Ma, Maurice
Reviewed-by:  Maurice Ma 

-Maurice

> -Original Message-
> From: Dong, Guo 
> Sent: Wednesday, June 30, 2021 15:51
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> 
> Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Fix the build failure
> 
> For non-universal payload, HandoffHobTable is used without initialization.
> This patch fixed this failure.
> 
> Signed-off-by: Guo Dong 
> ---
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c  | 3 +--
>  UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 4 +---
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> index ed956c447c..ae16f25c7c 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> @@ -559,7 +559,6 @@ PayloadEntry (
>  {
>EFI_STATUSStatus;
>PHYSICAL_ADDRESS  DxeCoreEntryPoint;
> -  EFI_HOB_HANDOFF_INFO_TABLE*HandoffHobTable;
>UINTN MemBase;
>UINTN HobMemBase;
>UINTN HobMemTop;
> @@ -603,7 +602,7 @@ PayloadEntry (
>IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);
>IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE,  0xFF);
> 
> -  Hob.HandoffInformationTable = HandoffHobTable;
> +  Hob.HandoffInformationTable = (EFI_HOB_HANDOFF_INFO_TABLE *)
> GetFirstHob(EFI_HOB_TYPE_HANDOFF);
>HandOffToDxeCore (DxeCoreEntryPoint, Hob);
> 
>// Should not get here
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
> b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
> index a67653eb11..7a00a56ab9 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
> @@ -364,7 +364,6 @@ _ModuleEntryPoint (
>  {
>EFI_STATUSStatus;
>PHYSICAL_ADDRESS  DxeCoreEntryPoint;
> -  EFI_HOB_HANDOFF_INFO_TABLE*HandoffHobTable;
>EFI_PEI_HOB_POINTERS  Hob;
>EFI_FIRMWARE_VOLUME_HEADER*DxeFv;
> 
> @@ -393,8 +392,7 @@ _ModuleEntryPoint (
>IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);
>IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE,  0xFF);
> 
> -  HandoffHobTable = (EFI_HOB_HANDOFF_INFO_TABLE *)
> GetFirstHob(EFI_HOB_TYPE_HANDOFF);
> -  Hob.HandoffInformationTable = HandoffHobTable;
> +  Hob.HandoffInformationTable = (EFI_HOB_HANDOFF_INFO_TABLE *)
> GetFirstHob(EFI_HOB_TYPE_HANDOFF);
>HandOffToDxeCore (DxeCoreEntryPoint, Hob);
> 
>// Should not get here
> --
> 2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77425): https://edk2.groups.io/g/devel/message/77425
Mute This Topic: https://groups.io/mt/83904719/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] Maintainers.txt: Update Maintainers and reviewers for UefiPayloadPkg

2021-06-29 Thread Ma, Maurice
Reviewed-by:  Maurice Ma 

-Maurice
> -Original Message-
> From: Dong, Guo 
> Sent: Tuesday, June 29, 2021 21:54
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> ; Ni, Ray ; Kinney, Michael D
> 
> Subject: [edk2-devel] [PATCH V2] Maintainers.txt: Update Maintainers and
> reviewers for UefiPayloadPkg
> 
> Add Ray Ni as UefiPayloadPkg Maintainer.
> Update Maurice Ma and Benjamin You as reviewers to continue support
> UefiPayloadPkg patch review.
> 
> Cc: Ray Ni 
> Cc: Benjamin You 
> Cc: Maurice Ma 
> Cc: Michael D Kinney 
> Reviewed-by: Maurice Ma 
> Reviewed-by: Benjamin You 
> Signed-off-by: Guo Dong 
> ---
>  Maintainers.txt | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index ea54e0b7e9..f4e4c72d06
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -580,9 +580,10 @@ R: Catharine West 
> UefiPayloadPkg
>  F: UefiPayloadPkg/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/UefiPayloadPkg
> -M: Maurice Ma 
>  M: Guo Dong 
> -M: Benjamin You 
> +M: Ray Ni 
> +R: Maurice Ma 
> +R: Benjamin You 
>  S: Maintained
> 
>  UnitTestFrameworkPkg
> --
> 2.16.2.windows.1



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




Re: [edk2-devel] [PATCH v3] UefiPayloadPkg/UefiPayloadEntry: Improve bootloader memrange parsing

2021-06-21 Thread Ma, Maurice
Looks good to me.   
Reviewed-by:  Maurice Ma 

Regards
-Maurice

> -Original Message-
> From: Patrick Rudolph 
> Sent: Monday, June 21, 2021 1:10
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin 
> Subject: [PATCH v3] UefiPayloadPkg/UefiPayloadEntry: Improve bootloader
> memrange parsing
> 
> Currently several DXE crash due to invalid memory resource settings.
> The PciHostBridgeDxe which expects the MMCONF and PCI Aperature to be
> EfiMemoryMappedIO, but currently those regions are (partly) mapped as
> EfiReservedMemoryType.
> 
> coreboot and slimbootloader provide an e820 compatible memory map,
> which doesn't work well with EDK2 as the e820 spec is missing MMIO regions.
> In e820 'reserved' could either mean "DRAM used by boot firmware" or
> "MMIO in use and not detectable by OS".
> 
> Guess Top of lower usable DRAM (TOLUD) by walking the bootloader
> provided memory ranges. Memory types of RAM, ACPI and ACPI NVS below
> 4 GiB are used to increment TOLUD and reserved memory ranges touching
> TOLUD at the base are also assumed to be reserved DRAM, which increment
> TOLUD.
> 
> Then mark everything reserved below TOLUD as EfiReservedMemoryType
> and everything reserved above TOLUD as EfiMemoryMappedIO.
> 
> This fixes assertions seen in PciHostBridgeDxe.
> 
> Signed-off-by: Patrick Rudolph 
> ---
>  .../UefiPayloadEntry/UefiPayloadEntry.c   | 190 +-
>  .../UefiPayloadEntry/UefiPayloadEntry.h   |  10 +
>  2 files changed, 197 insertions(+), 3 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> index 805f5448d9..04c58f776c 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> @@ -7,10 +7,159 @@
>   #include "UefiPayloadEntry.h" +STATIC UINT32 mTopOfLowerUsableDram =
> 0;+ /**Callback function to build resource descriptor HOB This 
> function
> build a HOB based on the memory map entry info.+   It creates only
> EFI_RESOURCE_MEMORY_MAPPED_IO and
> EFI_RESOURCE_MEMORY_RESERVED+   resources.++   @param
> MemoryMapEntry Memory map entry info got from bootloader.+
> @param Params A pointer to ACPI_BOARD_INFO.++  @retval
> EFI_SUCCESSSuccessfully build a HOB.+  @retval
> EFI_INVALID_PARAMETER  Invalid parameter
> provided.+**/+EFI_STATUS+MemInfoCallbackMmio (+  IN
> MEMROY_MAP_ENTRY  *MemoryMapEntry,+  IN VOID
> *Params+  )+{+  EFI_PHYSICAL_ADDRESS Base;+  EFI_RESOURCE_TYPE
> Type;+  UINT64   Size;+  EFI_RESOURCE_ATTRIBUTE_TYPE
> Attribue;+  ACPI_BOARD_INFO  *AcpiBoardInfo;++  AcpiBoardInfo =
> (ACPI_BOARD_INFO *)Params;+  if (AcpiBoardInfo == NULL) {+return
> EFI_INVALID_PARAMETER;+  }++  //+  // Skip types already handled in
> MemInfoCallback+  //+  if (MemoryMapEntry->Type == E820_RAM ||
> MemoryMapEntry->Type == E820_ACPI) {+return EFI_SUCCESS;+  }++  if
> (MemoryMapEntry->Base == AcpiBoardInfo->PcieBaseAddress) {+//+//
> MMCONF is always MMIO+//+Type =
> EFI_RESOURCE_MEMORY_MAPPED_IO;+  } else if (MemoryMapEntry->Base
> < mTopOfLowerUsableDram) {+//+// It's in DRAM and thus must be
> reserved+//+Type = EFI_RESOURCE_MEMORY_RESERVED;+  } else if
> ((MemoryMapEntry->Base < 0x1ULL) && (MemoryMapEntry-
> >Base >= mTopOfLowerUsableDram)) {+//+// It's not in DRAM, must be
> MMIO+//+Type = EFI_RESOURCE_MEMORY_MAPPED_IO;+  } else {+
> Type = EFI_RESOURCE_MEMORY_RESERVED;+  }++  Base=
> MemoryMapEntry->Base;+  Size= MemoryMapEntry->Size;++  Attribue =
> EFI_RESOURCE_ATTRIBUTE_PRESENT |+
> EFI_RESOURCE_ATTRIBUTE_INITIALIZED |+
> EFI_RESOURCE_ATTRIBUTE_TESTED |+
> EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |+
> EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |+
> EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |+
> EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;++
> BuildResourceDescriptorHob (Type, Attribue, (EFI_PHYSICAL_ADDRESS)Base,
> Size);+  DEBUG ((DEBUG_INFO , "buildhob: base = 0x%lx, size = 0x%lx, type =
> 0x%x\n", Base, Size, Type));++  if (MemoryMapEntry->Type ==
> E820_UNUSABLE ||+MemoryMapEntry->Type == E820_DISABLED) {+
> BuildMemoryAllocationHob (Base, Size, EfiUnusableMemory);+  } else if
> (MemoryMapEntry->Type == E820_PMEM) {+BuildMemoryAllocationHob
> (Base, Size, EfiPersistentMemory);+  }++  return EFI_SUCCESS;+}+++/**+
> Callback function to find TOLUD (Top of Lower Usable DRAM)++   Estimate
> where TOLUD (Top of Lower Usable DRAM) resides. The exact position+
> would require plat

Re: [edk2-devel] [PATCH v2] UefiPayloadPkg/UefiPayloadEntry: Improve bootloader memrange parsing

2021-06-17 Thread Ma, Maurice
Hi, Patrick,

The V2 patch addressed all previous comments.   

However, when I try to test your patch and build with VS2019,  it gave me 
compiling error as below: 
w:\edk2\UefiPayloadPkg\UefiPayloadEntry\UefiPayloadEntry.c(140): warning C4244: 
'=': conversion from 'UINT64' to 'UINT32', possible loss of data
w:\edk2\UefiPayloadPkg\UefiPayloadEntry\UefiPayloadEntry.c(150): warning C4244: 
'=': conversion from 'UINT64' to 'UINT32', possible loss of data
Both are related to mTopOfLowerUsableDram calculation:
   mTopOfLowerUsableDram = MemoryMapEntry->Base + MemoryMapEntry->Size;
I think we will need to add typecast to fix the build issue. 

Thanks
Maurice

> -Original Message-
> From: Patrick Rudolph 
> Sent: Thursday, June 17, 2021 5:25
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin 
> Subject: [PATCH v2] UefiPayloadPkg/UefiPayloadEntry: Improve bootloader
> memrange parsing
> 
> Currently several DXE crash due to invalid memory resource settings.
> The PciHostBridgeDxe which expects the MMCONF and PCI Aperature to be
> EfiMemoryMappedIO, but currently those regions are (partly) mapped as
> EfiReservedMemoryType.
> 
> coreboot and slimbootloader provide an e820 compatible memory map,
> which doesn't work well with EDK2 as the e820 spec is missing MMIO regions.
> In e820 'reserved' could either mean "DRAM used by boot firmware" or
> "MMIO in use and not detectable by OS".
> 
> Guess Top of lower usable DRAM (TOLUD) by walking the bootloader
> provided memory ranges. Memory types of RAM, ACPI and ACPI NVS below
> 4 GiB are used to increment TOLUD and reserved memory ranges touching
> TOLUD at the base are also assumed to be reserved DRAM, which increment
> TOLUD.
> 
> Then mark everything reserved below TOLUD as EfiReservedMemoryType
> and everything reserved above TOLUD as EfiMemoryMappedIO.
> 
> This fixes assertions seen in PciHostBridgeDxe.
> 
> Signed-off-by: Patrick Rudolph 
> ---
>  .../UefiPayloadEntry/UefiPayloadEntry.c   | 190 +-
>  .../UefiPayloadEntry/UefiPayloadEntry.h   |  10 +
>  2 files changed, 197 insertions(+), 3 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> index 805f5448d9..1b2a674401 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> @@ -7,10 +7,159 @@
>   #include "UefiPayloadEntry.h" +STATIC UINT32 mTopOfLowerUsableDram =
> 0;+ /**Callback function to build resource descriptor HOB This 
> function
> build a HOB based on the memory map entry info.+   It creates only
> EFI_RESOURCE_MEMORY_MAPPED_IO and
> EFI_RESOURCE_MEMORY_RESERVED+   resources.++   @param
> MemoryMapEntry Memory map entry info got from bootloader.+
> @param Params A pointer to ACPI_BOARD_INFO.++  @retval
> EFI_SUCCESSSuccessfully build a HOB.+  @retval
> EFI_INVALID_PARAMETER  Invalid parameter
> provided.+**/+EFI_STATUS+MemInfoCallbackMmio (+  IN
> MEMROY_MAP_ENTRY  *MemoryMapEntry,+  IN VOID
> *Params+  )+{+  EFI_PHYSICAL_ADDRESS Base;+  EFI_RESOURCE_TYPE
> Type;+  UINT64   Size;+  EFI_RESOURCE_ATTRIBUTE_TYPE
> Attribue;+  ACPI_BOARD_INFO  *AcpiBoardInfo;++  AcpiBoardInfo =
> (ACPI_BOARD_INFO *)Params;+  if (AcpiBoardInfo == NULL) {+return
> EFI_INVALID_PARAMETER;+  }++  //+  // Skip types already handled in
> MemInfoCallback+  //+  if (MemoryMapEntry->Type == E820_RAM ||
> MemoryMapEntry->Type == E820_ACPI) {+return EFI_SUCCESS;+  }++  if
> (MemoryMapEntry->Base == AcpiBoardInfo->PcieBaseAddress) {+//+//
> MMCONF is always MMIO+//+Type =
> EFI_RESOURCE_MEMORY_MAPPED_IO;+  } else if (MemoryMapEntry->Base
> < mTopOfLowerUsableDram) {+//+// It's in DRAM and thus must be
> reserved+//+Type = EFI_RESOURCE_MEMORY_RESERVED;+  } else if
> ((MemoryMapEntry->Base < 0x1ULL) && (MemoryMapEntry-
> >Base >= mTopOfLowerUsableDram)) {+//+// It's not in DRAM, must be
> MMIO+//+Type = EFI_RESOURCE_MEMORY_MAPPED_IO;+  } else {+
> Type = EFI_RESOURCE_MEMORY_RESERVED;+  }++  Base=
> MemoryMapEntry->Base;+  Size= MemoryMapEntry->Size;++  Attribue =
> EFI_RESOURCE_ATTRIBUTE_PRESENT |+
> EFI_RESOURCE_ATTRIBUTE_INITIALIZED |+
> EFI_RESOURCE_ATTRIBUTE_TESTED |+
> EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |+
> EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |+
> EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |+
> EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;++
> BuildResourceDescriptorHob (Type, Attribue, (EFI_PHYSICAL_ADDRESS)Ba

Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Improve bootloader memrange parsing

2021-06-17 Thread Ma, Maurice
Hi, Patrick,

Thank you,  I will take a look on the new patch!

Regards
Maurice
> -Original Message-
> From: Patrick Rudolph 
> Sent: Thursday, June 17, 2021 6:21
> To: Ma, Maurice 
> Cc: devel@edk2.groups.io; Dong, Guo ; You,
> Benjamin 
> Subject: Re: [PATCH] UefiPayloadPkg/UefiPayloadEntry: Improve bootloader
> memrange parsing
> 
> Hi Maurice,
> I've implemented the requested changes. It now also accepts ACPI_NVS as
> usable DRAM.
> 
> Thanks,
> Patrick
> 
> On Thu, Jun 17, 2021 at 2:33 AM Ma, Maurice 
> wrote:
> >
> > Hi, Rudolph,
> >
> > Thank you for submitting the patch.   In general the approach looks good to
> me.
> > Here I have several minor comments on your patch as listed below:
> >
> > 1.  For global variable in module, could we add "m" prefix ?   EX:  Change
> "TopOfLowerUsableDram" to "mTopOfLowerUsableDram" ?
> >
> > 2.  Please rename "MemInfoCallbackMMIO" to "MemInfoCallbackMmio"
> to follow naming convention.
> >
> > 3.  Maybe we can add parentheses for some condition expressions to make
> it easier to read.
> >  EX:  Change:
> >(MemoryMapEntry->Base < 0x1ULL &&  MemoryMapEntry-
> >Base >= TopOfLowerUsableDram)
> >  To:
> >((MemoryMapEntry->Base < 0x1ULL) &&
> > (MemoryMapEntry->Base >= TopOfLowerUsableDram))
> >
> > 4.  If we use "EFI_STATUS" for function status, then function return type
> should match that.
> >  EX:  Use "EFI_SUCCESS" instead of "RETURN_SUCCESS ".
> >
> > 5.  I think the new FindToludCallback() function will find the correct TOLUD
> if ACPI NVS memory region is below ACPI RECLAIM memory.
> >  However, if it is the other way around, the TOLUD calculation might be
> incorrect.  Should we consider both cases?
> >  For example, given the memory map below,  your patch will get TOLUM
> = 0x1EB6C000.  But the actual TOLUM should be 0x2000.
> >  Base Length
> >  E820 Type
> >  MEM:  000A  1
> >  MEM: 000A 0006  2
> >  MEM: 0010 1EA0  1
> >  MEM: 1EB0 4000  2
> >  MEM: 1EB04000 00068000  3 (ACPI Reclaim)
> >      MEM: 1EB6C000 8000  4 (ACPI NVS)
> >  MEM: 1EB74000 0038C000  2
> >  MEM: 1EF0 0010  2
> >  MEM: 1F00 0100  2
> >
> > Thanks
> > Maurice
> >
> > > -Original Message-
> > > From: Patrick Rudolph 
> > > Sent: Tuesday, June 15, 2021 6:23
> > > To: devel@edk2.groups.io
> > > Cc: Ma, Maurice ; Dong, Guo
> > > ; You, Benjamin 
> > > Subject: [PATCH] UefiPayloadPkg/UefiPayloadEntry: Improve bootloader
> > > memrange parsing
> > >
> > > Currently several DXE crash due to invalid memory resource settings.
> > > coreboot and slimbootloader provide an e820 compatible memory map,
> > > which doesn't work well with EDK2 as the e820 spec is missing MMIO
> regions.
> > > In e820 'reserved' could either mean "DRAM used by boot firmware" or
> > > "MMIO in use and not detectable by OS".
> > >
> > > Guess Top of lower usable DRAM (TOLUD) by walking memory ranges
> and
> > > then mark everything reserved below TOLUD as DRAM and everything
> > > reserved above TOLUD as MMIO.
> > >
> > > This fixes several assertions seen in PciHostBridgeDxe.
> > >
> > > Signed-off-by: Patrick Rudolph 
> > > ---
> > >  .../UefiPayloadEntry/UefiPayloadEntry.c   | 187 +-
> > >  .../UefiPayloadEntry/UefiPayloadEntry.h   |  10 +
> > >  2 files changed, 194 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> > > b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> > > index 805f5448d9..d20e1a0862 100644
> > > --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> > > +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> > > @@ -7,10 +7,162 @@
> > >   #include "UefiPayloadEntry.h" +STATIC UINT32 TopOfLowerUsableDram
> =
> > > 0;+ /**Callback function to build resource descriptor HOB This
> function
> > > build a HOB based on the memory map entry in

Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Improve bootloader memrange parsing

2021-06-16 Thread Ma, Maurice
Hi, Rudolph,

Thank you for submitting the patch.   In general the approach looks good to me. 
Here I have several minor comments on your patch as listed below:

1.  For global variable in module, could we add "m" prefix ?   EX:  Change  
"TopOfLowerUsableDram" to "mTopOfLowerUsableDram" ?

2.  Please rename "MemInfoCallbackMMIO" to "MemInfoCallbackMmio" to follow 
naming convention.

3.  Maybe we can add parentheses for some condition expressions to make it 
easier to read.
 EX:  Change: 
   (MemoryMapEntry->Base < 0x1ULL &&  MemoryMapEntry->Base >= 
TopOfLowerUsableDram)
 To:
   ((MemoryMapEntry->Base < 0x1ULL) &&  (MemoryMapEntry->Base 
>= TopOfLowerUsableDram))

4.  If we use "EFI_STATUS" for function status, then function return type 
should match that.
 EX:  Use "EFI_SUCCESS" instead of "RETURN_SUCCESS ".

5.  I think the new FindToludCallback() function will find the correct TOLUD if 
ACPI NVS memory region is below ACPI RECLAIM memory.
 However, if it is the other way around, the TOLUD calculation might be 
incorrect.  Should we consider both cases?
 For example, given the memory map below,  your patch will get TOLUM = 
0x1EB6C000.  But the actual TOLUM should be 0x2000.
 Base Length
 E820 Type
 MEM:  000A  1
 MEM: 000A 0006  2
 MEM: 0010 1EA0  1
 MEM: 1EB0 4000  2
 MEM: 1EB04000 00068000  3 (ACPI Reclaim)
 MEM: 1EB6C000 8000  4 (ACPI NVS)
 MEM: 1EB74000 0038C000  2
 MEM: 1EF0 0010  2
 MEM: 1F00 0100  2

Thanks
Maurice

> -----Original Message-
> From: Patrick Rudolph 
> Sent: Tuesday, June 15, 2021 6:23
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin 
> Subject: [PATCH] UefiPayloadPkg/UefiPayloadEntry: Improve bootloader
> memrange parsing
> 
> Currently several DXE crash due to invalid memory resource settings.
> coreboot and slimbootloader provide an e820 compatible memory map,
> which doesn't work well with EDK2 as the e820 spec is missing MMIO regions.
> In e820 'reserved' could either mean "DRAM used by boot firmware" or
> "MMIO in use and not detectable by OS".
> 
> Guess Top of lower usable DRAM (TOLUD) by walking memory ranges and
> then mark everything reserved below TOLUD as DRAM and everything
> reserved above TOLUD as MMIO.
> 
> This fixes several assertions seen in PciHostBridgeDxe.
> 
> Signed-off-by: Patrick Rudolph 
> ---
>  .../UefiPayloadEntry/UefiPayloadEntry.c   | 187 +-
>  .../UefiPayloadEntry/UefiPayloadEntry.h   |  10 +
>  2 files changed, 194 insertions(+), 3 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> index 805f5448d9..d20e1a0862 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> @@ -7,10 +7,162 @@
>   #include "UefiPayloadEntry.h" +STATIC UINT32 TopOfLowerUsableDram =
> 0;+ /**Callback function to build resource descriptor HOB This 
> function
> build a HOB based on the memory map entry info.+   It creates only
> EFI_RESOURCE_MEMORY_MAPPED_IO and
> EFI_RESOURCE_MEMORY_RESERVED+   resources.++   @param
> MemoryMapEntry Memory map entry info got from bootloader.+
> @param Params A pointer to ACPI_BOARD_INFO.++  @retval
> RETURN_SUCCESS Successfully build a HOB.+  @retval
> EFI_INVALID_PARAMETER  Invalid parameter
> provided.+**/+EFI_STATUS+MemInfoCallbackMMIO (+  IN
> MEMROY_MAP_ENTRY  *MemoryMapEntry,+  IN VOID
> *Params+  )+{+  EFI_PHYSICAL_ADDRESS Base;+  EFI_RESOURCE_TYPE
> Type;+  UINT64   Size;+  EFI_RESOURCE_ATTRIBUTE_TYPE
> Attribue;+  ACPI_BOARD_INFO  *AcpiBoardInfo;++  AcpiBoardInfo =
> (ACPI_BOARD_INFO *)Params;+  if (AcpiBoardInfo == NULL) {+return
> EFI_INVALID_PARAMETER;+  }++  //+  // Skip types already handled in
> MemInfoCallback+  //+  if (MemoryMapEntry->Type == E820_RAM ||
> MemoryMapEntry->Type == E820_ACPI) {+return RETURN_SUCCESS;+  }++
> if (MemoryMapEntry->Base == AcpiBoardInfo->PcieBaseAddress) {+//+
> // MMCONF is always MMIO+//+Type =
> EFI_RESOURCE_MEMORY_MAPPED_IO;+  } else if (MemoryMapEntry->Base
> < TopOfLowerUsableDram) {+//+// It's in DRAM and thus must be
> reserved+//+Type = EFI_RESOURCE_MEMORY_RE

Re: [edk2-devel] [Patch V3 1/9] MdeModulePkg: Add Universal Payload general defination header file

2021-06-08 Thread Ma, Maurice
Hi, Ray,

Yes, I agree.   PLD might cause confusion sometimes.  
Maybe we just use the full name UNIVERSAL_PAYLOAD instead ?

Thanks
Maurice
> -Original Message-
> From: Ni, Ray 
> Sent: Tuesday, June 8, 2021 19:58
> To: Ma, Maurice ; Dong, Guo
> ; Rangarajan, Ravi P 
> Cc: Liming Gao ; Wang, Jian J
> ; Wu, Hao A ;
> devel@edk2.groups.io; Kinney, Michael D ;
> Liu, Zhiguang ; Zimmer, Vincent
> 
> Subject: RE: [edk2-devel] [Patch V3 1/9] MdeModulePkg: Add Universal
> Payload general defination header file
> 
> Mike,
> Thanks for the recommendation.
> Just check https://en.wikipedia.org/wiki/Programmable_logic_device and it
> seems to me PLD is a very common term in EE world. FPGA is a kind of PLD.
> 
> Maurice, Ravi, Guo, comments?
> 
> Thanks,
> Ray
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of
> Michael
> > D Kinney
> > Sent: Wednesday, June 9, 2021 12:26 AM
> > To: Liu, Zhiguang ; devel@edk2.groups.io;
> > Kinney, Michael D 
> > Cc: Liming Gao ; Wang, Jian J
> > ; Wu, Hao A 
> > Subject: Re: [edk2-devel] [Patch V3 1/9] MdeModulePkg: Add Universal
> > Payload general defination header file
> >
> > I see use of the abbreviation PLD in this series.
> >
> > PLD is sometimes interpreted as Programmable Logic Device.
> >
> > Given this is for Universal Payload, I recommend using
> > UNIVERSAL_PAYLOAD or PAYLOAD as appropriate.
> >
> > Mike
> >
> > > -Original Message-
> > > From: Liu, Zhiguang 
> > > Sent: Friday, June 4, 2021 2:42 AM
> > > To: devel@edk2.groups.io
> > > Cc: Kinney, Michael D ; Liming Gao
> > ; Wang, Jian J
> > > ; Wu, Hao A 
> > > Subject: [Patch V3 1/9] MdeModulePkg: Add Universal Payload general
> > defination header file
> > >
> > > V1:
> > > Add Universal Payload general defination header file according to
> > > Universal Payload’s documentation
> > > V2:
> > > Add a macro funtion to check the Revision
> > >
> > > Cc: Michael D Kinney 
> > > Cc: Liming Gao 
> > > Cc: Jian J Wang 
> > > Cc: Hao A Wu 
> > >
> > > Signed-off-by: Zhiguang Liu 
> > > ---
> > >  MdeModulePkg/Include/UniversalPayload/UniversalPayload.h | 33
> > +
> > >  1 file changed, 33 insertions(+)
> > >
> > > diff --git
> > > a/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
> > > b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
> > > new file mode 100644
> > > index 00..627b9e880e
> > > --- /dev/null
> > > +++ b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
> > > @@ -0,0 +1,33 @@
> > > +/** @file
> > >
> > > +  Universal Payload general definations.
> > >
> > > +
> > >
> > > +Copyright (c) 2021, Intel Corporation. All rights reserved.
> > >
> > > +SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > +
> > >
> > > +**/
> > >
> > > +
> > >
> > > +#ifndef __UNIVERSAL_PAYLOAD_H__
> > >
> > > +#define __UNIVERSAL_PAYLOAD_H__
> > >
> > > +
> > >
> > > +#pragma pack(1)
> > >
> > > +
> > >
> > > +typedef struct {
> > >
> > > +  UINT8Revision;
> > >
> > > +  UINT8Reserved;
> > >
> > > +  UINT16   Length;
> > >
> > > +} PLD_GENERIC_HEADER;
> > >
> > > +
> > >
> > > +#pragma pack()
> > >
> > > +
> > >
> > > +/**
> > >
> > > +  Returns the size of a structure of known type, up through and
> > > + including a
> > specified field.
> > >
> > > +
> > >
> > > +  @param   TYPE The name of the data structure that contains the 
> > > field
> > specified by Field.
> > >
> > > +  @param   FieldThe name of the field in the data structure.
> > >
> > > +
> > >
> > > +  @return  size, in bytes.
> > >
> > > +
> > >
> > > +**/
> > >
> > > +#define PLD_SIZEOF_THROUGH_FIELD(TYPE, Field) (OFFSET_OF(TYPE,
> > Field) + sizeof (((TYPE *) 0)->Field))
> > >
> > > +
> > >
> > > +#endif // __UNIVERSAL_PAYLOAD_H__
> > >
> > > --
> > > 2.30.0.windows.2
> >
> >
> >
> > 
> >



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




Re: [edk2-devel] [PATCH 3/4] UefiPayloadPkg/UefiPayloadPkg.dsc: Consume MicrocodeLib

2021-04-07 Thread Ma, Maurice
Reviewed-by:  Maurice Ma 

-Maurice

> -Original Message-
> From: Ni, Ray 
> Sent: Thursday, April 1, 2021 22:58
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin 
> Subject: [PATCH 3/4] UefiPayloadPkg/UefiPayloadPkg.dsc: Consume
> MicrocodeLib
> 
> Signed-off-by: Ray Ni 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index e3b017858e..37ad5a0ae7 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -180,6 +180,7 @@ [LibraryClasses]
>#
> 
>MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf
> 
> 
> LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.in
> f
> 
> +  MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf
> 
> 
> 
>#
> 
># Platform
> 
> --
> 2.27.0.windows.1



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




Re: [edk2-devel] [patch V4 26/29] UefiPayloadPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib

2021-03-28 Thread Ma, Maurice
Reviewed-by:  Maurice Ma 

-Maurice
> -Original Message-
> From: Bi, Dandan 
> Sent: Sunday, March 28, 2021 5:02
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin 
> Subject: [patch V4 26/29] UefiPayloadPkg: Consume MdeLibs.dsc.inc for
> RegisterFilterLib
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
> 
> MdeLibs.dsc.inc was added for some basic/default library instances provided
> by MdePkg and RegisterFilterLibNull Library was also added into it as the 
> first
> version of MdeLibs.dsc.inc.
> 
> So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull
> which will be consumed by IoLib and BaseLib.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Signed-off-by: Dandan Bi 
> Acked-by: Ard Biesheuvel 
> Reviewed-by: Guo Dong 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 23edd163e9..e3b017858e 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -1,11 +1,11 @@
>  ## @file
>  # Bootloader Payload Package
>  #
>  # Provides drivers and definitions to create uefi payload for bootloaders.
>  #
> -# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
> +# Copyright (c) 2014 - 2021, Intel Corporation. All rights
> +reserved.
>  # Copyright (c) Microsoft Corporation.
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ##
> 
> @@ -111,10 +111,13 @@ [SkuIds]
> 
> ##
> ##
>  #
>  # Library Class section - list of all Library Classes needed by this 
> Platform.
>  #
> 
> ##
> ##
> +
> +!include MdePkg/MdeLibs.dsc.inc
> +
>  [LibraryClasses]
>#
># Entry point
>#
> 
> DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint
> .inf
> --
> 2.18.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73504): https://edk2.groups.io/g/devel/message/73504
Mute This Topic: https://groups.io/mt/81670705/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 26/29] UefiPayloadPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib

2021-03-22 Thread Ma, Maurice
Reviewed-by:  Maurice Ma 


> -Original Message-
> From: Bi, Dandan 
> Sent: Monday, March 22, 2021 1:10
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin 
> Subject: [patch V2 26/29] UefiPayloadPkg: Consume MdeLibs.dsc.inc for
> RegisterFilterLib
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
> 
> MdeLibs.dsc.inc was added for some basic/default library instances provided
> by MdePkg and RegisterFilterLibNull Library was also added into it as the 
> first
> version of MdeLibs.dsc.inc.
> 
> So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull
> which will be consumed by IoLib and BaseLib.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Signed-off-by: Dandan Bi 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 23edd163e9..11f951ac59 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -1,11 +1,11 @@
>  ## @file
>  # Bootloader Payload Package
>  #
>  # Provides drivers and definitions to create uefi payload for bootloaders.
>  #
> -# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
> +# Copyright (c) 2014 - 2021, Intel Corporation. All rights
> +reserved.
>  # Copyright (c) Microsoft Corporation.
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ##
> 
> @@ -112,10 +112,12 @@ [SkuIds]
>  #
>  # Library Class section - list of all Library Classes needed by this 
> Platform.
>  #
> 
> ##
> ##
>  [LibraryClasses]
> +  !include MdePkg/MdeLibs.dsc.inc
> +
>#
># Entry point
>#
> 
> DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint
> .inf
> 
> UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry
> Point.inf
> --
> 2.18.0.windows.1



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




Re: [edk2-devel] [patch 25/28] UefiPayloadPkg: Consume RegisterFilterLibNull instance

2021-03-15 Thread Ma, Maurice
Reviewed-by:  Maurice Ma 

Regards
Maurice
> -Original Message-
> From: Bi, Dandan 
> Sent: Sunday, March 14, 2021 20:59
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin 
> Subject: [patch 25/28] UefiPayloadPkg: Consume RegisterFilterLibNull
> instance
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
> 
> Add RegisterFilterLibNull in dsc which will be consumed by IoLib and BaseLib.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Signed-off-by: Dandan Bi 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 23edd163e9..56c8147f01 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -141,10 +141,11 @@
> 
> PciSegmentInfoLib|UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInf
> o/PciSegmentInfoLibAcpiBoardInfo.inf
>PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
> 
> PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/Base
> PeCoffGetEntryPointLib.inf
> 
> CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCac
> heMaintenanceLib.inf
>SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
> +
> + RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterL
> + ibNull.inf
> 
>#
># UEFI & PI
>#
> 
> UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBo
> otServicesTableLib.inf
> --
> 2.18.0.windows.1



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




Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB memory WA

2021-02-23 Thread Ma, Maurice
Hi, Ray, Eric and Jeff,

Sure, I am OK with that too.
 Thank you all for looking into it and provide a solution quickly.

Regards
Maurice
From: Ni, Ray 
Sent: Tuesday, February 23, 2021 1:08
To: Ma, Maurice ; devel@edk2.groups.io; 
fanjianf...@byosoft.com.cn; Patrick Rudolph ; 
Dong, Guo ; Dong, Eric 
Cc: You, Benjamin 
Subject: RE: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB 
memory WA

Maurice,
It’s doable 
I prefer to accept today’s below 4G limitation to maintain simple 
implementation.


Thanks,
Ray

From: Ma, Maurice mailto:maurice...@intel.com>>
Sent: Tuesday, February 23, 2021 3:26 PM
To: Ni, Ray mailto:ray...@intel.com>>; 
devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
fanjianf...@byosoft.com.cn<mailto:fanjianf...@byosoft.com.cn>; Patrick Rudolph 
mailto:patrick.rudo...@9elements.com>>; Dong, 
Guo mailto:guo.d...@intel.com>>; Dong, Eric 
mailto:eric.d...@intel.com>>
Cc: You, Benjamin mailto:benjamin@intel.com>>
Subject: RE: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB 
memory WA

Could we decouple BSP and AP GDT in early waking up stage ?
For example, AP uses temporary GDT (below 4GB) just for mode switching.  Once 
AP is in the final stage,  AP can reload GDT to match BSP.  In this way, we 
don’t have assumption on the final GDT location.

Thanks
Maurice
From: Ni, Ray mailto:ray...@intel.com>>
Sent: Monday, February 22, 2021 21:22
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; 
fanjianf...@byosoft.com.cn<mailto:fanjianf...@byosoft.com.cn>; Ma, Maurice 
mailto:maurice...@intel.com>>; Patrick Rudolph 
mailto:patrick.rudo...@9elements.com>>; Dong, 
Guo mailto:guo.d...@intel.com>>; Dong, Eric 
mailto:eric.d...@intel.com>>
Cc: You, Benjamin mailto:benjamin@intel.com>>
Subject: RE: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB 
memory WA

“But we could allocate room under 4G for GDT table directly in CpuDxe.”
The GDT pre-allocated is re-used by AP. Why do you suggest CpuDxe allocate GDT?

Thanks,
Ray

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> On Behalf Of Jeff Fan
Sent: Tuesday, February 23, 2021 11:43 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Ni, Ray 
mailto:ray...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; Patrick Rudolph 
mailto:patrick.rudo...@9elements.com>>; Dong, 
Guo mailto:guo.d...@intel.com>>; Dong, Eric 
mailto:eric.d...@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB 
memory WA

Ray,

Yes. You are right. Acutally, x64 IDT table cannot work correctly on protected 
mode. :-)

But for GDT location, I agree it should be located under 4G space to support AP 
mode changing.  But we could allocate room under 4G for GDT table directly in 
CpuDxe.

Thanks,
Jeff


From: Ni, Ray<mailto:ray...@intel.com>
Date: 2021-02-23 10:52
To: fanjianf...@byosoft.com.cn<mailto:fanjianf...@byosoft.com.cn>; 
devel<mailto:devel@edk2.groups.io>; Ma, Maurice<mailto:maurice...@intel.com>; 
Patrick Rudolph<mailto:patrick.rudo...@9elements.com>; Dong, 
Guo<mailto:guo.d...@intel.com>; Dong, Eric<mailto:eric.d...@intel.com>
CC: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; You, 
Benjamin<mailto:benjamin@intel.com>
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB 
memory WA
Jeff,
You are right that BSP’s GDT and IDT tables are under 4G memory.

It’s because when AP wakes up, it needs the GDT for entering protected mode. AP 
cannot access above 4G memory without entering to long mode.

I do agree that the 64bit IDT is not proper for AP when entering protected 
mode. As long as there is no exception in the short time frame (load 64bit IDT, 
before entering long mode), it’s still ok.

Thanks,
Ray

From: fanjianf...@byosoft.com.cn<mailto:fanjianf...@byosoft.com.cn> 
mailto:fanjianf...@byosoft.com.cn>>
Sent: Tuesday, February 23, 2021 8:50 AM
To: devel mailto:devel@edk2.groups.io>>; Ma, Maurice 
mailto:maurice...@intel.com>>; Patrick Rudolph 
mailto:patrick.rudo...@9elements.com>>; Dong, 
Guo mailto:guo.d...@intel.com>>; Dong, Eric 
mailto:eric.d...@intel.com>>; Ni, Ray 
mailto:ray...@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: Re: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 
4GB memory WA

we will save the current BSP's GDT and IDT for APs at first time APs are waken 
by BSP as below. APs will start from real mode to protected mode and then to 
long mode. During protected mode, BSP's GDT/IDT table are working on APs.

In UefiCpuPkg\

Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB memory WA

2021-02-22 Thread Ma, Maurice
Could we decouple BSP and AP GDT in early waking up stage ?
For example, AP uses temporary GDT (below 4GB) just for mode switching.  Once 
AP is in the final stage,  AP can reload GDT to match BSP.  In this way, we 
don’t have assumption on the final GDT location.

Thanks
Maurice
From: Ni, Ray 
Sent: Monday, February 22, 2021 21:22
To: devel@edk2.groups.io; fanjianf...@byosoft.com.cn; Ma, Maurice 
; Patrick Rudolph ; Dong, 
Guo ; Dong, Eric 
Cc: You, Benjamin 
Subject: RE: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB 
memory WA

“But we could allocate room under 4G for GDT table directly in CpuDxe.”
The GDT pre-allocated is re-used by AP. Why do you suggest CpuDxe allocate GDT?

Thanks,
Ray

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> On Behalf Of Jeff Fan
Sent: Tuesday, February 23, 2021 11:43 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Ni, Ray 
mailto:ray...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; Patrick Rudolph 
mailto:patrick.rudo...@9elements.com>>; Dong, 
Guo mailto:guo.d...@intel.com>>; Dong, Eric 
mailto:eric.d...@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB 
memory WA

Ray,

Yes. You are right. Acutally, x64 IDT table cannot work correctly on protected 
mode. :-)

But for GDT location, I agree it should be located under 4G space to support AP 
mode changing.  But we could allocate room under 4G for GDT table directly in 
CpuDxe.

Thanks,
Jeff


From: Ni, Ray<mailto:ray...@intel.com>
Date: 2021-02-23 10:52
To: fanjianf...@byosoft.com.cn<mailto:fanjianf...@byosoft.com.cn>; 
devel<mailto:devel@edk2.groups.io>; Ma, Maurice<mailto:maurice...@intel.com>; 
Patrick Rudolph<mailto:patrick.rudo...@9elements.com>; Dong, 
Guo<mailto:guo.d...@intel.com>; Dong, Eric<mailto:eric.d...@intel.com>
CC: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; You, 
Benjamin<mailto:benjamin@intel.com>
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB 
memory WA
Jeff,
You are right that BSP’s GDT and IDT tables are under 4G memory.

It’s because when AP wakes up, it needs the GDT for entering protected mode. AP 
cannot access above 4G memory without entering to long mode.

I do agree that the 64bit IDT is not proper for AP when entering protected 
mode. As long as there is no exception in the short time frame (load 64bit IDT, 
before entering long mode), it’s still ok.

Thanks,
Ray

From: fanjianf...@byosoft.com.cn<mailto:fanjianf...@byosoft.com.cn> 
mailto:fanjianf...@byosoft.com.cn>>
Sent: Tuesday, February 23, 2021 8:50 AM
To: devel mailto:devel@edk2.groups.io>>; Ma, Maurice 
mailto:maurice...@intel.com>>; Patrick Rudolph 
mailto:patrick.rudo...@9elements.com>>; Dong, 
Guo mailto:guo.d...@intel.com>>; Dong, Eric 
mailto:eric.d...@intel.com>>; Ni, Ray 
mailto:ray...@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: Re: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 
4GB memory WA

we will save the current BSP's GDT and IDT for APs at first time APs are waken 
by BSP as below. APs will start from real mode to protected mode and then to 
long mode. During protected mode, BSP's GDT/IDT table are working on APs.

In UefiCpuPkg\Library\MpInitLib\MpLib.c,
  //
  // Get the BSP's data of GDT and IDT
  //
  AsmReadGdtr ((IA32_DESCRIPTOR *) >GdtrProfile);
  AsmReadIdtr ((IA32_DESCRIPTOR *) >IdtrProfile);

It seems to be one bug we have assumption on GDT table and IDT table located 
under 4G memory space.

Could Ray help me to confirm it?

Jeff

From: Ma, Maurice<mailto:maurice...@intel.com>
Date: 2021-02-23 00:49
To: Patrick Rudolph<mailto:patrick.rudo...@9elements.com>; Dong, 
Guo<mailto:guo.d...@intel.com>; Dong, Eric<mailto:eric.d...@intel.com>; Ni, 
Ray<mailto:ray...@intel.com>
CC: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; You, 
Benjamin<mailto:benjamin@intel.com>
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB 
memory WA
Hi, Ray and Eric,

Is there any reason why the GDT base was typecast to UINT32 in CpuDxe driver ?
In x64 long mode, the GDT base is actually 64bit.   Typecasting will zero out 
the high 32bit address.
To me the correct code seems to be something like:
gdtPtr.Base = (UINTN)(VOID*) gdt;

Thanks
Maurice
> -Original Message-
> From: Patrick Rudolph 
> mailto:patrick.rudo...@9elements.com>>
> Sent: Monday, February 22, 2021 7:43
> To: Dong, Guo mailto:guo.d...@intel.com>>
> Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Ma, Maurice 
&g

Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB memory WA

2021-02-22 Thread Ma, Maurice
Hi, Ray and Eric,

Is there any reason why the GDT base was typecast to UINT32 in CpuDxe driver ?  
In x64 long mode, the GDT base is actually 64bit.   Typecasting will zero out 
the high 32bit address.
To me the correct code seems to be something like: 
gdtPtr.Base = (UINTN)(VOID*) gdt;

Thanks
Maurice
> -Original Message-
> From: Patrick Rudolph 
> Sent: Monday, February 22, 2021 7:43
> To: Dong, Guo 
> Cc: devel@edk2.groups.io; Ma, Maurice ; You,
> Benjamin 
> Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry:
> Remove 4GB memory WA
> 
> Hi Guo,
> I tested on 078400ee15e7b250e4dfafd840c2e0c19835e16b and run it in
> QEMU.
> The problem seems to be here, as gdt is allocated > 4GiB:
> gdtPtr.Base = (UINT32)(UINTN)(VOID*) gdt;
> 
> Regards,
> Patrick
> 
> On Mon, Feb 22, 2021 at 3:59 PM Dong, Guo  wrote:
> >
> >
> > Hi Patrick,
> > Please make sure you are using latest master when testing this patch.
> > That issue should be fix be this patch:
> > UefiCpuPkg/CpuDxe: Fix boot error (commit:
> > ebfe2d3eb5ac7fd92d74011edb31303a181920c7)
> > And there is similar fix in another place as below:
> > UefiCpuPkg/MpInitLib: Fix a hang in above 4GB case (commit:
> > edd74ad3ad79b855f76d9cf60a96c405cb3e863b)
> >
> > Thanks,
> > Guo
> >
> > > -Original Message-----
> > > From: devel@edk2.groups.io  On Behalf Of
> > > Patrick Rudolph
> > > Sent: Monday, February 22, 2021 7:04 AM
> > > To: devel@edk2.groups.io; Ma, Maurice 
> > > Cc: Dong, Guo ; You, Benjamin
> > > 
> > > Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry:
> > > Remove 4GB memory WA
> > >
> > > This patch breaks booting on master.
> > > In CpuDxe.efi / InitGlobalDescriptorTable as the GDT pointer is
> > > casted to 32bits.
> > >
> > > Regards,
> > > Patrick
> > >
> > > On Fri, Feb 19, 2021 at 3:12 AM Ma, Maurice 
> wrote:
> > > >
> > > > Reviewed-by:  Maurice Ma 
> > > >
> > > > Regards
> > > > Maurice
> > > >
> > > > > -Original Message-
> > > > > From: Dong, Guo 
> > > > > Sent: Sunday, February 14, 2021 21:13
> > > > > To: devel@edk2.groups.io
> > > > > Cc: Ma, Maurice ; You, Benjamin
> > > > > 
> > > > > Subject: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry:
> > > > > Remove 4GB memory WA
> > > > >
> > > > > Previous it would hang in CpuDxe if DXE drivers are dispatched above
> 4GB.
> > > > > Now remove the work around since the fixed in CpuDxe are merged.
> > > > >
> > > > > Signed-off-by: Guo Dong 
> > > > > ---
> > > > >  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 5 -
> > > > >  1 file changed, 5 deletions(-)
> > > > >
> > > > > diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> > > > > b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> > > > > index 805f5448d9..c403b0a80a 100644
> > > > > --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> > > > > +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> > > > > @@ -40,11 +40,6 @@ MemInfoCallback (
> > > > >   EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
> > > > >   EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;
> > > > >
> > > > > -  if (Base >= BASE_4GB ) {
> > > > > -// Remove tested attribute to avoid DXE core to dispatch driver 
> > > > > to
> > > > > memory above 4GB
> > > > > -Attribue &= ~EFI_RESOURCE_ATTRIBUTE_TESTED;
> > > > > -  }
> > > > > -
> > > > >BuildResourceDescriptorHob (Type, Attribue,
> > > > > (EFI_PHYSICAL_ADDRESS)Base, Size);
> > > > >DEBUG ((DEBUG_INFO , "buildhob: base = 0x%lx, size = 0x%lx,
> > > > > type = 0x%x\n", Base, Size, Type));
> > > > >
> > > > > --
> > > > > 2.16.2.windows.1
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > 
> > >
> >


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




Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB memory WA

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

Regards
Maurice

> -Original Message-
> From: Dong, Guo 
> Sent: Sunday, February 14, 2021 21:13
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> 
> Subject: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove
> 4GB memory WA
> 
> Previous it would hang in CpuDxe if DXE drivers are dispatched above 4GB.
> Now remove the work around since the fixed in CpuDxe are merged.
> 
> Signed-off-by: Guo Dong 
> ---
>  UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 5 -
>  1 file changed, 5 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> index 805f5448d9..c403b0a80a 100644
> --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
> @@ -40,11 +40,6 @@ MemInfoCallback (
>   EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
>   EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;
> 
> -  if (Base >= BASE_4GB ) {
> -// Remove tested attribute to avoid DXE core to dispatch driver to
> memory above 4GB
> -Attribue &= ~EFI_RESOURCE_ATTRIBUTE_TESTED;
> -  }
> -
>BuildResourceDescriptorHob (Type, Attribue,
> (EFI_PHYSICAL_ADDRESS)Base, Size);
>DEBUG ((DEBUG_INFO , "buildhob: base = 0x%lx, size = 0x%lx, type =
> 0x%x\n", Base, Size, Type));
> 
> --
> 2.16.2.windows.1



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




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

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

Regards
Maurice

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



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




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix PciLib dependency on BlSupportDxe

2021-01-25 Thread Ma, Maurice
Reviewed-by:  Maurice Ma 

Regards
Maurice

> -Original Message-
> From: Patrick Rudolph 
> Sent: Monday, January 25, 2021 7:05
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin 
> Subject: [PATCH] UefiPayloadPkg: Fix PciLib dependency on BlSupportDxe
> 
> The PciLib depends on PCDs
> - PcdPciExpressBaseAddress
> - PcdPciExpressBaseSize
> being updated by BlSupportDxe before MMCONF accesses are working.
> 
> Add BlSupportDxe to APRIORI to start it first and get the system into an
> useable state where at least PCI accesses work reliable.
> 
> Fixes a bug where BlSupportDxe is scheduled too late and other DXEs fail to
> load due to broken PCI access.
> 
> Signed-off-by: Patrick Rudolph 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.fdf | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf
> b/UefiPayloadPkg/UefiPayloadPkg.fdf
> index a97ace7395..1ae260c13a 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.fdf
> +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
> @@ -80,6 +80,11 @@ READ_STATUS= TRUE
>  READ_LOCK_CAP  = TRUE READ_LOCK_STATUS   = TRUE +APRIORI DXE {+
> INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf+  INF
> MdeModulePkg/Universal/PCD/Dxe/Pcd.inf+  INF
> UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf+}  # # DXE Phase modules--
> 2.26.2



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




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add RNG support

2021-01-21 Thread Ma, Maurice
Hi,  Patrick
Let us add MdePkg maintainers into the discussion to see what could be the best 
approach for this.

Hi, Mike and Liming,
Any recommendation from your side ?

Thanks
Maurice

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Patrick
> Rudolph
> Sent: Thursday, January 21, 2021 1:05
> To: Ma, Maurice 
> Cc: devel@edk2.groups.io; Dong, Guo ; You, Benjamin
> 
> Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add RNG support
> 
> Hi Maurice,
> it's a copy of the MdeModulePkg's BaseRngLib with runtime detection support.
> 
> Are the MdeModulePkg maintainers OK with adding runtime detection support?
> I had the impression that it should only be used on platforms supporting 
> rdrand
> for sure, and therefore must not be used on platforms not supporting rdrand.
> 
> Kind Regards,
> Patrick Rudolph
> 
> On Thu, Jan 21, 2021 at 1:42 AM Ma, Maurice  wrote:
> >
> > Hi,  Patrick
> >
> > There is a BaseRngLib in MdePkg package already.  I am wondering why a new
> instance was created under UefiPayloadPkg in the patch.
> > Could we just reuse the same library in MdePkg?
> > If not, what is the reason?   Can we try to enhance the library in MdePkg to
> address it if required?
> >
> > Thanks
> > Maurice
> > > -Original Message-
> > > From: Patrick Rudolph 
> > > Sent: Wednesday, January 20, 2021 7:52
> > > To: devel@edk2.groups.io
> > > Cc: Ma, Maurice ; Dong, Guo
> > > ; You, Benjamin 
> > > Subject: [PATCH] UefiPayloadPkg: Add RNG support
> > >
> > > Uses the RDRAND instruction if available and install EfiRngProtocol.
> > > The protocol may be used by iPXE or the Linux kernel to gather entropy.
> > >
> > > Signed-off-by: Patrick Rudolph 
> > > ---
> > >  UefiPayloadPkg/Library/BaseRngLib/BaseRng.c  | 199
> > > 
> > >  UefiPayloadPkg/Library/BaseRngLib/BaseRngLib.inf |  32 
> > > UefiPayloadPkg/Library/BaseRngLib/BaseRngLib.uni |  17 ++
> > >  UefiPayloadPkg/UefiPayloadPkg.dsc|   8 +
> > >  UefiPayloadPkg/UefiPayloadPkg.fdf|   4 +
> > >  5 files changed, 260 insertions(+)
> > >
> > > diff --git a/UefiPayloadPkg/Library/BaseRngLib/BaseRng.c
> > > b/UefiPayloadPkg/Library/BaseRngLib/BaseRng.c
> > > new file mode 100644
> > > index 00..1fe9e1dbe0
> > > --- /dev/null
> > > +++ b/UefiPayloadPkg/Library/BaseRngLib/BaseRng.c
> > > @@ -0,0 +1,199 @@
> > > +/** @file+  Random number generator services that uses RdRand
> > > +instruction
> > > access+  to provide high-quality random numbers.++Copyright (c)
> > > access+ 2015, Intel
> > > Corporation. All rights reserved.+SPDX-License-Identifier:
> > > BSD-2-Clause-
> > > Patent++**/++#include +#include
> > > +#include ++STATIC
> > > BOOLEAN mHasRdRand;++//+// Bit mask used to determine if RdRand
> instruction is
> > > supported.+//+#define RDRAND_MASK  BIT30++//+// Limited 
> > > retry
> > > number when valid random data is returned.+// Uses the recommended
> > > value defined in Section 7.3.17 of "Intel 64 and IA-32+// Architectures
> Software
> > > Developer's Mannual".+//+#define RDRAND_RETRY_LIMIT   10++/**+
> The
> > > constructor function checks whether or not RDRAND instruction is
> > > supported+ by the host hardware.++  The constructor function checks
> > > whether or not RDRAND instruction is supported.+  It will always return
> RETURN_SUCCESS.++
> > > @retval RETURN_SUCCESS   The constructor always returns
> > > EFI_SUCCESS.++**/+RETURN_STATUS+EFIAPI+BaseRngLibConstructor (+
> > > VOID+  )+{+  UINT32  RegEax;+  UINT32  RegEcx;++  AsmCpuid
> > > (CPUID_SIGNATURE, , NULL, NULL, NULL);+  if (RegEax < 1) {+
> > > mHasRdRand = FALSE;+return RETURN_SUCCESS;+  }++  //+  // Determine
> > > RDRAND support by examining bit 30 of the ECX register returned by+  //
> CPUID.
> > > A value of 1 indicates that processor support RDRAND instruction.+
> > > //+ AsmCpuid (CPUID_VERSION_INFO, 0, 0, , 0);++  mHasRdRand =
> > > ((RegEcx & RDRAND_MASK) == RDRAND_MASK);++  return
> > > RETURN_SUCCESS;+}++/**+  Generates a 16-bit random number.++  if Rand
> is
> > > NULL, then ASSERT().++  @param[out] Rand Buffer pointer to store the
> 16-bit
> > > random value.++  @retval TRUE Random number generated
> successfully.+
> > > @retval FALSEFailed to generate 

Re: [edk2-devel] [PATCH] UefiPayloadPkg/BlSupportDxe: Use EfiSmbiosProtocol to install tables

2021-01-21 Thread Ma, Maurice
Hi, Patrick,

Since BlSupportDxe does some very basic initialization for UEFI payload (EX:  
Initialize PcdPciExpressBaseAddress dynamic PCD), and it needs to be done in 
very early phase.  So it is desired not to push the dispatching order by adding 
more dependencies.  Otherwise, drivers dispatched before it might get incorrect 
PCD values.

Yes, I know RegisterProtocolNotify() is discouraged for UEFI driver.   This 
driver is not UEFI driver, so we cannot use UEFI driver model to address it 
here.   Do we have any alternative way without adding new dependencies in INF ? 
 

Thanks
Maurice

> -Original Message-
> From: Patrick Rudolph 
> Sent: Thursday, January 21, 2021 0:11
> To: Ma, Maurice 
> Cc: devel@edk2.groups.io; Dong, Guo ; You, Benjamin
> 
> Subject: Re: [PATCH] UefiPayloadPkg/BlSupportDxe: Use EfiSmbiosProtocol to
> install tables
> 
> Hi Maurice,
> I'll adapt the function names to match EDK2 naming conventions.
> 
> The SmbiosDxe is already part of UefiPayloadPkg, so it's not optional (right 
> now).
> I don't see how registering gEfiSmbiosProtocolGuid could fail.
> If you think Depex must be true, there should be
> a) a comment stating the reasons why Depex must not be changed
> b) I'll have to move the SMBIOS code out of BlSupportDxe into
> BlSupportSmbiosDxe and add the Depex section there.
> A failed dispatch of BlSupportSmbiosDxe would then be non critical.
> 
> Do you think this would be a better solution?
> 
> I don't want to use RegisterProtocolNotify() as it's discouraged, isn't it?
> 
> Kind Regards,
> Patrick Rudolph
> 
> On Thu, Jan 21, 2021 at 2:14 AM Ma, Maurice  wrote:
> >
> > Hi, Patrick
> >
> > In this patch I noticed that we changed the BlSupportDxe dependency from
> True to gEfiSmbiosProtocolGuid.
> > Since BlSupportDxe is considered as critical for UEFI payload,  and on the 
> > other
> side SMBIOS driver could be optional in some case,  do you think it is better 
> to
> handle it through RegisterProtocolNotify() ?   In this way,  if
> gEfiSmbiosProtocolGuid is not installed for any reason,  BlSupportDxe can 
> still be
> dispatched and the boot flow can continue.
> >
> > Some other comments:
> > -  Please add function and parameter description for
> BlDxeInstallSMBIOStables().
> > -  To follow the naming convention in EDK2,   maybe  use
> BlDxeInstallSmbiosTables instead of BlDxeInstallSMBIOStables().
> >
> > Thanks
> > Maurice
> > > -Original Message-
> > > From: Patrick Rudolph 
> > > Sent: Wednesday, January 20, 2021 8:02
> > > To: devel@edk2.groups.io
> > > Cc: Ma, Maurice ; Dong, Guo
> > > ; You, Benjamin 
> > > Subject: [PATCH] UefiPayloadPkg/BlSupportDxe: Use EfiSmbiosProtocol
> > > to install tables
> > >
> > > The default EfiSmbiosProtocol operates on an empty SMBIOS table.
> > > As the SMBIOS tables are provided by the bootloader, install the
> > > SMBIOS tables using the EfiSmbiosProtocol.
> > >
> > > This fixes the settings menu not showing any hardware information,
> > > instead only
> > > "0 MB RAM" was displayed.
> > >
> > > Tests showed that the OS can still see the SMBIOS tables.
> > >
> > > Signed-off-by: Patrick Rudolph 
> > > ---
> > >  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c   | 111
> > > +++-
> > >  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h   |   3 +
> > >  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf |   5 +-
> > >  3 files changed, 115 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> > > b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> > > index a746d0581e..db478c1abc 100644
> > > --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> > > +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> > > @@ -79,6 +79,107 @@ ReserveResourceInGcd (
> > >return Status; } +EFI_STATUS+EFIAPI+BlDxeInstallSMBIOStables(+  IN
> UINT64
> > > SmbiosTableBase,+  IN UINT32SmbiosTableSize+)+{+  EFI_STATUS
> > > Status;+  SMBIOS_TABLE_ENTRY_POINT  *SmbiosTable;+
> > > SMBIOS_TABLE_3_0_ENTRY_POINT  *Smbios30Table;+
> > > SMBIOS_STRUCTURE_POINTER  Smbios;+  SMBIOS_STRUCTURE_POINTER
> > > SmbiosEnd;+  CHAR8 *String;+  EFI_SMBIOS_HANDLE
> > > SmbiosHandle;+  EFI_SMBIOS_PROTOCOL   *SmbiosProto;++  //+  //
> Locate
> > > Smbios protocol.+  //+  Status = gBS->LocateProtocol
> (,
> > > NULL, (VOID **));+  if (EFI_ERROR (Status)) {+DEBUG
> > > ((DEBUG

Re: [edk2-devel] [PATCH] UefiPayloadPkg/BlSupportDxe: Use EfiSmbiosProtocol to install tables

2021-01-20 Thread Ma, Maurice
Hi, Patrick

In this patch I noticed that we changed the BlSupportDxe dependency from True 
to gEfiSmbiosProtocolGuid.
Since BlSupportDxe is considered as critical for UEFI payload,  and on the 
other side SMBIOS driver could be optional in some case,  do you think it is 
better to handle it through RegisterProtocolNotify() ?   In this way,  if 
gEfiSmbiosProtocolGuid is not installed for any reason,  BlSupportDxe can still 
be dispatched and the boot flow can continue.

Some other comments:
-  Please add function and parameter description for BlDxeInstallSMBIOStables().
-  To follow the naming convention in EDK2,   maybe  use 
BlDxeInstallSmbiosTables instead of BlDxeInstallSMBIOStables().

Thanks
Maurice
> -Original Message-
> From: Patrick Rudolph 
> Sent: Wednesday, January 20, 2021 8:02
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo ;
> You, Benjamin 
> Subject: [PATCH] UefiPayloadPkg/BlSupportDxe: Use EfiSmbiosProtocol to
> install tables
> 
> The default EfiSmbiosProtocol operates on an empty SMBIOS table.
> As the SMBIOS tables are provided by the bootloader, install the SMBIOS tables
> using the EfiSmbiosProtocol.
> 
> This fixes the settings menu not showing any hardware information, instead 
> only
> "0 MB RAM" was displayed.
> 
> Tests showed that the OS can still see the SMBIOS tables.
> 
> Signed-off-by: Patrick Rudolph 
> ---
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c   | 111
> +++-
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h   |   3 +
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf |   5 +-
>  3 files changed, 115 insertions(+), 4 deletions(-)
> 
> diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> index a746d0581e..db478c1abc 100644
> --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> @@ -79,6 +79,107 @@ ReserveResourceInGcd (
>return Status; } +EFI_STATUS+EFIAPI+BlDxeInstallSMBIOStables(+  IN UINT64
> SmbiosTableBase,+  IN UINT32SmbiosTableSize+)+{+  EFI_STATUS
> Status;+  SMBIOS_TABLE_ENTRY_POINT  *SmbiosTable;+
> SMBIOS_TABLE_3_0_ENTRY_POINT  *Smbios30Table;+
> SMBIOS_STRUCTURE_POINTER  Smbios;+  SMBIOS_STRUCTURE_POINTER
> SmbiosEnd;+  CHAR8 *String;+  EFI_SMBIOS_HANDLE
> SmbiosHandle;+  EFI_SMBIOS_PROTOCOL   *SmbiosProto;++  //+  // Locate
> Smbios protocol.+  //+  Status = gBS->LocateProtocol (,
> NULL, (VOID **));+  if (EFI_ERROR (Status)) {+DEBUG
> ((DEBUG_ERROR, "%a: Failed to locate gEfiSmbiosProtocolGuid\n",+
> __FUNCTION__));+return Status;+  }++  Smbios30Table =
> (SMBIOS_TABLE_3_0_ENTRY_POINT *)(UINTN)(SmbiosTableBase);+
> SmbiosTable = (SMBIOS_TABLE_ENTRY_POINT *)(UINTN)(SmbiosTableBase);++
> if (CompareMem (Smbios30Table->AnchorString, "_SM3_", 5) == 0) {+
> Smbios.Hdr = (SMBIOS_STRUCTURE *) (UINTN) Smbios30Table-
> >TableAddress;+SmbiosEnd.Raw = (UINT8 *) (UINTN) (Smbios30Table-
> >TableAddress + Smbios30Table->TableMaximumSize);+if (Smbios30Table-
> >TableMaximumSize > SmbiosTableSize) {+  DEBUG((DEBUG_INFO, "%a:
> SMBIOS table size greater than reported by bootloader\n",+
> __FUNCTION__));+}+  } else if (CompareMem (SmbiosTable->AnchorString,
> "_SM_", 4) == 0) {+Smbios.Hdr= (SMBIOS_STRUCTURE *) (UINTN)
> SmbiosTable->TableAddress;+SmbiosEnd.Raw = (UINT8 *) ((UINTN)
> SmbiosTable->TableAddress + SmbiosTable->TableLength);++if (SmbiosTable-
> >TableLength > SmbiosTableSize) {+  DEBUG((DEBUG_INFO, "%a: SMBIOS
> table size greater than reported by bootloader\n",+
> __FUNCTION__));+}+  } else {+DEBUG ((DEBUG_ERROR, "%a: No valid
> SMBIOS table found\n", __FUNCTION__ ));+return EFI_NOT_FOUND;+  }++
> do {+// Check for end marker+if (Smbios.Hdr->Type == 127) {+
> break;+}++// Install the table+SmbiosHandle =
> SMBIOS_HANDLE_PI_RESERVED;+Status = SmbiosProto->Add (+
> SmbiosProto,+  gImageHandle,+ 
>  ,+
> Smbios.Hdr+  );+ASSERT_EFI_ERROR (Status);+if 
> (EFI_ERROR
> (Status)) {+  return Status;+}+//+// Go to the next SMBIOS 
> structure.
> Each SMBIOS structure may include 2 parts:+// 1. Formatted section; 2.
> Unformatted string section. So, 2 steps are needed+// to skip one SMBIOS
> structure.+//++//+// Step 1: Skip over formatted section.+//+ 
>String =
> (CHAR8 *) (Smbios.Raw + Smbios.Hdr->Length);++//+// Step 2: Skip over
> unformatted string section.+//+do {+  //+  // Each string is 
> terminated
> with a NULL(00

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add RNG support

2021-01-20 Thread Ma, Maurice
Hi,  Patrick

There is a BaseRngLib in MdePkg package already.  I am wondering why a new 
instance was created under UefiPayloadPkg in the patch.
Could we just reuse the same library in MdePkg?   
If not, what is the reason?   Can we try to enhance the library in MdePkg to 
address it if required?

Thanks
Maurice
> -Original Message-
> From: Patrick Rudolph 
> Sent: Wednesday, January 20, 2021 7:52
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo ;
> You, Benjamin 
> Subject: [PATCH] UefiPayloadPkg: Add RNG support
> 
> Uses the RDRAND instruction if available and install EfiRngProtocol.
> The protocol may be used by iPXE or the Linux kernel to gather entropy.
> 
> Signed-off-by: Patrick Rudolph 
> ---
>  UefiPayloadPkg/Library/BaseRngLib/BaseRng.c  | 199
> 
>  UefiPayloadPkg/Library/BaseRngLib/BaseRngLib.inf |  32 
> UefiPayloadPkg/Library/BaseRngLib/BaseRngLib.uni |  17 ++
>  UefiPayloadPkg/UefiPayloadPkg.dsc|   8 +
>  UefiPayloadPkg/UefiPayloadPkg.fdf|   4 +
>  5 files changed, 260 insertions(+)
> 
> diff --git a/UefiPayloadPkg/Library/BaseRngLib/BaseRng.c
> b/UefiPayloadPkg/Library/BaseRngLib/BaseRng.c
> new file mode 100644
> index 00..1fe9e1dbe0
> --- /dev/null
> +++ b/UefiPayloadPkg/Library/BaseRngLib/BaseRng.c
> @@ -0,0 +1,199 @@
> +/** @file+  Random number generator services that uses RdRand instruction
> access+  to provide high-quality random numbers.++Copyright (c) 2015, Intel
> Corporation. All rights reserved.+SPDX-License-Identifier: BSD-2-Clause-
> Patent++**/++#include +#include
> +#include ++STATIC BOOLEAN
> mHasRdRand;++//+// Bit mask used to determine if RdRand instruction is
> supported.+//+#define RDRAND_MASK  BIT30++//+// Limited retry
> number when valid random data is returned.+// Uses the recommended value
> defined in Section 7.3.17 of "Intel 64 and IA-32+// Architectures Software
> Developer's Mannual".+//+#define RDRAND_RETRY_LIMIT   10++/**+  The
> constructor function checks whether or not RDRAND instruction is supported+
> by the host hardware.++  The constructor function checks whether or not
> RDRAND instruction is supported.+  It will always return RETURN_SUCCESS.++
> @retval RETURN_SUCCESS   The constructor always returns
> EFI_SUCCESS.++**/+RETURN_STATUS+EFIAPI+BaseRngLibConstructor (+
> VOID+  )+{+  UINT32  RegEax;+  UINT32  RegEcx;++  AsmCpuid
> (CPUID_SIGNATURE, , NULL, NULL, NULL);+  if (RegEax < 1) {+
> mHasRdRand = FALSE;+return RETURN_SUCCESS;+  }++  //+  // Determine
> RDRAND support by examining bit 30 of the ECX register returned by+  // CPUID.
> A value of 1 indicates that processor support RDRAND instruction.+  //+
> AsmCpuid (CPUID_VERSION_INFO, 0, 0, , 0);++  mHasRdRand =
> ((RegEcx & RDRAND_MASK) == RDRAND_MASK);++  return
> RETURN_SUCCESS;+}++/**+  Generates a 16-bit random number.++  if Rand is
> NULL, then ASSERT().++  @param[out] Rand Buffer pointer to store the 
> 16-bit
> random value.++  @retval TRUE Random number generated successfully.+
> @retval FALSEFailed to generate the random
> number.++**/+BOOLEAN+EFIAPI+GetRandomNumber16 (+  OUT UINT16
> *Rand+  )+{+  UINT32  Index;++  ASSERT (Rand != NULL);++  if (mHasRdRand) {+
> //+// A loop to fetch a 16 bit random value with a retry count limit.+
> //+
> for (Index = 0; Index < RDRAND_RETRY_LIMIT; Index++) {+  if (AsmRdRand16
> (Rand)) {+return TRUE;+  }+}+  }++  return FALSE;+}++/**+  
> Generates a
> 32-bit random number.++  if Rand is NULL, then ASSERT().++  @param[out]
> Rand Buffer pointer to store the 32-bit random value.++  @retval TRUE
> Random number generated successfully.+  @retval FALSEFailed to 
> generate
> the random number.++**/+BOOLEAN+EFIAPI+GetRandomNumber32 (+  OUT
> UINT32*Rand+  )+{+  UINT32  Index;++  ASSERT (Rand != 
> NULL);++  if
> (mHasRdRand) {+//+// A loop to fetch a 32 bit random value with a 
> retry
> count limit.+//+for (Index = 0; Index < RDRAND_RETRY_LIMIT; Index++) 
> {+
> if (AsmRdRand32 (Rand)) {+return TRUE;+  }+}+  }++  return
> FALSE;+}++/**+  Generates a 64-bit random number.++  if Rand is NULL, then
> ASSERT().++  @param[out] Rand Buffer pointer to store the 64-bit random
> value.++  @retval TRUE Random number generated successfully.+  @retval
> FALSEFailed to generate the random
> number.++**/+BOOLEAN+EFIAPI+GetRandomNumber64 (+  OUT UINT64
> *Rand+  )+{+  UINT32  Index;++  ASSERT (Rand != NULL);++  if (mHasRdRand) {+
> //+// A loop to fetch a 64 bit random value with a retry count limit.+
> //+
> for (Index = 0; Index < RDRA

Re: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Set default PciBaseSize on Ia32

2020-09-28 Thread Ma, Maurice
Reviewed-by: 
Maurice Ma 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Marcello
> Sylvester Bauer
> Sent: Thursday, September 24, 2020 4:49
> To: devel@edk2.groups.io
> Cc: Marcello Sylvester Bauer ;
> patrick.rudo...@9elements.com; Ma, Maurice ; Dong,
> Guo ; You, Benjamin 
> Subject: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Set default PciBaseSize
> on Ia32
> 
> Add missing PcdPciExpressBaseSize default on Ia32 targets analog to X64.
> 
> This adjustment relates to the changes in commit:
> 8028b2907e20b21cd7d69639a36ac82a77c81dc1
> 
> Signed-off-by: Marcello Sylvester Bauer 
> Cc: Patrick Rudolph 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index 12d7ffe81416..36ed460053d0 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -364,6 +364,7 @@ [PcdsDynamicDefault]
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|31
> gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|100
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0+
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0
> #
> ### #--
> 2.28.0
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#65565): https://edk2.groups.io/g/devel/message/65565
> Mute This Topic: https://groups.io/mt/77055386/1773972
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [maurice...@intel.com] -
> =-=-=-=-=-=
> 



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




Re: [edk2-devel] [PATCH v3 1/3] UefiPayloadPkg: Store the size of the MMCONF window

2020-07-22 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: Marcello Sylvester Bauer 
> Sent: Wednesday, July 22, 2020 6:16
> To: devel@edk2.groups.io
> Cc: Patrick Rudolph ; Christian Walter
> ; Ma, Maurice ;
> Dong, Guo ; You, Benjamin 
> Subject: [PATCH v3 1/3] UefiPayloadPkg: Store the size of the MMCONF
> window
> 
> From: Patrick Rudolph 
> 
> Store the real size of the Pcie Memory Mapped Address Space.
> This change is necessary to support variable size of MMCONF spaces.
> 
> Signed-off-by: Patrick Rudolph 
> Signed-off-by: Marcello Sylvester Bauer 
> Cc: Patrick Rudolph 
> Cc: Christian Walter 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> ---
>  UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h | 1 +
>  UefiPayloadPkg/BlSupportPei/BlSupportPei.c  | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> b/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> index fe783fe5e14c..043b748ae4a9 100644
> --- a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> +++ b/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> @@ -24,6 +24,7 @@ typedef struct {
>UINT64 PmTimerRegBase;
> 
>UINT64 ResetRegAddress;
> 
>UINT64 PcieBaseAddress;
> 
> +  UINT64 PcieBaseSize;
> 
>  } ACPI_BOARD_INFO;
> 
> 
> 
>  #endif
> 
> diff --git a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> index 22972453117a..a7e99f9ec6de 100644
> --- a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> +++ b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> @@ -240,8 +240,10 @@ Done:
>if (MmCfgHdr != NULL) {
> 
>  MmCfgBase =
> (EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_A
> DDRESS_ALLOCATION_STRUCTURE *)((UINT8*) MmCfgHdr + sizeof
> (*MmCfgHdr));
> 
>  AcpiBoardInfo->PcieBaseAddress = MmCfgBase->BaseAddress;
> 
> +AcpiBoardInfo->PcieBaseSize = (MmCfgBase->EndBusNumber + 1 -
> MmCfgBase->StartBusNumber) * 4096 * 32 * 8;
> 
>} else {
> 
>  AcpiBoardInfo->PcieBaseAddress = 0;
> 
> +AcpiBoardInfo->PcieBaseSize = 0;
> 
>}
> 
>DEBUG ((DEBUG_INFO, "PmCtrl  Reg 0x%lx\n",  AcpiBoardInfo-
> >PmCtrlRegBase));
> 
>DEBUG ((DEBUG_INFO, "PmTimer Reg 0x%lx\n",  AcpiBoardInfo-
> >PmTimerRegBase));
> 
> @@ -250,6 +252,7 @@ Done:
>DEBUG ((DEBUG_INFO, "PmEvt   Reg 0x%lx\n",  AcpiBoardInfo->PmEvtBase));
> 
>DEBUG ((DEBUG_INFO, "PmGpeEn Reg 0x%lx\n",  AcpiBoardInfo-
> >PmGpeEnBase));
> 
>DEBUG ((DEBUG_INFO, "PcieBaseAddr 0x%lx\n", AcpiBoardInfo-
> >PcieBaseAddress));
> 
> +  DEBUG ((DEBUG_INFO, "PcieBaseSize 0x%lx\n", AcpiBoardInfo-
> >PcieBaseSize));
> 
> 
> 
>//
> 
>// Verify values for proper operation
> 
> --
> 2.27.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#63117): https://edk2.groups.io/g/devel/message/63117
Mute This Topic: https://groups.io/mt/75724105/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v10 10/46] UefiPayloadPkg: Prepare UefiPayloadPkg to use the VmgExitLib library

2020-07-20 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Lendacky,
> Thomas
> Sent: Tuesday, July 14, 2020 7:28
> To: devel@edk2.groups.io
> Cc: Brijesh Singh ; Ard Biesheuvel
> ; Dong, Eric ; Justen, Jordan
> L ; Laszlo Ersek ; Gao, Liming
> ; Kinney, Michael D ; Ni,
> Ray ; Ma, Maurice ; Dong, Guo
> ; You, Benjamin 
> Subject: [edk2-devel] [PATCH v10 10/46] UefiPayloadPkg: Prepare
> UefiPayloadPkg to use the VmgExitLib library
> 
> From: Tom Lendacky 
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198
> 
> Various CpuExceptionHandlerLib libraries will updated to use the new
> VmgExitLib library. To prevent any build breakage, update the UefiPayloadPkg
> DSC files that use a form of the CpuExceptionHandlerLib library to include the
> VmgExitLib library.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Reviewed-by: Guo Dong 
> Signed-off-by: Tom Lendacky 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc| 2 ++
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index 9a9ca3060e47..460da1c504dc 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -237,6 +237,7 @@ [LibraryClasses.common.DXE_CORE]
> 
> DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib
> .inf
>  !endif
> 
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpu
> ExceptionHandlerLib.inf
> +  VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
> 
>  [LibraryClasses.common.DXE_DRIVER]
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> @@ -249,6 +250,7 @@ [LibraryClasses.common.DXE_DRIVER]
>  !endif
> 
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpu
> ExceptionHandlerLib.inf
>MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> +  VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
> 
>  [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index a768a8702c66..942bc9076634 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -238,6 +238,7 @@ [LibraryClasses.common.DXE_CORE]
> 
> DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib
> .inf
>  !endif
> 
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpu
> ExceptionHandlerLib.inf
> +  VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
> 
>  [LibraryClasses.common.DXE_DRIVER]
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> @@ -250,6 +251,7 @@ [LibraryClasses.common.DXE_DRIVER]
>  !endif
> 
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpu
> ExceptionHandlerLib.inf
>MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> +  VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
> 
>  [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> --
> 2.27.0
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62850): https://edk2.groups.io/g/devel/message/62850
Mute This Topic: https://groups.io/mt/75499809/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 2/2] MdePkg: Add support for variable size MMCONF space

2020-07-20 Thread Ma, Maurice
Hi Marcello,

Since this patch mixes changes for both UefiPayloadPkg  and MdePkg.  I think 
you might want to split this patch into two so that it can be reviewed by the 
proper package maintainers.

Thanks
Maurice
> -Original Message-
> From: Marcello Sylvester Bauer 
> Sent: Thursday, July 16, 2020 4:48
> To: devel@edk2.groups.io
> Cc: Patrick Rudolph ; Christian Walter
> ; Ma, Maurice ;
> Desimone, Nathaniel L ; Zeng, Star
> ; Kinney, Michael D ; Gao,
> Liming 
> Subject: [PATCH v2 2/2] MdePkg: Add support for variable size MMCONF space
> 
> From: Patrick Rudolph 
> 
> On embedded AMD platforms the MMCONF window is usually only 64MiB.
> 
> Add support for arbitrary sized MMCONF by introducing a new PCD.
> The default size is still 256MiB, but will be overwritten by UefiPayloadPkg 
> with
> the real MMCONF size.
> 
> Fixes crash on platforms not exposing 256 buses.
> 
> Tested on:
> * AMD Stoney Ridge
> 
> Signed-off-by: Patrick Rudolph 
> Signed-off-by: Marcello Sylvester Bauer 
> Cc: Patrick Rudolph 
> Cc: Christian Walter 
> Cc: Maurice Ma 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> ---
>  MdePkg/MdePkg.dec  |   4 +
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc   |   1 +
>  MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf |   6 +-
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf   |   1 +
>  MdePkg/Include/Library/PciExpressLib.h |   5 +-
>  MdePkg/Library/BasePciExpressLib/PciExpressLib.c   | 118
> +++-
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c |   4 +-
>  7 files changed, 131 insertions(+), 8 deletions(-)
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> 73f6c2407357..02e736a01126 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -2274,6 +2274,10 @@ [PcdsFixedAtBuild, PcdsPatchableInModule,
> PcdsDynamic, PcdsDynamicEx]
># @Prompt PCI Express Base Address.
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000|UINT64|
> 0x000a +  ## This value is used to set the size of PCI express hierarchy. 
> The
> default is 256 MB.+  # @Prompt PCI Express Base Size.+
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x0FFF|UINT64|0x00
> 0f+   ## Default current ISO 639-2 language: English & French.   #
> @Prompt Default Value of LangCodes Variable.
> gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfraengfra"
> |VOID*|0x001cdiff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index a768a8702c66..162cbf47a83f 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -363,6 +363,7 @@ [PcdsDynamicDefault]
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|31
> gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|100
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0+
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0
> #
> ### #diff --git
> a/MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
> b/MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
> index a7edb74cde71..12734b022ac7 100644
> --- a/MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
> +++ b/MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
> @@ -1,7 +1,7 @@
>  ## @file-#  Instance of PCI Express Library using the 256 MB PCI Express MMIO
> window.+#  Instance of PCI Express Library using the variable size PCI Express
> MMIO window. #-#  PCI Express Library that uses the 256 MB PCI Express MMIO
> window to perform+#  PCI Express Library that uses the variable size PCI 
> Express
> MMIO window to perform #  PCI Configuration cycles. Layers on top of an I/O
> Library instance. # #  Copyright (c) 2007 - 2018, Intel Corporation. All 
> rights
> reserved.@@ -38,4 +38,4 @@ [LibraryClasses]
>   [Pcd]   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress  ##
> CONSUMES-+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize  ##
> CONSUMESdiff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> index 1371d5eb7952..cebc81135565 100644
> --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> @@ -54,6 +54,7 @@ [Pcd]
>gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution
> gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress+
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize  [Depex]   TRUEdiff --git
> a/MdePkg/Include/Library/PciExpressLib.h
> b/MdePkg/Include/Library/Pc

Re: [edk2-devel] [PATCH v2 1/2] UefiPayloadPkg: Store the real size of the MMCONF window

2020-07-20 Thread Ma, Maurice
Hi Marcello,

Could you put a little bit more details in the patch commit message ?   

Thanks
Maurice
> -Original Message-
> From: Marcello Sylvester Bauer 
> Sent: Thursday, July 16, 2020 4:48
> To: devel@edk2.groups.io
> Cc: Patrick Rudolph ; Christian Walter
> ; Ma, Maurice ;
> Desimone, Nathaniel L ; Zeng, Star
> ; Kinney, Michael D ; Gao,
> Liming 
> Subject: [PATCH v2 1/2] UefiPayloadPkg: Store the real size of the MMCONF
> window
> 
> From: Patrick Rudolph 
> 
> This will fix issues with the PciBusDxe.
> 
> Signed-off-by: Patrick Rudolph 
> Signed-off-by: Marcello Sylvester Bauer 
> Cc: Patrick Rudolph 
> Cc: Christian Walter 
> Cc: Maurice Ma 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> ---
>  UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h | 1 +
>  UefiPayloadPkg/BlSupportPei/BlSupportPei.c  | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> b/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> index fe783fe5e14c..043b748ae4a9 100644
> --- a/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> +++ b/UefiPayloadPkg/Include/Guid/AcpiBoardInfoGuid.h
> @@ -24,6 +24,7 @@ typedef struct {
>UINT64 PmTimerRegBase;
> 
>UINT64 ResetRegAddress;
> 
>UINT64 PcieBaseAddress;
> 
> +  UINT64 PcieBaseSize;
> 
>  } ACPI_BOARD_INFO;
> 
> 
> 
>  #endif
> 
> diff --git a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> index 22972453117a..a7e99f9ec6de 100644
> --- a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> +++ b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> @@ -240,8 +240,10 @@ Done:
>if (MmCfgHdr != NULL) {
> 
>  MmCfgBase =
> (EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_A
> DDRESS_ALLOCATION_STRUCTURE *)((UINT8*) MmCfgHdr + sizeof
> (*MmCfgHdr));
> 
>  AcpiBoardInfo->PcieBaseAddress = MmCfgBase->BaseAddress;
> 
> +AcpiBoardInfo->PcieBaseSize = (MmCfgBase->EndBusNumber + 1 -
> MmCfgBase->StartBusNumber) * 4096 * 32 * 8;
> 
>} else {
> 
>  AcpiBoardInfo->PcieBaseAddress = 0;
> 
> +AcpiBoardInfo->PcieBaseSize = 0;
> 
>}
> 
>DEBUG ((DEBUG_INFO, "PmCtrl  Reg 0x%lx\n",  AcpiBoardInfo-
> >PmCtrlRegBase));
> 
>DEBUG ((DEBUG_INFO, "PmTimer Reg 0x%lx\n",  AcpiBoardInfo-
> >PmTimerRegBase));
> 
> @@ -250,6 +252,7 @@ Done:
>DEBUG ((DEBUG_INFO, "PmEvt   Reg 0x%lx\n",  AcpiBoardInfo->PmEvtBase));
> 
>DEBUG ((DEBUG_INFO, "PmGpeEn Reg 0x%lx\n",  AcpiBoardInfo-
> >PmGpeEnBase));
> 
>DEBUG ((DEBUG_INFO, "PcieBaseAddr 0x%lx\n", AcpiBoardInfo-
> >PcieBaseAddress));
> 
> +  DEBUG ((DEBUG_INFO, "PcieBaseSize 0x%lx\n", AcpiBoardInfo-
> >PcieBaseSize));
> 
> 
> 
>//
> 
>// Verify values for proper operation
> 
> --
> 2.27.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62848): https://edk2.groups.io/g/devel/message/62848
Mute This Topic: https://groups.io/mt/75539545/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 1/1] UefiPayloadPkg: Remove x86 legacy UART defaults

2020-07-13 Thread Ma, Maurice
As I mentioned in the previous comments,  could you please CC all 
UefiPayloadPkg maintainers listed in the Maintainers.txt under the root of the 
EDK2 directory for code changes in UefiPayloadPkg  ?

Other than that, this patch looks good to me.

Reviewed-by: Maurice Ma 

Thanks
Maurice
> -Original Message-
> From: Marcello Sylvester Bauer 
> Sent: Monday, July 13, 2020 1:25
> To: devel@edk2.groups.io
> Cc: Patrick Rudolph ; Christian Walter
> ; Ma, Maurice ;
> Desimone, Nathaniel L ; Zeng, Star
> 
> Subject: [PATCH v2 1/1] UefiPayloadPkg: Remove x86 legacy UART defaults
> 
> From: Patrick Rudolph 
> 
> The BaseSerialPortLib16550 does fallback to a fixed address UART defined by
> PcdSerialRegisterBase and does not initialize if it is zero. Do not assume a 
> serial
> port at 0x3F8, otherwise it could cause errors during initialisation of a non-
> existent serial port on non legacy platforms.
> 
> Signed-off-by: Patrick Rudolph 
> Signed-off-by: Marcello Sylvester Bauer 
> Cc: Patrick Rudolph 
> Cc: Christian Walter 
> Cc: Maurice Ma 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc| 2 +-
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index 0efcfa8fb2f4..0d8854810700 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -306,7 +306,7 @@ [PcdsPatchableInModule.common]
># The following parameters are set by Library/PlatformHookLib   #
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE-
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f8+
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1 diff --git
> a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index d645d233cd08..34640b1fc1da 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -307,7 +307,7 @@ [PcdsPatchableInModule.common]
># The following parameters are set by Library/PlatformHookLib   #
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE-
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f8+
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1 --
> 2.27.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62430): https://edk2.groups.io/g/devel/message/62430
Mute This Topic: https://groups.io/mt/75472935/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Remove x86 legacy UART defaults

2020-07-08 Thread Ma, Maurice
BTW,  I just noticed that not all package maintainers are on the CC list.  
For changed under UefiPayloadPkg,  please ensure you CC all UefiPayloadPkg 
maintainers listed in the Maintainers.txt under the root of the EDK2 directory.

Thanks
Maurice
> -Original Message-
> From: Ma, Maurice
> Sent: Wednesday, July 8, 2020 8:25
> To: 'Marcello Sylvester Bauer' ;
> devel@edk2.groups.io
> Cc: Patrick Rudolph ; Christian Walter
> ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: RE: [PATCH v1 1/1] UefiPayloadPkg: Remove x86 legacy UART defaults
> 
> Could you please add some commit message to explain what issue you are trying
> to address ?  Why is it required ?
> 
> Thanks
> Maurice
> > -Original Message-
> > From: Marcello Sylvester Bauer 
> > Sent: Wednesday, July 8, 2020 7:09
> > To: devel@edk2.groups.io
> > Cc: Patrick Rudolph ; Christian Walter
> > ; Ma, Maurice ;
> > Desimone, Nathaniel L ; Zeng, Star
> > 
> > Subject: [PATCH v1 1/1] UefiPayloadPkg: Remove x86 legacy UART
> > defaults
> >
> > From: Patrick Rudolph 
> >
> > Signed-off-by: Patrick Rudolph 
> > Signed-off-by: Marcello Sylvester Bauer 
> > Cc: Patrick Rudolph 
> > Cc: Christian Walter 
> > Cc: Maurice Ma 
> > Cc: Nate DeSimone 
> > Cc: Star Zeng 
> > ---
> >  UefiPayloadPkg/UefiPayloadPkgIa32.dsc| 2 +-
> >  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> > b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> > index 0efcfa8fb2f4..0d8854810700 100644
> > --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> > +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> > @@ -306,7 +306,7 @@ [PcdsPatchableInModule.common]
> ># The following parameters are set by Library/PlatformHookLib
> >
> >#
> >
> >gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
> >
> > -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f8
> >
> > +  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0
> >
> >gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
> >
> >gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1
> >
> >
> >
> > diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> > b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> > index d645d233cd08..34640b1fc1da 100644
> > --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> > +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> > @@ -307,7 +307,7 @@ [PcdsPatchableInModule.common]
> ># The following parameters are set by Library/PlatformHookLib
> >
> >#
> >
> >gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
> >
> > -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f8
> >
> > +  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0
> >
> >gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
> >
> >gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1
> >
> >
> >
> > --
> > 2.27.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62258): https://edk2.groups.io/g/devel/message/62258
Mute This Topic: https://groups.io/mt/75376903/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Remove x86 legacy UART defaults

2020-07-08 Thread Ma, Maurice
Could you please add some commit message to explain what issue you are trying 
to address ?  Why is it required ?

Thanks
Maurice
> -Original Message-
> From: Marcello Sylvester Bauer 
> Sent: Wednesday, July 8, 2020 7:09
> To: devel@edk2.groups.io
> Cc: Patrick Rudolph ; Christian Walter
> ; Ma, Maurice ;
> Desimone, Nathaniel L ; Zeng, Star
> 
> Subject: [PATCH v1 1/1] UefiPayloadPkg: Remove x86 legacy UART defaults
> 
> From: Patrick Rudolph 
> 
> Signed-off-by: Patrick Rudolph 
> Signed-off-by: Marcello Sylvester Bauer 
> Cc: Patrick Rudolph 
> Cc: Christian Walter 
> Cc: Maurice Ma 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc| 2 +-
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index 0efcfa8fb2f4..0d8854810700 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -306,7 +306,7 @@ [PcdsPatchableInModule.common]
># The following parameters are set by Library/PlatformHookLib
> 
>#
> 
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
> 
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f8
> 
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0
> 
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
> 
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1
> 
> 
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index d645d233cd08..34640b1fc1da 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -307,7 +307,7 @@ [PcdsPatchableInModule.common]
># The following parameters are set by Library/PlatformHookLib
> 
>#
> 
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
> 
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f8
> 
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0
> 
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
> 
>gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1
> 
> 
> 
> --
> 2.27.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62237): https://edk2.groups.io/g/devel/message/62237
Mute This Topic: https://groups.io/mt/75376903/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2 1/1] UefiPayloadPkg: Make TerminalDxe build time configurable

2020-06-24 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: Marcello Sylvester Bauer 
> Sent: Wednesday, June 24, 2020 2:58
> To: devel@edk2.groups.io
> Cc: Patrick Rudolph ; Christian Walter
> ; Ma, Maurice ;
> Dong, Guo ; You, Benjamin 
> Subject: [PATCH v2 1/1] UefiPayloadPkg: Make TerminalDxe build time
> configurable
> 
> From: Patrick Rudolph 
> 
> As the TerminalDxe significantly slows down the boot menu rendering, add the
> DISABLE_SERIAL_TERMINAL option to disable it at build time.
> 
> Signed-off-by: Patrick Rudolph 
> Signed-off-by: Marcello Sylvester Bauer 
> Cc: Patrick Rudolph 
> Cc: Christian Walter 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc| 5 +
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 5 +
>  UefiPayloadPkg/UefiPayloadPkg.fdf| 2 ++
>  3 files changed, 12 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index c6c47833871b..49f42285882d 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -58,6 +58,9 @@ [Defines]
>DEFINE UART_DEFAULT_STOP_BITS   = 1   DEFINE
> DEFAULT_TERMINAL_TYPE= 0 +  # Enabling the serial terminal will slow
> down the boot menu rendering!+  DEFINE DISABLE_SERIAL_TERMINAL  =
> FALSE+   #   #  typedef struct {   #UINT16  VendorId;  ///< 
> Vendor ID to
> match the PCI device.  The value 0x terminates the list of entries.@@ -
> 502,7 +505,9 @@ [Components.IA32]
>MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
> MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.in
> f+!if $(DISABLE_SERIAL_TERMINAL) == FALSE
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf+!endif
> UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutputDxe.inf
> #
> --diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 5559b1258521..33805902f705 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -59,6 +59,9 @@ [Defines]
>DEFINE UART_DEFAULT_STOP_BITS   = 1   DEFINE
> DEFAULT_TERMINAL_TYPE= 0 +  # Enabling the serial terminal will slow
> down the boot menu redering!+  DEFINE DISABLE_SERIAL_TERMINAL  =
> FALSE+   #   #  typedef struct {   #UINT16  VendorId;  ///< 
> Vendor ID to
> match the PCI device.  The value 0x terminates the list of entries.@@ -
> 504,7 +507,9 @@ [Components.X64]
>MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
> MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.in
> f+!if $(DISABLE_SERIAL_TERMINAL) == FALSE
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf+!endif
> UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutputDxe.inf
> #
> --diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf
> b/UefiPayloadPkg/UefiPayloadPkg.fdf
> index dfbcde566849..03ff6a9595d1 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.fdf
> +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
> @@ -131,7 +131,9 @@ [FV.DXEFV]
>  INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf INF
> MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.in
> f+!if $(DISABLE_SERIAL_TERMINAL) == FALSE INF
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf+!endif INF
> UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutputDxe.inf  #--
> 2.25.4


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61679): https://edk2.groups.io/g/devel/message/61679
Mute This Topic: https://groups.io/mt/75080106/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v6 08/14] UefiPayloadPkg: Add VariablePolicy engine to UefiPayloadPkg platform

2020-06-23 Thread Ma, Maurice
Reviewed-by: Maurice Ma 


> -Original Message-
> From: Bret Barkelew 
> Sent: Monday, June 22, 2020 23:41
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo ;
> You, Benjamin 
> Subject: [PATCH v6 08/14] UefiPayloadPkg: Add VariablePolicy engine to
> UefiPayloadPkg platform
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2522
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Cc: Bret Barkelew 
> Signed-off-by: Bret Barkelew 
> Reviewed-by: Maurice Ma 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc| 4 
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 4 
>  2 files changed, 8 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index c6c47833871b..4bed6aaa78d0 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -4,6 +4,7 @@
>  # Provides drivers and definitions to create uefi payload for bootloaders.
> 
>  #
> 
>  # Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
> 
> +# Copyright (c) Microsoft Corporation.
> 
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
>  ##
> 
> @@ -204,6 +205,8 @@ [LibraryClasses]
> 
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib
> Null.inf
> 
> 
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmM
> easurementLibNull.inf
> 
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> 
> +
> VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.i
> nf
> 
> +
> VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Varia
> blePolicyHelperLib.inf
> 
> 
> 
>  [LibraryClasses.IA32.SEC]
> 
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> 
> @@ -251,6 +254,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> 
> 
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> AllocationLib.inf
> 
> 
> ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib
> /RuntimeDxeReportStatusCodeLib.inf
> 
> +
> VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibR
> untimeDxe.inf
> 
> 
> 
> 
> [LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATI
> ON]
> 
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 5559b1258521..6e07dd866acd 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -4,6 +4,7 @@
>  # Provides drivers and definitions to create uefi payload for bootloaders.
> 
>  #
> 
>  # Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
> 
> +# Copyright (c) Microsoft Corporation.
> 
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
>  ##
> 
> @@ -205,6 +206,8 @@ [LibraryClasses]
> 
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib
> Null.inf
> 
> 
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmM
> easurementLibNull.inf
> 
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> 
> +
> VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.i
> nf
> 
> +
> VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Varia
> blePolicyHelperLib.inf
> 
> 
> 
>  [LibraryClasses.IA32.SEC]
> 
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> 
> @@ -252,6 +255,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> 
> 
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> AllocationLib.inf
> 
> 
> ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib
> /RuntimeDxeReportStatusCodeLib.inf
> 
> +
> VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibR
> untimeDxe.inf
> 
> 
> 
> 
> [LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATI
> ON]
> 
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> 
> --
> 2.26.2.windows.1.8.g01c50adf56.20200515075929


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61610): https://edk2.groups.io/g/devel/message/61610
Mute This Topic: https://groups.io/mt/75057703/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V1] UefiPayloadPkg:Fix NOOPT build failure

2020-06-22 Thread Ma, Maurice
Reviewed-by: Maurice Ma 


> -Original Message-
> From: Dong, Guo 
> Sent: Saturday, June 20, 2020 19:15
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> ; Dong, Guo 
> Subject: [edk2-devel] [PATCH V1] UefiPayloadPkg:Fix NOOPT build failure
> 
> When build UEFI payload using NOOPT, it would build failure since the FV size.
> So this patch increases FV size to support NOOPT.
> If not NOOPT build, there is no change to FV size.
> 
> Signed-off-by: Guo Dong 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.fdf | 32 
>  1 file changed, 24 insertions(+), 8 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf
> b/UefiPayloadPkg/UefiPayloadPkg.fdf
> index dfbcde5668..a04fcd2ec2 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.fdf
> +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
> @@ -8,23 +8,39 @@
>  #
>  ##
> 
> +[Defines]
> +DEFINE FD_BASE   = 0x0080
> +DEFINE FD_BLOCK_SIZE = 0x1000
> +
> +!if $(TARGET) == "NOOPT"
> +DEFINE PEI_FV_SIZE = 0x0005
> +DEFINE DXE_FV_SIZE = 0x0080
> +DEFINE FD_SIZE = 0x0085
> +DEFINE NUM_BLOCKS  = 0x850
> +!else
> +DEFINE PEI_FV_SIZE = 0x3
> +DEFINE DXE_FV_SIZE = 0x3E
> +DEFINE FD_SIZE = 0x0041
> +DEFINE NUM_BLOCKS  = 0x410
> +!endif
> +
> 
> #
> ###
>  [FD.UefiPayload]
> -BaseAddress   =
> 0x80|gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemBase
> -Size  =
> 0x41|gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemSize
> +BaseAddress   = $(FD_BASE) |
> gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemBase
> +Size  = $(FD_SIZE) |
> gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemSize
>  ErasePolarity = 1
> -BlockSize = 0x1000
> -NumBlocks = 0x410
> +BlockSize = $(FD_BLOCK_SIZE)
> +NumBlocks = $(NUM_BLOCKS)
> 
> -0x|0x03
> +0x|$(PEI_FV_SIZE)
>  FV = PEIFV
> 
> -0x0003|0x3E
> +$(PEI_FV_SIZE)|$(DXE_FV_SIZE)
>  FV = DXEFV
> 
> 
> #
> ###
>  [FV.PEIFV]
> -BlockSize  = 0x1000
> +BlockSize  = $(FD_BLOCK_SIZE)
>  FvAlignment= 16
>  ERASE_POLARITY = 1
>  MEMORY_MAPPED  = TRUE
> @@ -54,7 +70,7 @@ INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
> 
> #
> ###
> 
>  [FV.DXEFV]
> -BlockSize  = 0x1000
> +BlockSize  = $(FD_BLOCK_SIZE)
>  FvForceRebase  = FALSE
>  FvAlignment= 16
>  ERASE_POLARITY = 1
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61564): https://edk2.groups.io/g/devel/message/61564
Mute This Topic: https://groups.io/mt/75013473/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V3 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB

2020-06-17 Thread Ma, Maurice
Patch V3 addressed all my previous comments.   It looks good to me.
Reviewed-by: Maurice Ma 

Regards,
Maurice
> -Original Message-
> From: Ni, Ray 
> Sent: Wednesday, June 17, 2020 1:41
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo ;
> You, Benjamin 
> Subject: [PATCH V3 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in
> AcpiBoardInfo HOB
> 
> Today's UefiPayloadPkg always uses 0xE000 as the PCIE base address and
> ignores the value set in AcpiBoardInfo HOB created by the boot loader. This
> makes the payload binary cannot work in environment where the PCIE base
> address set by boot loader doesn't equal to 0xE000.
> 
> The patch enhances UefiPayloadPkg so that the PCIE base address set by boot
> loader in the AcpiBoardInfo HOB is used.
> 
> Signed-off-by: Ray Ni 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> ---
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c| 13 +++-
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf  |  3 +-
>  .../PciSegmentInfoLibAcpiBoardInfo.c  | 59 +++
>  .../PciSegmentInfoLibAcpiBoardInfo.inf| 36 +++
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 10 ++--
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc  | 11 ++--
>  6 files changed, 121 insertions(+), 11 deletions(-)  create mode 100644
> UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAc
> piBoardInfo.c
>  create mode 100644
> UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAc
> piBoardInfo.inf
> 
> diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> index 28dfc8fc55..a3974dcc02 100644
> --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
> @@ -2,7 +2,7 @@
>This driver will report some MMIO/IO resources to dxe core, extract smbios
> and acpi   tables from bootloader. -  Copyright (c) 2014 - 2019, Intel 
> Corporation.
> All rights reserved.+  Copyright (c) 2014 - 2020, Intel Corporation. All 
> rights
> reserved.   SPDX-License-Identifier: BSD-2-Clause-Patent  **/@@ -101,6
> +101,7 @@ BlDxeEntryPoint (
>EFI_HOB_GUID_TYPE  *GuidHob;   SYSTEM_TABLE_INFO
> *SystemTableInfo;   EFI_PEI_GRAPHICS_INFO_HOB  *GfxInfo;+
> ACPI_BOARD_INFO*AcpiBoardInfo;Status = EFI_SUCCESS;   //@@ -
> 153,6 +154,16 @@ BlDxeEntryPoint (
>  ASSERT_EFI_ERROR (Status);   } +  //+  // Set PcdPciExpressBaseAddress by
> HOB info+  //+  GuidHob = GetFirstGuidHob ();+  if
> (GuidHob != NULL) {+AcpiBoardInfo = (ACPI_BOARD_INFO
> *)GET_GUID_HOB_DATA (GuidHob);+Status = PcdSet64S
> (PcdPciExpressBaseAddress, AcpiBoardInfo->PcieBaseAddress);+
> ASSERT_EFI_ERROR (Status);+  }+   return EFI_SUCCESS; } diff --git
> a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> index 4c2b4670af..1371d5eb79 100644
> --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
> @@ -3,7 +3,7 @@
>  # # Report some MMIO/IO resources to dxe core, extract smbios and acpi tables
> #-#  Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.+#
> Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved. # #  
> SPDX-
> License-Identifier: BSD-2-Clause-Patent #@@ -53,6 +53,7 @@ [Pcd]
>gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution
> gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution
> gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution+
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress  [Depex]   TRUEdiff --git
> a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.c
> b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.c
> new file mode 100644
> index 00..d37c91cc9f
> --- /dev/null
> +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentIn
> +++ foLibAcpiBoardInfo.c
> @@ -0,0 +1,59 @@
> +/** @file+  PCI Segment Information Library that returns one segment whose+
> segment base address is retrieved from AcpiBoardInfo HOB.++  Copyright (c)
> 2020, Intel Corporation. All rights reserved.+  SPDX-License-Identifier:
> BSD-2-Clause-Patent++**/++#include +#include
> ++#include +#include
> +#include ++STATIC
> PCI_SEGMENT_INFO mPciSegment0 = {+  0,  // Segment number+  0,  // To be
> fixed later+  0,  // Start bus number+  255 // End bus number+};++/**+  Return
> an array of PCI_SEGMENT_INFO holding the segment information.++  Note: The
> returned array/buffer is owned by callee.++  @param  Count  Return the count
> of segments.++  @retval A callee owned array holding the segment
> information.+

Re: [edk2-devel] [PATCH V2 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB

2020-06-08 Thread Ma, Maurice
Hi, Ray,

I noticed in this V2 patch, you removed the following line from the DSC file.
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE)
It will make the PcdPciExpressBaseAddress become PcdsFixedAtBuild type instead 
of PcdsDynamicDefault.   Is this your intention ?

Also this V2 patch forced PcdLib class instance to be BasePciLibCf8.  It means 
all PCI configuration space access will use I/O port access.  We prefer using 
BasePciSegmentLibPci.   I think we should keep the original code for this so 
that it is configurable.

Also can we sync up DSC changes into UefiPayloadPkgIa32.dsc as well ?

Thanks
Maurice
> -Original Message-
> From: Ni, Ray 
> Sent: Wednesday, June 3, 2020 20:27
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo ;
> You, Benjamin 
> Subject: [PATCH V2 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in
> AcpiBoardInfo HOB
> 
> Today's UefiPayloadPkg always uses 0xE000 as the PCIE base address and
> ignores the value set in AcpiBoardInfo HOB created by the boot loader. This
> makes the payload binary cannot work in environment where the PCIE base
> address set by boot loader doesn't equal to 0xE000.
> 
> The patch enhances UefiPayloadPkg so that the PCIE base address set by boot
> loader in the AcpiBoardInfo HOB is used.
> 
> Signed-off-by: Ray Ni 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> ---
>  .../PciSegmentInfoLibAcpiBoardInfo.c  | 59 +++
>  .../PciSegmentInfoLibAcpiBoardInfo.inf| 36 +++
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc  | 16 +
>  3 files changed, 98 insertions(+), 13 deletions(-)  create mode 100644
> UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAc
> piBoardInfo.c
>  create mode 100644
> UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAc
> piBoardInfo.inf
> 
> diff --git
> a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.c
> b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.c
> new file mode 100644
> index 00..d37c91cc9f
> --- /dev/null
> +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentIn
> +++ foLibAcpiBoardInfo.c
> @@ -0,0 +1,59 @@
> +/** @file+  PCI Segment Information Library that returns one segment
> whose+  segment base address is retrieved from AcpiBoardInfo HOB.++
> Copyright (c) 2020, Intel Corporation. All rights reserved.+  
> SPDX-License-
> Identifier: BSD-2-Clause-Patent++**/++#include +#include
> ++#include +#include
> +#include ++STATIC
> PCI_SEGMENT_INFO mPciSegment0 = {+  0,  // Segment number+  0,  // To be
> fixed later+  0,  // Start bus number+  255 // End bus number+};++/**+  Return
> an array of PCI_SEGMENT_INFO holding the segment information.++  Note: The
> returned array/buffer is owned by callee.++  @param  Count  Return the count
> of segments.++  @retval A callee owned array holding the segment
> information.+**/+PCI_SEGMENT_INFO *+EFIAPI+GetPciSegmentInfo (+  UINTN
> *Count+  )+{+  EFI_HOB_GUID_TYPE  *GuidHob;+  ACPI_BOARD_INFO
> *AcpiBoardInfo;++  ASSERT (Count != NULL);+  if (Count == NULL) {+return
> NULL;+  }++  if (mPciSegment0.BaseAddress == 0) {+//+// Find the acpi
> board information guid hob+//+GuidHob = GetFirstGuidHob
> ();+ASSERT (GuidHob != NULL);++AcpiBoardInfo =
> (ACPI_BOARD_INFO *) GET_GUID_HOB_DATA (GuidHob);+
> mPciSegment0.BaseAddress = AcpiBoardInfo->PcieBaseAddress;+  }+  *Count =
> 1;+  return +}diff --git
> a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.inf
> b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.inf
> new file mode 100644
> index 00..ec4dbaaa55
> --- /dev/null
> +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentIn
> +++ foLibAcpiBoardInfo.inf
> @@ -0,0 +1,36 @@
> +## @file+#   PCI Segment Information Library that returns one segment
> whose+#   segment base address is retrieved from AcpiBoardInfo HOB.+#+#
> Copyright (c) 2020, Intel Corporation. All rights reserved.+#+#  SPDX-
> License-Identifier: BSD-2-Clause-Patent+#+#+##++[Defines]+  INF_VERSION
> = 0x00010005+  BASE_NAME  = 
> PciSegmentInfoLibAcpiBoardInfo+
> FILE_GUID  = 0EA82AA2-6C36-4FD5-BC90-FFA3ECB5E0CE+
> MODULE_TYPE= BASE+  VERSION_STRING = 1.0+
> LIBRARY_CLASS  = PciSegmentInfoLib | DXE_DRIVER++#+# The
> following information is for reference only and not required by the build
> tools.+#+#  VALID_ARCHITECTURES   = IA32 X64 EBC+#++[Sources]+
> PciSegmentInfoLibAcpiBoa

Re: [edk2-devel] [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB

2020-06-04 Thread Ma, Maurice
Hi, Ray,

Yes,  that addressed my questions.   Thank you!

Thanks
Maurice
> -Original Message-
> From: Ni, Ray 
> Sent: Wednesday, June 3, 2020 20:06
> To: Ma, Maurice ; devel@edk2.groups.io
> Cc: Dong, Guo ; You, Benjamin
> 
> Subject: RE: [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in
> AcpiBoardInfo HOB
> 
> Maurice,
> 1. EFIAPI: sure. I will add the missing "EFIAPI".
> 2. ASSERT: Is below code to avoid dereferencing NULL pointer ok to you?
> 
>   ASSERT (Count != NULL);
> +  if (Count == NULL) {
> +return NULL;
> +  }
> 
> Thanks,
> Ray
> 
> > -Original Message-
> > From: Ma, Maurice 
> > Sent: Wednesday, June 3, 2020 11:35 PM
> > To: Ni, Ray ; devel@edk2.groups.io
> > Cc: Dong, Guo ; You, Benjamin
> > 
> > Subject: RE: [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr
> > stored in AcpiBoardInfo HOB
> >
> > Hi, Ray,
> >
> > Thank you very much for making this change.
> >
> > Two minor comments here,
> > - Should we add "EFIAPI" for function GetPciSegmentInfo() since it is 
> > standard
> library interface ?
> > - For  ASSERT (Count != NULL),   can we have an error handling flow in the
> code to deal with the case ?
> >
> > Thanks
> > Maurice
> >
> > > -Original Message-
> > > From: Ni, Ray 
> > > Sent: Wednesday, June 3, 2020 3:21
> > > To: devel@edk2.groups.io
> > > Cc: Ma, Maurice ; Dong, Guo
> > > ; You, Benjamin 
> > > Subject: [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr
> > > stored in AcpiBoardInfo HOB
> > >
> > > Today's UefiPayloadPkg always uses 0xE000 as the PCIE base
> > > address and ignores the value set in AcpiBoardInfo HOB created by
> > > the boot loader. This makes the payload binary cannot work in
> > > environment where the PCIE base address set by boot loader doesn't equal
> to 0xE000.
> > >
> > > The patch enhances UefiPayloadPkg so that the PCIE base address set
> > > by boot loader in the AcpiBoardInfo HOB is used.
> > >
> > > Signed-off-by: Ray Ni 
> > > Cc: Maurice Ma 
> > > Cc: Guo Dong 
> > > Cc: Benjamin You 
> > > ---
> > >  .../PciSegmentInfoLibAcpiBoardInfo.c  | 55 +++
> > >  .../PciSegmentInfoLibAcpiBoardInfo.inf| 36 
> > >  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc  |  6 +-
> > >  3 files changed, 95 insertions(+), 2 deletions(-)  create mode
> > > 100644
> > > UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfo
> > > LibAc
> > > piBoardInfo.c
> > >  create mode 100644
> > > UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfo
> > > LibAc
> > > piBoardInfo.inf
> > >
> > > diff --git
> > > a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentIn
> > > foLib
> > > AcpiBoardInfo.c
> > > b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentIn
> > > foLib
> > > AcpiBoardInfo.c
> > > new file mode 100644
> > > index 00..28ca4b5799
> > > --- /dev/null
> > > +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegme
> > > +++ ntIn
> > > +++ foLibAcpiBoardInfo.c
> > > @@ -0,0 +1,55 @@
> > > +/** @file+  PCI Segment Information Library that returns one
> > > +segment
> > > whose+  segment base address is retrieved from AcpiBoardInfo HOB.++
> > > Copyright (c) 2020, Intel Corporation. All rights reserved.+
> > > SPDX-License-
> > > Identifier: BSD-2-Clause-Patent++**/++#include +#include
> > > ++#include +#include
> > > +#include ++STATIC
> > > PCI_SEGMENT_INFO mPciSegment0 = {+  0,  // Segment number+  0,  //
> > > To be fixed later+  0,  // Start bus number+  255 // End bus
> > > number+};++/**+  Return an array of PCI_SEGMENT_INFO holding the
> > > segment information.++  Note: The returned array/buffer is owned by
> > > callee.++  @param  Count  Return the count of segments.++  @retval A
> > > callee owned array holding the segment
> > > information.+**/+PCI_SEGMENT_INFO *+GetPciSegmentInfo (+  UINTN
> > > *Count+  )+{+  EFI_HOB_GUID_TYPE  *GuidHob;+  ACPI_BOARD_INFO
> *AcpiBoardInfo;++  ASSERT (Count != NULL);++  if (mPciSegment0.BaseAddress
> > > == 0) {+//+// Find the acpi board information guid hob+//+
> GuidHob =
> > > GetFirstGuidHob ();+ASSERT (GuidHo

Re: [edk2-devel] [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in AcpiBoardInfo HOB

2020-06-03 Thread Ma, Maurice
Hi, Ray,

Thank you very much for making this change.

Two minor comments here,
- Should we add "EFIAPI" for function GetPciSegmentInfo() since it is standard 
library interface ? 
- For  ASSERT (Count != NULL),   can we have an error handling flow in the code 
to deal with the case ?

Thanks
Maurice

> -Original Message-
> From: Ni, Ray 
> Sent: Wednesday, June 3, 2020 3:21
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo ;
> You, Benjamin 
> Subject: [PATCH 2/2] UefiPayloadPkg/Pci: Use the PCIE Base Addr stored in
> AcpiBoardInfo HOB
> 
> Today's UefiPayloadPkg always uses 0xE000 as the PCIE base address and
> ignores the value set in AcpiBoardInfo HOB created by the boot loader. This
> makes the payload binary cannot work in environment where the PCIE base
> address set by boot loader doesn't equal to 0xE000.
> 
> The patch enhances UefiPayloadPkg so that the PCIE base address set by boot
> loader in the AcpiBoardInfo HOB is used.
> 
> Signed-off-by: Ray Ni 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> ---
>  .../PciSegmentInfoLibAcpiBoardInfo.c  | 55 +++
>  .../PciSegmentInfoLibAcpiBoardInfo.inf| 36 
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc  |  6 +-
>  3 files changed, 95 insertions(+), 2 deletions(-)  create mode 100644
> UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAc
> piBoardInfo.c
>  create mode 100644
> UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLibAc
> piBoardInfo.inf
> 
> diff --git
> a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.c
> b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.c
> new file mode 100644
> index 00..28ca4b5799
> --- /dev/null
> +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentIn
> +++ foLibAcpiBoardInfo.c
> @@ -0,0 +1,55 @@
> +/** @file+  PCI Segment Information Library that returns one segment
> whose+  segment base address is retrieved from AcpiBoardInfo HOB.++
> Copyright (c) 2020, Intel Corporation. All rights reserved.+  
> SPDX-License-
> Identifier: BSD-2-Clause-Patent++**/++#include +#include
> ++#include +#include
> +#include ++STATIC
> PCI_SEGMENT_INFO mPciSegment0 = {+  0,  // Segment number+  0,  // To be
> fixed later+  0,  // Start bus number+  255 // End bus number+};++/**+  Return
> an array of PCI_SEGMENT_INFO holding the segment information.++  Note: The
> returned array/buffer is owned by callee.++  @param  Count  Return the count
> of segments.++  @retval A callee owned array holding the segment
> information.+**/+PCI_SEGMENT_INFO *+GetPciSegmentInfo (+  UINTN
> *Count+  )+{+  EFI_HOB_GUID_TYPE  *GuidHob;+  ACPI_BOARD_INFO
> *AcpiBoardInfo;++  ASSERT (Count != NULL);++  if (mPciSegment0.BaseAddress
> == 0) {+//+// Find the acpi board information guid hob+//+
> GuidHob =
> GetFirstGuidHob ();+ASSERT (GuidHob != NULL);++
> AcpiBoardInfo = (ACPI_BOARD_INFO *) GET_GUID_HOB_DATA (GuidHob);+
> mPciSegment0.BaseAddress = AcpiBoardInfo->PcieBaseAddress;+  }+  *Count =
> 1;+  return +}diff --git
> a/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.inf
> b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentInfoLib
> AcpiBoardInfo.inf
> new file mode 100644
> index 00..ec4dbaaa55
> --- /dev/null
> +++ b/UefiPayloadPkg/Library/PciSegmentInfoLibAcpiBoardInfo/PciSegmentIn
> +++ foLibAcpiBoardInfo.inf
> @@ -0,0 +1,36 @@
> +## @file+#   PCI Segment Information Library that returns one segment
> whose+#   segment base address is retrieved from AcpiBoardInfo HOB.+#+#
> Copyright (c) 2020, Intel Corporation. All rights reserved.+#+#  SPDX-
> License-Identifier: BSD-2-Clause-Patent+#+#+##++[Defines]+  INF_VERSION
> = 0x00010005+  BASE_NAME  = 
> PciSegmentInfoLibAcpiBoardInfo+
> FILE_GUID  = 0EA82AA2-6C36-4FD5-BC90-FFA3ECB5E0CE+
> MODULE_TYPE= BASE+  VERSION_STRING = 1.0+
> LIBRARY_CLASS  = PciSegmentInfoLib | DXE_DRIVER++#+# The
> following information is for reference only and not required by the build
> tools.+#+#  VALID_ARCHITECTURES   = IA32 X64 EBC+#++[Sources]+
> PciSegmentInfoLibAcpiBoardInfo.c++[Packages]+  MdePkg/MdePkg.dec+
> UefiPayloadPkg/UefiPayloadPkg.dec++[LibraryClasses]+  PcdLib+  HobLib+
> DebugLibdiff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 0736cd9954..e114039f82 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -129,

Re: [edk2-devel] [PATCH v5 08/14] UefiPayloadPkg: Add VariablePolicy engine to UefiPayloadPkg platform

2020-06-03 Thread Ma, Maurice
Reviewed-by: Maurice Ma 


> -Original Message-
> From: Bret Barkelew 
> Sent: Tuesday, June 2, 2020 23:58
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo ;
> You, Benjamin 
> Subject: [PATCH v5 08/14] UefiPayloadPkg: Add VariablePolicy engine to
> UefiPayloadPkg platform
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2522
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Cc: Bret Barkelew 
> Signed-off-by: Bret Barkelew 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc| 4 
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 4 
>  2 files changed, 8 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index d52945442e0e..d6b6e16f21b0 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -4,6 +4,7 @@
>  # Provides drivers and definitions to create uefi payload for bootloaders.
> 
>  #
> 
>  # Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> 
> +# Copyright (c) Microsoft Corporation.
> 
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
>  ##
> 
> @@ -204,6 +205,8 @@ [LibraryClasses]
> 
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib
> Null.inf
> 
> 
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tpm
> MeasurementLibNull.inf
> 
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> 
> +
> VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.i
> nf
> 
> +
> VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Vari
> ablePolicyHelperLib.inf
> 
> 
> 
>  [LibraryClasses.IA32.SEC]
> 
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> 
> @@ -251,6 +254,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> 
> 
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> AllocationLib.inf
> 
> 
> ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib
> /RuntimeDxeReportStatusCodeLib.inf
> 
> +
> VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibR
> untimeDxe.inf
> 
> 
> 
> 
> [LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATI
> ON]
> 
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 0736cd995476..d93949fcea33 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -4,6 +4,7 @@
>  # Provides drivers and definitions to create uefi payload for bootloaders.
> 
>  #
> 
>  # Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> 
> +# Copyright (c) Microsoft Corporation.
> 
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
>  ##
> 
> @@ -205,6 +206,8 @@ [LibraryClasses]
> 
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib
> Null.inf
> 
> 
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tpm
> MeasurementLibNull.inf
> 
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> 
> +
> VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.i
> nf
> 
> +
> VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Vari
> ablePolicyHelperLib.inf
> 
> 
> 
>  [LibraryClasses.IA32.SEC]
> 
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> 
> @@ -252,6 +255,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> 
> 
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> AllocationLib.inf
> 
> 
> ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib
> /RuntimeDxeReportStatusCodeLib.inf
> 
> +
> VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibR
> untimeDxe.inf
> 
> 
> 
> 
> [LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATI
> ON]
> 
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> 
> --
> 2.26.2.windows.1.8.g01c50adf56.20200515075929


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#60667): https://edk2.groups.io/g/devel/message/60667
Mute This Topic: https://groups.io/mt/74646430/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v3 08/14] UefiPayloadPkg: Add VariablePolicy engine to UefiPayloadPkg platform

2020-05-21 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael
> Kubacki
> Sent: Thursday, May 21, 2020 15:43
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo ;
> You, Benjamin ; Bret Barkelew
> 
> Subject: [edk2-devel] [PATCH v3 08/14] UefiPayloadPkg: Add VariablePolicy
> engine to UefiPayloadPkg platform
> 
> From: Bret Barkelew 
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2522
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Cc: Bret Barkelew 
> Signed-off-by: Michael Kubacki 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc| 7 +++
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 7 +++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index d52945442e0e..472196d2c60e 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -4,6 +4,7 @@
>  # Provides drivers and definitions to create uefi payload for bootloaders.
>  #
>  # Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> +# Copyright (c) Microsoft Corporation.
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -204,6 +205,8 @@
> [LibraryClasses]
> 
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib
> Null.inf
> 
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tpm
> MeasurementLibNull.inf
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> +
> + VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic
> + yLib.inf
> + VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V
> + ariablePolicyHelperLib.inf
> 
>  [LibraryClasses.IA32.SEC]
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> @@ -251,6 +254,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> 
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> AllocationLib.inf
> 
> ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib
> /RuntimeDxeReportStatusCodeLib.inf
> +
> + VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic
> + yLibRuntimeDxe.inf
> 
> 
> [LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATI
> ON]
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> @@ -329,6 +333,9 @@ [PcdsPatchableInModule.common]
> 
> 
> gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|$(MAX_LO
> GICAL_PROCESSORS)
> 
> +  # Optional: Omit if VariablePolicy should be always-on.
> +
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdAllowVariablePolicyEnforcementDisabl
> + e|TRUE
> +
> 
> 
> 
> 
>  #
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 0736cd995476..817400604347 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -4,6 +4,7 @@
>  # Provides drivers and definitions to create uefi payload for bootloaders.
>  #
>  # Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> +# Copyright (c) Microsoft Corporation.
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -205,6 +206,8 @@
> [LibraryClasses]
> 
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib
> Null.inf
> 
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tpm
> MeasurementLibNull.inf
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> +
> + VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic
> + yLib.inf
> + VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/V
> + ariablePolicyHelperLib.inf
> 
>  [LibraryClasses.IA32.SEC]
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> @@ -252,6 +255,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER]
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> 
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> AllocationLib.inf
> 
> ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib
> /RuntimeDxeReportStatusCodeLib.inf
> +
> + VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolic
> + yLibRuntimeDxe.inf
> 
> 
> [LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATI
> ON]
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> @@ -331,6 +335,9 @@ [PcdsPatchableInModule.common]
> 
> 
> gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|$(MAX_LO
> GICAL_PROCESSORS)
> 
> +  # Opti

Re: [EXTERNAL] Re: [edk2-devel] [PATCH v2 00/12] Add the VariablePolicy feature

2020-05-13 Thread Ma, Maurice
Hi, Bret

For UefiPayloadPkg, could you please provide a patch for it ?

Thanks
Maurice

From: devel@edk2.groups.io  On Behalf Of Bret Barkelew 
via groups.io
Sent: Tuesday, May 12, 2020 22:19
To: devel@edk2.groups.io; ler...@redhat.com; michael.kuba...@outlook.com
Cc: Yao, Jiewen ; Zhang, Chao B ; 
Wang, Jian J ; Wu, Hao A ; Gao, 
Liming ; Justen, Jordan L ; 
Ard Biesheuvel ; Andrew Fish ; Ni, Ray 
; Anthony Perard ; Julien Grall 
; Ma, Maurice ; Dong, Guo 
; You, Benjamin 
Subject: Re: [EXTERNAL] Re: [edk2-devel] [PATCH v2 00/12] Add the 
VariablePolicy feature

“Not sure about the UefiPayloadPkg platforms; please ask their maintainers.”

UefiPayloadPkg maintainers: what say you? 

- Bret


From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> on behalf of Laszlo Ersek 
via groups.io mailto:lersek=redhat@groups.io>>
Sent: Tuesday, May 12, 2020 4:52:52 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>>; 
michael.kuba...@outlook.com<mailto:michael.kuba...@outlook.com> 
mailto:michael.kuba...@outlook.com>>
Cc: Yao, Jiewen mailto:jiewen@intel.com>>; Chao Zhang 
mailto:chao.b.zh...@intel.com>>; Jian J Wang 
mailto:jian.j.w...@intel.com>>; Hao A Wu 
mailto:hao.a...@intel.com>>; liming.gao 
mailto:liming@intel.com>>; Jordan Justen 
mailto:jordan.l.jus...@intel.com>>; Ard Biesheuvel 
mailto:ard.biesheu...@arm.com>>; Andrew Fish 
mailto:af...@apple.com>>; Ni, Ray 
mailto:ray...@intel.com>>; Anthony Perard 
mailto:anthony.per...@citrix.com>>; Julien Grall 
mailto:jul...@xen.org>>; Maurice Ma 
mailto:maurice...@intel.com>>; Guo Dong 
mailto:guo.d...@intel.com>>; Benjamin You 
mailto:benjamin@intel.com>>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v2 00/12] Add the VariablePolicy 
feature

On 05/12/20 08:46, Michael Kubacki wrote:
> From: Michael Kubacki 
> mailto:michael.kuba...@microsoft.com>>
>
> REF:https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2522data=02%7C01%7Cbret.barkelew%40microsoft.com%7C98d423482cea4e143c4308d7f66b0927%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248811886928541sdata=GlpxfE6%2FzZR01KXRvOoaXQTQEG%2F3TNuaZxJ6C1fl6LI%3Dreserved=0
>
> The 12 patches in this series add the VariablePolicy feature to the core,
> deprecate Edk2VarLock (while adding a compatibility layer to reduce code
> churn), and integrate the VariablePolicy libraries and protocols into
> Variable Services.
>
> Since the integration requires multiple changes, including adding libraries,
> a protocol, an SMI communication handler, and VariableServices integration,
> the patches are broken up by individual library additions and then a final
> integration. Security-sensitive changes like bypassing Authenticated
> Variable enforcement are also broken out into individual patches so that
> attention can be called directly to them.
>
> Platform porting instructions are described in this wiki entry:
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FVariablePolicy-Protocol---Enhanced-Method-for-Managing-Variables%23platform-portingdata=02%7C01%7Cbret.barkelew%40microsoft.com%7C98d423482cea4e143c4308d7f66b0927%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248811886928541sdata=o%2FraXnHgx4RMreIkSFSONm8He0CzM7ZTXoV8loOrxe0%3Dreserved=0

(1) This wiki article is helpful, thanks.

I have one remark: there's a heading saying "VarCheckPolicyLib NULL
Instance":

https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FVariablePolicy-Protocol---Enhanced-Method-for-Managing-Variables%23varcheckpolicylib-null-instancedata=02%7C01%7Cbret.barkelew%40microsoft.com%7C98d423482cea4e143c4308d7f66b0927%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248811886928541sdata=4qTYEB6%2F3uJnLZ9MjRHODQGaaPq6zZEp7bFlCXEP7gI%3Dreserved=0

I think what's meant is "NULL class", not "NULL instance".

(2) The following platform DSC files in edk2 include the non-SMM
variable driver
("MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf"),
but they are not modified by this patch series:

ArmVirtPkg/ArmVirtQemu.dsc
ArmVirtPkg/ArmVirtQemuKernel.dsc
ArmVirtPkg/ArmVirtXen.dsc
OvmfPkg/OvmfXen.dsc
UefiPayloadPkg/UefiPayloadPkgIa32.dsc
UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc

I'm asking that you please (a) include a patch for ArmVirtPkg, (b)
update the OvmfPkg patch to cover "OvmfXen.dsc" too.

Not sure about the UefiPayloadPkg platforms; please ask their maintainers.

(I've CC'd the OvmfXen and UefiPayloadPkg maintainers/reviewers.)

Thanks,
Laszlo

>
> Discussion of the feature can be found in multip

Re: [edk2-devel] [PATCH 16/18] UefiPayloadPkg: Remove All UGA Support

2020-05-08 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: Jiang, Guomin 
> Sent: Friday, May 8, 2020 1:38
> To: devel@edk2.groups.io
> Cc: GuoMinJ ; Ma, Maurice
> ; Dong, Guo ; You, Benjamin
> 
> Subject: [PATCH 16/18] UefiPayloadPkg: Remove All UGA Support
> 
> From: GuoMinJ 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove PcdConOutGopSupport, it is unnecessary any more.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Signed-off-by: Guomin Jiang 
> ---
>  .../Library/PlatformBootManagerLib/PlatformBootManager.h| 2 +-
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc   | 1 -
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc| 1 -
>  3 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> index 2f600c796ff2..3ab0a24d384a 100644
> ---
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> +++
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
> @@ -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 Devices are back in text mode and synced up.
> 
>  **/
>  EFI_STATUS
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index e8832925eed8..d31f6ca4fb7d 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -271,7 +271,6 @@ [PcdsFeatureFlag]
>  !endif
>gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
>gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> 
>  [PcdsFixedAtBuild]
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x1
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 20462f68817d..8d67e25731e3 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -272,7 +272,6 @@ [PcdsFeatureFlag]
>  !endif
>gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
>gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> 
>  [PcdsFixedAtBuild]
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x1
> --
> 2.25.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58889): https://edk2.groups.io/g/devel/message/58889
Mute This Topic: https://groups.io/mt/74068795/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 02/18] UefiPayloadPkg: Remove All UGA Support

2020-05-08 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

> -Original Message-
> From: Jiang, Guomin 
> Sent: Friday, May 8, 2020 1:38
> To: devel@edk2.groups.io
> Cc: GuoMinJ ; Ma, Maurice
> ; Dong, Guo ; You, Benjamin
> 
> Subject: [PATCH 02/18] UefiPayloadPkg: Remove All UGA Support
> 
> From: GuoMinJ 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2368
> 
> Remove All UGA Support in UefiPayloadPkg.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Signed-off-by: Guomin Jiang 
> ---
>  .../Library/PlatformBootManagerLib/PlatformBootManagerLib.inf   | 2 --
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc   | 1 -
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc| 1 -
>  3 files changed, 4 deletions(-)
> 
> diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i
> nf
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i
> nf
> index 1f5a0bcad038..1072a3b21011 100644
> ---
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i
> nf
> +++
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i
> nf
> @@ -53,14 +53,12 @@ [Guids]
>  [Protocols]
>gEfiGenericMemTestProtocolGuid  ## CONSUMES
>gEfiGraphicsOutputProtocolGuid  ## CONSUMES
> -  gEfiUgaDrawProtocolGuid ## CONSUMES
>gEfiBootLogoProtocolGuid## CONSUMES
>gEfiDxeSmmReadyToLockProtocolGuid
>gEfiSmmAccess2ProtocolGuid
> 
>  [Pcd]
>gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
> -  gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
>gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index d52945442e0e..e8832925eed8 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -272,7 +272,6 @@ [PcdsFeatureFlag]
>gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
>gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
> 
>  [PcdsFixedAtBuild]
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x1
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 0736cd995476..20462f68817d 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -273,7 +273,6 @@ [PcdsFeatureFlag]
>gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
>gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
> 
>  [PcdsFixedAtBuild]
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x1
> --
> 2.25.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#5): https://edk2.groups.io/g/devel/message/5
Mute This Topic: https://groups.io/mt/74068779/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v3] IntelFsp2Pkg: Support Multi-Phase SiInit and debug handlers.

2020-05-07 Thread Ma, Maurice
Looks good to me.
Reviewed-by: Maurice Ma 

Thanks
Maurice
> -Original Message-
> From: Chiu, Chasel 
> Sent: Thursday, May 7, 2020 0:50
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: [PATCH v3] IntelFsp2Pkg: Support Multi-Phase SiInit and debug
> handlers.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2698
> 
> To enhance FSP silicon initialization flexibility an optional Multi-Phase API 
> is
> introduced and FSP header needs update for new API offset. Also new SecCore
> module created for FspMultiPhaseSiInit API
> 
> New ARCH_UPD introduced for enhancing FSP debug message flexibility now
> bootloader can pass its own debug handler function pointer and FSP will call 
> the
> function to handle debug message.
> 
> Cc: Maurice Ma 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Signed-off-by: Chasel Chiu 
> ---
>  IntelFsp2Pkg/FspSecCore/SecFspApiChk.c |   6 
> +++---
>  IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c |  19
> ++-
>  IntelFsp2Pkg/FspSecCore/FspSecCoreSS.inf   |  48
> 
>  IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryCommon.nasm|  20
> ++--
>  IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntrySS.nasm|  58
> ++
>  IntelFsp2Pkg/Include/FspEas/FspApi.h   | 124
> 
> ++--
>  IntelFsp2Pkg/Include/FspGlobalData.h   |   3 ++-
>  IntelFsp2Pkg/Include/Guid/FspHeaderFile.h  |  10 
> --
>  IntelFsp2Pkg/Include/Library/FspSecPlatformLib.h   |  16
> +++-
>  9 files changed, 292 insertions(+), 12 deletions(-)
> 
> diff --git a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
> b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
> index 8e0595fe9a..1334959005 100644
> --- a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
> +++ b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> +  Copyright (c) 2016 - 2020, Intel Corporation. All rights
> + reserved.
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -59,7 +59,7 @@ FspApiCallingCheck (
>  Status = EFI_UNSUPPORTED;
>}
>  }
> -  } else if (ApiIdx == FspSiliconInitApiIndex) {
> +  } else if ((ApiIdx == FspSiliconInitApiIndex) || (ApiIdx ==
> + FspMultiPhaseSiInitApiIndex)) {
>  //
>  // FspSiliconInit check
>  //
> @@ -68,7 +68,7 @@ FspApiCallingCheck (
>  } else {
>if (FspData->Signature != FSP_GLOBAL_DATA_SIGNATURE) {
>  Status = EFI_UNSUPPORTED;
> -  } else if (EFI_ERROR (FspUpdSignatureCheck (ApiIdx, ApiParam))) {
> +  } else if (EFI_ERROR (FspUpdSignatureCheck
> + (FspSiliconInitApiIndex, ApiParam))) {
>  Status = EFI_INVALID_PARAMETER;
>}
>  }
> diff --git 
> a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c
> b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c
> index f7945b5240..df8c5d121f 100644
> --- a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c
> +++ b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c
> @@ -1,7 +1,7 @@
>  /** @file
>Null instance of Platform Sec Lib.
> 
> -  Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
> +  Copyright (c) 2014 - 2020, Intel Corporation. All rights
> + reserved.
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -25,3 +25,20 @@ FspUpdSignatureCheck (  {
>return EFI_SUCCESS;
>  }
> +
> +/**
> +  This function handles FspMultiPhaseSiInitApi.
> +
> +  @param[in]  ApiIdx   Internal index of the FSP API.
> +  @param[in]  ApiParam Parameter of the FSP API.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +FspMultiPhaseSiInitApiHandler (
> +  IN UINT32   ApiIdx,
> +  IN VOID *ApiParam
> +  )
> +{
> +  return EFI_SUCCESS;
> +}
> diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreSS.inf
> b/IntelFsp2Pkg/FspSecCore/FspSecCoreSS.inf
> new file mode 100644
> index 00..184101c7d3
> --- /dev/null
> +++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreSS.inf
> @@ -0,0 +1,48 @@
> +## @file
> +#  Sec Core for FSP to support MultiPhase (SeparatePhase) SiInitialization.
> +#
> +#  Copyright (c) 2020, Intel Corporation. All rights reserved. # #
> +SPDX-License-Iden

Re: [edk2-devel] [PATCH V2] UefiPayloadPkg/BootManager: Add PS2 keyboard support

2019-12-18 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

Thanks,
-Maurice
> -Original Message-
> From: Dong, Guo
> Sent: Tuesday, December 17, 2019 16:12
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> ; Dong, Guo ;
> u14...@gmail.com
> Subject: [edk2-devel] [PATCH V2] UefiPayloadPkg/BootManager: Add PS2
> keyboard support
> 
> Add PS2 keyboard support.
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2316
> 
> This patch adds PS2 keyboard support in boot manager, and add a build flag
> PS2_KEYBOARD_ENABLE for PS2 keyboard to build PS2 keyboard driver and
> SIO driver. Be default the build flag is not enabled since PS2 keyboard is not
> common used. could use -DPS2_KEYBOARD_ENABLE to enable build it if
> need this feature.
> 
> Signed-off-by: Guo Dong 
> Reviewed-by: Maurice Ma 
> ---
>  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c | 25
> -
>  UefiPayloadPkg/UefiPayloadPkg.fdf   |  4 
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc   |  4 
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc|  5 +
>  4 files changed, 33 insertions(+), 5 deletions(-)
> 
> diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> index ee2d8c8d1e..a27cc552ab 100644
> --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> @@ -44,6 +44,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #define
> gPnp16550ComPort \
>PNPID_DEVICE_PATH_NODE(0x0501)
> 
> +#define gPnpPs2Keyboard \
> +  PNPID_DEVICE_PATH_NODE(0x0303)
> +
>  #define gUartVendor \
>{ \
>  { \
> @@ -87,7 +90,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  DEVICE_PATH_MESSAGING_PC_ANSI \
>}
> 
> -
> +ACPI_HID_DEVICE_PATH   gPnpPs2KeyboardDeviceNode  =
> gPnpPs2Keyboard;
>  ACPI_HID_DEVICE_PATH   gPnp16550ComPortDeviceNode =
> gPnp16550ComPort;
>  UART_DEVICE_PATH   gUartDeviceNode= gUart;
>  VENDOR_DEVICE_PATH gTerminalTypeDeviceNode= gPcAnsiTerminal;
> @@ -109,12 +112,15 @@ EFI_DEVICE_PATH_PROTOCOL
> *gPlatformRootBridges[] = {
>  BOOLEAN   mDetectVgaOnly;
> 
>  /**
> -  Add UART to ConOut, ConIn, ErrOut.
> +  Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut.
> 
> -  @param[in]   DeviceHandle - LPC device path.
> +  @param[in] DeviceHandle  Handle of the LPC Bridge device.
> 
> -  @retval EFI_SUCCESS  - Serial console is added to ConOut, ConIn, and
> ErrOut.
> -  @retval EFI_STATUS   - No serial console is added.
> +  @retval EFI_SUCCESS  Console devices on the LPC bridge have been added
> to
> +   ConOut, ConIn, and ErrOut.
> +
> +  @return  Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing
> +   from DeviceHandle.
>  **/
>  EFI_STATUS
>  PrepareLpcBridgeDevicePath (
> @@ -123,6 +129,7 @@ PrepareLpcBridgeDevicePath (  {
>EFI_STATUSStatus;
>EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
> +  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;
> 
>DevicePath = NULL;
>Status = gBS->HandleProtocol (
> @@ -133,10 +140,18 @@ PrepareLpcBridgeDevicePath (
>if (EFI_ERROR (Status)) {
>  return Status;
>}
> +  TempDevicePath = DevicePath;
> +
> +  //
> +  // Register Keyboard
> +  //
> +  DevicePath = AppendDevicePathNode (DevicePath,
> + (EFI_DEVICE_PATH_PROTOCOL *));
> + EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);
> 
>//
>// Register COM1
>//
> +  DevicePath = TempDevicePath;
>DevicePath = AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL
> *)NULL, (EFI_DEVICE_PATH_PROTOCOL *));
>DevicePath = AppendDevicePathNode (DevicePath,
> (EFI_DEVICE_PATH_PROTOCOL *));
>DevicePath = AppendDevicePathNode (DevicePath,
> (EFI_DEVICE_PATH_PROTOCOL *)); diff --git
> a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
> index 4cd88a3f85..dfbcde5668 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.fdf
> +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
> @@ -120,6 +120,10 @@ INF
> MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>  # ISA Support
>  #
>  INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> +!if $(PS2_KEYBOARD_ENABLE) == TRUE
> +INF OvmfPkg/SioBusDxe/SioBusDxe.inf
> +INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> +!endif
> 
>  #
>  # Console Support
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index 11cf17ca06..d52945442e 100

Re: [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2 keyboard support

2019-12-17 Thread Ma, Maurice
Hi, Guo,

Since PS2 keyboard is not commonly seen anymore,   do you think it is better to 
define a control variable in DSC so that the PS2 driver can be easily added or 
removed using build command line ?

Thanks
Maurice
> -Original Message-
> From: Dong, Guo
> Sent: Tuesday, December 10, 2019 15:09
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> ; Dong, Guo ;
> u14...@gmail.com
> Subject: [edk2-devel] [PATCH] UefiPayloadPkg/BootManager: Add PS2
> keyboard support
> 
> Add PS2 keyboard support by default.
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2316
> 
> This patch adds PS2 keyboard support in boot manager, and build PS2
> keyboard driver and SIO driver by default.
> 
> Signed-off-by: Guo Dong 
> ---
>  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c | 25
> -
>  UefiPayloadPkg/UefiPayloadPkg.fdf   |  2 ++
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc   |  2 ++
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc|  2 ++
>  4 files changed, 26 insertions(+), 5 deletions(-)
> 
> diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> index ee2d8c8d1e..a27cc552ab 100644
> --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> @@ -44,6 +44,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #define
> gPnp16550ComPort \
>PNPID_DEVICE_PATH_NODE(0x0501)
> 
> +#define gPnpPs2Keyboard \
> +  PNPID_DEVICE_PATH_NODE(0x0303)
> +
>  #define gUartVendor \
>{ \
>  { \
> @@ -87,7 +90,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  DEVICE_PATH_MESSAGING_PC_ANSI \
>}
> 
> -
> +ACPI_HID_DEVICE_PATH   gPnpPs2KeyboardDeviceNode  =
> gPnpPs2Keyboard;
>  ACPI_HID_DEVICE_PATH   gPnp16550ComPortDeviceNode =
> gPnp16550ComPort;
>  UART_DEVICE_PATH   gUartDeviceNode= gUart;
>  VENDOR_DEVICE_PATH gTerminalTypeDeviceNode= gPcAnsiTerminal;
> @@ -109,12 +112,15 @@ EFI_DEVICE_PATH_PROTOCOL
> *gPlatformRootBridges[] = {
>  BOOLEAN   mDetectVgaOnly;
> 
>  /**
> -  Add UART to ConOut, ConIn, ErrOut.
> +  Add IsaKeyboard to ConIn; add IsaSerial to ConOut, ConIn, ErrOut.
> 
> -  @param[in]   DeviceHandle - LPC device path.
> +  @param[in] DeviceHandle  Handle of the LPC Bridge device.
> 
> -  @retval EFI_SUCCESS  - Serial console is added to ConOut, ConIn, and
> ErrOut.
> -  @retval EFI_STATUS   - No serial console is added.
> +  @retval EFI_SUCCESS  Console devices on the LPC bridge have been added
> to
> +   ConOut, ConIn, and ErrOut.
> +
> +  @return  Error codes, due to EFI_DEVICE_PATH_PROTOCOL missing
> +   from DeviceHandle.
>  **/
>  EFI_STATUS
>  PrepareLpcBridgeDevicePath (
> @@ -123,6 +129,7 @@ PrepareLpcBridgeDevicePath (  {
>EFI_STATUSStatus;
>EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
> +  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;
> 
>DevicePath = NULL;
>Status = gBS->HandleProtocol (
> @@ -133,10 +140,18 @@ PrepareLpcBridgeDevicePath (
>if (EFI_ERROR (Status)) {
>  return Status;
>}
> +  TempDevicePath = DevicePath;
> +
> +  //
> +  // Register Keyboard
> +  //
> +  DevicePath = AppendDevicePathNode (DevicePath,
> + (EFI_DEVICE_PATH_PROTOCOL *));
> + EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);
> 
>//
>// Register COM1
>//
> +  DevicePath = TempDevicePath;
>DevicePath = AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL
> *)NULL, (EFI_DEVICE_PATH_PROTOCOL *));
>DevicePath = AppendDevicePathNode (DevicePath,
> (EFI_DEVICE_PATH_PROTOCOL *));
>DevicePath = AppendDevicePathNode (DevicePath,
> (EFI_DEVICE_PATH_PROTOCOL *)); diff --git
> a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
> index 4cd88a3f85..b20ab82f47 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.fdf
> +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
> @@ -120,6 +120,8 @@ INF
> MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>  # ISA Support
>  #
>  INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> +INF OvmfPkg/SioBusDxe/SioBusDxe.inf
> +INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
> 
>  #
>  # Console Support
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index 11cf17ca06..c9c2a87940 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -491,6 +

Re: [edk2-devel] [PATCH v2 057/105] .mailmap: Add an entry for Maurice Ma

2019-12-06 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

Thanks,
-Maurice
> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Philippe Mathieu-Daudé
> Sent: Friday, December 6, 2019 3:26
> To: devel@edk2.groups.io
> Cc: Philippe Mathieu-Daude ; Ma, Maurice
> 
> Subject: [edk2-devel] [PATCH v2 057/105] .mailmap: Add an entry for
> Maurice Ma
> 
> We use .mailmap to display contributors email addresses in an uniform
> format.
> 
> Add an entry for Maurice Ma to have his name and email address displayed
> properly in the git history.
> 
> Cc: Maurice Ma 
> Signed-off-by: Philippe Mathieu-Daude 
> ---
> [Due to MTA restricting the recipient list to 100, I can not Cc all the  named
> developers in the cover. Therefore I'm adapting the explaination  from the
> cover in each patch]
> 
> This patch won't get merged if Maurice Ma doesn't give his approval, by
> replying to this patch with:
>   Reviewed-by: Maurice Ma 
> 
> If you think this patch is inappropriate, you don't need to justify, reply 
> with:
>   NAcked-by: Maurice Ma  or simply:
>   NACK
> 
> If your Firstname Lastname order is incorrect, tell me and I will fix it.
> 
> You can also ignore this mail, but I might resend it and keep bothering you.
> 
> Regards,
> 
> Phil.
> ---
>  .mailmap | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/.mailmap b/.mailmap
> index 4b76c5b50d5c..ce558e39b1b5 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -110,3 +110,4 @@ Marvin Häuser 
> edk2-develMateusz Albecki 
> Mateusz Albecki   Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Albecki,
> Mateusz3be>
> +Maurice Ma 
> --
> 2.21.0
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#51969): https://edk2.groups.io/g/devel/message/51969
Mute This Topic: https://groups.io/mt/67468038/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V3 10/15] UefiPayloadPkg/UefiPayloadPkgIa32.dsc: Add ResetUtilityLib to dsc file

2019-08-07 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

Regards,
Maurice

> -Original Message-
> From: Gao, Zhichao
> Sent: Wednesday, August 7, 2019 18:08
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin ; Gao,
> Liming 
> Subject: [PATCH V3 10/15] UefiPayloadPkg/UefiPayloadPkgIa32.dsc: Add
> ResetUtilityLib to dsc file
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772
> 
> ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
> So add it for the platform dsc file.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index 11cf17ca06..22bd9b8f7c 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -205,6 +205,8 @@
> 
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tp
> mMeasurementLibNull.inf
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> 
> +  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
> +
>  [LibraryClasses.IA32.SEC]
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
>PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> --
> 2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#45097): https://edk2.groups.io/g/devel/message/45097
Mute This Topic: https://groups.io/mt/32794361/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V3 11/15] UefiPayloadPkg: Add ResetUtilityLib to UefiPayloadPkgIa32X64.dsc

2019-08-07 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

Regards,
Maurice

> -Original Message-
> From: Gao, Zhichao
> Sent: Wednesday, August 7, 2019 18:08
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Dong, Guo
> ; You, Benjamin ; Gao,
> Liming 
> Subject: [PATCH V3 11/15] UefiPayloadPkg: Add ResetUtilityLib to
> UefiPayloadPkgIa32X64.dsc
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772
> 
> ResetUtilityLib would be consumed by CapsuleRuntimeDxe.
> So add it for the platform dsc file.
> 
> Cc: Maurice Ma 
> Cc: Guo Dong 
> Cc: Benjamin You 
> Cc: Liming Gao 
> Signed-off-by: Zhichao Gao 
> ---
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index 5b7994a62c..ec6d5b7162 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -205,6 +205,8 @@
> 
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tp
> mMeasurementLibNull.inf
>VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> 
> +  ResetUtilityLib|MdeModulePkg/Library/ResetUtilityLib/ResetUtilityLib.inf
> +
>  [LibraryClasses.IA32.SEC]
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
>PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> --
> 2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#45096): https://edk2.groups.io/g/devel/message/45096
Mute This Topic: https://groups.io/mt/32794362/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/4] Define EDKII_SERIAL_PORT_LIB_VENDOR_GUID

2019-06-13 Thread Ma, Maurice
Hi, Laszlo

Thank you for the reminder.   Reviewed patch #4 just now.

Regards,
Maurice
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, June 13, 2019 8:32
> To: Ard Biesheuvel ; Leif Lindholm
> ; Ma, Maurice ; Dong,
> Guo ; You, Benjamin 
> Cc: Wang, Jian J ; Wu, Hao A ;
> Zeng, Star ; devel@edk2.groups.io; Anthony Perard
> ; Julien Grall ; Ni, Ray
> 
> Subject: Re: [edk2-devel] [PATCH v2 0/4] Define
> EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> 
> On 06/06/19 15:14, Anthony PERARD wrote:
> > The macro SERIAL_DXE_FILE_GUID is been defined twice and the GUID is
> > been used once without defining the macro. This patch series define a
> > macro in MdeModulePkg where the SerialDxe is, and replace all other
> > use by this new one, EDKII_SERIAL_PORT_LIB_VENDOR_GUID.
> >
> > Note that I haven't build/test those changes, but I have test the
> > first patch by applying a similar change to a patch series I'm working on.
> >
> > Patch series available in this git branch:
> > https://xenbits.xen.org/git-http/people/aperard/ovmf.git
> > br.serial-dxe-guid-v2
> >
> > Thanks.
> >
> > Anthony PERARD (4):
> >   MdeModulePkg: Introduce EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> >   ArmVirtPkg/PlatformBootManagerLib: Use
> > EDKII_SERIAL_PORT_LIB_VENDOR_GUID from MdeModulePkg
> >   ArmPkg/PlatformBootManagerLib: Use
> EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> > from MdeModulePkg
> 
> Leif, Ard, can you please review patch #3?
> 
> >   UefiPayloadPkg/PlatformBootManagerLib: Use
> > EDKII_SERIAL_PORT_LIB_VENDOR_GUID from MdeModulePkg
> 
> Maurice, Guo, Benjamin, can you please review patch #4?
> 
> Thanks,
> Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42386): https://edk2.groups.io/g/devel/message/42386
Mute This Topic: https://groups.io/mt/31950872/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 4/4] UefiPayloadPkg/PlatformBootManagerLib: Use EDKII_SERIAL_PORT_LIB_VENDOR_GUID from MdeModulePkg

2019-06-13 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

Regards,
Maurice

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Anthony PERARD
> Sent: Thursday, June 6, 2019 6:15
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Julien Grall ; Ard
> Biesheuvel ; Leif Lindholm
> ; Laszlo Ersek ; Wang, Jian J
> ; Wu, Hao A ; Zeng, Star
> ; Anthony PERARD 
> Subject: [edk2-devel] [PATCH v2 4/4]
> UefiPayloadPkg/PlatformBootManagerLib: Use
> EDKII_SERIAL_PORT_LIB_VENDOR_GUID from MdeModulePkg
> 
> EDKII_SERIAL_PORT_LIB_VENDOR_GUID is now defined in MdeModulePkg,
> simply use it.
> 
> Signed-off-by: Anthony PERARD 
> ---
>  .../Library/PlatformBootManagerLib/PlatformConsole.c   | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> index 80a11d7451..ee2d8c8d1e 100644
> --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
> @@ -8,6 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #include "PlatformBootManager.h"
>  #include "PlatformConsole.h"
> +#include 
> 
>  #define PCI_DEVICE_PATH_NODE(Func, Dev) \
>{ \
> @@ -53,7 +54,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \
>} \
>  }, \
> -{0xD3987D4B, 0x971A, 0x435F, {0x8C, 0xAF, 0x49, 0x67, 0xEB, 0x62, 0x72,
> 0x41}} \
> +EDKII_SERIAL_PORT_LIB_VENDOR_GUID \
>}
> 
>  #define gUart \
> --
> Anthony PERARD
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42385): https://edk2.groups.io/g/devel/message/42385
Mute This Topic: https://groups.io/mt/31950873/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] UefiPayloadPkg: Remove legacy PIC 8259 driver

2019-05-30 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

Regards,
Maurice

> -Original Message-
> From: Dong, Guo
> Sent: Thursday, May 30, 2019 2:52
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> ; Dong, Guo 
> Subject: [edk2-devel] UefiPayloadPkg: Remove legacy PIC 8259 driver
> 
> Since legacy PIC 8259 driver would be removed from edk2, update UEFI payload
> to remove 8259 driver.
> If required, bootloader could disable 8259.
> 
> Signed-off-by: Guo Dong 
> ---
>  UefiPayloadPkg/UefiPayloadPkg.fdf| 1 -
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc| 1 -
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc | 1 -
>  3 files changed, 3 deletions(-)
> 
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf
> b/UefiPayloadPkg/UefiPayloadPkg.fdf
> index ce3b34999b..4cd88a3f85 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.fdf
> +++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
> @@ -104,7 +104,6 @@ INF
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
>  INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf
>  INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
>  INF
> MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestD
> xe.inf
> -INF PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf
>  INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
>  INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
>  INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> index 5b6ed36e9c..11cf17ca06 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32.dsc
> @@ -432,7 +432,6 @@
>UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf
>MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
> 
> MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestD
> xe.inf
> -  PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf
>MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
>MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
>MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
> diff --git a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> index d57b5241dc..5b7994a62c 100644
> --- a/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
> @@ -433,7 +433,6 @@
>UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf
>MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
> 
> MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestD
> xe.inf
> -  PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf
>MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
>MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
>MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41691): https://edk2.groups.io/g/devel/message/41691
Mute This Topic: https://groups.io/mt/31837164/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] Maintainers.txt: update UEFI payload information

2019-05-30 Thread Ma, Maurice
Reviewed-by: Maurice Ma 

Regards,
Maurice

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Guo
> Dong
> Sent: Thursday, May 30, 2019 3:07
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> ; Dong, Guo ; Agyeman,
> Prince 
> Subject: [edk2-devel] Maintainers.txt: update UEFI payload information
> 
> Remove CorebootModulePkg and CorebootPayloadPkg, and add
> UefiPayloadPkg to reflect recently change in UEFI payload.
> wiki link for UefiPayloadPkg would be available soon.
> 
> Signed-off-by: Guo Dong 
> ---
>  Maintainers.txt | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index f3ce5edd8a..010ec31404
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -86,13 +86,6 @@ M: Bob Feng 
>  M: Liming Gao 
>  R: Yonghong Zhu 
> 
> -CorebootModulePkg, CorebootPayloadPkg
> -W:
> https://github.com/tianocore/tianocore.github.io/wiki/Coreboot_UEFI_payload
> -M: Maurice Ma 
> -M: Prince Agyeman 
> -M: Benjamin You 
> -S: Maintained
> -
>  CryptoPkg
>  W: https://github.com/tianocore/tianocore.github.io/wiki/CryptoPkg
>  M: Jian Wang 
> @@ -238,6 +231,13 @@ M: Eric Dong 
>  M: Ray Ni 
>  R: Laszlo Ersek 
> 
> +UefiPayloadPkg
> +W: https://github.com/tianocore/tianocore.github.io/wiki/UefiPayloadPkg
> +M: Maurice Ma 
> +M: Guo Dong 
> +M: Benjamin You 
> +S: Maintained
> +
>  StandaloneMmPkg
>  M: Achin Gupta 
>  M: Jiewen Yao 
> --
> 2.16.2.windows.1
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41690): https://edk2.groups.io/g/devel/message/41690
Mute This Topic: https://groups.io/mt/31837296/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 0/2] Retire CorebootModulePkg and CorebootPayloadPkg

2019-05-08 Thread Ma, Maurice
This patchset looks good me.

Reviewed-by: Maurice Ma 

Regards,
Maurice

> -Original Message-
> From: Dong, Guo
> Sent: Tuesday, May 7, 2019 15:27
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Agyeman, Prince
> ; You, Benjamin ;
> Dong, Guo 
> Subject: [edk2-devel] [PATCH 0/2] Retire CorebootModulePkg and
> CorebootPayloadPkg
> 
> Since UefiPayloadPkg in EDK2 supports Coreboot and Slim Bootloader, and
> no concerns were received for the RFC to remove CorebootModulePkg and
> CorebootPayloadPkg from EDK2
> (https://edk2.groups.io/g/devel/message/39126),
> here is the action patch to remove CorebootModulePkg and
> CorebootPayloadPkg.
> 
> Guo Dong (2):
>   Retire CorebootModulePkg from EDK2
>   Retire CorebootPayloadPkg from EDK2
> 
>  CorebootModulePkg/CbSupportDxe/CbSupportDxe.c  |  158 --
>  CorebootModulePkg/CbSupportDxe/CbSupportDxe.h  |   30 -
>  CorebootModulePkg/CbSupportDxe/CbSupportDxe.inf|   60 -
>  CorebootModulePkg/CbSupportPei/CbSupportPei.c  |  440 --
>  CorebootModulePkg/CbSupportPei/CbSupportPei.h  |   42 -
>  CorebootModulePkg/CbSupportPei/CbSupportPei.inf|   74 -
>  CorebootModulePkg/CorebootModulePkg.dec|   59 -
>  CorebootModulePkg/Include/Coreboot.h   |  249 
>  CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h |   26 -
>  .../Include/Guid/FrameBufferInfoGuid.h |   34 -
>  .../Include/Guid/SystemTableInfoGuid.h |   24 -
>  CorebootModulePkg/Include/Library/CbParseLib.h |  186 ---
>  .../Include/Library/CbPlatformSupportLib.h |   28 -
>  .../BaseSerialPortLib16550.c   | 1089 --
>  .../BaseSerialPortLib16550.inf |   42 -
>  .../BaseSerialPortLib16550.uni |   16 -
>  CorebootModulePkg/Library/CbParseLib/CbParseLib.c  |  721 -
>  .../Library/CbParseLib/CbParseLib.inf  |   39 -
>  .../CbPlatformSupportLibNull.c |   29 -
>  .../CbPlatformSupportLibNull.inf   |   29 -
>  .../CbPlatformSupportLibNull.uni   |   14 -
>  .../SataControllerDxe/ComponentName.c  |  170 ---
>  .../SataControllerDxe/SataController.c | 1043 -
>  .../SataControllerDxe/SataController.h |  536 ---
>  .../SataControllerDxe/SataControllerDxe.inf|   43 -
>  CorebootModulePkg/SecCore/FindPeiCore.c|  193 ---
>  CorebootModulePkg/SecCore/Ia32/SecEntry.asm|   72 -
>  CorebootModulePkg/SecCore/Ia32/SecEntry.nasm   |   66 -
>  CorebootModulePkg/SecCore/Ia32/Stack.asm   |   76 -
>  CorebootModulePkg/SecCore/Ia32/Stack.nasm  |   72 -
>  CorebootModulePkg/SecCore/SecCore.inf  |   57 -
>  CorebootModulePkg/SecCore/SecMain.c|  285 
>  CorebootModulePkg/SecCore/SecMain.h|  128 --
>  .../BuildAndIntegrationInstructions.txt|   82 --
>  CorebootPayloadPkg/CorebootPayloadPkg.dec  |   48 -
>  CorebootPayloadPkg/CorebootPayloadPkg.fdf  |  285 
>  CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc  |  574 
>  CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc   |  575 
>  CorebootPayloadPkg/FbGop/ComponentName.c   |  306 
>  CorebootPayloadPkg/FbGop/FbGop.c   | 1536 
> 
>  CorebootPayloadPkg/FbGop/FbGop.h   |  413 --
>  CorebootPayloadPkg/FbGop/FbGop.inf |   63 -
>  .../Library/AcpiTimerLib/AcpiTimerLib.c|  270 
>  .../Library/AcpiTimerLib/AcpiTimerLib.inf  |   40 -
>  .../Library/PciHostBridgeLib/PciHostBridge.h   |   80 -
>  .../Library/PciHostBridgeLib/PciHostBridgeLib.c|  222 ---
>  .../Library/PciHostBridgeLib/PciHostBridgeLib.inf  |   41 -
>  .../PciHostBridgeLib/PciHostBridgeSupport.c|  584 
>  .../PlatformBootManagerLib/PlatformBootManager.c   |  265 
>  .../PlatformBootManagerLib/PlatformBootManager.h   |  121 --
>  .../PlatformBootManagerLib.inf |   74 -
>  .../PlatformBootManagerLib/PlatformConsole.c   |  611 
>  .../PlatformBootManagerLib/PlatformConsole.h   |   70 -
>  .../Library/PlatformBootManagerLib/PlatformData.c  |   19 -
>  .../Library/PlatformHookLib/PlatformHookLib.c  |  105 --
>  .../Library/PlatformHookLib/PlatformHookLib.inf|   39 -
>  .../Library/ResetSystemLib/ResetSystemLib.c|  221 ---
>  .../Library/ResetSystemLib/ResetSystemLib.inf  |   38 -
>  58 files changed, 12812 deletions(-)
>  delete mode 100755 CorebootModulePkg/CbSupportDxe/CbSupportDxe.c
>  delete mode 100644 CorebootModulePkg/CbSupportDxe/CbSupportDxe.h
>  delete mode 100644 CorebootMod

Re: Commit Partitioning - Re: [edk2-devel] [edk2] [PATCH V2] UefiPayloadPkg: Enhance UEFI payload for coreboot and Slim Bootloader

2019-04-15 Thread Ma, Maurice
Hi, Jordan

That is a good point.   Smaller patch will always help the review easier.  
Thank you for pointing it out.   

Thanks
Maurice
> -Original Message-
> From: Justen, Jordan L
> Sent: Monday, April 15, 2019 15:28
> To: Dong, Guo ; Ma, Maurice
> ; devel@edk2.groups.io
> Cc: Agyeman, Prince ; You, Benjamin
> ; Dong, Guo 
> Subject: Commit Partitioning - Re: [edk2-devel] [edk2] [PATCH V2]
> UefiPayloadPkg: Enhance UEFI payload for coreboot and Slim Bootloader
> 
> On 2019-04-11 08:51:22, Guo Dong wrote:
> > CorebootModulePkg and CorebootPayloadPkg originally supports coreboot
> only.
> > In order to support other bootloaders, such as Slim Bootloader, they
> > need be updated to be more generic.
> > UEFI Payload (UefiPayloadPkg) a converged package from
> > CorebootModulePkg and CorebootPayloadPkg with following updates:
> > a. Support both coreboot and Slim Bootloader b. Removed
> > SataControllerDxe and BaseSerialPortLib16550 to use EDK2 modules c.
> > Support passing bootloader parameter to UEFI payload, e.g. coreboot
> >table from coreboot or HOB list from Slim Bootloader d. Using
> > GraphicsOutputDxe from EDK2 with minor change instead of FbGop e.
> > Remove the dependency to IntelFrameworkPkg and
> IntelFrameworkModulePkg
> >and QuarkSocPkg
> > f. Use BaseDebugLibSerialPort library as DebugLib g. Use HPET timer,
> > drop legacy 8254 timer support h. Use BaseXApicX2ApicLib instead of
> > BaseXApicLib i. Remove HOB gUefiFrameBufferInfoGuid to use EDK2
> > graphics HOBs.
> > j. Other clean ups
> 
> Why this wasn't split into *at least* 10 patches given the 10 major bullet
> points listed here?
> 
> https://github.com/tianocore/tianocore.github.io/wiki/Commit-Partitioning
> 
> >
> > On how UefiPayloadPkg could work with coreboot/Slim Bootloader, please
> > refer UefiPayloadPkg/BuildAndIntegrationInstructions.txt
> >
> > Once UefiPayloadPkg is checked-in, CorebootModulePkg and
> > CorebootPayloadPkg could be retired.
> >
> > Signed-off-by: Guo Dong 
> > Reviewed-by: Maurice Ma 
> 
> Same question to Maurice.
> 
> Maybe something to consider in the future.
> 
> -Jordan
> 
> > ---
> >  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c   | 
> > 158
> ++
> ++
> ++
> >  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h   | 
> >  30
> ++
> >  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf | 
> >  58
> ++
> >  UefiPayloadPkg/BlSupportPei/BlSupportPei.c   | 
> > 566
> ++
> ++
> ++
> ++
> ++
> ++
> ++
> ++
> ++
> 
> >  UefiPayloadPkg/BlSupportPei/BlSupportPei.h   | 
> >  39
> +++
> >  UefiPayloadPkg/BlSupportPei/BlSupportPei.inf | 
> >  73
> ++
> +++
> >  UefiPayloadPkg/BuildAndIntegrationInstructions.txt   | 
> >  82
> ++
> 
> >  UefiPayloadPkg/GraphicsOutputDxe/ComponentName.c | 
> > 184
> ++
> ++
> ++
> ++
> >  UefiPayloadPkg/GraphicsOutputDxe/GraphicsOutput.c| 
> > 739
> ++
> ++
> ++
> ++
> ++
> 

Re: [edk2-devel] [PATCH v2 1/2] CorebootModulePkg: Fix non - CRLF line endings

2019-04-09 Thread Ma, Maurice
This patch series looks good to me.
Reviewed-by: Maurice Ma 

Regards,
Maurice

> -Original Message-
> From: Agyeman, Prince
> Sent: Thursday, April 4, 2019 8:32
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; You, Benjamin
> 
> Subject: [PATCH v2 1/2] CorebootModulePkg: Fix non - CRLF line endings
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1658
> 
> Replaced non CRLF line endings with CRLF
> 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Agyeman 
> ---
>  CorebootModulePkg/Include/Coreboot.h  |   32 +-
>  .../BaseSerialPortLib16550.c  | 2178 -
>  .../SataControllerDxe/SataController.h| 1082 
>  CorebootModulePkg/SecCore/Ia32/Stack.S|  138 +-
>  4 files changed, 1715 insertions(+), 1715 deletions(-)
> 
> diff --git a/CorebootModulePkg/Include/Coreboot.h
> b/CorebootModulePkg/Include/Coreboot.h
> index 784e0b128a..b622e6f17e 100644
> --- a/CorebootModulePkg/Include/Coreboot.h
> +++ b/CorebootModulePkg/Include/Coreboot.h
> @@ -80,7 +80,7 @@ struct imd_root {
>UINT32 max_entries;
>UINT32 num_entries;
>UINT32 flags;
> -  UINT32 entry_align;
> +  UINT32 entry_align;
>UINT32 max_offset;
>struct imd_entry entries[0];
>  };
> @@ -165,21 +165,21 @@ struct cb_serial {
>UINT32 type;
>UINT32 baseaddr;
>UINT32 baud;
> -  UINT32 regwidth;
> -
> -  // Crystal or input frequency to the chip containing the UART.
> -  // Provide the board specific details to allow the payload to
> -  // initialize the chip containing the UART and make independent
> -  // decisions as to which dividers to select and their values
> -  // to eventually arrive at the desired console baud-rate.
> -  UINT32 input_hertz;
> -
> -  // UART PCI address: bus, device, function
> -  // 1 << 31 - Valid bit, PCI UART in use
> -  // Bus << 20
> -  // Device << 15
> -  // Function << 12
> -  UINT32 uart_pci_addr;
> +  UINT32 regwidth;
> +
> +  // Crystal or input frequency to the chip containing the UART.
> +  // Provide the board specific details to allow the payload to
> +  // initialize the chip containing the UART and make independent
> +  // decisions as to which dividers to select and their values
> +  // to eventually arrive at the desired console baud-rate.
> +  UINT32 input_hertz;
> +
> +  // UART PCI address: bus, device, function
> +  // 1 << 31 - Valid bit, PCI UART in use
> +  // Bus << 20
> +  // Device << 15
> +  // Function << 12
> +  UINT32 uart_pci_addr;
>  };
> 
>  #define CB_TAG_CONSOLE   0x00010
> diff --git
> a/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib165
> 50.c
> b/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib165
> 50.c
> index a5e1755a44..804b948906 100644
> ---
> a/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib165
> 50.c
> +++
> b/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib165
> 50.c
> @@ -1,1095 +1,1095 @@
> -/** @file
> -  16550 UART Serial Port library functions
> -
> -  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> -  This program and the accompanying materials
> -  are licensed and made available under the terms and conditions of the BSD
> License
> -  which accompanies this distribution.  The full text of the license may be
> found at
> -  http://opensource.org/licenses/bsd-license.php
> -
> -  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> -  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> -
> -**/
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -//
> +/** @file
> +  16550 UART Serial Port library functions
> +
> +  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
> +  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> +  This program and the accompanying materials
> +  are licensed and made available under the terms and conditions of the BSD
> License
> +  which accompanies this distribution.  The full text of the license may be
> found at
> +  http://opensource.org/licenses/bsd-license.php
> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#i

Re: [edk2-devel] [edk2] [PATCH V3] Change EDK II to BSD+Patent License

2019-04-04 Thread Ma, Maurice
Reviewed changes for CorebootPayloadPkg and CorebootModulePkg. 
And they look good to me.

Reviewed-by: Maurice Ma < maurice...@intel.com >

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#38589): https://edk2.groups.io/g/devel/message/38589
Mute This Topic: https://groups.io/mt/30887153/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-