[edk2-devel] [PATCH v3] BaseTools GenFw: Add support for RISCV GOT/PLT relocations

2021-06-16 Thread Sunil V L
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096

This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20
relocations generated by PIE enabled compiler. This also needed
changes to R_RISCV_32 and R_RISCV_64 relocations as explained in
https://github.com/riscv/riscv-gnu-toolchain/issues/905#issuecomment-846682710

Changes in v3:
  - Added the comments to address Liming's feedback.

Changes in v2:
  - Addressed Daniel's comment on formatting

Testing:
1) Debian GCC 8.3.0 and booted sifive_u and QMEU virt models.
2) Debian 10.2.0 and booted QEMU virt model.
3) riscv-gnu-tool chain 9.2 and booted QEMU virt model.

Signed-off-by: Sunil V L 

Acked-by: Abner Chang 
Reviewed-by: Daniel Schaefer 
Tested-by: Daniel Schaefer 

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Heinrich Schuchardt 
---
 BaseTools/Source/C/GenFw/Elf64Convert.c | 58 ++---
 1 file changed, 52 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c 
b/BaseTools/Source/C/GenFw/Elf64Convert.c
index d097db8632..310ad38f90 100644
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
@@ -129,6 +129,8 @@ STATIC UINT32 mDebugOffset;
 STATIC UINT8   *mRiscVPass1Targ = NULL;
 STATIC Elf_Shdr*mRiscVPass1Sym = NULL;
 STATIC Elf64_Half  mRiscVPass1SymSecIndex = 0;
+STATIC INT32   mRiscVPass1Offset;
+STATIC INT32   mRiscVPass1GotFixup;
 
 //
 // Initialization Function
@@ -479,11 +481,11 @@ WriteSectionRiscV64 (
 break;
 
   case R_RISCV_32:
-*(UINT32 *)Targ = (UINT32)((UINT64)(*(UINT32 *)Targ) - SymShdr->sh_addr + 
mCoffSectionsOffset[Sym->st_shndx]);
+*(UINT64 *)Targ = Sym->st_value + Rel->r_addend;
 break;
 
   case R_RISCV_64:
-*(UINT64 *)Targ = *(UINT64 *)Targ - SymShdr->sh_addr + 
mCoffSectionsOffset[Sym->st_shndx];
+*(UINT64 *)Targ = Sym->st_value + Rel->r_addend;
 break;
 
   case R_RISCV_HI20:
@@ -533,6 +535,18 @@ WriteSectionRiscV64 (
 mRiscVPass1SymSecIndex = 0;
 break;
 
+  case R_RISCV_GOT_HI20:
+Value = (Sym->st_value - Rel->r_offset);
+mRiscVPass1Offset = RV_X(Value, 0, 12);
+Value = RV_X(Value, 12, 20);
+*(UINT32 *)Targ = (Value << 12) | (RV_X(*(UINT32*)Targ, 0, 12));
+
+mRiscVPass1Targ = Targ;
+mRiscVPass1Sym = SymShdr;
+mRiscVPass1SymSecIndex = Sym->st_shndx;
+mRiscVPass1GotFixup = 1;
+break;
+
   case R_RISCV_PCREL_HI20:
 mRiscVPass1Targ = Targ;
 mRiscVPass1Sym = SymShdr;
@@ -545,11 +559,17 @@ WriteSectionRiscV64 (
 if (mRiscVPass1Targ != NULL && mRiscVPass1Sym != NULL && 
mRiscVPass1SymSecIndex != 0) {
   int i;
   Value2 = (UINT32)(RV_X(*(UINT32 *)mRiscVPass1Targ, 12, 20));
-  Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12));
-  if(Value & (RISCV_IMM_REACH/2)) {
-Value |= ~(RISCV_IMM_REACH-1);
+
+  if(mRiscVPass1GotFixup) {
+Value = (UINT32)(mRiscVPass1Offset);
+  } else {
+Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12));
+if(Value & (RISCV_IMM_REACH/2)) {
+  Value |= ~(RISCV_IMM_REACH-1);
+}
   }
   Value = Value - (UINT32)mRiscVPass1Sym->sh_addr + 
mCoffSectionsOffset[mRiscVPass1SymSecIndex];
+
   if(-2048 > (INT32)Value) {
 i = (((INT32)Value * -1) / 4096);
 Value2 -= i;
@@ -569,12 +589,35 @@ WriteSectionRiscV64 (
 }
   }
 
-  *(UINT32 *)Targ = (RV_X(Value, 0, 12) << 20) | (RV_X(*(UINT32*)Targ, 0, 
20));
+  if(mRiscVPass1GotFixup) {
+*(UINT32 *)Targ = (RV_X((UINT32)Value, 0, 12) << 20)
+| (RV_X(*(UINT32*)Targ, 0, 20));
+// Convert LD instruction to ADDI
+//
+// |31  20|19  15|14  12|11   7|6   0|
+// |-|
+// |imm[11:0] | rs1  | 011  |  rd  | 011 | LD
+//  -
+
+// |-|
+// |imm[11:0] | rs1  | 000  |  rd  | 0010011 | ADDI
+//  -
+
+// To convert, let's first reset bits 12-14 and 0-6 using ~0x707f
+// Then modify the opcode to ADDI (0010011)
+// All other fields will remain same.
+
+*(UINT32 *)Targ = ((*(UINT32 *)Targ & ~0x707f) | 0x13);
+  } else {
+*(UINT32 *)Targ = (RV_X(Value, 0, 12) << 20) | (RV_X(*(UINT32*)Targ, 
0, 20));
+  }
   *(UINT32 *)mRiscVPass1Targ = (RV_X(Value2, 0, 20)<<12) | (RV_X(*(UINT32 
*)mRiscVPass1Targ, 0, 12));
 }
 mRiscVPass1Sym = NULL;
 mRiscVPass1Targ = NULL;
 mRiscVPass1SymSecIndex = 0;
+mRiscVPass1Offset = 0;
+mRiscVPass1GotFixup = 0;
 break;
 
   case R_RISCV_ADD64:
@@ -586,6 +629,7 @@ WriteSectionRiscV64 (
   case R_RISCV_GPREL_I:
   case R_RISCV_GPREL_S:
   case R_RISCV_CALL:
+  case R_RISCV_CALL_PLT:
   case R_RISCV_RVC_BRANCH:
   case R_RISCV_RVC_JUMP:
   case R_RISCV_RELAX:
@@ -1528,6 +1572,7 @@ WriteRelocations64 (
   

Re: [edk2-devel] 回复: [RESEND PATCH v2] BaseTools: Add support for RISCV GOT/PLT relocations

2021-06-16 Thread Sunil V L
Hi Liming,
   Thank you very much for the review.

On Thu, Jun 17, 2021 at 09:43:21AM +0800, gaoliming wrote:
> Sunil:
>   I add my comments below. 
> 
> Thanks
> Liming
> > -邮件原件-
> > 发件人: Sunil V L 
> > 发送时间: 2021年6月11日 22:05
> > 收件人: devel@edk2.groups.io
> > 抄送: Sunil V L ; Abner Chang
> > ; Daniel Schaefer ; Bob
> > Feng ; Liming Gao ;
> > Yuwei Chen ; Heinrich Schuchardt
> > 
> > 主题: [RESEND PATCH v2] BaseTools: Add support for RISCV GOT/PLT
> > relocations
> > 
> > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096
> > 
> > This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20
> > relocations generated by PIE enabled compiler. This also needed
> > changes to R_RISCV_32 and R_RISCV_64 relocations as explained in
> > https://github.com/riscv/riscv-gnu-toolchain/issues/905#issuecomment-8466
> > 82710
> > 
> > Changes in v2:
> >   - Addressed Daniel's comment on formatting
> > 
> > Testing:
> > 1) Debian GCC 8.3.0 and booted sifive_u and QMEU virt models.
> > 2) Debian 10.2.0 and booted QEMU virt model.
> > 3) riscv-gnu-tool chain 9.2 and booted QEMU virt model.
> > 
> > Signed-off-by: Sunil V L 
> > 
> > Acked-by: Abner Chang 
> > Reviewed-by: Daniel Schaefer 
> > Tested-by: 
> 
> Tested-By format is invalid. Its format is same Reviewed-by. 
Sure. Will fix it.
> 
> > 
> > Cc: Bob Feng 
> > Cc: Liming Gao 
> > Cc: Yuwei Chen 
> > Cc: Heinrich Schuchardt 
> > ---
> >  BaseTools/Source/C/GenFw/Elf64Convert.c | 44
> > +
> >  1 file changed, 38 insertions(+), 6 deletions(-)
> > 
> > diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c
> > b/BaseTools/Source/C/GenFw/Elf64Convert.c
> > index d097db8632..d684318269 100644
> > --- a/BaseTools/Source/C/GenFw/Elf64Convert.c
> > +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
> > @@ -129,6 +129,8 @@ STATIC UINT32 mDebugOffset;
> >  STATIC UINT8   *mRiscVPass1Targ = NULL;
> > 
> >  STATIC Elf_Shdr*mRiscVPass1Sym = NULL;
> > 
> >  STATIC Elf64_Half  mRiscVPass1SymSecIndex = 0;
> > 
> > +STATIC INT32   mRiscVPass1Offset;
> > 
> > +STATIC INT32   mRiscVPass1GotFixup;
> > 
> > 
> > 
> >  //
> > 
> >  // Initialization Function
> > 
> > @@ -479,11 +481,11 @@ WriteSectionRiscV64 (
> >  break;
> > 
> > 
> > 
> >case R_RISCV_32:
> > 
> > -*(UINT32 *)Targ = (UINT32)((UINT64)(*(UINT32 *)Targ) -
> > SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]);
> > 
> > +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend;
> > 
> >  break;
> > 
> > 
> > 
> >case R_RISCV_64:
> > 
> > -*(UINT64 *)Targ = *(UINT64 *)Targ - SymShdr->sh_addr +
> > mCoffSectionsOffset[Sym->st_shndx];
> > 
> > +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend;
> > 
> >  break;
> > 
> > 
> > 
> >case R_RISCV_HI20:
> > 
> > @@ -533,6 +535,18 @@ WriteSectionRiscV64 (
> >  mRiscVPass1SymSecIndex = 0;
> > 
> >  break;
> > 
> > 
> > 
> > +  case R_RISCV_GOT_HI20:
> > 
> > +Value = (Sym->st_value - Rel->r_offset);
> > 
> > +mRiscVPass1Offset = RV_X(Value, 0, 12);
> > 
> > +Value = RV_X(Value, 12, 20);
> > 
> > +*(UINT32 *)Targ = (Value << 12) | (RV_X(*(UINT32*)Targ, 0, 12));
> > 
> > +
> > 
> > +mRiscVPass1Targ = Targ;
> > 
> > +mRiscVPass1Sym = SymShdr;
> > 
> > +mRiscVPass1SymSecIndex = Sym->st_shndx;
> > 
> > +mRiscVPass1GotFixup = 1;
> > 
> > +break;
> > 
> > +
> > 
> >case R_RISCV_PCREL_HI20:
> > 
> >  mRiscVPass1Targ = Targ;
> > 
> >  mRiscVPass1Sym = SymShdr;
> > 
> > @@ -545,11 +559,17 @@ WriteSectionRiscV64 (
> >  if (mRiscVPass1Targ != NULL && mRiscVPass1Sym != NULL &&
> > mRiscVPass1SymSecIndex != 0) {
> > 
> >int i;
> > 
> >Value2 = (UINT32)(RV_X(*(UINT32 *)mRiscVPass1Targ, 12, 20));
> > 
> > -  Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12));
> > 
> > -  if(Value & (RISCV_IMM_REACH/2)) {
> > 
> > -Value |= ~(RISCV_IMM_REACH-1);
> > 
> > +
> > 
> > +  if(mRiscVPass1GotFixup) {
> > 
> > +Value = (UINT32)(mRiscVPass1Offset);
> > 
> > +  } else {
> > 
> > +Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12));
> > 
> > +if(Value & (RISCV_IMM_REACH/2)) {
> > 
> > +  Value |= ~(RISCV_IMM_REACH-1);
> > 
> > +}
> > 
> >}
> > 
> >Value = Value - (UINT32)mRiscVPass1Sym->sh_addr +
> > mCoffSectionsOffset[mRiscVPass1SymSecIndex];
> > 
> > +
> > 
> >if(-2048 > (INT32)Value) {
> > 
> >  i = (((INT32)Value * -1) / 4096);
> > 
> >  Value2 -= i;
> > 
> > @@ -569,12 +589,21 @@ WriteSectionRiscV64 (
> >  }
> > 
> >}
> > 
> > 
> > 
> > -  *(UINT32 *)Targ = (RV_X(Value, 0, 12) << 20) |
> (RV_X(*(UINT32*)Targ,
> > 0, 20));
> > 
> > +  if(mRiscVPass1GotFixup) {
> > 
> > +*(UINT32 *)Targ = (RV_X((UINT32)Value, 0, 12) << 20)
> > 
> > +| (RV_X(*(UINT32*)Targ, 0, 20));
> > 
> > +/* Convert LD instruction to ADDI */
> > 
> > +*(UINT32 *)Targ = ((*(UINT32 *)Targ & ~0x707f) | 0x13);
> > 

Re: [edk2-devel] [RESEND PATCH v2] BaseTools: Add support for RISCV GOT/PLT relocations

2021-06-16 Thread Sunil V L
Hi Pete,
   Thank you very much!.
On Wed, Jun 16, 2021 at 01:35:27PM +0100, Pete Batard wrote:
> Sunil, Daniel, thanks for the patch.
> 
> I confirm that this addresses the 0x13 and 0x14 relocation issues that I was
> seeing.
> 
> However, this patch appears to introduces new R_RISCV_PCREL_LO12_S
> relocation errors that I was not seeing previously, so I still can't manage
> to get a successful compilation.

It is not introduced by the patch but looks like one more new relocation
type is added by the latest tool chain you are using. Please raise a new
bug and I will add the support for it in next patch.

Thanks!
Sunil
> 
> Especially the stream of 0x13 and 0x14 relocation errors I was getting at
> https://github.com/pbatard/ntfs-3g/runs/2278190652?check_suite_focus=true
> has now switched to (tested on up to date Ubuntu with latest EDK2):
> 
> -
> "GenFw" -e UEFI_DRIVER -o 
> /usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/OUTPUT/ntfs.efi
>  
> /usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll
> GenFw: ERROR 3000: Invalid
>   WriteSections64(): 
> /usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll
> unsupported ELF EM_RISCV64 relocation 0x19.
> GenFw: ERROR 3000: Invalid
>   WriteSections64(): 
> /usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll
> unsupported ELF EM_RISCV64 relocation 0x19.
> GenFw: ERROR 3000: Invalid
>   WriteSections64(): 
> /usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll
> unsupported ELF EM_RISCV64 relocation 0x19.
> GenFw: ERROR 3000: Invalid
>   WriteRelocations64(): 
> /usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll
> unsupported ELF EM_RISCV64 relocation 0x19.
> GenFw: ERROR 3000: Invalid
>   WriteRelocations64(): 
> /usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll
> unsupported ELF EM_RISCV64 relocation 0x19.
> GenFw: ERROR 3000: Invalid
>   WriteRelocations64(): 
> /usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll
> unsupported ELF EM_RISCV64 relocation 0x19.
> make: *** [GNUmakefile:553: 
> /usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/OUTPUT/ntfs.efi]
> Error 2
> -
> 
> So, in effect, some of the earlier relocation errors appear to have morphed
> into 0x19/R_RISCV_PCREL_LO12_S ones...
> 
> I can open a new bug for this issue if you prefer.
> 
> Regards,
> 
> /Pete
> 
> On 2021.06.15 03:26, Daniel Schaefer wrote:
> > Great commit message, thanks Sunil!
> > Maintainers, please take a look and let us know if there's any other
> > concern.
> > This patch lets us build the RISC-V platforms using modern toolchains
> > that are provided directly by the distributions, rather than building
> > your own from source.
> > 
> > Thanks,
> > Daniel
> > 
> > *From:* Sunil V L 
> > *Sent:* Friday, June 11, 2021 22:08
> > *To:* devel@edk2.groups.io 
> > *Cc:* Chang, Abner (HPS SW/FW Technologist) ;
> > Schaefer, Daniel ; Bob Feng
> > ; Liming Gao ; Yuwei
> > Chen ; Heinrich Schuchardt 
> > *Subject:* Re: [RESEND PATCH v2] BaseTools: Add support for RISCV
> > GOT/PLT relocations
> > Hi,
> >      I just edited the commit message to indicate the module and CC the
> >      maintainers. Could I get the feedback please?
> > Thanks
> > Sunil
> > 
> > On Fri, Jun 11, 2021 at 07:35:03PM +0530, Sunil V L wrote:
> > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096
> > 
> > > 
> > > This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20
> > > relocations generated by PIE enabled compiler. This also needed
> > > changes to R_RISCV_32 and R_RISCV_64 relocations as explained in
> > > https://github.com/riscv/riscv-gnu-toolchain/issues/905#issuecomment-846682710
> > 
> > > 
> > > Changes in v2:
> > >    - Addressed Daniel's comment on formatting
> > > 
> > > Testing:
> > > 1) Debian GCC 8.3.0 and booted sifive_u and QMEU virt models.
> > > 2) Debian 10.2.0 and booted QEMU virt model.
> > > 3) riscv-gnu-tool chain 9.2 and booted QEMU virt model.
> > > 
> > > Signed-off-by: Sunil V L 
> > > 
> > > Acked-by: Abner Chang 
> > > Reviewed-by: Daniel Schaefer 
> > > Tested-by: 
> > > 
> > > Cc: Bob Feng 
> > > Cc: Liming Gao 
> > > Cc: Yuwei Chen 
> > > Cc: Heinrich Schuchardt 
> > > ---
> > >   BaseTools/Source/C/GenFw/Elf64Convert.c | 44 +
> > >   1 file changed, 38 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c 
> > > b/BaseTools/Source/C/GenFw/Elf64Convert.c
> > > index d097db8632..d684318269 100644
> > > 

[edk2-devel] OvmfPkgIa32X64.dsc is broken: OvmfPkg/Sec/SecMain.inf NOT found in DSC file; Is it really a binary module?

2021-06-16 Thread Rebecca Cran
Is OvmfPkg/OvmfPkgIa32X64.dsc still supposed to work after the recent 
changes in OvmfPkg? I realized it's currently broken.



bcran@photon:~/src/uefi/edk2> build -p OvmfPkg/OvmfPkgIa32X64.dsc -a X64 
-t GCC5 -b RELEASE

Build environment: Linux-5.12.9-1-default-x86_64-with-glibc2.2.5
Build start time: 22:11:28, Jun.16 2021

WORKSPACE    = /home/bcran/src/uefi/edk2
EDK_TOOLS_PATH   = /home/bcran/src/uefi/edk2/BaseTools
CONF_PATH    = /home/bcran/src/uefi/edk2/Conf
PYTHON_COMMAND   = /usr/bin/python3.8


Processing meta-data
.Architecture(s)  = X64
Build target = RELEASE
Toolchain    = GCC5

Active Platform  = 
/home/bcran/src/uefi/edk2/OvmfPkg/OvmfPkgIa32X64.dsc



build.py...
 : error F001: Module /home/bcran/src/uefi/edk2/OvmfPkg/Sec/SecMain.inf 
NOT found in DSC file; Is it really a binary module?




- Failed -
Build end time: 22:11:29, Jun.16 2021
Build total time: 00:00:01


--
Rebecca Cran




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




Re: [edk2-devel] [PATCH] BaseTools: Remove check for Split.exe in toolset.bat

2021-06-16 Thread Bob Feng
Reviewed-by: Bob Feng 

-Original Message-
From: gaoliming  
Sent: Thursday, June 17, 2021 9:36 AM
To: devel@edk2.groups.io; rebe...@bsdio.com; Feng, Bob C 
; Chen, Christine 
Subject: 回复: [edk2-devel] [PATCH] BaseTools: Remove check for Split.exe in 
toolset.bat

Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Rebecca Cran
> 发送时间: 2021年6月13日 11:35
> 收件人: Bob Feng ; Liming Gao 
> ; Yuwei Chen 
> 抄送: Rebecca Cran ; devel@edk2.groups.io
> 主题: [edk2-devel] [PATCH] BaseTools: Remove check for Split.exe in 
> toolset.bat
> 
> Split is now a Python tool, so BaseTools\Bin\Win32\Split.exe no longer 
> exists. Remove the check for it from toolsetup.bat to prevent the 
> erroneous claim that the binary C tools are missing.
> 
> Signed-off-by: Rebecca Cran 
> ---
>  BaseTools/toolsetup.bat | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 
> 4b5256ab6e..a766a69f08 100755
> --- a/BaseTools/toolsetup.bat
> +++ b/BaseTools/toolsetup.bat
> @@ -299,7 +299,6 @@ IF NOT EXIST "%EDK_TOOLS_BIN%\GenFfs.exe" goto 
> check_c_tools  IF NOT EXIST "%EDK_TOOLS_BIN%\GenFv.exe" goto 
> check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\GenFw.exe" goto check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\GenSec.exe" goto check_c_tools
> 
> -IF NOT EXIST "%EDK_TOOLS_BIN%\Split.exe" goto check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\TianoCompress.exe" goto check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\VfrCompile.exe" goto check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\VolInfo.exe" goto check_c_tools
> 
> --
> 2.32.0
> 
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#76441): 
> https://edk2.groups.io/g/devel/message/76441
> Mute This Topic: https://groups.io/mt/83503018/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





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




回复: [edk2-devel] [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with

2021-06-16 Thread gaoliming
 

Please follow 
https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format to 
update the commit message format.

 

And, for the override PciBus module, can you give more detail why need to 
override PciBus? Is it possible to update Edk2 MdeModulePkg PciBus to meet the 
platform requirement?

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 manickavasakam 
karpagavinayagam
发送时间: 2021年6月17日 7:05
收件人: devel@edk2.groups.io
主题: [edk2-devel] [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform 
and Override generic PciBus Driver with

 

Add BoardTiogaPass packages to support TiogaPass Platform Enabled Network, 
ISCSI,IPMI, SMBIOS, Performance Measurement 
Remove AST2500 UEFI option ROM driver from PurleyOpenBoardPkg

AST2500 UEFI option ROM move to edk2-non-osi ASpeedGopBinPkg Update copyright 
headers

 

manickavasakam karpagavinayagam (2):

  PurleyOpenBoardPkg : Support for TiogaPass Platform

  PurleyOpenBoardPkg : Override generic PciBus Driver with Platform

specific instance of PciBus driver.

 

.../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c |8 +-

.../Acpi/BoardAcpiDxe/AmlOffsetTable.c|  453 +-

.../Acpi/BoardAcpiDxe/BoardAcpiDxeDsdt.c  |3 +

.../BoardTiogaPass/CoreDxeInclude.dsc |  168 +

.../BoardTiogaPass/CoreUefiBootInclude.fdf|   82 +

.../BoardTiogaPass/GitEdk2MinTiogaPass.bat|   93 +

.../BasePlatformHookLib/BasePlatformHookLib.c |  389 +

.../BasePlatformHookLib.inf   |   36 +

.../BoardAcpiLib/DxeBoardAcpiTableLib.c   |   36 +

.../BoardAcpiLib/DxeBoardAcpiTableLib.inf |   40 +

.../BoardAcpiLib/DxeTiogaPassAcpiTableLib.c   |   53 +

.../BoardAcpiLib/SmmBoardAcpiEnableLib.c  |   62 +

.../BoardAcpiLib/SmmBoardAcpiEnableLib.inf|   41 +

.../BoardAcpiLib/SmmSiliconAcpiEnableLib.c|  120 +

.../BoardAcpiLib/SmmTiogaPassAcpiEnableLib.c  |   37 +

.../Library/BoardInitLib/AllLanesEparam.c |   44 +

.../Library/BoardInitLib/GpioTable.c  |  296 +

.../Library/BoardInitLib/IioBifur.c   |   70 +

.../BoardInitLib/PeiBoardInitPostMemLib.c |   46 +

.../BoardInitLib/PeiBoardInitPostMemLib.inf   |   37 +

.../BoardInitLib/PeiBoardInitPreMemLib.c  |  112 +

.../BoardInitLib/PeiBoardInitPreMemLib.inf|   69 +

.../Library/BoardInitLib/PeiTiogaPassDetect.c |   28 +

.../BoardInitLib/PeiTiogaPassInitLib.h|   18 +

.../BoardInitLib/PeiTiogaPassInitPostMemLib.c |   86 +

.../BoardInitLib/PeiTiogaPassInitPreMemLib.c  |  638 ++

.../Library/BoardInitLib/UsbOC.c  |   46 +

.../Library/PeiReportFvLib/PeiReportFvLib.c   |  138 +

.../Library/PeiReportFvLib/PeiReportFvLib.inf |   51 +

.../BoardTiogaPass/OpenBoardPkg.dsc   |  245 +

.../BoardTiogaPass/OpenBoardPkg.fdf   |  600 ++

.../BoardTiogaPass/PlatformPkgBuildOption.dsc |   84 +

.../BoardTiogaPass/PlatformPkgConfig.dsc  |   58 +

.../BoardTiogaPass/PlatformPkgPcd.dsc |  392 ++

.../BoardTiogaPass/StructureConfig.dsc| 6236 +

.../BoardTiogaPass/__init__.py|0

.../PurleyOpenBoardPkg/BoardTiogaPass/bld.bat |  139 +

.../BoardTiogaPass/build_board.py |  195 +

.../BoardTiogaPass/build_config.cfg   |   34 +

.../BoardTiogaPass/logo.txt   |   10 +

.../BoardTiogaPass/postbuild.bat  |   96 +

.../BoardTiogaPass/prebuild.bat   |  213 +

.../Ipmi/Library/IpmiLibKcs/IpmiLibKcs.inf|   10 +-

.../IpmiPlatformHookLib.inf   |6 +-

.../Include/Guid/PchRcVariable.h  |6 +

.../Include/Guid/SetupVariable.h  |   15 +-

.../Intel/PurleyOpenBoardPkg/OpenBoardPkg.dec |1 +

.../Bus/Pci/PciBusDxe/ComponentName.c |  170 +

.../Bus/Pci/PciBusDxe/ComponentName.h |  146 +

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c   |  460 ++

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h   |  396 ++

.../Bus/Pci/PciBusDxe/PciBusDxe.inf   |  112 +

.../Bus/Pci/PciBusDxe/PciBusDxe.uni   |   16 +

.../Bus/Pci/PciBusDxe/PciBusDxeExtra.uni  |   14 +

.../Bus/Pci/PciBusDxe/PciCommand.c|  267 +

.../Bus/Pci/PciBusDxe/PciCommand.h|  232 +

.../Bus/Pci/PciBusDxe/PciDeviceSupport.c  | 1056 +++

.../Bus/Pci/PciBusDxe/PciDeviceSupport.h  |  266 +

.../Bus/Pci/PciBusDxe/PciDriverOverride.c |  188 +

.../Bus/Pci/PciBusDxe/PciDriverOverride.h |   83 +

.../Bus/Pci/PciBusDxe/PciEnumerator.c | 2210 ++

.../Bus/Pci/PciBusDxe/PciEnumerator.h |  515 ++

.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c  | 2885   
.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.h  |  480 ++

.../Bus/Pci/PciBusDxe/PciHotPlugSupport.c |  484 ++

.../Bus/Pci/PciBusDxe/PciHotPlugSupport.h |  205 +

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c| 2087 ++

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h|  660 ++

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c   | 1809 +


[edk2-devel] 回复: [edk2][PATCH V1] MdePkg : Add IPMI Macro and Structure Defintions to resolve the IPMI build error

2021-06-16 Thread gaoliming
Manickavasakam:
  Please update this patch. It also includes
0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch. 

  The patch should only include the code changes in MdePkg. 

Thanks
Liming
> -邮件原件-
> 发件人: gaoliming 
> 发送时间: 2021年6月17日 10:50
> 收件人: 'manickavasakam karpagavinayagam'
> ; 'devel@edk2.groups.io'
> 
> 抄送: 'isaac.w.o...@intel.com' ;
> 'nathaniel.l.desim...@intel.com' ;
> 'fel...@ami.com' ; 'harikrish...@ami.com'
> ; 'mani...@ami.com' ;
> 'zacha...@ami.com' 
> 主题: 回复: [edk2][PATCH V1] MdePkg : Add IPMI Macro and Structure
> Defintions to resolve the IPMI build error
> 
> 
> 
> > -邮件原件-
> > 发件人: manickavasakam karpagavinayagam
> 
> > 发送时间: 2021年6月12日 5:50
> > 收件人: devel@edk2.groups.io
> > 抄送: isaac.w.o...@intel.com; nathaniel.l.desim...@intel.com;
> > fel...@ami.com; harikrish...@ami.com; mani...@ami.com;
> > zacha...@ami.com; manickavasak...@ami.com;
> > gaolim...@byosoft.com.cn
> > 主题: [edk2][PATCH V1] MdePkg : Add IPMI Macro and Structure
> Defintions
> > to resolve the IPMI build error
> >
> > Build error reported for missing structures
> > IPMI_SET_BOOT_OPTIONS_RESPONSE,
> > EFI_IPMI_MSG_GET_BMC_EXEC_RSP and macros
> > EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> >
> EFI_FIRMWARE_BMC_IN_FULL_RUNTIME/EFI_FIRMWARE_BMC_IN_FORCE
> > D_UPDATE_MODE
> > when using
> > edk2-platforms\Features\Intel\OutOfBandManagement\IpmiFeaturePkg
> >
> > MdePkg : Rename IPMI Macro and Structure Defintions
> >
> > Rename the EFI_IPMI_MSG_GET_BMC_EXEC_RSPB,
> > EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> > EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE to
> > IPMI_MSG_GET_BMC_EXEC_RSPB,IPMI_GET_BMC_EXECUTION_CONTEXT
> > IPMI_BMC_IN_FORCED_UPDATE_MODE
> > ---
> >
> > Notes:
> > V1 :
> > - Rename the EFI_IPMI_MSG_GET_BMC_EXEC_RSPB,
> > EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> > - EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE to
> > IPMI_MSG_GET_BMC_EXEC_RSPB,IPMI_GET_BMC_EXECUTION_CONTEXT
> > - IPMI_BMC_IN_FORCED_UPDATE_MODE
> >
> >  0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch | 61
> > 
> >  MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h  |
> > 4 ++
> >  MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> |
> > 18 ++
> >  3 files changed, 83 insertions(+)
> >
> > diff --git
> > a/0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch
> > b/0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch
> > new file mode 100644
> > index 00..16d149e2d8
> > --- /dev/null
> > +++ b/0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch
> > @@ -0,0 +1,61 @@
> > +From c5e221cfe5d815883f39b71667b6e8f644a27390 Mon Sep 17
> 00:00:00
> > 2001
> > +From: manickavasakam karpagavinayagam
> 
> > +Date: Thu, 10 Jun 2021 14:59:22 -0400
> > +Subject: [edk2][PATCH] MdePkg : Add IPMI Macro and Structure Defintions
> > to resolve
> > + the IPMI build error
> > +
> > +Build error reported for missing structures
> > IPMI_SET_BOOT_OPTIONS_RESPONSE,
> > +EFI_IPMI_MSG_GET_BMC_EXEC_RSP and macros
> > EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> >
> +EFI_FIRMWARE_BMC_IN_FULL_RUNTIME/EFI_FIRMWARE_BMC_IN_FORC
> > ED_UPDATE_MODE
> > +when using
> > edk2-platforms\Features\Intel\OutOfBandManagement\IpmiFeaturePkg
> > +---
> > + MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h  |  4 
> > + MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h | 19
> > +++
> > + 2 files changed, 23 insertions(+)
> > +
> > +diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> > b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> > +index 79db55523d..d7cdd3a865 100644
> > +--- a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> >  b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> > +@@ -186,6 +186,10 @@ typedef struct {
> > +   UINT8  ParameterData[0];
> > + } IPMI_SET_BOOT_OPTIONS_REQUEST;
> > +
> > ++typedef struct {
> > ++  UINT8   CompletionCode:8;
> > ++} IPMI_SET_BOOT_OPTIONS_RESPONSE;
> > ++
> > + //
> > + //  Definitions for Get System Boot options command
> > + //
> > +diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> > b/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> > +index 2d892dbd5a..1c692cc792 100644
> > +--- a/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> >  b/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> > +@@ -17,4 +17,23 @@
> > + // All Firmware commands and their structure definitions to follow
here
> > + //
> > +
> >
>
++/*
---
> > -
> > ++Definitions for Get BMC Execution Context
> >
>
++--
--*
> > /
> > ++#define EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT  0x23
> > ++
> > ++//
> > ++//  Constants and Structure definitions for "Get Device ID" command to
> > follow here
> > ++//
> > ++typedef struct {
> > ++  UINT8   CurrentExecutionContext;
> > ++  

[edk2-devel] 回复: [edk2][PATCH V1] MdePkg : Add IPMI Macro and Structure Defintions to resolve the IPMI build error

2021-06-16 Thread gaoliming



> -邮件原件-
> 发件人: manickavasakam karpagavinayagam 
> 发送时间: 2021年6月12日 5:50
> 收件人: devel@edk2.groups.io
> 抄送: isaac.w.o...@intel.com; nathaniel.l.desim...@intel.com;
> fel...@ami.com; harikrish...@ami.com; mani...@ami.com;
> zacha...@ami.com; manickavasak...@ami.com;
> gaolim...@byosoft.com.cn
> 主题: [edk2][PATCH V1] MdePkg : Add IPMI Macro and Structure Defintions
> to resolve the IPMI build error
> 
> Build error reported for missing structures
> IPMI_SET_BOOT_OPTIONS_RESPONSE,
> EFI_IPMI_MSG_GET_BMC_EXEC_RSP and macros
> EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> EFI_FIRMWARE_BMC_IN_FULL_RUNTIME/EFI_FIRMWARE_BMC_IN_FORCE
> D_UPDATE_MODE
> when using
> edk2-platforms\Features\Intel\OutOfBandManagement\IpmiFeaturePkg
> 
> MdePkg : Rename IPMI Macro and Structure Defintions
> 
> Rename the EFI_IPMI_MSG_GET_BMC_EXEC_RSPB,
> EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE to
> IPMI_MSG_GET_BMC_EXEC_RSPB,IPMI_GET_BMC_EXECUTION_CONTEXT
> IPMI_BMC_IN_FORCED_UPDATE_MODE
> ---
> 
> Notes:
> V1 :
> - Rename the EFI_IPMI_MSG_GET_BMC_EXEC_RSPB,
> EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> - EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE to
> IPMI_MSG_GET_BMC_EXEC_RSPB,IPMI_GET_BMC_EXECUTION_CONTEXT
> - IPMI_BMC_IN_FORCED_UPDATE_MODE
> 
>  0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch | 61
> 
>  MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h  |
> 4 ++
>  MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h |
> 18 ++
>  3 files changed, 83 insertions(+)
> 
> diff --git
> a/0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch
> b/0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch
> new file mode 100644
> index 00..16d149e2d8
> --- /dev/null
> +++ b/0001-MdePkg-Add-IPMI-Macro-and-Structure-Defintions-to-re.patch
> @@ -0,0 +1,61 @@
> +From c5e221cfe5d815883f39b71667b6e8f644a27390 Mon Sep 17 00:00:00
> 2001
> +From: manickavasakam karpagavinayagam 
> +Date: Thu, 10 Jun 2021 14:59:22 -0400
> +Subject: [edk2][PATCH] MdePkg : Add IPMI Macro and Structure Defintions
> to resolve
> + the IPMI build error
> +
> +Build error reported for missing structures
> IPMI_SET_BOOT_OPTIONS_RESPONSE,
> +EFI_IPMI_MSG_GET_BMC_EXEC_RSP and macros
> EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
> +EFI_FIRMWARE_BMC_IN_FULL_RUNTIME/EFI_FIRMWARE_BMC_IN_FORC
> ED_UPDATE_MODE
> +when using
> edk2-platforms\Features\Intel\OutOfBandManagement\IpmiFeaturePkg
> +---
> + MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h  |  4 
> + MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h | 19
> +++
> + 2 files changed, 23 insertions(+)
> +
> +diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> +index 79db55523d..d7cdd3a865 100644
> +--- a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
>  b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> +@@ -186,6 +186,10 @@ typedef struct {
> +   UINT8  ParameterData[0];
> + } IPMI_SET_BOOT_OPTIONS_REQUEST;
> +
> ++typedef struct {
> ++  UINT8   CompletionCode:8;
> ++} IPMI_SET_BOOT_OPTIONS_RESPONSE;
> ++
> + //
> + //  Definitions for Get System Boot options command
> + //
> +diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> b/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> +index 2d892dbd5a..1c692cc792 100644
> +--- a/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
>  b/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
> +@@ -17,4 +17,23 @@
> + // All Firmware commands and their structure definitions to follow here
> + //
> +
>
++/*
---
> -
> ++Definitions for Get BMC Execution Context
>
++--
--*
> /
> ++#define EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT  0x23
> ++
> ++//
> ++//  Constants and Structure definitions for "Get Device ID" command to
> follow here
> ++//
> ++typedef struct {
> ++  UINT8   CurrentExecutionContext;
> ++  UINT8   PartitionPointer;
> ++} EFI_IPMI_MSG_GET_BMC_EXEC_RSP;
> ++
> ++//
> ++// Current Execution Context responses
> ++//
> ++#define EFI_FIRMWARE_BMC_IN_FULL_RUNTIME0x10
> ++#define EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE  0x11
> ++
> + #endif
> +--
> +2.25.0.windows.1
> +
> diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> index 79db55523d..d7cdd3a865 100644
> --- a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
> @@ -186,6 +186,10 @@ typedef struct {
>UINT8  ParameterData[0];
> 
>  } IPMI_SET_BOOT_OPTIONS_REQUEST;
> 
> 
> 
> +typedef struct {
> 
> +  UINT8   CompletionCode:8;
> 
> +} IPMI_SET_BOOT_OPTIONS_RESPONSE;
> 
> +
> 
>  //
> 
>  //  Definitions 

回复: [edk2-devel] [PATCH v3 8/8] MdeModulePkg: Use SecureBootVariableLib in PlatformVarCleanupLib.

2021-06-16 Thread gaoliming
Grzegorz:
  MdeModulePkg is generic base package. It should not depend on SecurityPkg.

  I agree CreateTimeBasedPayload() is the generic API. It can be shared in
the different modules. 
  I propose to add it into MdeModulePkg AuthVariableLib.

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Grzegorz
> Bernacki
> 发送时间: 2021年6月14日 17:43
> 收件人: devel@edk2.groups.io
> 抄送: l...@nuviainc.com; ardb+tianoc...@kernel.org;
> samer.el-haj-mahm...@arm.com; sunny.w...@arm.com;
> m...@semihalf.com; upstr...@semihalf.com; jiewen@intel.com;
> jian.j.w...@intel.com; min.m...@intel.com; ler...@redhat.com;
> sami.muja...@arm.com; af...@apple.com; ray...@intel.com;
> jordan.l.jus...@intel.com; rebe...@bsdio.com; gre...@freebsd.org;
> thomas.abra...@arm.com; chasel.c...@intel.com;
> nathaniel.l.desim...@intel.com; gaolim...@byosoft.com.cn;
> eric.d...@intel.com; michael.d.kin...@intel.com; zailiang@intel.com;
> yi.q...@intel.com; gra...@nuviainc.com; r...@semihalf.com; p...@akeo.ie;
> Grzegorz Bernacki 
> 主题: [edk2-devel] [PATCH v3 8/8] MdeModulePkg: Use
> SecureBootVariableLib in PlatformVarCleanupLib.
> 
> This commits removes CreateTimeBasedPayload() function from
> PlatformVarCleanupLib and uses exactly the same function from
> SecureBootVariableLib.
> 
> Signed-off-by: Grzegorz Bernacki 
> ---
>  MdeModulePkg/Library/PlatformVarCleanupLib/PlatformVarCleanupLib.inf |
> 2 +
>  MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanup.h
> |  1 +
>  MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
> | 84 
>  3 files changed, 3 insertions(+), 84 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatformVarCleanupLib.inf
> b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatformVarCleanupLib.inf
> index 8d5db826a0..493d03e1d8 100644
> ---
> a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatformVarCleanupLib.inf
> +++
> b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatformVarCleanupLib.inf
> @@ -34,6 +34,7 @@
>  [Packages]
>MdePkg/MdePkg.dec
>MdeModulePkg/MdeModulePkg.dec
> +  SecurityPkg/SecurityPkg.dec
> 
>  [LibraryClasses]
>UefiBootServicesTableLib
> @@ -44,6 +45,7 @@
>PrintLib
>MemoryAllocationLib
>HiiLib
> +  SecureBootVariableLib
> 
>  [Guids]
>gEfiIfrTianoGuid  ## SOMETIMES_PRODUCES   ##
> GUID
> diff --git a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanup.h
> b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanup.h
> index c809a7086b..94fbc7d2a4 100644
> --- a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanup.h
> +++ b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanup.h
> @@ -18,6 +18,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  #include 
>  #include 
> diff --git
> a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
> b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
> index 3875d614bb..204f1e00ad 100644
> --- a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
> +++ b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
> @@ -319,90 +319,6 @@ DestroyUserVariableNode (
>}
>  }
> 
> -/**
> -  Create a time based data payload by concatenating the
> EFI_VARIABLE_AUTHENTICATION_2
> -  descriptor with the input data. NO authentication is required in this
> function.
> -
> -  @param[in, out] DataSize  On input, the size of Data buffer in
> bytes.
> -On output, the size of data
> returned in Data
> -buffer in bytes.
> -  @param[in, out] Data  On input, Pointer to data buffer to
> be wrapped or
> -pointer to NULL to wrap an
> empty payload.
> -On output, Pointer to the new
> payload date buffer allocated from pool,
> -it's caller's responsibility to free
> the memory after using it.
> -
> -  @retval EFI_SUCCESS   Create time based payload
> successfully.
> -  @retval EFI_OUT_OF_RESOURCES  There are not enough memory
> resourses to create time based payload.
> -  @retval EFI_INVALID_PARAMETER The parameter is invalid.
> -  @retval OthersUnexpected error happens.
> -
> -**/
> -EFI_STATUS
> -CreateTimeBasedPayload (
> -  IN OUT UINTN  *DataSize,
> -  IN OUT UINT8  **Data
> -  )
> -{
> -  EFI_STATUSStatus;
> -  UINT8 *NewData;
> -  UINT8 *Payload;
> -  UINTN PayloadSize;
> -  EFI_VARIABLE_AUTHENTICATION_2 *DescriptorData;
> -  UINTN DescriptorSize;
> -  EFI_TIME  Time;
> -
> -  if (Data == NULL || DataSize == NULL) {
> -return EFI_INVALID_PARAMETER;
> -  }
> -
> -  //
> -  // At user physical presence, the variable does not need to be signed
but
> the
> 

回复: [edk2-devel] [PATCH] MdePkg/Include: Smbios Specification 3.4.0 changes

2021-06-16 Thread gaoliming
Gopi:

 Could you let me know why changes below field name?

 

MemoryArrayLocationCXLFlexbus10AddonCard ==> MemoryArrayLocationCXLAddonCard

MemoryTechnologyIntelPersistentMemory ==> 
MemoryTechnologyIntelOptanePersistentMemory

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 Thotala, Gopi
发送时间: 2021年6月14日 23:40
收件人: Rebecca Cran ; devel@edk2.groups.io
主题: Re: [edk2-devel] [PATCH] MdePkg/Include: Smbios Specification 3.4.0 changes

 

Attached V2 patch after typo correction.

 

Thanks

Gopi

 

From: Rebecca Cran mailto:rebe...@bsdio.com> > 
Sent: Sunday, June 13, 2021 9:34 AM
To: devel@edk2.groups.io  ; Thotala, Gopi 
mailto:gopi.thot...@intel.com> >
Subject: Re: [edk2-devel] [PATCH] MdePkg/Include: Smbios Specification 3.4.0 
changes

 

There’s a typo of ‘persistent’ in: 

 

// Optane DC Presistent Memory in SMBIOS spec 3.4.0

 

Rebecca Cran

 

 

On Jun 2, 2021, at 10:46 AM, Thotala, Gopi mailto:gopi.thot...@intel.com> > wrote:

 

Initial patch submitted for review.



 

 





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




回复: [edk2-devel] [PATCH v2 4/4] Azurepipeline: SpellCheck: Enforce Node dependency to use version 14.x

2021-06-16 Thread gaoliming
Acked-by: Liming Gao 

> -邮件原件-
> 发件人: Kun Qin 
> 发送时间: 2021年6月17日 5:08
> 收件人: devel@edk2.groups.io
> 抄送: Sean Brogan ; Bret Barkelew
> ; Michael D Kinney
> ; Liming Gao ;
> Ard Biesheuvel 
> 主题: Re: [edk2-devel] [PATCH v2 4/4] Azurepipeline: SpellCheck: Enforce
> Node dependency to use version 14.x
> 
> Hi pipeline maintainers,
> 
> Could you please help reviewing this specific patch?
> 
> Thanks to Ard, the other patches in this series are already reviewed and
> merged.
> 
> Regards,
> Kun
> 
> On 06/14/2021 11:34, Kun Qin via groups.io wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3445
> >
> > Per update from Cspell tool, the minimal requirement of Cspell 5.x
> > regarding Node is 12 and above. This has caused multple Cspell failures
> > during CI build validation:
> > "Failed to process "**.c" TypeError: text.matchAll(...) is not a function
> > or its return value is not iterable"
> >
> > This change updates the lowest required node version to 14.x to support
> > Cspell functionalities.
> >
> > Cc: Sean Brogan 
> > Cc: Bret Barkelew 
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> >
> > Signed-off-by: Kun Qin 
> > Reviewed-by: Ard Biesheuvel 
> > ---
> >
> > Notes:
> >  v2:
> >  - Added reviewed-by tag [Ard]
> >
> >   .azurepipelines/templates/spell-check-prereq-steps.yml | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/.azurepipelines/templates/spell-check-prereq-steps.yml
> b/.azurepipelines/templates/spell-check-prereq-steps.yml
> > index e1570d4f2aac..98ee3cfa6bc6 100644
> > --- a/.azurepipelines/templates/spell-check-prereq-steps.yml
> > +++ b/.azurepipelines/templates/spell-check-prereq-steps.yml
> > @@ -13,7 +13,7 @@ parameters:
> >   steps:
> >   - task: NodeTool@0
> > inputs:
> > -versionSpec: '10.x'
> > +versionSpec: '14.x'
> >   #checkLatest: false # Optional
> > condition: and(gt(variables.pkg_count, 0), succeeded())
> >
> >




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




[edk2-devel] 回复: [PATCH v2 1/1] Pytool: SpellCheck: Defer path expansion in cspell parameters

2021-06-16 Thread gaoliming
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Kun Qin 
> 发送时间: 2021年6月16日 0:54
> 收件人: devel@edk2.groups.io
> 抄送: Sean Brogan ; Bret Barkelew
> ; Michael D Kinney
> ; Liming Gao ;
> Bret Barkelew 
> 主题: [PATCH v2 1/1] Pytool: SpellCheck: Defer path expansion in cspell
> parameters
> 
> From: Sean Brogan 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3454
> 
> On Linux the shell expands the wildcard paths and causes multiple files
> to be missed. This change adds additional quotes to defer expansion in
> order to bring parity in cspell result.
> 
> Cc: Sean Brogan 
> Cc: Bret Barkelew 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> 
> Signed-off-by: Sean Brogan 
> Signed-off-by: Kun Qin 
> Reviewed-by: Sean Brogan 
> Reviewed-by: Bret Barkelew 
> ---
> 
> Notes:
> v2:
> - Added reviewed-by tags [Bret]
> - Added reviewed-by tag [Sean]
> - Added signed-off-by tag from Kun [Sean]
> 
>  .pytool/Plugin/SpellCheck/SpellCheck.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/.pytool/Plugin/SpellCheck/SpellCheck.py
> b/.pytool/Plugin/SpellCheck/SpellCheck.py
> index 9ad57632a6e8..05c471d91ba1 100644
> --- a/.pytool/Plugin/SpellCheck/SpellCheck.py
> +++ b/.pytool/Plugin/SpellCheck/SpellCheck.py
> @@ -134,7 +134,8 @@ class SpellCheck(ICiBuildPlugin):
>  #
>  relpath = os.path.relpath(abs_pkg_path)
>  cpsell_paths = " ".join(
> -[f"{relpath}/**/{x}" for x in
> package_relative_paths_to_spell_check])
> +# Double quote each path to defer expansion to cspell
> parameters
> +[f'"{relpath}/**/{x}"' for x in
> package_relative_paths_to_spell_check])
> 
>  # Make the config file
>  config_file_path = os.path.join(
> --
> 2.31.1.windows.1





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




[edk2-devel] 回复: [RESEND PATCH v2] BaseTools: Add support for RISCV GOT/PLT relocations

2021-06-16 Thread gaoliming
Sunil:
  I add my comments below. 

Thanks
Liming
> -邮件原件-
> 发件人: Sunil V L 
> 发送时间: 2021年6月11日 22:05
> 收件人: devel@edk2.groups.io
> 抄送: Sunil V L ; Abner Chang
> ; Daniel Schaefer ; Bob
> Feng ; Liming Gao ;
> Yuwei Chen ; Heinrich Schuchardt
> 
> 主题: [RESEND PATCH v2] BaseTools: Add support for RISCV GOT/PLT
> relocations
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096
> 
> This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20
> relocations generated by PIE enabled compiler. This also needed
> changes to R_RISCV_32 and R_RISCV_64 relocations as explained in
> https://github.com/riscv/riscv-gnu-toolchain/issues/905#issuecomment-8466
> 82710
> 
> Changes in v2:
>   - Addressed Daniel's comment on formatting
> 
> Testing:
> 1) Debian GCC 8.3.0 and booted sifive_u and QMEU virt models.
> 2) Debian 10.2.0 and booted QEMU virt model.
> 3) riscv-gnu-tool chain 9.2 and booted QEMU virt model.
> 
> Signed-off-by: Sunil V L 
> 
> Acked-by: Abner Chang 
> Reviewed-by: Daniel Schaefer 
> Tested-by: 

Tested-By format is invalid. Its format is same Reviewed-by. 

> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Cc: Heinrich Schuchardt 
> ---
>  BaseTools/Source/C/GenFw/Elf64Convert.c | 44
> +
>  1 file changed, 38 insertions(+), 6 deletions(-)
> 
> diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c
> b/BaseTools/Source/C/GenFw/Elf64Convert.c
> index d097db8632..d684318269 100644
> --- a/BaseTools/Source/C/GenFw/Elf64Convert.c
> +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
> @@ -129,6 +129,8 @@ STATIC UINT32 mDebugOffset;
>  STATIC UINT8   *mRiscVPass1Targ = NULL;
> 
>  STATIC Elf_Shdr*mRiscVPass1Sym = NULL;
> 
>  STATIC Elf64_Half  mRiscVPass1SymSecIndex = 0;
> 
> +STATIC INT32   mRiscVPass1Offset;
> 
> +STATIC INT32   mRiscVPass1GotFixup;
> 
> 
> 
>  //
> 
>  // Initialization Function
> 
> @@ -479,11 +481,11 @@ WriteSectionRiscV64 (
>  break;
> 
> 
> 
>case R_RISCV_32:
> 
> -*(UINT32 *)Targ = (UINT32)((UINT64)(*(UINT32 *)Targ) -
> SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]);
> 
> +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend;
> 
>  break;
> 
> 
> 
>case R_RISCV_64:
> 
> -*(UINT64 *)Targ = *(UINT64 *)Targ - SymShdr->sh_addr +
> mCoffSectionsOffset[Sym->st_shndx];
> 
> +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend;
> 
>  break;
> 
> 
> 
>case R_RISCV_HI20:
> 
> @@ -533,6 +535,18 @@ WriteSectionRiscV64 (
>  mRiscVPass1SymSecIndex = 0;
> 
>  break;
> 
> 
> 
> +  case R_RISCV_GOT_HI20:
> 
> +Value = (Sym->st_value - Rel->r_offset);
> 
> +mRiscVPass1Offset = RV_X(Value, 0, 12);
> 
> +Value = RV_X(Value, 12, 20);
> 
> +*(UINT32 *)Targ = (Value << 12) | (RV_X(*(UINT32*)Targ, 0, 12));
> 
> +
> 
> +mRiscVPass1Targ = Targ;
> 
> +mRiscVPass1Sym = SymShdr;
> 
> +mRiscVPass1SymSecIndex = Sym->st_shndx;
> 
> +mRiscVPass1GotFixup = 1;
> 
> +break;
> 
> +
> 
>case R_RISCV_PCREL_HI20:
> 
>  mRiscVPass1Targ = Targ;
> 
>  mRiscVPass1Sym = SymShdr;
> 
> @@ -545,11 +559,17 @@ WriteSectionRiscV64 (
>  if (mRiscVPass1Targ != NULL && mRiscVPass1Sym != NULL &&
> mRiscVPass1SymSecIndex != 0) {
> 
>int i;
> 
>Value2 = (UINT32)(RV_X(*(UINT32 *)mRiscVPass1Targ, 12, 20));
> 
> -  Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12));
> 
> -  if(Value & (RISCV_IMM_REACH/2)) {
> 
> -Value |= ~(RISCV_IMM_REACH-1);
> 
> +
> 
> +  if(mRiscVPass1GotFixup) {
> 
> +Value = (UINT32)(mRiscVPass1Offset);
> 
> +  } else {
> 
> +Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12));
> 
> +if(Value & (RISCV_IMM_REACH/2)) {
> 
> +  Value |= ~(RISCV_IMM_REACH-1);
> 
> +}
> 
>}
> 
>Value = Value - (UINT32)mRiscVPass1Sym->sh_addr +
> mCoffSectionsOffset[mRiscVPass1SymSecIndex];
> 
> +
> 
>if(-2048 > (INT32)Value) {
> 
>  i = (((INT32)Value * -1) / 4096);
> 
>  Value2 -= i;
> 
> @@ -569,12 +589,21 @@ WriteSectionRiscV64 (
>  }
> 
>}
> 
> 
> 
> -  *(UINT32 *)Targ = (RV_X(Value, 0, 12) << 20) |
(RV_X(*(UINT32*)Targ,
> 0, 20));
> 
> +  if(mRiscVPass1GotFixup) {
> 
> +*(UINT32 *)Targ = (RV_X((UINT32)Value, 0, 12) << 20)
> 
> +| (RV_X(*(UINT32*)Targ, 0, 20));
> 
> +/* Convert LD instruction to ADDI */
> 
> +*(UINT32 *)Targ = ((*(UINT32 *)Targ & ~0x707f) | 0x13);
> 
Can you add the comments for the hard value 0x707f and 0x13? 

Thanks
Liming

> +  } else {
> 
> +*(UINT32 *)Targ = (RV_X(Value, 0, 12) << 20) |
> (RV_X(*(UINT32*)Targ, 0, 20));
> 
> +  }
> 
>*(UINT32 *)mRiscVPass1Targ = (RV_X(Value2, 0, 20)<<12) |
> (RV_X(*(UINT32 *)mRiscVPass1Targ, 0, 12));
> 
>  }
> 
>  mRiscVPass1Sym = NULL;
> 
>  mRiscVPass1Targ = NULL;
> 
>  mRiscVPass1SymSecIndex = 0;
> 
> +mRiscVPass1Offset = 0;
> 
> +mRiscVPass1GotFixup = 0;
> 
>  break;
> 
> 
> 
>

回复: [edk2-devel] [PATCH] BaseTools: Reset ERRORLEVEL in toolsetup.bat after edk2basetools check

2021-06-16 Thread gaoliming
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Rebecca Cran
> 发送时间: 2021年6月13日 11:43
> 收件人: Bob Feng ; Liming Gao
> ; Yuwei Chen 
> 抄送: Rebecca Cran ; devel@edk2.groups.io
> 主题: [edk2-devel] [PATCH] BaseTools: Reset ERRORLEVEL in toolsetup.bat
> after edk2basetools check
> 
> When using the in-source BaseTools, edksetup.bat will exit with an
> ERRORLEVEL of 1 because the line in toolsetup.bat
> "%PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL"
> fails.
> 
> Ensure ERRORLEVEL is set to 0 when edksetup.bat or toolsetup.bat is
> successfully run.
> 
> Signed-off-by: Rebecca Cran 
> ---
>  BaseTools/toolsetup.bat | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
> index a766a69f08..ca8bfdd677 100755
> --- a/BaseTools/toolsetup.bat
> +++ b/BaseTools/toolsetup.bat
> @@ -401,6 +401,8 @@ goto end
>if %ERRORLEVEL% EQU 0 (
> 
>  goto use_pip_basetools
> 
>) else (
> 
> +REM reset ERRORLEVEL
> 
> +type nul>nul
> 
>  goto use_builtin_basetools
> 
>)
> 
> 
> 
> --
> 2.32.0
> 
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#76442): https://edk2.groups.io/g/devel/message/76442
> Mute This Topic: https://groups.io/mt/83503069/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





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




回复: [edk2-devel] [PATCH] BaseTools: Fix spelling of "overwrite" and "overwriting" in toolset.bat

2021-06-16 Thread gaoliming
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Rebecca Cran
> 发送时间: 2021年6月13日 11:56
> 收件人: Bob Feng ; Liming Gao
> ; Yuwei Chen 
> 抄送: Rebecca Cran ; devel@edk2.groups.io
> 主题: [edk2-devel] [PATCH] BaseTools: Fix spelling of "overwrite" and
> "overwriting" in toolset.bat
> 
> The words "overwrite" and "overwriting" are one word and shouldn't have
> hyphens.
> 
> Signed-off-by: Rebecca Cran 
> ---
>  BaseTools/toolsetup.bat | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
> index 4b5256ab6e..1fb44aaeff 100755
> --- a/BaseTools/toolsetup.bat
> +++ b/BaseTools/toolsetup.bat
> @@ -227,7 +227,7 @@ if NOT exist %CONF_PATH% (
>  ) else (
> 
>if defined RECONFIG (
> 
>  echo.
> 
> -echo  Over-writing the files in the CONF_PATH directory
> 
> +echo  Overwriting the files in the CONF_PATH directory
> 
>  echo  using the default template files
> 
>  echo.
> 
>)
> 
> @@ -240,7 +240,7 @@ if NOT exist %CONF_PATH%\target.txt (
>)
> 
> 
> copy %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt >
> nul
> 
>  ) else (
> 
> -  if defined RECONFIG echo over-write ... target.template
> to %CONF_PATH%\target.txt
> 
> +  if defined RECONFIG echo overwrite ... target.template
> to %CONF_PATH%\target.txt
> 
>if defined RECONFIG copy
> /Y %EDK_TOOLS_PATH%\Conf\target.template %CONF_PATH%\target.txt >
> nul
> 
>  )
> 
> 
> 
> @@ -251,7 +251,7 @@ if NOT exist %CONF_PATH%\tools_def.txt (
>)
> 
> 
> copy %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_d
> ef.txt > nul
> 
>  ) else (
> 
> -  if defined RECONFIG echo over-write ... tools_def.template
> to %CONF_PATH%\tools_def.txt
> 
> +  if defined RECONFIG echo overwrite ... tools_def.template
> to %CONF_PATH%\tools_def.txt
> 
>if defined RECONFIG copy
> /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %CONF_PATH%\tools_def.t
> xt > nul
> 
>  )
> 
> 
> 
> --
> 2.32.0
> 
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#76443): https://edk2.groups.io/g/devel/message/76443
> Mute This Topic: https://groups.io/mt/83503170/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





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




回复: [edk2-devel] [PATCH] BaseTools: Remove check for Split.exe in toolset.bat

2021-06-16 Thread gaoliming
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Rebecca Cran
> 发送时间: 2021年6月13日 11:35
> 收件人: Bob Feng ; Liming Gao
> ; Yuwei Chen 
> 抄送: Rebecca Cran ; devel@edk2.groups.io
> 主题: [edk2-devel] [PATCH] BaseTools: Remove check for Split.exe in
> toolset.bat
> 
> Split is now a Python tool, so BaseTools\Bin\Win32\Split.exe no longer
> exists. Remove the check for it from toolsetup.bat to prevent the
> erroneous claim that the binary C tools are missing.
> 
> Signed-off-by: Rebecca Cran 
> ---
>  BaseTools/toolsetup.bat | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
> index 4b5256ab6e..a766a69f08 100755
> --- a/BaseTools/toolsetup.bat
> +++ b/BaseTools/toolsetup.bat
> @@ -299,7 +299,6 @@ IF NOT EXIST "%EDK_TOOLS_BIN%\GenFfs.exe" goto
> check_c_tools
>  IF NOT EXIST "%EDK_TOOLS_BIN%\GenFv.exe" goto check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\GenFw.exe" goto check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\GenSec.exe" goto check_c_tools
> 
> -IF NOT EXIST "%EDK_TOOLS_BIN%\Split.exe" goto check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\TianoCompress.exe" goto check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\VfrCompile.exe" goto check_c_tools
> 
>  IF NOT EXIST "%EDK_TOOLS_BIN%\VolInfo.exe" goto check_c_tools
> 
> --
> 2.32.0
> 
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#76441): https://edk2.groups.io/g/devel/message/76441
> Mute This Topic: https://groups.io/mt/83503018/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





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




回复: [edk2-devel] [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Increase the width of the data read during oprom shadow

2021-06-16 Thread gaoliming
Create PR https://github.com/tianocore/edk2/pull/1728 for it. 

This patch has been reviewed by Ray Ni. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Sumana
> Venur
> 发送时间: 2021年6月12日 1:02
> 收件人: Ni, Ray ; Wu, Hao A 
> 抄送: devel@edk2.groups.io
> 主题: Re: [edk2-devel] [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Increase
> the width of the data read during oprom shadow
> 
> Hello Maintainers
> 
> This patch is for MdeModulePkg/Bus. Please review and help with merging to
> master
> It was sent a few months ago, might have been reviewed already. But due to
> CI failures and low importance it was lost.
> 
> Gerrit link - https://git-amr-7.devtools.intel.com/gerrit/#/c/117842/
> 
> Thanks
> Sumana
> 
> -Original Message-
> From: Venur, Sumana 
> Sent: Friday, June 11, 2021 9:38 AM
> To: devel@edk2.groups.io
> Cc: Venur, Sumana 
> Subject: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Increase the width of
> the data read during oprom shadow
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2989
> 
> Long times spent on shadowing oprom from graphics card to system memory.
> We are currently using 8 bit read cycles.
> This needs to be wider, at least 32bit reads to reduce the time for oprom
> shadow
> 
> Signed-off-by: Sumana Venur 
> ---
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c
> b/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c
> index c994ed5fe3..a981f93f43 100644
> --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c
> +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c
> @@ -521,9 +521,9 @@ LoadOpRomImage (
>  //
>  PciDevice->PciRootBridgeIo->Mem.Read (
>PciDevice->PciRootBridgeIo,
> -  EfiPciWidthUint8,
> +  EfiPciWidthUint32,
>RomBar,
> -  (UINT32) RomImageSize,
> +  (UINT32)
> RomImageSize/sizeof(UINT32),
>Image
>);
>  RomInMemory = Image;
> --
> 2.16.2.windows.1
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76631): https://edk2.groups.io/g/devel/message/76631
Mute This Topic: https://groups.io/mt/83595650/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/6] Secure Boot default keys

2021-06-16 Thread Min Xu
On 06/14/2021 5:48 PM, Grzegorz Bernacki Wrote:
> Hi Min M,
> 
> Please find log from tests of OvmfX64 built with VS2019 at:
> https://drive.google.com/file/d/18w7s6GxIz3aeId22xABMib7I3JX7G9X1/view?u
> sp=sharing
> 
Usually we summarize the test in a table which is posted in the mail thread, so 
that
the test result is clear and easy to read. Also in this way the test result can 
be recorded in
the review thread. I am afraid the test log in the google drive cannot be 
accessed
one day.

> thanks,
> greg
> 
> pon., 7 cze 2021 o 09:29 Grzegorz Bernacki  napisał(a):
> >
> > Hi Min M,
> >
> > I tested it with Ovmf. I will try other compiler and provide you logs soon.
> >
> > thanks,
> > greg
> >
> > pt., 4 cze 2021 o 10:17 Xu, Min M  napisał(a):
> > >
> > > Grzegorz
> > > Have you built this feature with different tool chains, such as
> VS2017/VS2019/GCC5? And test it in IA32/X64/AARCH64?
> > > Would you post your test result in the mail?
> > > Thanks much!
> > >
> > > > -Original Message-
> > > > From: Grzegorz Bernacki 
> > > > Sent: Tuesday, June 1, 2021 9:12 PM
> > > > To: devel@edk2.groups.io
> > > > Cc: l...@nuviainc.com; ardb+tianoc...@kernel.org; Samer.El-Haj-
> > > > mahm...@arm.com; sunny.w...@arm.com; m...@semihalf.com;
> > > > upstr...@semihalf.com; Yao, Jiewen ; Wang,
> > > > Jian J ; Xu, Min M ;
> > > > ler...@redhat.com; Grzegorz Bernacki 
> > > > Subject: [PATCH v2 0/6] Secure Boot default keys
> > > >
> > > > This patchset adds support for initialization of default Secure
> > > > Boot variables based on keys content embedded in flash binary.
> > > > This feature is active only if Secure Boot is enabled and
> > > > DEFAULT_KEY is defined. The patchset consist also application to
> > > > enroll keys from default variables and secure boot menu change to allow
> user to reset key content to default values.
> > > > Discussion on design can be found at:
> > > > https://edk2.groups.io/g/rfc/topic/82139806#600
> > > >
> > > > I also added patch for RPi4 which enables this feature for that 
> > > > platform.
> > > >
> > > > Changes since v1:
> > > > - change names:
> > > >   SecBootVariableLib => SecureBootVariableLib
> > > >   SecBootDefaultKeysDxe => SecureBootDefaultKeysDxe
> > > >   SecEnrollDefaultKeysApp => EnrollFromDefaultKeysApp
> > > > - change name of function CheckSetupMode to GetSetupMode
> > > > - remove ShellPkg dependecy from EnrollFromDefaultKeysApp
> > > > - rebase to master
> > > >
> > > > Grzegorz Bernacki (6):
> > > > [edk2]
> > > >   SecurityPkg: Create library for setting Secure Boot variables.
> > > >   SecurityPkg: Create include file for default key content.
> > > >   SecurityPkg: Add SecureBootDefaultKeysDxe driver
> > > >   SecurityPkg: Add EnrollFromDefaultKeys application.
> > > >   SecurityPkg: Add new modules to Security package.
> > > >   SecurityPkg: Add option to reset secure boot keys.
> > > > [edk2-platform]
> > > >   Platform/RaspberryPi: Enable default Secure Boot variables
> > > > initialization
> > > >
> > > >  SecurityPkg/SecurityPkg.dec
> > > >  |  14 +
> > > >  SecurityPkg/SecurityPkg.dsc
> > > >  |   5 +
> > > >  SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.inf
> > > > |  47 +
> > > >
> > > > SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.in
> > > > f
> > > > |  79 ++
> > > >
> > > >
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig
> > > > Dxe.inf   |   2 +
> > > >
> > > > SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureB
> > > > ootD
> > > > efaultKeysDxe.inf |  46 +
> > > >  SecurityPkg/Include/Library/SecureBootVariableLib.h
> > > >  |
> > > > 252 +
> > > >
> > > >
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig
> > > > NvData.h  |   2 +
> > > >
> > > >
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.
> > > > vfr  |   6 +
> > > >  SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.c
> > > > | 107 +++
> > > >  SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c
> > > > | 979 
> > > >
> > > >
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigI
> > > > mpl.c| 343 ---
> > > >
> > > >
> SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootD
> > > > efaultKeysDxe.c   |  69 ++
> > > >
> > > > SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.un
> > > > i
> > > > |  16 +
> > > >  SecurityPkg/SecureBootDefaultKeys.fdf.inc  
> > > >  |  62
> ++
> > > >
> > > >
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigS
> > > > trings.uni   |   4 +
> > > >
> > > > SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureB
> > > > ootD
> > > > efaultKeysDxe.uni |  17 +
> 

[edk2-devel] 回复: [PATCH v2 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy

2021-06-16 Thread gaoliming
Ken:
  Thanks for your update. Please also update
MdeModulePkg\Universal\BdsDxe\Bds.h to remove #include
, because EDKII_VARIABLE_LOCK_PROTOCOL is not used
any more. 

Thanks
Liming
> -邮件原件-
> 发件人: kenlautn...@gmail.com 
> 发送时间: 2021年6月17日 6:45
> 收件人: devel@edk2.groups.io
> 抄送: Jian J Wang ; Hao A Wu
> ; Zhichao Gao ; Ray Ni
> ; Liming Gao 
> 主题: [PATCH v2 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use
> Variable Policy
> 
> From: Ken Lautner 
> 
> Changed BdsEntry.c to use Variable Policy instead of Variable Lock
> as Variable Lock will be Deprecated eventually
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Zhichao Gao 
> Cc: Ray Ni 
> Cc: Liming Gao 
> Signed-off-by: Kenneth Lautner 
> 
> Reviewed-by Liming Gao 
> ---
>  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  4 +++-
>  MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20 +++-
>  2 files changed, 18 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> index 9310b4dccb18..76ff6a0f5fc3 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> @@ -50,6 +50,8 @@
>BaseMemoryLib
> 
>DebugLib
> 
>UefiBootManagerLib
> 
> +  VariablePolicyLib
> 
> +  VariablePolicyHelperLib
> 
>PlatformBootManagerLib
> 
>PcdLib
> 
>PrintLib
> 
> @@ -77,7 +79,7 @@
>  [Protocols]
> 
>gEfiBdsArchProtocolGuid   ## PRODUCES
> 
>gEfiSimpleTextInputExProtocolGuid ## CONSUMES
> 
> -  gEdkiiVariableLockProtocolGuid##
> SOMETIMES_CONSUMES
> 
> +  gEdkiiVariablePolicyProtocolGuid  ##
> SOMETIMES_CONSUMES
> 
>gEfiDeferredImageLoadProtocolGuid ## CONSUMES
> 
> 
> 
>  [FeaturePcd]
> 
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> index 83b773a2fa5f..13c10bdc5bf8 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> @@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include "Bds.h"
> 
>  #include "Language.h"
> 
>  #include "HwErrRecSupport.h"
> 
> +#include 
> 
> 
> 
>  #define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) {  \
> 
>(a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) <<
> LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT)) &
> EFI_BOOT_OPTION_SUPPORT_COUNT); \
> 
> @@ -670,7 +671,7 @@ BdsEntry (
>EFI_STATUS  Status;
> 
>UINT32  BootOptionSupport;
> 
>UINT16  BootTimeOut;
> 
> -  EDKII_VARIABLE_LOCK_PROTOCOL*VariableLock;
> 
> +  EDKII_VARIABLE_POLICY_PROTOCOL  *VariablePolicy;
> 
>UINTN   Index;
> 
>EFI_BOOT_MANAGER_LOAD_OPTIONLoadOption;
> 
>UINT16  *BootNext;
> 
> @@ -716,12 +717,21 @@ BdsEntry (
>//
> 
>// Mark the read-only variables if the Variable Lock protocol exists
> 
>//
> 
> -  Status = gBS->LocateProtocol (, NULL,
> (VOID **) );
> 
> -  DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n",
> Status));
> 
> +  Status = gBS->LocateProtocol(, NULL,
> (VOID**));
> 
> +  DEBUG((DEBUG_INFO, "[BdsDxe] Locate Variable Policy protocol - %r\n",
> Status));
> 
>if (!EFI_ERROR (Status)) {
> 
>  for (Index = 0; Index < ARRAY_SIZE (mReadOnlyVariables); Index++) {
> 
> -  Status = VariableLock->RequestToLock (VariableLock,
> mReadOnlyVariables[Index], );
> 
> -  ASSERT_EFI_ERROR (Status);
> 
> +  Status = RegisterBasicVariablePolicy(
> 
> + VariablePolicy,
> 
> + ,
> 
> + mReadOnlyVariables[Index],
> 
> + VARIABLE_POLICY_NO_MIN_SIZE,
> 
> + VARIABLE_POLICY_NO_MAX_SIZE,
> 
> + VARIABLE_POLICY_NO_MUST_ATTR,
> 
> + VARIABLE_POLICY_NO_CANT_ATTR,
> 
> + VARIABLE_POLICY_TYPE_LOCK_NOW
> 
> + );
> 
> +  ASSERT_EFI_ERROR(Status);
> 
>  }
> 
>}
> 
> 
> 
> --
> 2.31.1.windows.1





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




[edk2-devel] [edk2-platforms] [PATCH V1] PurleyOpenBoardPkg : Support for LINUX Boot

2021-06-16 Thread Nate DeSimone
From: Manickavasakam Karpagavinayagam 

Support for LINUX Boot
To enable/disable feature, PcdLinuxBootEnable can be used
1.  Follow directions on http://osresearch.net/Building/ to compile the 
heads kernel and initrd for qemu-system_x86_64
2.  Copy the following built files
(1) initrd.cpio.xz  to LinuxBootPkg/LinuxBinaries/initrd.cpio.xz
(2) bzimage to LinuxBootPkg/LinuxBinaries/linux.efi

Cc: Isaac Oram 
Cc: Felix Polyudov 
Cc: Harikrishna Doppalapudi 
Cc: Manish Jha 
Cc: Zachary Bobroff 
Cc: Manickavasakam Karpagavinayagam 
---
 .../BoardTiogaPass/CoreDxeInclude.dsc |   5 +-
 .../BoardTiogaPass/CoreUefiBootInclude.fdf|   5 +-
 .../BoardTiogaPass/OpenBoardPkg.dsc   |   7 +
 .../BoardTiogaPass/OpenBoardPkg.fdf   |  57 ++-
 .../BoardTiogaPass/PlatformPkgConfig.dsc  |   7 +
 .../LinuxBinaries/LinuxKernel.inf |   9 +
 .../LinuxBootPkg/LinuxBinaries/initrd.cpio.xz | Bin 0 -> 16 bytes
 .../LinuxBootPkg/LinuxBinaries/linux.efi  | Bin 0 -> 16 bytes
 .../LinuxBootPkg/LinuxBoot.c  | 422 ++
 .../LinuxBootPkg/LinuxBoot.h  | 193 
 .../LinuxBootPkg/LinuxBoot.inf|  46 ++
 .../LinuxBootPkg/LinuxBootNull.c  |  43 ++
 .../LinuxBootPkg/LinuxBootNull.inf|  31 ++
 .../Intel/PurleyOpenBoardPkg/OpenBoardPkg.dec |   2 +
 .../DxePlatformBootManagerLib/BdsPlatform.c   |   9 +
 .../DxePlatformBootManagerLib.inf |   2 +
 Platform/Intel/Readme.md  |  42 ++
 17 files changed, 872 insertions(+), 8 deletions(-)
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBinaries/LinuxKernel.inf
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBinaries/initrd.cpio.xz
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBinaries/linux.efi
 create mode 100644 Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBoot.c
 create mode 100644 Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBoot.h
 create mode 100644 Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBoot.inf
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBootNull.c
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBootNull.inf

diff --git 
a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc 
b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc
index b0660d72dd..a17015704b 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc
@@ -83,6 +83,7 @@
   
$(PLATFORM_BOARD_PACKAGE)/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
 #TiogaPass Override END
 
+!if gPlatformTokenSpaceGuid.PcdLinuxBootEnable == FALSE
   MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
@@ -97,10 +98,11 @@
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
   MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
   FatPkg/EnhancedFatDxe/Fat.inf
-
+!endif
   #MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
   MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
 
+!if gPlatformTokenSpaceGuid.PcdLinuxBootEnable == FALSE
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
   MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
 
@@ -124,6 +126,7 @@
 
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
   }
+!endif
 
 !if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
   MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
diff --git 
a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf 
b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf
index 141ce5dda3..6cd8ba6626 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf
@@ -47,6 +47,7 @@ INF  PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
  INF  
$(PLATFORM_BOARD_PACKAGE)/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
 #TiogaPass Override END
 
+!if gPlatformTokenSpaceGuid.PcdLinuxBootEnable == FALSE
 INF  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
@@ -62,10 +63,12 @@ INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
 INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
 INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
 INF  FatPkg/EnhancedFatDxe/Fat.inf
+!endif
 
 #INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
 INF  MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
 
+!if gPlatformTokenSpaceGuid.PcdLinuxBootEnable == FALSE
 INF  

[edk2-devel] [edk2-non-osi] [PATCH] ASpeed : ASpeedGopBinPkg : Add X64 ASpeedAst2500Gop UEFI Driver

2021-06-16 Thread Nate DeSimone
From: manickavasakam karpagavinayagam 

Add X64 ASpeedAst2500Gop UEFI Driver

Cc: Isaac Oram 
Cc: Felix Polyudov 
Cc: Harikrishna Doppalapudi 
Cc: Manish Jha 
Cc: Zachary Bobroff 
Cc: Manickavasakam Karpagavinayagam 
---
 .../ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf |   4 
 .../ASpeedGopBinPkg/X64/ASpeedAst2500Gop.efi| Bin 0 -> 36928 bytes
 2 files changed, 4 insertions(+)
 create mode 100644 Drivers/ASpeed/ASpeedGopBinPkg/X64/ASpeedAst2500Gop.efi

diff --git a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf 
b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
index b3cee45..b563f76 100644
--- a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
+++ b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
@@ -3,6 +3,7 @@
 #
 #  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
 #  Copyright (c) 2020, ASPEED Technology Inc. All rights reserved.
+#  Copyright (c) 2021, American Megatrends International LLC.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -17,3 +18,6 @@
 
 [Binaries.AArch64]
   PE32|AArch64/ASpeedAst2500Gop.efi|*
+
+[Binaries.X64]
+  PE32|X64/ASpeedAst2500Gop.efi|*
diff --git a/Drivers/ASpeed/ASpeedGopBinPkg/X64/ASpeedAst2500Gop.efi 
b/Drivers/ASpeed/ASpeedGopBinPkg/X64/ASpeedAst2500Gop.efi
new file mode 100644
index 
..07d9de0fe5241bf26d516f3522a930880a57f5c5
GIT binary patch
literal 36928
zcmeIbeS8$v^*=tF-H;^-nMH#Q5@nT*Mjj*()Ih-Ogk6}GU5SKfT0u8LLQ;8%$u198
zba4~S?zon=+G;!mjny
zuJ)j;A2O4iBzvm7MApo4_17-0@zfx_;c`6RoxD@N_Oo(ax0deIb6h8Q)$SUc?pBT~
zzjn1ku#of{0!+Q1hu2iQbj2b?cG7_l2y{>VSwT+>EU*}F6aB}`Vqn-W9^yDrIxI?O
z#nxTkOG394i=konuH`sqD7_Ll`KLDnA#m9e!fSoUdkNsr0v@WI3dCCoV>Mw>h!
z-NCRr8P?ATtD+28;|Ob>f>jNy;uNfJ-A`B(fmMK%Jf30gle59JC@ruQiT)ktJGbv~
zO7A)Xw;LUSO4F_2-0JWzI>Cvd^v!4kM_{Jx3=Oj*3CQ1<5M+)C&|dI5SAjl3x4^I(
z1-(ZMjTk}@Dg7s{ETe*<4RhcYUoYw?tLJ6#;1gRr*UWQDohb3lYL1ik$~qTQ
zk0#8}uySJk9)e5Tf%rWIvB${}A1B0H(Plt=5ouWjB5J-2HG@Io*IvAld)7O)@7c3Qly-=L
zYLggf%%hfXbV`mwXUJ+4r7uM3IJ1(T?8y{g
zg0<7n2lAJKJSv-m%AC@yLZ`G3OvKllnf|vsLkld84(awhhtzC#NFTrq_AuKO1M@AW
zs#|Xp<_lHAt-@`hbPO_8ymSIua7ZVlH=I(`KKUPVC269ylW+MiWJqs-MS1B>Bo{Hs
zx3rSdx;UY7eu*=*+UW3KjrM3XiIPhMQ(I~YGkukx<6P2Cm*gt!vRMk5q5@8fS=EZv
zN2J=0gJXv@#2K2C2VE2=51>T(q*#kq7aSEBr|(gw~`j*U_7;Y2HHsluwS2z=03_SLj*>KIREv<=qS(&@cOl->g26Y}A?$PLU~9ZMJei%c6u&{
zF75^c(99!?AuN;yejU_YN_W{UTdzj8D)M`bt=+O^LK3!%V19HCzU5#2>Gi
zcDa}1UPP8pehQqUb9@_su$9CL4O@$}oK5ZLUu-D>WM)0tVUZY`Q;mLq6}X~jnDxvO
zF#Ga4qA=|FMFd8Jf$>j~PT`oEZuJcgDFa#E$f7nzQdn{(^$3+e)!n$x2ZR8!}
zlmv95*HC4r4-`TpPTs|8R%(s%I_hWC@ojJo5^Q8dFA#wK1E7=4X;g9GzJz&`ZNEb>
z#hGmH7T1+hfAL&~#+i=6F#Hy1qH%hg(Ksta4HHJgngK0UNUiW~R?Qr$aXBSbwO)#9
z-?R7!
zUi^v$VCii+XBKh;)Y-k+Vu#jIV>dejH;N&{?|=llmx%gT(E?J7|0z5N$_@Rq0N=pi
zM(ItbG(`UGxp=&|6CJ;Un8DAd#5%A-xGoRb<9)D4ggydBZ)$!>zSNSJ==Tu)o^A}?
z>u#jpC`yNz(9bqP=uVJ>&=a8m`R_Jj?o;%VywZ}URP(zG%_T~Y_M(07!6|h~Z^(^b$Ky`v
zRv59)C
za7rgVqhXNz3bc(HF8I-9ZBPA{lv3a^#8RD
zY0jGicPB=A)5Jh40UXk-Jg4M!JEhu2Ni;|Y#1M2BGWc*k41r{c^M9%H~#a
z)hI_OdlK?~sOI-bK5AHGt(=l-gil#E5ZJ%NojUY@%6OvkCWgj(QNK6#XLz7H?!{P5
z;ZVE+c4pMaRb
z#JNg8qo=d3);>?J7=KNScZ>SBMEy=N0MvlJ-qm{6lkJG_b;S3$^q;%*|1GT}CHS{z
zz~4k-`WO4+@i=U1OeD2z=
z;0LYeI%Pe-rCXF9CMtE2qx!n619d1{5i6i>Z#PN%X8|Ph8^*p
ziiVw~UYURJF?jdrNCV?!ywWngyx$0bQ(A`p{w}KjnbIzEyeYFg-}Hr3CUQ8
ztE1?#_@E+#2||)lRD%-rE>~!_4o<@F)OV_Mg4t=lBfUbKs7nQW)p9C?E4(;U
zQZU;j#phWIV8jPE~}b@_J_3
z`ckyOZ_Tc#gH8F4d^J!H6-*CMkD`aah+ol88ZxrFk;*_KHUo*<(mJRs*Ns8%o2|2ag)W!QZ|P*cF+=H$S}zP#f!a3s*B+@m
za>PU~EUP=<`WqrxzLjPsHtC0CqmI&3e5(%$A>`13dOS|1X%F3$;T+Sg^)eU#{2mAY
z{Oj;Dj;siJ+qV#3nK1kO8%^R1VVRj^nXz%O|IKK#*(O+QsA@ktp@uLtmIFuydkh;<
zpE8}J^@hCYAMiXUlz*+W^i$sdYdny*3llR?X~G+*$|Y~`TGAW1^a(Z-?Bz1nSYH8q
z;Y?7B6~HT8oXS*~LZ9=v0`Cwag*j3oTmvakVTqW0a4{)LN*~?KobZWwg}Jyh`XD
z<_{i=Nm-l=t*HnXq9(-dXFsDths1zTf;b2O`EvjQf)|~FZh9AVyAbTgE37oN
zbvdPsu!RUn>Fof+VH!g>^{TlOMTsvyDEX;H1L*Q|5bb1iSq*WRiRk|oi~n}|DH_tn
zE3HaEguuyz2o-TD#X__SL*g1~vINn?jofmCRZfdl{=o$JFq;KKi+)%H71*TI+-Brr
zhGRwsmr|$`-~z4)?AR<8l(rObK*7ApfLNL0Hgmj_CXVYcKef(raw{+CUuizd1M_nK
zeHIJn+1NibKAz(`(A(6x+Bfk2CNMSLTT!4t?^}^O2=9jfCGT#Ky&&&1`}3~pyin+%
z#tM5>wHL{k0ukX+oQsF=O90b}G)6K6%(4Sc2hlqzbfgA5nS`Zl8Y)Ed!XA~jJ-?nm
zj2on$p8=@RJc2M?t>+HrW0mS(OM+)B?wE1)$0WEYOmjg6`>7;2!L029%%Q35hjg=|hh
zGE_)=0`mDatnoPRp|CXp>{WmdK_RvTaJPo(3yTTh76$a;7j`CqPXh?IP`F)dhZ6J=
z@?Fp}B2q5wR)x39D}jn0TFCLOe@2ehmtvXcckt#bQp)|3%Ju5VH?R)wO^c<)c5A-C
zb9I>0Yu;xSPzz`=J&9~2eyIDis=ZT5{YjpVg4Gu@kqb}x&@wpC^?i6akM);;7PZ2E
z3murWqzd*=n_I`dPY)DA`42*;Ccmk0|Sm9H})C=wkg0X8PGKP^2-S5Q-H$%oPu-a_)N{%$=n
z!yKKQR{%f4p)Z=Vx}^v)6O~B7WVO_oGl&&$fl@jxS=w}7=~zVyb5Se{}iqO1*-
zijC(N9YHzgfo)W4iav`#lwjr*ZRP{U8X?7Zm86t$BcEiWVtiQ6CdZy^p}$`Rfs>EL
z3bHy5aYh=4dexGd{YyTBlIPVcbPUzIzk(Vxqr4wjLPtO6WR)8L>;gMfFPZXs+?y|l
zaZ2-P-I<2cSwNwBG20>LV?8wgP4RG6*}^Dq-rROcm@{kD@c@P!6OW7Wh%VtH1r)MA
z;2DjIExlv79|;}ii*>N(E3~q205e8C#==>+A1SIgCrJGnxi2n;d7!g=`@33aQ5BHr
z|3Zg>ENDT+YBeOdAH@VVzJzTFU;_hI%?75J0M2K?i>bIX0W70hH$0@HT0dyeY85&@
zjhCgR)RM=_uA;K@6J_-bIG{a_BQi>9o|(WQ{X#cp^ACDU?XLdKN92ZN&?Lsr6a
zisZ+E$%Gg0?gY0^ONmV~=)xv6Ej<;uAGz3cm;l!9ElUS+)0(eBHFp_DHPoV8eK^u~!Q5K5U^sXN!Ob|xF`i-

[edk2-devel] FW: [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with

2021-06-16 Thread Nate DeSimone
Hi Everyone,

It seems like Manic is having issues sending his patch series to the mailing 
list. I will forward it to the list on Manic's behalf while he gets these 
issues sorted out with his email system.

Thanks,
Nate

-Original Message-
From: manickavasakam karpagavinayagam  
Sent: Wednesday, June 16, 2021 2:44 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Desimone, Nathaniel L 
; fel...@ami.com; DOPPALAPUDI, HARIKRISHNA 
; Jha, Manish ; Bobroff, Zachary 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 
Subject: [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and 
Override generic PciBus Driver with

Add BoardTiogaPass packages to support TiogaPass Platform Enabled Network, 
ISCSI,IPMI, SMBIOS, Performance Measurement Remove AST2500 UEFI option ROM 
driver from PurleyOpenBoardPkg
AST2500 UEFI option ROM move to edk2-non-osi ASpeedGopBinPkg Update copyright 
headers

manickavasakam karpagavinayagam (2):
  PurleyOpenBoardPkg : Support for TiogaPass Platform
  PurleyOpenBoardPkg : Override generic PciBus Driver with Platform
specific instance of PciBus driver.

 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c |8 +-
 .../Acpi/BoardAcpiDxe/AmlOffsetTable.c|  453 +-
 .../Acpi/BoardAcpiDxe/BoardAcpiDxeDsdt.c  |3 +
 .../BoardTiogaPass/CoreDxeInclude.dsc |  168 +
 .../BoardTiogaPass/CoreUefiBootInclude.fdf|   82 +
 .../BoardTiogaPass/GitEdk2MinTiogaPass.bat|   93 +
 .../BasePlatformHookLib/BasePlatformHookLib.c |  389 +
 .../BasePlatformHookLib.inf   |   36 +
 .../BoardAcpiLib/DxeBoardAcpiTableLib.c   |   36 +
 .../BoardAcpiLib/DxeBoardAcpiTableLib.inf |   40 +
 .../BoardAcpiLib/DxeTiogaPassAcpiTableLib.c   |   53 +
 .../BoardAcpiLib/SmmBoardAcpiEnableLib.c  |   62 +
 .../BoardAcpiLib/SmmBoardAcpiEnableLib.inf|   41 +
 .../BoardAcpiLib/SmmSiliconAcpiEnableLib.c|  120 +
 .../BoardAcpiLib/SmmTiogaPassAcpiEnableLib.c  |   37 +
 .../Library/BoardInitLib/AllLanesEparam.c |   44 +
 .../Library/BoardInitLib/GpioTable.c  |  296 +
 .../Library/BoardInitLib/IioBifur.c   |   70 +
 .../BoardInitLib/PeiBoardInitPostMemLib.c |   46 +
 .../BoardInitLib/PeiBoardInitPostMemLib.inf   |   37 +
 .../BoardInitLib/PeiBoardInitPreMemLib.c  |  112 +
 .../BoardInitLib/PeiBoardInitPreMemLib.inf|   69 +
 .../Library/BoardInitLib/PeiTiogaPassDetect.c |   28 +
 .../BoardInitLib/PeiTiogaPassInitLib.h|   18 +
 .../BoardInitLib/PeiTiogaPassInitPostMemLib.c |   86 +
 .../BoardInitLib/PeiTiogaPassInitPreMemLib.c  |  638 ++
 .../Library/BoardInitLib/UsbOC.c  |   46 +
 .../Library/PeiReportFvLib/PeiReportFvLib.c   |  138 +
 .../Library/PeiReportFvLib/PeiReportFvLib.inf |   51 +
 .../BoardTiogaPass/OpenBoardPkg.dsc   |  245 +
 .../BoardTiogaPass/OpenBoardPkg.fdf   |  600 ++
 .../BoardTiogaPass/PlatformPkgBuildOption.dsc |   84 +
 .../BoardTiogaPass/PlatformPkgConfig.dsc  |   58 +
 .../BoardTiogaPass/PlatformPkgPcd.dsc |  392 ++
 .../BoardTiogaPass/StructureConfig.dsc| 6236 +
 .../BoardTiogaPass/__init__.py|0
 .../PurleyOpenBoardPkg/BoardTiogaPass/bld.bat |  139 +
 .../BoardTiogaPass/build_board.py |  195 +
 .../BoardTiogaPass/build_config.cfg   |   34 +
 .../BoardTiogaPass/logo.txt   |   10 +
 .../BoardTiogaPass/postbuild.bat  |   96 +
 .../BoardTiogaPass/prebuild.bat   |  213 +
 .../Ipmi/Library/IpmiLibKcs/IpmiLibKcs.inf|   10 +-
 .../IpmiPlatformHookLib.inf   |6 +-
 .../Include/Guid/PchRcVariable.h  |6 +
 .../Include/Guid/SetupVariable.h  |   15 +-
 .../Intel/PurleyOpenBoardPkg/OpenBoardPkg.dec |1 +
 .../Bus/Pci/PciBusDxe/ComponentName.c |  170 +
 .../Bus/Pci/PciBusDxe/ComponentName.h |  146 +
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c   |  460 ++
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h   |  396 ++
 .../Bus/Pci/PciBusDxe/PciBusDxe.inf   |  112 +
 .../Bus/Pci/PciBusDxe/PciBusDxe.uni   |   16 +
 .../Bus/Pci/PciBusDxe/PciBusDxeExtra.uni  |   14 +
 .../Bus/Pci/PciBusDxe/PciCommand.c|  267 +
 .../Bus/Pci/PciBusDxe/PciCommand.h|  232 +
 .../Bus/Pci/PciBusDxe/PciDeviceSupport.c  | 1056 +++
 .../Bus/Pci/PciBusDxe/PciDeviceSupport.h  |  266 +
 .../Bus/Pci/PciBusDxe/PciDriverOverride.c |  188 +
 .../Bus/Pci/PciBusDxe/PciDriverOverride.h |   83 +
 .../Bus/Pci/PciBusDxe/PciEnumerator.c | 2210 ++
 .../Bus/Pci/PciBusDxe/PciEnumerator.h |  515 ++
 .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c  | 2885   
.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.h  |  480 ++
 .../Bus/Pci/PciBusDxe/PciHotPlugSupport.c |  484 ++
 .../Bus/Pci/PciBusDxe/PciHotPlugSupport.h |  205 +
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c| 2087 ++
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h|  660 ++
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c   

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_RESERVED;+  } else if
> (MemoryMapEntry->Base < 0x1ULL &&+MemoryMapEntry-
> >Base >= TopOfLowerUsableDram) {+//+// 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;++ 

[edk2-devel] [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with

2021-06-16 Thread manickavasakam karpagavinayagam
Add BoardTiogaPass packages to support TiogaPass Platform
Enabled Network, ISCSI,IPMI, SMBIOS, Performance Measurement
Remove AST2500 UEFI option ROM driver from PurleyOpenBoardPkg
AST2500 UEFI option ROM move to edk2-non-osi ASpeedGopBinPkg
Update copyright headers

manickavasakam karpagavinayagam (2):
  PurleyOpenBoardPkg : Support for TiogaPass Platform
  PurleyOpenBoardPkg : Override generic PciBus Driver with Platform
specific instance of PciBus driver.

 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c |8 +-
 .../Acpi/BoardAcpiDxe/AmlOffsetTable.c|  453 +-
 .../Acpi/BoardAcpiDxe/BoardAcpiDxeDsdt.c  |3 +
 .../BoardTiogaPass/CoreDxeInclude.dsc |  168 +
 .../BoardTiogaPass/CoreUefiBootInclude.fdf|   82 +
 .../BoardTiogaPass/GitEdk2MinTiogaPass.bat|   93 +
 .../BasePlatformHookLib/BasePlatformHookLib.c |  389 +
 .../BasePlatformHookLib.inf   |   36 +
 .../BoardAcpiLib/DxeBoardAcpiTableLib.c   |   36 +
 .../BoardAcpiLib/DxeBoardAcpiTableLib.inf |   40 +
 .../BoardAcpiLib/DxeTiogaPassAcpiTableLib.c   |   53 +
 .../BoardAcpiLib/SmmBoardAcpiEnableLib.c  |   62 +
 .../BoardAcpiLib/SmmBoardAcpiEnableLib.inf|   41 +
 .../BoardAcpiLib/SmmSiliconAcpiEnableLib.c|  120 +
 .../BoardAcpiLib/SmmTiogaPassAcpiEnableLib.c  |   37 +
 .../Library/BoardInitLib/AllLanesEparam.c |   44 +
 .../Library/BoardInitLib/GpioTable.c  |  296 +
 .../Library/BoardInitLib/IioBifur.c   |   70 +
 .../BoardInitLib/PeiBoardInitPostMemLib.c |   46 +
 .../BoardInitLib/PeiBoardInitPostMemLib.inf   |   37 +
 .../BoardInitLib/PeiBoardInitPreMemLib.c  |  112 +
 .../BoardInitLib/PeiBoardInitPreMemLib.inf|   69 +
 .../Library/BoardInitLib/PeiTiogaPassDetect.c |   28 +
 .../BoardInitLib/PeiTiogaPassInitLib.h|   18 +
 .../BoardInitLib/PeiTiogaPassInitPostMemLib.c |   86 +
 .../BoardInitLib/PeiTiogaPassInitPreMemLib.c  |  638 ++
 .../Library/BoardInitLib/UsbOC.c  |   46 +
 .../Library/PeiReportFvLib/PeiReportFvLib.c   |  138 +
 .../Library/PeiReportFvLib/PeiReportFvLib.inf |   51 +
 .../BoardTiogaPass/OpenBoardPkg.dsc   |  245 +
 .../BoardTiogaPass/OpenBoardPkg.fdf   |  600 ++
 .../BoardTiogaPass/PlatformPkgBuildOption.dsc |   84 +
 .../BoardTiogaPass/PlatformPkgConfig.dsc  |   58 +
 .../BoardTiogaPass/PlatformPkgPcd.dsc |  392 ++
 .../BoardTiogaPass/StructureConfig.dsc| 6236 +
 .../BoardTiogaPass/__init__.py|0
 .../PurleyOpenBoardPkg/BoardTiogaPass/bld.bat |  139 +
 .../BoardTiogaPass/build_board.py |  195 +
 .../BoardTiogaPass/build_config.cfg   |   34 +
 .../BoardTiogaPass/logo.txt   |   10 +
 .../BoardTiogaPass/postbuild.bat  |   96 +
 .../BoardTiogaPass/prebuild.bat   |  213 +
 .../Ipmi/Library/IpmiLibKcs/IpmiLibKcs.inf|   10 +-
 .../IpmiPlatformHookLib.inf   |6 +-
 .../Include/Guid/PchRcVariable.h  |6 +
 .../Include/Guid/SetupVariable.h  |   15 +-
 .../Intel/PurleyOpenBoardPkg/OpenBoardPkg.dec |1 +
 .../Bus/Pci/PciBusDxe/ComponentName.c |  170 +
 .../Bus/Pci/PciBusDxe/ComponentName.h |  146 +
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c   |  460 ++
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h   |  396 ++
 .../Bus/Pci/PciBusDxe/PciBusDxe.inf   |  112 +
 .../Bus/Pci/PciBusDxe/PciBusDxe.uni   |   16 +
 .../Bus/Pci/PciBusDxe/PciBusDxeExtra.uni  |   14 +
 .../Bus/Pci/PciBusDxe/PciCommand.c|  267 +
 .../Bus/Pci/PciBusDxe/PciCommand.h|  232 +
 .../Bus/Pci/PciBusDxe/PciDeviceSupport.c  | 1056 +++
 .../Bus/Pci/PciBusDxe/PciDeviceSupport.h  |  266 +
 .../Bus/Pci/PciBusDxe/PciDriverOverride.c |  188 +
 .../Bus/Pci/PciBusDxe/PciDriverOverride.h |   83 +
 .../Bus/Pci/PciBusDxe/PciEnumerator.c | 2210 ++
 .../Bus/Pci/PciBusDxe/PciEnumerator.h |  515 ++
 .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c  | 2885 
 .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.h  |  480 ++
 .../Bus/Pci/PciBusDxe/PciHotPlugSupport.c |  484 ++
 .../Bus/Pci/PciBusDxe/PciHotPlugSupport.h |  205 +
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c| 2087 ++
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h|  660 ++
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c   | 1809 +
 .../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.h   |  179 +
 .../Bus/Pci/PciBusDxe/PciOptionRomSupport.c   |  776 ++
 .../Bus/Pci/PciBusDxe/PciOptionRomSupport.h   |  136 +
 .../Bus/Pci/PciBusDxe/PciPowerManagement.c|   82 +
 .../Bus/Pci/PciBusDxe/PciPowerManagement.h|   28 +
 .../Bus/Pci/PciBusDxe/PciResourceSupport.c| 2292 ++
 .../Bus/Pci/PciBusDxe/PciResourceSupport.h|  456 ++
 .../Bus/Pci/PciBusDxe/PciRomTable.c   |  135 +
 .../Bus/Pci/PciBusDxe/PciRomTable.h   |   48 +
 Platform/Intel/build.cfg  |2 +
 Platform/Intel/build_bios.py  | 

[edk2-devel] [edk2-platforms] [PATCH V1 1/2] PurleyOpenBoardPkg : Support for TiogaPass Platform

2021-06-16 Thread manickavasakam karpagavinayagam
Add BoardTiogaPass packages to support TiogaPass Platform Enabled Network, 
ISCSI,IPMI, SMBIOS, Performance Measurement Remove AST2500 UEFI option ROM 
driver from PurleyOpenBoardPkg

AST2500 UEFI option ROM move to edk2-non-osi ASpeedGopBinPkg Update copyright 
headers

manickavasakam karpagavinayagam (2):

PurleyOpenBoardPkg : Support for TiogaPass Platform

PurleyOpenBoardPkg : Override generic PciBus Driver with Platform

specific instance of PciBus driver.

.../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 8 +-

.../Acpi/BoardAcpiDxe/AmlOffsetTable.c | 453 +-

.../Acpi/BoardAcpiDxe/BoardAcpiDxeDsdt.c | 3 +

.../BoardTiogaPass/CoreDxeInclude.dsc | 168 +

.../BoardTiogaPass/CoreUefiBootInclude.fdf | 82 +

.../BoardTiogaPass/GitEdk2MinTiogaPass.bat | 93 +

.../BasePlatformHookLib/BasePlatformHookLib.c | 389 +

.../BasePlatformHookLib.inf | 36 +

.../BoardAcpiLib/DxeBoardAcpiTableLib.c | 36 +

.../BoardAcpiLib/DxeBoardAcpiTableLib.inf | 40 +

.../BoardAcpiLib/DxeTiogaPassAcpiTableLib.c | 53 +

.../BoardAcpiLib/SmmBoardAcpiEnableLib.c | 62 +

.../BoardAcpiLib/SmmBoardAcpiEnableLib.inf | 41 +

.../BoardAcpiLib/SmmSiliconAcpiEnableLib.c | 120 +

.../BoardAcpiLib/SmmTiogaPassAcpiEnableLib.c | 37 +

.../Library/BoardInitLib/AllLanesEparam.c | 44 +

.../Library/BoardInitLib/GpioTable.c | 296 +

.../Library/BoardInitLib/IioBifur.c | 70 +

.../BoardInitLib/PeiBoardInitPostMemLib.c | 46 +

.../BoardInitLib/PeiBoardInitPostMemLib.inf | 37 +

.../BoardInitLib/PeiBoardInitPreMemLib.c | 112 +

.../BoardInitLib/PeiBoardInitPreMemLib.inf | 69 +

.../Library/BoardInitLib/PeiTiogaPassDetect.c | 28 +

.../BoardInitLib/PeiTiogaPassInitLib.h | 18 +

.../BoardInitLib/PeiTiogaPassInitPostMemLib.c | 86 +

.../BoardInitLib/PeiTiogaPassInitPreMemLib.c | 638 ++

.../Library/BoardInitLib/UsbOC.c | 46 +

.../Library/PeiReportFvLib/PeiReportFvLib.c | 138 +

.../Library/PeiReportFvLib/PeiReportFvLib.inf | 51 +

.../BoardTiogaPass/OpenBoardPkg.dsc | 245 +

.../BoardTiogaPass/OpenBoardPkg.fdf | 600 ++

.../BoardTiogaPass/PlatformPkgBuildOption.dsc | 84 +

.../BoardTiogaPass/PlatformPkgConfig.dsc | 58 +

.../BoardTiogaPass/PlatformPkgPcd.dsc | 392 ++

.../BoardTiogaPass/StructureConfig.dsc | 6236 +

.../BoardTiogaPass/__init__.py | 0

.../PurleyOpenBoardPkg/BoardTiogaPass/bld.bat | 139 +

.../BoardTiogaPass/build_board.py | 195 +

.../BoardTiogaPass/build_config.cfg | 34 +

.../BoardTiogaPass/logo.txt | 10 +

.../BoardTiogaPass/postbuild.bat | 96 +

.../BoardTiogaPass/prebuild.bat | 213 +

.../Ipmi/Library/IpmiLibKcs/IpmiLibKcs.inf | 10 +-

.../IpmiPlatformHookLib.inf | 6 +-

.../Include/Guid/PchRcVariable.h | 6 +

.../Include/Guid/SetupVariable.h | 15 +-

.../Intel/PurleyOpenBoardPkg/OpenBoardPkg.dec | 1 +

.../Bus/Pci/PciBusDxe/ComponentName.c | 170 +

.../Bus/Pci/PciBusDxe/ComponentName.h | 146 +

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 460 ++

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h | 396 ++

.../Bus/Pci/PciBusDxe/PciBusDxe.inf | 112 +

.../Bus/Pci/PciBusDxe/PciBusDxe.uni | 16 +

.../Bus/Pci/PciBusDxe/PciBusDxeExtra.uni | 14 +

.../Bus/Pci/PciBusDxe/PciCommand.c | 267 +

.../Bus/Pci/PciBusDxe/PciCommand.h | 232 +

.../Bus/Pci/PciBusDxe/PciDeviceSupport.c | 1056 +++

.../Bus/Pci/PciBusDxe/PciDeviceSupport.h | 266 +

.../Bus/Pci/PciBusDxe/PciDriverOverride.c | 188 +

.../Bus/Pci/PciBusDxe/PciDriverOverride.h | 83 +

.../Bus/Pci/PciBusDxe/PciEnumerator.c | 2210 ++

.../Bus/Pci/PciBusDxe/PciEnumerator.h | 515 ++

.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 2885 
.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.h | 480 ++

.../Bus/Pci/PciBusDxe/PciHotPlugSupport.c | 484 ++

.../Bus/Pci/PciBusDxe/PciHotPlugSupport.h | 205 +

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 2087 ++

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h | 660 ++

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 1809 +

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.h | 179 +

.../Bus/Pci/PciBusDxe/PciOptionRomSupport.c | 776 ++

.../Bus/Pci/PciBusDxe/PciOptionRomSupport.h | 136 +

.../Bus/Pci/PciBusDxe/PciPowerManagement.c | 82 +

.../Bus/Pci/PciBusDxe/PciPowerManagement.h | 28 +

.../Bus/Pci/PciBusDxe/PciResourceSupport.c | 2292 ++

.../Bus/Pci/PciBusDxe/PciResourceSupport.h | 456 ++

.../Bus/Pci/PciBusDxe/PciRomTable.c | 135 +

.../Bus/Pci/PciBusDxe/PciRomTable.h | 48 +

Platform/Intel/build.cfg | 2 +

Platform/Intel/build_bios.py | 3 +-

80 files changed, 30278 insertions(+), 240 deletions(-) create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc

create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf

create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/GitEdk2MinTiogaPass.bat

create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BasePlatformHookLib/BasePlatformHookLib.c

create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BasePlatformHookLib/BasePlatformHookLib.inf

create mode 100644 

[edk2-devel] [edk2-non-osi] [PATCH] ASpeed : ASpeedGopBinPkg : Add X64 ASpeedAst2500Gop UEFI Driver

2021-06-16 Thread manickavasakam karpagavinayagam
Add X64 ASpeedAst2500Gop UEFI Driver
---
 .../ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf |   4 
 .../ASpeedGopBinPkg/X64/ASpeedAst2500Gop.efi| Bin 0 -> 36928 bytes
 2 files changed, 4 insertions(+)
 create mode 100644 Drivers/ASpeed/ASpeedGopBinPkg/X64/ASpeedAst2500Gop.efi

diff --git a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf 
b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
index b3cee45..b563f76 100644
--- a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
+++ b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
@@ -3,6 +3,7 @@
 #

 #  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.

 #  Copyright (c) 2020, ASPEED Technology Inc. All rights reserved.

+#  Copyright (c) 2021, American Megatrends International LLC.

 #

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

 #

@@ -17,3 +18,6 @@
 

 [Binaries.AArch64]

   PE32|AArch64/ASpeedAst2500Gop.efi|*

+

+[Binaries.X64]

+  PE32|X64/ASpeedAst2500Gop.efi|*

diff --git a/Drivers/ASpeed/ASpeedGopBinPkg/X64/ASpeedAst2500Gop.efi 
b/Drivers/ASpeed/ASpeedGopBinPkg/X64/ASpeedAst2500Gop.efi
new file mode 100644
index 
..07d9de0fe5241bf26d516f3522a930880a57f5c5
GIT binary patch
literal 36928
zcmeIbeS8$v^*=tF-H;^-nMH#Q5@nT*Mjj*()Ih-Ogk6}GU5SKfT0u8LLQ;8%$u198
zba4~S?zon=+G;!mjny
zuJ)j;A2O4iBzvm7MApo4_17-0@zfx_;c`6RoxD@N_Oo(ax0deIb6h8Q)$SUc?pBT~
zzjn1ku#of{0!+Q1hu2iQbj2b?cG7_l2y{>VSwT+>EU*}F6aB}`Vqn-W9^yDrIxI?O
z#nxTkOG394i=konuH`sqD7_Ll`KLDnA#m9e!fSoUdkNsr0v@WI3dCCoV>Mw>h!
z-NCRr8P?ATtD+28;|Ob>f>jNy;uNfJ-A`B(fmMK%Jf30gle59JC@ruQiT)ktJGbv~
zO7A)Xw;LUSO4F_2-0JWzI>Cvd^v!4kM_{Jx3=Oj*3CQ1<5M+)C&|dI5SAjl3x4^I(
z1-(ZMjTk}@Dg7s{ETe*<4RhcYUoYw?tLJ6#;1gRr*UWQDohb3lYL1ik$~qTQ
zk0#8}uySJk9)e5Tf%rWIvB${}A1B0H(Plt=5ouWjB5J-2HG@Io*IvAld)7O)@7c3Qly-=L
zYLggf%%hfXbV`mwXUJ+4r7uM3IJ1(T?8y{g
zg0<7n2lAJKJSv-m%AC@yLZ`G3OvKllnf|vsLkld84(awhhtzC#NFTrq_AuKO1M@AW
zs#|Xp<_lHAt-@`hbPO_8ymSIua7ZVlH=I(`KKUPVC269ylW+MiWJqs-MS1B>Bo{Hs
zx3rSdx;UY7eu*=*+UW3KjrM3XiIPhMQ(I~YGkukx<6P2Cm*gt!vRMk5q5@8fS=EZv
zN2J=0gJXv@#2K2C2VE2=51>T(q*#kq7aSEBr|(gw~`j*U_7;Y2HHsluwS2z=03_SLj*>KIREv<=qS(&@cOl->g26Y}A?$PLU~9ZMJei%c6u&{
zF75^c(99!?AuN;yejU_YN_W{UTdzj8D)M`bt=+O^LK3!%V19HCzU5#2>Gi
zcDa}1UPP8pehQqUb9@_su$9CL4O@$}oK5ZLUu-D>WM)0tVUZY`Q;mLq6}X~jnDxvO
zF#Ga4qA=|FMFd8Jf$>j~PT`oEZuJcgDFa#E$f7nzQdn{(^$3+e)!n$x2ZR8!}
zlmv95*HC4r4-`TpPTs|8R%(s%I_hWC@ojJo5^Q8dFA#wK1E7=4X;g9GzJz&`ZNEb>
z#hGmH7T1+hfAL&~#+i=6F#Hy1qH%hg(Ksta4HHJgngK0UNUiW~R?Qr$aXBSbwO)#9
z-?R7!
zUi^v$VCii+XBKh;)Y-k+Vu#jIV>dejH;N&{?|=llmx%gT(E?J7|0z5N$_@Rq0N=pi
zM(ItbG(`UGxp=&|6CJ;Un8DAd#5%A-xGoRb<9)D4ggydBZ)$!>zSNSJ==Tu)o^A}?
z>u#jpC`yNz(9bqP=uVJ>&=a8m`R_Jj?o;%VywZ}URP(zG%_T~Y_M(07!6|h~Z^(^b$Ky`v
zRv59)C
za7rgVqhXNz3bc(HF8I-9ZBPA{lv3a^#8RD
zY0jGicPB=A)5Jh40UXk-Jg4M!JEhu2Ni;|Y#1M2BGWc*k41r{c^M9%H~#a
z)hI_OdlK?~sOI-bK5AHGt(=l-gil#E5ZJ%NojUY@%6OvkCWgj(QNK6#XLz7H?!{P5
z;ZVE+c4pMaRb
z#JNg8qo=d3);>?J7=KNScZ>SBMEy=N0MvlJ-qm{6lkJG_b;S3$^q;%*|1GT}CHS{z
zz~4k-`WO4+@i=U1OeD2z=
z;0LYeI%Pe-rCXF9CMtE2qx!n619d1{5i6i>Z#PN%X8|Ph8^*p
ziiVw~UYURJF?jdrNCV?!ywWngyx$0bQ(A`p{w}KjnbIzEyeYFg-}Hr3CUQ8
ztE1?#_@E+#2||)lRD%-rE>~!_4o<@F)OV_Mg4t=lBfUbKs7nQW)p9C?E4(;U
zQZU;j#phWIV8jPE~}b@_J_3
z`ckyOZ_Tc#gH8F4d^J!H6-*CMkD`aah+ol88ZxrFk;*_KHUo*<(mJRs*Ns8%o2|2ag)W!QZ|P*cF+=H$S}zP#f!a3s*B+@m
za>PU~EUP=<`WqrxzLjPsHtC0CqmI&3e5(%$A>`13dOS|1X%F3$;T+Sg^)eU#{2mAY
z{Oj;Dj;siJ+qV#3nK1kO8%^R1VVRj^nXz%O|IKK#*(O+QsA@ktp@uLtmIFuydkh;<
zpE8}J^@hCYAMiXUlz*+W^i$sdYdny*3llR?X~G+*$|Y~`TGAW1^a(Z-?Bz1nSYH8q
z;Y?7B6~HT8oXS*~LZ9=v0`Cwag*j3oTmvakVTqW0a4{)LN*~?KobZWwg}Jyh`XD
z<_{i=Nm-l=t*HnXq9(-dXFsDths1zTf;b2O`EvjQf)|~FZh9AVyAbTgE37oN
zbvdPsu!RUn>Fof+VH!g>^{TlOMTsvyDEX;H1L*Q|5bb1iSq*WRiRk|oi~n}|DH_tn
zE3HaEguuyz2o-TD#X__SL*g1~vINn?jofmCRZfdl{=o$JFq;KKi+)%H71*TI+-Brr
zhGRwsmr|$`-~z4)?AR<8l(rObK*7ApfLNL0Hgmj_CXVYcKef(raw{+CUuizd1M_nK
zeHIJn+1NibKAz(`(A(6x+Bfk2CNMSLTT!4t?^}^O2=9jfCGT#Ky&&&1`}3~pyin+%
z#tM5>wHL{k0ukX+oQsF=O90b}G)6K6%(4Sc2hlqzbfgA5nS`Zl8Y)Ed!XA~jJ-?nm
zj2on$p8=@RJc2M?t>+HrW0mS(OM+)B?wE1)$0WEYOmjg6`>7;2!L029%%Q35hjg=|hh
zGE_)=0`mDatnoPRp|CXp>{WmdK_RvTaJPo(3yTTh76$a;7j`CqPXh?IP`F)dhZ6J=
z@?Fp}B2q5wR)x39D}jn0TFCLOe@2ehmtvXcckt#bQp)|3%Ju5VH?R)wO^c<)c5A-C
zb9I>0Yu;xSPzz`=J&9~2eyIDis=ZT5{YjpVg4Gu@kqb}x&@wpC^?i6akM);;7PZ2E
z3murWqzd*=n_I`dPY)DA`42*;Ccmk0|Sm9H})C=wkg0X8PGKP^2-S5Q-H$%oPu-a_)N{%$=n
z!yKKQR{%f4p)Z=Vx}^v)6O~B7WVO_oGl&&$fl@jxS=w}7=~zVyb5Se{}iqO1*-
zijC(N9YHzgfo)W4iav`#lwjr*ZRP{U8X?7Zm86t$BcEiWVtiQ6CdZy^p}$`Rfs>EL
z3bHy5aYh=4dexGd{YyTBlIPVcbPUzIzk(Vxqr4wjLPtO6WR)8L>;gMfFPZXs+?y|l
zaZ2-P-I<2cSwNwBG20>LV?8wgP4RG6*}^Dq-rROcm@{kD@c@P!6OW7Wh%VtH1r)MA
z;2DjIExlv79|;}ii*>N(E3~q205e8C#==>+A1SIgCrJGnxi2n;d7!g=`@33aQ5BHr
z|3Zg>ENDT+YBeOdAH@VVzJzTFU;_hI%?75J0M2K?i>bIX0W70hH$0@HT0dyeY85&@
zjhCgR)RM=_uA;K@6J_-bIG{a_BQi>9o|(WQ{X#cp^ACDU?XLdKN92ZN&?Lsr6a
zisZ+E$%Gg0?gY0^ONmV~=)xv6Ej<;uAGz3cm;l!9ElUS+)0(eBHFp_DHPoV8eK^u~!Q5K5U^sXN!Ob|xF`i-
zXcFNc351hZCab_}291K8K-iyxkd;I@mOywu1tB|$a3X>5XbQrxB*JG2gk>oRSl-ik
z=u03tfgp4kv9uLlp8(##fJ4Z@I}^Yw8Sn?GZlOpX1|X3wl9yn1p(zxrP+Co9oo10o

Re: [EXTERNAL] RE: [edk2-devel] [edk2-platforms][PATCH 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with

2021-06-16 Thread manickavasakam karpagavinayagam
Nate :

Thank you for your review comments. Addressed all below comments and sent V1 
patches and new patch for ASPEED 2500 GOP driver

[edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override 
generic PciBus Driver with
[edk2-platforms] [PATCH V1 1/2] PurleyOpenBoardPkg : Support for TiogaPass 
Platform
[edk2-platforms] [PATCH V1 2/2] PurleyOpenBoardPkg : Override generic PciBus 
Driver with Platform specific instance of PciBus driver.
[edk2-platforms] [PATCH V1] PurleyOpenBoardPkg : Support for LINUX Boot

[edk2-non-osi] [PATCH] ASpeed : ASpeedGopBinPkg : Add X64 ASpeedAst2500Gop UEFI 
Driver

Thank you

-Manic

-Original Message-
From: Desimone, Nathaniel L 
Sent: Tuesday, June 15, 2021 6:34 PM
To: devel@edk2.groups.io; Desimone, Nathaniel L 
; Manickavasakam Karpagavinayagam 

Cc: Oram, Isaac W ; Felix Polyudov ; 
Harikrishna Doppalapudi ; Manish Jha ; 
Zachary Bobroff 
Subject: [EXTERNAL] RE: [edk2-devel] [edk2-platforms][PATCH 0/2] Support for 
TiogaPass Platform and Override generic PciBus Driver with


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

One final comment, 
PurleyOpenBoardPkg/Override/edk2/MdeModulePkg/Bus/Pci/PciBusDxe seems a little 
excessive, I think you can do 
PurleyOpenBoardPkg/Override/MdeModulePkg/Bus/Pci/PciBusDxe and everyone will 
understand what it is.

Thanks,
Nate

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Nate DeSimone
Sent: Tuesday, June 15, 2021 2:45 PM
To: devel@edk2.groups.io; Desimone, Nathaniel L 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 

Cc: Oram, Isaac W ; fel...@ami.com; DOPPALAPUDI, 
HARIKRISHNA ; Jha, Manish ; Bobroff, 
Zachary 
Subject: Re: [edk2-devel] [edk2-platforms][PATCH 0/2] Support for TiogaPass 
Platform and Override generic PciBus Driver with

Also, uefi_2500_800.efi should not be added directly inside of 
PurleyOpenBoardPkg. You will need to move that to edk2-non-osi. I'm not sure 
exactly which driver that is, but I have a suspicion that it might make sense 
to add it to ASpeedGopBinPkg.

Thanks,
Nate

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Nate DeSimone
Sent: Tuesday, June 15, 2021 2:41 PM
To: KARPAGAVINAYAGAM, MANICKAVASAKAM ; 
devel@edk2.groups.io
Cc: Oram, Isaac W ; fel...@ami.com; DOPPALAPUDI, 
HARIKRISHNA ; Jha, Manish ; Bobroff, 
Zachary ; KARPAGAVINAYAGAM, MANICKAVASAKAM 

Subject: Re: [edk2-devel] [edk2-platforms][PATCH 0/2] Support for TiogaPass 
Platform and Override generic PciBus Driver with

Hi Manic,

I looked over all of your changes. The code itself looks good. However, there 
is an issue with the copyright headers that you have placed on the top of many 
of the files included here. It appears that you added the following:

/** @file

Copyright (c) 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

**/

//***
//* *
//*   Copyright (c) 1985 - 2021, American Megatrends International LLC. *
//* *
//*  All rights reserved.   *
//* *
//*  SPDX-License-Identifier: BSD-2-Clause-Patent   *
//* *
//***

Note that the SPDX spec requires that there be only one copyright and license 
statement per file. The correct way to add your new attribution would be the 
following:

/** @file

Copyright (c) 2018, Intel Corporation. All rights reserved. Copyright (c) 
2021, American Megatrends International LLC.
SPDX-License-Identifier: BSD-2-Clause-Patent

**/

There are also several files where you modified the file but did not add the 
new copyright notice. For example AmlOffsetTable.c, BoardAcpiDxeDsdt.c do not 
have the new copyright added. Please correct this and send a new patch series.

Thanks,
Nate

-Original Message-
From: manickavasakam karpagavinayagam 
Sent: Thursday, June 10, 2021 4:50 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Desimone, Nathaniel L 
; fel...@ami.com; DOPPALAPUDI, HARIKRISHNA 
; Jha, Manish ; Bobroff, Zachary 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 
Subject: [edk2-platforms][PATCH 0/2] Support for TiogaPass Platform and 
Override generic PciBus Driver with

Add BoardTiogaPass packages to support TiogaPass Platform Overriden generic 
PciBus Driver with Platform specific instance of PciBus driver To skip SPI 
controller initialization during PCI enumeration to avoid SET variable assert 
issue during POST To skip executing a specific MLX card UEFI OPROM


manickavasakam karpagavinayagam (2):
  PurleyOpenBoardPkg : Support for TiogaPass 

[edk2-devel] [edk2-platforms] [PATCH V1] PurleyOpenBoardPkg : Support for LINUX Boot

2021-06-16 Thread manickavasakam karpagavinayagam
Support for LINUX Boot
To enable/disable feature, PcdLinuxBootEnable can be used
1.  Follow directions on http://osresearch.net/Building/ to compile the 
heads kernel and initrd for qemu-system_x86_64
2.  Copy the following built files
(1) initrd.cpio.xz  to LinuxBootPkg/LinuxBinaries/initrd.cpio.xz
(2) bzimage to LinuxBootPkg/LinuxBinaries/linux.efi
---
 .../BoardTiogaPass/CoreDxeInclude.dsc |   5 +-
 .../BoardTiogaPass/CoreUefiBootInclude.fdf|   5 +-
 .../BoardTiogaPass/OpenBoardPkg.dsc   |   7 +
 .../BoardTiogaPass/OpenBoardPkg.fdf   |  57 ++-
 .../BoardTiogaPass/PlatformPkgConfig.dsc  |   7 +
 .../LinuxBinaries/LinuxKernel.inf |   9 +
 .../LinuxBootPkg/LinuxBinaries/initrd.cpio.xz | Bin 0 -> 16 bytes
 .../LinuxBootPkg/LinuxBinaries/linux.efi  | Bin 0 -> 16 bytes
 .../LinuxBootPkg/LinuxBoot.c  | 422 ++
 .../LinuxBootPkg/LinuxBoot.h  | 193 
 .../LinuxBootPkg/LinuxBoot.inf|  46 ++
 .../LinuxBootPkg/LinuxBootNull.c  |  43 ++
 .../LinuxBootPkg/LinuxBootNull.inf|  31 ++
 .../Intel/PurleyOpenBoardPkg/OpenBoardPkg.dec |   2 +
 .../DxePlatformBootManagerLib/BdsPlatform.c   |   9 +
 .../DxePlatformBootManagerLib.inf |   2 +
 Platform/Intel/Readme.md  |  42 ++
 17 files changed, 872 insertions(+), 8 deletions(-)
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBinaries/LinuxKernel.inf
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBinaries/initrd.cpio.xz
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBinaries/linux.efi
 create mode 100644 Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBoot.c
 create mode 100644 Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBoot.h
 create mode 100644 Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBoot.inf
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBootNull.c
 create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/LinuxBootPkg/LinuxBootNull.inf

diff --git 
a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc 
b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc
index b0660d72dd..a17015704b 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc
@@ -83,6 +83,7 @@
   
$(PLATFORM_BOARD_PACKAGE)/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
 #TiogaPass Override END

+!if gPlatformTokenSpaceGuid.PcdLinuxBootEnable == FALSE
   MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
@@ -97,10 +98,11 @@
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
   MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
   FatPkg/EnhancedFatDxe/Fat.inf
-
+!endif
   #MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
   MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf

+!if gPlatformTokenSpaceGuid.PcdLinuxBootEnable == FALSE
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
   MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf

@@ -124,6 +126,7 @@
 
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
   }
+!endif

 !if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
   MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
diff --git 
a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf 
b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf
index 141ce5dda3..6cd8ba6626 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf
@@ -47,6 +47,7 @@ INF  PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
  INF  
$(PLATFORM_BOARD_PACKAGE)/Override/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
 #TiogaPass Override END

+!if gPlatformTokenSpaceGuid.PcdLinuxBootEnable == FALSE
 INF  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
@@ -62,10 +63,12 @@ INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
 INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
 INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
 INF  FatPkg/EnhancedFatDxe/Fat.inf
+!endif

 #INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
 INF  MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf

+!if gPlatformTokenSpaceGuid.PcdLinuxBootEnable == FALSE
 INF  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
 INF  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf

@@ -79,4 +82,4 @@ INF  

[edk2-devel] [edk2-platforms] [PATCH V1 0/2] Support for TiogaPass Platform and Override generic PciBus Driver with

2021-06-16 Thread manickavasakam karpagavinayagam
Add BoardTiogaPass packages to support TiogaPass Platform Enabled Network, 
ISCSI,IPMI, SMBIOS, Performance Measurement
Remove AST2500 UEFI option ROM driver from PurleyOpenBoardPkg

AST2500 UEFI option ROM move to edk2-non-osi ASpeedGopBinPkg Update copyright 
headers

manickavasakam karpagavinayagam (2):

PurleyOpenBoardPkg : Support for TiogaPass Platform

PurleyOpenBoardPkg : Override generic PciBus Driver with Platform

specific instance of PciBus driver.

.../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 8 +-

.../Acpi/BoardAcpiDxe/AmlOffsetTable.c | 453 +-

.../Acpi/BoardAcpiDxe/BoardAcpiDxeDsdt.c | 3 +

.../BoardTiogaPass/CoreDxeInclude.dsc | 168 +

.../BoardTiogaPass/CoreUefiBootInclude.fdf | 82 +

.../BoardTiogaPass/GitEdk2MinTiogaPass.bat | 93 +

.../BasePlatformHookLib/BasePlatformHookLib.c | 389 +

.../BasePlatformHookLib.inf | 36 +

.../BoardAcpiLib/DxeBoardAcpiTableLib.c | 36 +

.../BoardAcpiLib/DxeBoardAcpiTableLib.inf | 40 +

.../BoardAcpiLib/DxeTiogaPassAcpiTableLib.c | 53 +

.../BoardAcpiLib/SmmBoardAcpiEnableLib.c | 62 +

.../BoardAcpiLib/SmmBoardAcpiEnableLib.inf | 41 +

.../BoardAcpiLib/SmmSiliconAcpiEnableLib.c | 120 +

.../BoardAcpiLib/SmmTiogaPassAcpiEnableLib.c | 37 +

.../Library/BoardInitLib/AllLanesEparam.c | 44 +

.../Library/BoardInitLib/GpioTable.c | 296 +

.../Library/BoardInitLib/IioBifur.c | 70 +

.../BoardInitLib/PeiBoardInitPostMemLib.c | 46 +

.../BoardInitLib/PeiBoardInitPostMemLib.inf | 37 +

.../BoardInitLib/PeiBoardInitPreMemLib.c | 112 +

.../BoardInitLib/PeiBoardInitPreMemLib.inf | 69 +

.../Library/BoardInitLib/PeiTiogaPassDetect.c | 28 +

.../BoardInitLib/PeiTiogaPassInitLib.h | 18 +

.../BoardInitLib/PeiTiogaPassInitPostMemLib.c | 86 +

.../BoardInitLib/PeiTiogaPassInitPreMemLib.c | 638 ++

.../Library/BoardInitLib/UsbOC.c | 46 +

.../Library/PeiReportFvLib/PeiReportFvLib.c | 138 +

.../Library/PeiReportFvLib/PeiReportFvLib.inf | 51 +

.../BoardTiogaPass/OpenBoardPkg.dsc | 245 +

.../BoardTiogaPass/OpenBoardPkg.fdf | 600 ++

.../BoardTiogaPass/PlatformPkgBuildOption.dsc | 84 +

.../BoardTiogaPass/PlatformPkgConfig.dsc | 58 +

.../BoardTiogaPass/PlatformPkgPcd.dsc | 392 ++

.../BoardTiogaPass/StructureConfig.dsc | 6236 +

.../BoardTiogaPass/__init__.py | 0

.../PurleyOpenBoardPkg/BoardTiogaPass/bld.bat | 139 +

.../BoardTiogaPass/build_board.py | 195 +

.../BoardTiogaPass/build_config.cfg | 34 +

.../BoardTiogaPass/logo.txt | 10 +

.../BoardTiogaPass/postbuild.bat | 96 +

.../BoardTiogaPass/prebuild.bat | 213 +

.../Ipmi/Library/IpmiLibKcs/IpmiLibKcs.inf | 10 +-

.../IpmiPlatformHookLib.inf | 6 +-

.../Include/Guid/PchRcVariable.h | 6 +

.../Include/Guid/SetupVariable.h | 15 +-

.../Intel/PurleyOpenBoardPkg/OpenBoardPkg.dec | 1 +

.../Bus/Pci/PciBusDxe/ComponentName.c | 170 +

.../Bus/Pci/PciBusDxe/ComponentName.h | 146 +

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 460 ++

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h | 396 ++

.../Bus/Pci/PciBusDxe/PciBusDxe.inf | 112 +

.../Bus/Pci/PciBusDxe/PciBusDxe.uni | 16 +

.../Bus/Pci/PciBusDxe/PciBusDxeExtra.uni | 14 +

.../Bus/Pci/PciBusDxe/PciCommand.c | 267 +

.../Bus/Pci/PciBusDxe/PciCommand.h | 232 +

.../Bus/Pci/PciBusDxe/PciDeviceSupport.c | 1056 +++

.../Bus/Pci/PciBusDxe/PciDeviceSupport.h | 266 +

.../Bus/Pci/PciBusDxe/PciDriverOverride.c | 188 +

.../Bus/Pci/PciBusDxe/PciDriverOverride.h | 83 +

.../Bus/Pci/PciBusDxe/PciEnumerator.c | 2210 ++

.../Bus/Pci/PciBusDxe/PciEnumerator.h | 515 ++

.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 2885 
.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.h | 480 ++

.../Bus/Pci/PciBusDxe/PciHotPlugSupport.c | 484 ++

.../Bus/Pci/PciBusDxe/PciHotPlugSupport.h | 205 +

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 2087 ++

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.h | 660 ++

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 1809 +

.../MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.h | 179 +

.../Bus/Pci/PciBusDxe/PciOptionRomSupport.c | 776 ++

.../Bus/Pci/PciBusDxe/PciOptionRomSupport.h | 136 +

.../Bus/Pci/PciBusDxe/PciPowerManagement.c | 82 +

.../Bus/Pci/PciBusDxe/PciPowerManagement.h | 28 +

.../Bus/Pci/PciBusDxe/PciResourceSupport.c | 2292 ++

.../Bus/Pci/PciBusDxe/PciResourceSupport.h | 456 ++

.../Bus/Pci/PciBusDxe/PciRomTable.c | 135 +

.../Bus/Pci/PciBusDxe/PciRomTable.h | 48 +

Platform/Intel/build.cfg | 2 +

Platform/Intel/build_bios.py | 3 +-

80 files changed, 30278 insertions(+), 240 deletions(-) create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreDxeInclude.dsc

create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/CoreUefiBootInclude.fdf

create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/GitEdk2MinTiogaPass.bat

create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BasePlatformHookLib/BasePlatformHookLib.c

create mode 100644 
Platform/Intel/PurleyOpenBoardPkg/BoardTiogaPass/Library/BasePlatformHookLib/BasePlatformHookLib.inf

create mode 100644 

Re: [edk2-devel] SIMPLE_TEXT_OUTPUT_PROTOCOL and Video Resolution

2021-06-16 Thread Andrew Fish via groups.io


> On Jun 16, 2021, at 2:45 PM, David F.  wrote:
> 
> Also, I found if there are 2 GOP handles and you change the mode of
> one, the other one doesn't reflect the change (but still doesn't solve
> anything with the original question), are you supposed to set the mode
> on every handle to keep that part in sync?
> 

A common implementation is to have the Conspliter [1] driver that produces 
virtual handles that aggregate how many actual devices you have and manages 
policy. 

You should grab the protocols on the gST->ConsoleOutHandle as these are the 
Spec defined active console devices. 


In terms on Simple Text Output Protocol on Graphics this is the default driver 
in edk2 [2]. These are the config knobs you can set from your DSC file to 
control defaults. 

[Pcd]
  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## 
SOMETIMES_CONSUMES
  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution   ## 
SOMETIMES_CONSUMES
  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## 
SOMETIMES_CONSUMES
  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn  ## 
SOMETIMES_CONSUMES
Note: If you have serial active that may mess with the Conspliter and force it 
to pick a lower resolution since it has to find the best match between the 
serial and graphics Simple Text In. So try the Graphics without the serial 
terminal connect to see if it does different stuff. 


[1] 
https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Universal/Console/ConSplitterDxe
 


[2] 
https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Universal/Console/GraphicsConsoleDxe
 



Thanks,

Andrew Fish

> On Tue, Jun 15, 2021 at 11:33 PM David F. via groups.io
>  wrote:
>> 
>> Hello,
>> 
>> I've found that most implementation of UEFI don't automatically change
>> the resolution when setting the mode with STOP (Simple Text Output
>> Protocol) .  You can use GOP to change it after the mode but that
>> causes other problems.  For example, using surface pro 7 in this case,
>> with 4K screen.  The default text mode is 342x96 which puts it in
>> 2736x1824 mode which you'd expect and the text is tiny.  But now you
>> set the mode to 0 which is 80x25 and it actually sets the mode to
>> 2736x1824 if not already in that resolution and uses a 80x25 area in
>> the center of the screen, still tiny text you can hardly read.  If you
>> then say you want GOP in 640x480 mode (which is available as GOP mode
>> 1 on this system, it will make the font larger but you can't see
>> anything because it's still offset to the middle of the 2736x1824 area
>> and you're only seeing the 640x480 upper left of that area on the
>> screen.   Likewise if you have it in 342x96 so it's fully in the upper
>> left corner of the screen and change the mode to say 800x600
>> (available as GOP mode 2 on this system) it will make the text
>> readable but the text can go off the screen in both directions because
>> it's still 342x96 when the 100x31 STOP mode would be the correct one
>> (which happens to be mode 2 on this system).
>> 
>> Shouldn't setting the STOP mode handle adjusting the resolution since
>> that's the main reason you want to change the mode so the size shown
>> on the screen changes to something you can read.
>> 
>> Any tricks? I've tried a bunch of things, resetting the controller,
>> using the Reset() protocol function, and other things but nothing
>> works.  As soon as you use STOP to set the mode, it is back to high
>> resolution and using an area centered in the screen and changing the
>> resolution after that leaves it in the area centered in the high res
>> screen and not in the upper left area.
>> 
>> Thanks.
>> 
> 
> 
> 
> 
> 



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




[edk2-devel] [PATCH v2 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy

2021-06-16 Thread Kenneth Lautner
From: Ken Lautner 

Changed BdsEntry.c to use Variable Policy instead of Variable Lock
as Variable Lock will be Deprecated eventually

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Zhichao Gao 
Cc: Ray Ni 
Cc: Liming Gao 
Signed-off-by: Kenneth Lautner 

Reviewed-by Liming Gao 
---
 MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  4 +++-
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20 +++-
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf 
b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
index 9310b4dccb18..76ff6a0f5fc3 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -50,6 +50,8 @@
   BaseMemoryLib
   DebugLib
   UefiBootManagerLib
+  VariablePolicyLib
+  VariablePolicyHelperLib
   PlatformBootManagerLib
   PcdLib
   PrintLib
@@ -77,7 +79,7 @@
 [Protocols]
   gEfiBdsArchProtocolGuid   ## PRODUCES
   gEfiSimpleTextInputExProtocolGuid ## CONSUMES
-  gEdkiiVariableLockProtocolGuid## SOMETIMES_CONSUMES
+  gEdkiiVariablePolicyProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiDeferredImageLoadProtocolGuid ## CONSUMES
 
 [FeaturePcd]
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c 
b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 83b773a2fa5f..13c10bdc5bf8 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include "Bds.h"
 #include "Language.h"
 #include "HwErrRecSupport.h"
+#include 
 
 #define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) {  \
   (a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << LowBitSet32 
(EFI_BOOT_OPTION_SUPPORT_COUNT)) & EFI_BOOT_OPTION_SUPPORT_COUNT); \
@@ -670,7 +671,7 @@ BdsEntry (
   EFI_STATUS  Status;
   UINT32  BootOptionSupport;
   UINT16  BootTimeOut;
-  EDKII_VARIABLE_LOCK_PROTOCOL*VariableLock;
+  EDKII_VARIABLE_POLICY_PROTOCOL  *VariablePolicy;
   UINTN   Index;
   EFI_BOOT_MANAGER_LOAD_OPTIONLoadOption;
   UINT16  *BootNext;
@@ -716,12 +717,21 @@ BdsEntry (
   //
   // Mark the read-only variables if the Variable Lock protocol exists
   //
-  Status = gBS->LocateProtocol (, NULL, (VOID 
**) );
-  DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n", 
Status));
+  Status = gBS->LocateProtocol(, NULL, 
(VOID**));
+  DEBUG((DEBUG_INFO, "[BdsDxe] Locate Variable Policy protocol - %r\n", 
Status));
   if (!EFI_ERROR (Status)) {
 for (Index = 0; Index < ARRAY_SIZE (mReadOnlyVariables); Index++) {
-  Status = VariableLock->RequestToLock (VariableLock, 
mReadOnlyVariables[Index], );
-  ASSERT_EFI_ERROR (Status);
+  Status = RegisterBasicVariablePolicy(
+ VariablePolicy,
+ ,
+ mReadOnlyVariables[Index],
+ VARIABLE_POLICY_NO_MIN_SIZE,
+ VARIABLE_POLICY_NO_MAX_SIZE,
+ VARIABLE_POLICY_NO_MUST_ATTR,
+ VARIABLE_POLICY_NO_CANT_ATTR,
+ VARIABLE_POLICY_TYPE_LOCK_NOW
+ );
+  ASSERT_EFI_ERROR(Status);
 }
   }
 
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76611): https://edk2.groups.io/g/devel/message/76611
Mute This Topic: https://groups.io/mt/83592723/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] MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy

2021-06-16 Thread Kenneth Lautner
This needs more editorial changes so disregard for now and I'll resend it
when it's better.  Sorry about that.

On Wed, Jun 16, 2021 at 10:35 AM Kenneth Lautner via groups.io  wrote:

> From: Ken Lautner 
>
> Changed BdsEntry.c to use Variable Policy instead of Variable Lock
> as Variable Lock will be Deprecated eventually
>
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Zhichao Gao 
> Cc: Ray Ni 
> Signed-off-by: Kenneth Lautner 
>
> Fixed Library References
>
> Quick revert
>
> MdeModulePkg/BdsDxe: Fixed Library References
>
> Fixed incorrect library reference in BdsEntry.c
>
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Zhichao Gao 
> Cc: Ray Ni 
> Cc: Liming Gao 
> Signed-off-by: Kenneth Lautner 
> ---
>  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  4 +++-
>  MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20 +++-
>  2 files changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> index 9310b4dccb18..76ff6a0f5fc3 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> @@ -50,6 +50,8 @@
>BaseMemoryLib
>DebugLib
>UefiBootManagerLib
> +  VariablePolicyLib
> +  VariablePolicyHelperLib
>PlatformBootManagerLib
>PcdLib
>PrintLib
> @@ -77,7 +79,7 @@
>  [Protocols]
>gEfiBdsArchProtocolGuid   ## PRODUCES
>gEfiSimpleTextInputExProtocolGuid ## CONSUMES
> -  gEdkiiVariableLockProtocolGuid## SOMETIMES_CONSUMES
> +  gEdkiiVariablePolicyProtocolGuid  ## SOMETIMES_CONSUMES
>gEfiDeferredImageLoadProtocolGuid ## CONSUMES
>
>  [FeaturePcd]
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> index 83b773a2fa5f..13c10bdc5bf8 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> @@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include "Bds.h"
>  #include "Language.h"
>  #include "HwErrRecSupport.h"
> +#include 
>
>  #define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) {  \
>(a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << LowBitSet32
> (EFI_BOOT_OPTION_SUPPORT_COUNT)) & EFI_BOOT_OPTION_SUPPORT_COUNT); \
> @@ -670,7 +671,7 @@ BdsEntry (
>EFI_STATUS  Status;
>UINT32  BootOptionSupport;
>UINT16  BootTimeOut;
> -  EDKII_VARIABLE_LOCK_PROTOCOL*VariableLock;
> +  EDKII_VARIABLE_POLICY_PROTOCOL  *VariablePolicy;
>UINTN   Index;
>EFI_BOOT_MANAGER_LOAD_OPTIONLoadOption;
>UINT16  *BootNext;
> @@ -716,12 +717,21 @@ BdsEntry (
>//
>// Mark the read-only variables if the Variable Lock protocol exists
>//
> -  Status = gBS->LocateProtocol (, NULL,
> (VOID **) );
> -  DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n",
> Status));
> +  Status = gBS->LocateProtocol(, NULL,
> (VOID**));
> +  DEBUG((DEBUG_INFO, "[BdsDxe] Locate Variable Policy protocol - %r\n",
> Status));
>if (!EFI_ERROR (Status)) {
>  for (Index = 0; Index < ARRAY_SIZE (mReadOnlyVariables); Index++) {
> -  Status = VariableLock->RequestToLock (VariableLock,
> mReadOnlyVariables[Index], );
> -  ASSERT_EFI_ERROR (Status);
> +  Status = RegisterBasicVariablePolicy(
> + VariablePolicy,
> + ,
> + mReadOnlyVariables[Index],
> + VARIABLE_POLICY_NO_MIN_SIZE,
> + VARIABLE_POLICY_NO_MAX_SIZE,
> + VARIABLE_POLICY_NO_MUST_ATTR,
> + VARIABLE_POLICY_NO_CANT_ATTR,
> + VARIABLE_POLICY_TYPE_LOCK_NOW
> + );
> +  ASSERT_EFI_ERROR(Status);
>  }
>}
>
> --
> 2.31.1.windows.1
>
>
>
> 
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#76602): https://edk2.groups.io/g/devel/message/76602
> Mute This Topic: https://groups.io/mt/83586104/6193780
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [kenlautn...@gmail.com]
> 
>
>
>


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




Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: clean up TPM_ENABLE remnants

2021-06-16 Thread Michael D Kinney
Hi Ard,

I was not merged into edk2/master.

PatchCheck failed due to the merge commit in the submitted PR.

You will just need to resubmit the PR without the merge commit and rebased 
against latest edk2/master, and it will then be able to go through.

Mike

> -Original Message-
> From: Ard Biesheuvel 
> Sent: Wednesday, June 16, 2021 2:55 PM
> To: Sean Brogan 
> Cc: Kinney, Michael D ; Peter Grehan 
> ; Laszlo Ersek ;
> Ard Biesheuvel ; Justen, Jordan L 
> ; Sean Brogan
> ; Rebecca Cran ; 
> edk2-devel-groups-io 
> Subject: Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: clean up TPM_ENABLE remnants
> 
> On Wed, 16 Jun 2021 at 21:00, Sean Brogan  wrote:
> >
> > Ard,
> >
> > The PR you are trying to "push" has a mergify merge in it which is
> > causing patchcheck to fail.
> >
> > https://github.com/tianocore/edk2/pull/1727/commits
> >
> 
> Ah, I missed that. So the base of my branch was out of date, and the
> merge was done automatically, right? I think we still want linear
> history in EDK2, so this should probably be rejected before even
> reaching the point where the tools perform the merge by themselves.
> 
> >
> >
> > Mike,
> >
> > I think github has better features now around things like auto complete
> > PR when "checks pass" and allow rebase merging and finally protections
> > to only allow linear history.  Might be time to talk about changes to
> > mergify/github.  I know you are busy so maybe opening up to more of the
> > edk2 community or actively looking for someone willing to provide best
> > practices for github usage (rust-lang and nodejs both do a lot with
> > github).
> >
> >
> > Thanks
> > Sean
> >
> >
> >
> >
> >
> > On 6/16/2021 8:58 AM, Ard Biesheuvel wrote:
> > > (+ Sean, Mike)
> > >
> > > On Sat, 12 Jun 2021 at 22:43, Rebecca Cran  wrote:
> > >>
> > >> TPM support hasn't been tested and any lines in the .dsc and .fdf files
> > >> that appear to show support are bogus. Remove them.
> > >>
> > >> This fixes https://bugzilla.tianocore.org/show_bug.cgi?id=3354 .
> > >>
> > >> Signed-off-by: Rebecca Cran 
> > >
> > > Strangely enough, this patch gets rejected by PatchCheck for lack of a
> > > Signed-off-by line
> > >
> > > https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=24198=results
> > >
> > > The patch itself looks good to me
> > >
> > > Acked-by: Ard Biesheuvel 
> > >
> > > so if anyone else manages to fix the CI issue, feel free to push the
> > > patch with my R-b (and Peter's, given in reply to this message)
> > >
> > > (I will go offline for 3 weeks after Friday)
> > >
> > >> ---
> > >>   OvmfPkg/Bhyve/BhyveX64.dsc | 64 
> > >>   OvmfPkg/Bhyve/BhyveX64.fdf | 15 -
> > >>   2 files changed, 79 deletions(-)
> > >>
> > >> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> > >> index d8792812ab..cbf896e89b 100644
> > >> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> > >> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> > >> @@ -31,8 +31,6 @@
> > >> DEFINE SECURE_BOOT_ENABLE  = FALSE
> > >> DEFINE SMM_REQUIRE = FALSE
> > >> DEFINE SOURCE_DEBUG_ENABLE = FALSE
> > >> -  DEFINE TPM_ENABLE  = FALSE
> > >> -  DEFINE TPM_CONFIG_ENABLE   = FALSE
> > >>
> > >> #
> > >> # Network definition
> > >> @@ -221,16 +219,8 @@
> > >> 
> > >> OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
> > >> XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
> > >>
> > >> -
> > >> -!if $(TPM_ENABLE) == TRUE
> > >> -  Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
> > >> -  
> > >> Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
> > >> -  
> > >> Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf
> > >> -  
> > >> TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
> > >> -!else
> > >> 
> > >> Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf
> > >> 
> > >> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
> > >> -!endif
> > >>
> > >>   [LibraryClasses.common]
> > >> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> > >> @@ -292,11 +282,6 @@
> > >> 
> > >> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
> > >> PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
> > >>
> > >> -!if $(TPM_ENABLE) == TRUE
> > >> -  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> > >> -  
> > >> Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf
> > >> -!endif
> > >> -
> > >> 
> > >> MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
> > >>
> > >>   [LibraryClasses.common.DXE_CORE]
> > >> @@ -366,9 +351,6 @@
> > >>   !endif
> > >> PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
> > >> 

Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: clean up TPM_ENABLE remnants

2021-06-16 Thread Ard Biesheuvel
On Wed, 16 Jun 2021 at 21:00, Sean Brogan  wrote:
>
> Ard,
>
> The PR you are trying to "push" has a mergify merge in it which is
> causing patchcheck to fail.
>
> https://github.com/tianocore/edk2/pull/1727/commits
>

Ah, I missed that. So the base of my branch was out of date, and the
merge was done automatically, right? I think we still want linear
history in EDK2, so this should probably be rejected before even
reaching the point where the tools perform the merge by themselves.

>
>
> Mike,
>
> I think github has better features now around things like auto complete
> PR when "checks pass" and allow rebase merging and finally protections
> to only allow linear history.  Might be time to talk about changes to
> mergify/github.  I know you are busy so maybe opening up to more of the
> edk2 community or actively looking for someone willing to provide best
> practices for github usage (rust-lang and nodejs both do a lot with
> github).
>
>
> Thanks
> Sean
>
>
>
>
>
> On 6/16/2021 8:58 AM, Ard Biesheuvel wrote:
> > (+ Sean, Mike)
> >
> > On Sat, 12 Jun 2021 at 22:43, Rebecca Cran  wrote:
> >>
> >> TPM support hasn't been tested and any lines in the .dsc and .fdf files
> >> that appear to show support are bogus. Remove them.
> >>
> >> This fixes https://bugzilla.tianocore.org/show_bug.cgi?id=3354 .
> >>
> >> Signed-off-by: Rebecca Cran 
> >
> > Strangely enough, this patch gets rejected by PatchCheck for lack of a
> > Signed-off-by line
> >
> > https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=24198=results
> >
> > The patch itself looks good to me
> >
> > Acked-by: Ard Biesheuvel 
> >
> > so if anyone else manages to fix the CI issue, feel free to push the
> > patch with my R-b (and Peter's, given in reply to this message)
> >
> > (I will go offline for 3 weeks after Friday)
> >
> >> ---
> >>   OvmfPkg/Bhyve/BhyveX64.dsc | 64 
> >>   OvmfPkg/Bhyve/BhyveX64.fdf | 15 -
> >>   2 files changed, 79 deletions(-)
> >>
> >> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> >> index d8792812ab..cbf896e89b 100644
> >> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> >> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> >> @@ -31,8 +31,6 @@
> >> DEFINE SECURE_BOOT_ENABLE  = FALSE
> >> DEFINE SMM_REQUIRE = FALSE
> >> DEFINE SOURCE_DEBUG_ENABLE = FALSE
> >> -  DEFINE TPM_ENABLE  = FALSE
> >> -  DEFINE TPM_CONFIG_ENABLE   = FALSE
> >>
> >> #
> >> # Network definition
> >> @@ -221,16 +219,8 @@
> >> 
> >> OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
> >> XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
> >>
> >> -
> >> -!if $(TPM_ENABLE) == TRUE
> >> -  Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
> >> -  
> >> Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
> >> -  
> >> Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf
> >> -  
> >> TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
> >> -!else
> >> 
> >> Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf
> >> 
> >> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
> >> -!endif
> >>
> >>   [LibraryClasses.common]
> >> BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> >> @@ -292,11 +282,6 @@
> >> 
> >> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
> >> PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
> >>
> >> -!if $(TPM_ENABLE) == TRUE
> >> -  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> >> -  
> >> Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf
> >> -!endif
> >> -
> >> 
> >> MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
> >>
> >>   [LibraryClasses.common.DXE_CORE]
> >> @@ -366,9 +351,6 @@
> >>   !endif
> >> PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
> >> MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf
> >> -!if $(TPM_ENABLE) == TRUE
> >> -  
> >> Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf
> >> -!endif
> >>
> >>   [LibraryClasses.common.UEFI_APPLICATION]
> >> PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> >> @@ -563,22 +545,12 @@
> >>
> >> gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00
> >>
> >> -!if $(TPM_ENABLE) == TRUE
> >> -  gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 
> >> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
> >> 0x00}
> >> -!endif
> >> -
> >> # MdeModulePkg resolution sets up the system display resolution
> >> gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|0
> >> gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|0
> >> 

Re: [edk2-devel] SIMPLE_TEXT_OUTPUT_PROTOCOL and Video Resolution

2021-06-16 Thread David F.
Also, I found if there are 2 GOP handles and you change the mode of
one, the other one doesn't reflect the change (but still doesn't solve
anything with the original question), are you supposed to set the mode
on every handle to keep that part in sync?

On Tue, Jun 15, 2021 at 11:33 PM David F. via groups.io
 wrote:
>
> Hello,
>
> I've found that most implementation of UEFI don't automatically change
> the resolution when setting the mode with STOP (Simple Text Output
> Protocol) .  You can use GOP to change it after the mode but that
> causes other problems.  For example, using surface pro 7 in this case,
> with 4K screen.  The default text mode is 342x96 which puts it in
> 2736x1824 mode which you'd expect and the text is tiny.  But now you
> set the mode to 0 which is 80x25 and it actually sets the mode to
> 2736x1824 if not already in that resolution and uses a 80x25 area in
> the center of the screen, still tiny text you can hardly read.  If you
> then say you want GOP in 640x480 mode (which is available as GOP mode
> 1 on this system, it will make the font larger but you can't see
> anything because it's still offset to the middle of the 2736x1824 area
> and you're only seeing the 640x480 upper left of that area on the
> screen.   Likewise if you have it in 342x96 so it's fully in the upper
> left corner of the screen and change the mode to say 800x600
> (available as GOP mode 2 on this system) it will make the text
> readable but the text can go off the screen in both directions because
> it's still 342x96 when the 100x31 STOP mode would be the correct one
> (which happens to be mode 2 on this system).
>
> Shouldn't setting the STOP mode handle adjusting the resolution since
> that's the main reason you want to change the mode so the size shown
> on the screen changes to something you can read.
>
> Any tricks? I've tried a bunch of things, resetting the controller,
> using the Reset() protocol function, and other things but nothing
> works.  As soon as you use STOP to set the mode, it is back to high
> resolution and using an area centered in the screen and changing the
> resolution after that leaves it in the area centered in the high res
> screen and not in the upper left area.
>
> Thanks.
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76607): https://edk2.groups.io/g/devel/message/76607
Mute This Topic: https://groups.io/mt/83575008/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] Azurepipeline: SpellCheck: Enforce Node dependency to use version 14.x

2021-06-16 Thread Kun Qin

Hi pipeline maintainers,

Could you please help reviewing this specific patch?

Thanks to Ard, the other patches in this series are already reviewed and 
merged.


Regards,
Kun

On 06/14/2021 11:34, Kun Qin via groups.io wrote:

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

Per update from Cspell tool, the minimal requirement of Cspell 5.x
regarding Node is 12 and above. This has caused multple Cspell failures
during CI build validation:
"Failed to process "**.c" TypeError: text.matchAll(...) is not a function
or its return value is not iterable"

This change updates the lowest required node version to 14.x to support
Cspell functionalities.

Cc: Sean Brogan 
Cc: Bret Barkelew 
Cc: Michael D Kinney 
Cc: Liming Gao 

Signed-off-by: Kun Qin 
Reviewed-by: Ard Biesheuvel 
---

Notes:
 v2:
 - Added reviewed-by tag [Ard]

  .azurepipelines/templates/spell-check-prereq-steps.yml | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.azurepipelines/templates/spell-check-prereq-steps.yml 
b/.azurepipelines/templates/spell-check-prereq-steps.yml
index e1570d4f2aac..98ee3cfa6bc6 100644
--- a/.azurepipelines/templates/spell-check-prereq-steps.yml
+++ b/.azurepipelines/templates/spell-check-prereq-steps.yml
@@ -13,7 +13,7 @@ parameters:
  steps:
  - task: NodeTool@0
inputs:
-versionSpec: '10.x'
+versionSpec: '14.x'
  #checkLatest: false # Optional
condition: and(gt(variables.pkg_count, 0), succeeded())
  




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76606): https://edk2.groups.io/g/devel/message/76606
Mute This Topic: https://groups.io/mt/83590720/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 0/5] EDK2 Code First: PI Specification: Update EFI_MM_COMMUNICATE_HEADER

2021-06-16 Thread Kun Qin

Hi Marvin,

Thanks for reaching out. Please see my comment inline.

Regards,
Kun

On 06/16/2021 00:02, Marvin Häuser wrote:

Good day,

May I ask about two small things?

1) Was there any rationale as to e.g. code compatibility with choosing 
UINT64 for the data length? I understand that this is the maximum of the 
two as of currently, but I wonder whether a message length that exceeds 
the UINT32 range (4 GB!) can possibly be considered sane or a good idea.
I agree that >4GB communication buffer may not be practical as of today. 
That is why we modified the SMM communication routine in PiSmmIpl to use 
SafeInt functions in Patch 2 of this series. With that change, at least 
for 32bit MM, larger than 4GB will be considered insane. But in the 
meantime, I do not want to rule out the >4GB communication capability 
that a 64bit MM currently already have.


Please let me know if I missed anything in regards to adding SafeInt 
functions to SmmCommunication routine.


2) Is it feasible yet with the current set of supported compilers to 
support flexible arrays?
My impression is that flexible arrays are already supported (as seen in 
UnitTestFrameworkPkg/PrivateInclude/UnitTestFrameworkTypes.h). Please 
correct me if I am wrong.


Would you mind letting me know why this is applicable here? We are 
trying to seek ideas on how to catch developer mistakes caused by this 
change. So any input is appreciated.


Thank you for your work!

Best regards,
Marvin

On 10.06.21 03:42, Kun Qin wrote:

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

In PI Spec v1.7 Errata A, Vol.4, Sec 5.7 MM Communication Protocol, the
MessageLength field of EFI_MM_COMMUNICATE_HEADER (also derived as
EFI_SMM_COMMUNICATE_HEADER) is currently defined as type UINTN.

But this structure, as a generic definition, could be used for both PEI
and DXE MM communication. Thus for a system that supports PEI MM launch,
but operates PEI in 32bit mode and MM foundation in 64bit, the current
EFI_MM_COMMUNICATE_HEADER definition will cause structure parse error due
to UINTN being used.

The suggested change is to make the MessageLength field defined with
definitive size as below:
```
typedef struct {
EFI_GUID  HeaderGuid;
UINT64    MessageLength;
UINT8 Data[ANYSIZE_ARRAY];
} EFI_MM_COMMUNICATE_HEADER;
```

Patch v1 branch: 
https://github.com/kuqin12/edk2/tree/BZ3398-MmCommunicate-Length


Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Andrew Fish 
Cc: Laszlo Ersek 
Cc: Leif Lindholm 

Kun Qin (5):
   EDK2 Code First: PI Specification: EFI_MM_COMMUNICATE_HEADER Update
   MdeModulePkg: PiSmmIpl: Update MessageLength calculation for
 MmCommunicate
   MdeModulePkg: MemoryProfileInfo: Updated MessageLength calculation
   MdeModulePkg: SmiHandlerProfileInfo: Updated MessageLength calculation
   MdePkg: MmCommunication: Extend MessageLength field size to UINT64

  
MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c 
| 20 +++--
  
MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c 
|  8 +-
  
MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c 
| 13 ++-
  
BZ3430-SpecChange.md   
| 88 
  
MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf   
|  1 +
  
MdePkg/Include/Protocol/MmCommunication.h  
|  3 +-

  6 files changed, 124 insertions(+), 9 deletions(-)
  create mode 100644 BZ3430-SpecChange.md






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




Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: clean up TPM_ENABLE remnants

2021-06-16 Thread Sean

Ard,

The PR you are trying to "push" has a mergify merge in it which is 
causing patchcheck to fail.


https://github.com/tianocore/edk2/pull/1727/commits



Mike,

I think github has better features now around things like auto complete 
PR when "checks pass" and allow rebase merging and finally protections 
to only allow linear history.  Might be time to talk about changes to 
mergify/github.  I know you are busy so maybe opening up to more of the 
edk2 community or actively looking for someone willing to provide best 
practices for github usage (rust-lang and nodejs both do a lot with 
github).



Thanks
Sean





On 6/16/2021 8:58 AM, Ard Biesheuvel wrote:

(+ Sean, Mike)

On Sat, 12 Jun 2021 at 22:43, Rebecca Cran  wrote:


TPM support hasn't been tested and any lines in the .dsc and .fdf files
that appear to show support are bogus. Remove them.

This fixes https://bugzilla.tianocore.org/show_bug.cgi?id=3354 .

Signed-off-by: Rebecca Cran 


Strangely enough, this patch gets rejected by PatchCheck for lack of a
Signed-off-by line

https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=24198=results

The patch itself looks good to me

Acked-by: Ard Biesheuvel 

so if anyone else manages to fix the CI issue, feel free to push the
patch with my R-b (and Peter's, given in reply to this message)

(I will go offline for 3 weeks after Friday)


---
  OvmfPkg/Bhyve/BhyveX64.dsc | 64 
  OvmfPkg/Bhyve/BhyveX64.fdf | 15 -
  2 files changed, 79 deletions(-)

diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index d8792812ab..cbf896e89b 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -31,8 +31,6 @@
DEFINE SECURE_BOOT_ENABLE  = FALSE
DEFINE SMM_REQUIRE = FALSE
DEFINE SOURCE_DEBUG_ENABLE = FALSE
-  DEFINE TPM_ENABLE  = FALSE
-  DEFINE TPM_CONFIG_ENABLE   = FALSE

#
# Network definition
@@ -221,16 +219,8 @@

OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf

-
-!if $(TPM_ENABLE) == TRUE
-  Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
-  
Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
-  
Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf
-  
TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
-!else

Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf

TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
-!endif

  [LibraryClasses.common]
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -292,11 +282,6 @@

CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf

-!if $(TPM_ENABLE) == TRUE
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
-  Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf
-!endif
-

MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf

  [LibraryClasses.common.DXE_CORE]
@@ -366,9 +351,6 @@
  !endif
PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf
-!if $(TPM_ENABLE) == TRUE
-  Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf
-!endif

  [LibraryClasses.common.UEFI_APPLICATION]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
@@ -563,22 +545,12 @@

gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00

-!if $(TPM_ENABLE) == TRUE
-  gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
-!endif
-
# MdeModulePkg resolution sets up the system display resolution
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|0
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|0
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|0
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|0

-[PcdsDynamicHii]
-!if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE
-  
gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS
-  
gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x8|3|NV,BS
-!endif
-
  

  #
  # Components Section - list of all EDK II Modules needed by this Platform.
@@ -618,19 +590,6 @@
  
}

-!if $(TPM_ENABLE) == TRUE
-  OvmfPkg/Bhyve/Tcg/Tcg2Config/Tcg2ConfigPei.inf
-  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {
-
-  
HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf
-  

Re: [edk2-devel] [PATCH v1 2/8] MdePkg: IORT header update for IORT Rev E.b spec

2021-06-16 Thread Sami Mujawar

Hi All,

I realised that setting EFI_ACPI_IO_REMAPPING_TABLE_REVISION to 3 (Rev 
3) will break existing platforms as they would not be populating the 
Identifier field in the IORT nodes. This can result in the Identifier 
fileds being non-unique.


I will send out a v2 patch series that sets 
EFI_ACPI_IO_REMAPPING_TABLE_REVISION to 0.


Regards,

Sami Mujawar

On 15/06/2021 05:36 PM, Sami Mujawar via groups.io wrote:

Bugzilla: 3458 - Add support IORT Rev E.b specification updates
   (https://bugzilla.tianocore.org/show_bug.cgi?id=3458)

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

Therefore, update the IORT header file to reflect these changes.

Signed-off-by: Sami Mujawar 
---
  MdePkg/Include/IndustryStandard/IoRemappingTable.h | 67 ++--
  1 file changed, 60 insertions(+), 7 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h 
b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
index 
731217441438a00dd5ff0bedf2010598d48d6dbf..c6f3e7bc321ea7d85e576b2fe3c2889422477506
 100644
--- a/MdePkg/Include/IndustryStandard/IoRemappingTable.h
+++ b/MdePkg/Include/IndustryStandard/IoRemappingTable.h
@@ -1,12 +1,19 @@
  /** @file
-  ACPI IO Remapping Table (IORT) as specified in ARM spec DEN0049D
-
-  
http://infocenter.arm.com/help/topic/com.arm.doc.den0049d/DEN0049D_IO_Remapping_Table.pdf
+  ACPI IO Remapping Table (IORT) definitions.
  
Copyright (c) 2017, Linaro Limited. All rights reserved.

-  Copyright (c) 2018, ARM Limited. All rights reserved.
+  Copyright (c) 2018 - 2021, Arm Limited. All rights reserved.
  
SPDX-License-Identifier: BSD-2-Clause-Patent

+
+  @par Reference(s):
+  - IO Remapping Table, Platform Design Document, Revision E.b, Feb 2021
+(https://developer.arm.com/documentation/den0049/)
+
+  @par Glossary:
+  - Ref  : Reference
+  - Mem  : Memory
+  - Desc : Descriptor
  **/
  
  #ifndef IO_REMAPPING_TABLE_H_

@@ -14,7 +21,9 @@
  
  #include 
  
-#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION0x0

+#define EFI_ACPI_IO_REMAPPING_TABLE_REV0  0x0
+#define EFI_ACPI_IO_REMAPPING_TABLE_REV3  0x3
+#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION  EFI_ACPI_IO_REMAPPING_TABLE_REV3
  
  #define EFI_ACPI_IORT_TYPE_ITS_GROUP0x0

  #define EFI_ACPI_IORT_TYPE_NAMED_COMP   0x1
@@ -22,6 +31,7 @@
  #define EFI_ACPI_IORT_TYPE_SMMUv1v2 0x3
  #define EFI_ACPI_IORT_TYPE_SMMUv3   0x4
  #define EFI_ACPI_IORT_TYPE_PMCG 0x5
+#define EFI_ACPI_IORT_TYPE_RMR  0x6
  
  #define EFI_ACPI_IORT_MEM_ACCESS_PROP_CCA   BIT0
  
@@ -55,7 +65,16 @@

  #define EFI_ACPI_IORT_SMMUv3_MODEL_CAVIUM_CN99XX0x2
  
  #define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED  0x0

-#define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED0x1
+#define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTEDBIT0
+
+#define EFI_ACPI_IORT_ROOT_COMPLEX_PRI_UNSUPPORTED  0x0
+#define EFI_ACPI_IORT_ROOT_COMPLEX_PRI_SUPPORTEDBIT1
+
+#define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_FWD_UNSUPPORTED  0x0
+#define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_FWD_SUPPORTEDBIT2
+
+#define EFI_ACPI_IORT_RMR_REMAP_NOT_PERMITTED   0x0
+#define EFI_ACPI_IORT_RMR_REMAP_PERMITTED   BIT0
  
  #define EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE   BIT0
  
@@ -89,7 +108,7 @@ typedef struct {

UINT8   Type;
UINT16  Length;
UINT8   Revision;
-  UINT32  Reserved;
+  UINT32  Identifier;
UINT32  NumIdMappings;
UINT32  IdReference;
  } EFI_ACPI_6_0_IO_REMAPPING_NODE;
@@ -198,6 +217,40 @@ typedef struct {
  //EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE  OverflowInterruptMsiMapping[1];
  } EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE;
  
+///

+/// Memory Range Descriptor.
+///
+typedef struct {
+  /// Base address of Reserved Memory Range,
+  /// aligned to a page size of 64K.
+  UINT64  Base;
+
+  /// Length of the Reserved Memory range.
+  /// Must be a multiple of the page size of 64K.
+  UINT64  Length;
+
+  /// Reserved, must be zero.
+  UINT32  Reserved;
+} EFI_ACPI_6_0_IO_REMAPPING_MEM_RANGE_DESC;

[edk2-devel] [PATCH v1 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy

2021-06-16 Thread Kenneth Lautner
From: Ken Lautner 

Changed BdsEntry.c to use Variable Policy instead of Variable Lock
as Variable Lock will be Deprecated eventually

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Zhichao Gao 
Cc: Ray Ni 
Signed-off-by: Kenneth Lautner 

Fixed Library References

Quick revert

MdeModulePkg/BdsDxe: Fixed Library References

Fixed incorrect library reference in BdsEntry.c

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Zhichao Gao 
Cc: Ray Ni 
Cc: Liming Gao 
Signed-off-by: Kenneth Lautner 
---
 MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  4 +++-
 MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20 +++-
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf 
b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
index 9310b4dccb18..76ff6a0f5fc3 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -50,6 +50,8 @@
   BaseMemoryLib
   DebugLib
   UefiBootManagerLib
+  VariablePolicyLib
+  VariablePolicyHelperLib
   PlatformBootManagerLib
   PcdLib
   PrintLib
@@ -77,7 +79,7 @@
 [Protocols]
   gEfiBdsArchProtocolGuid   ## PRODUCES
   gEfiSimpleTextInputExProtocolGuid ## CONSUMES
-  gEdkiiVariableLockProtocolGuid## SOMETIMES_CONSUMES
+  gEdkiiVariablePolicyProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiDeferredImageLoadProtocolGuid ## CONSUMES
 
 [FeaturePcd]
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c 
b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 83b773a2fa5f..13c10bdc5bf8 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include "Bds.h"
 #include "Language.h"
 #include "HwErrRecSupport.h"
+#include 
 
 #define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) {  \
   (a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << LowBitSet32 
(EFI_BOOT_OPTION_SUPPORT_COUNT)) & EFI_BOOT_OPTION_SUPPORT_COUNT); \
@@ -670,7 +671,7 @@ BdsEntry (
   EFI_STATUS  Status;
   UINT32  BootOptionSupport;
   UINT16  BootTimeOut;
-  EDKII_VARIABLE_LOCK_PROTOCOL*VariableLock;
+  EDKII_VARIABLE_POLICY_PROTOCOL  *VariablePolicy;
   UINTN   Index;
   EFI_BOOT_MANAGER_LOAD_OPTIONLoadOption;
   UINT16  *BootNext;
@@ -716,12 +717,21 @@ BdsEntry (
   //
   // Mark the read-only variables if the Variable Lock protocol exists
   //
-  Status = gBS->LocateProtocol (, NULL, (VOID 
**) );
-  DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n", 
Status));
+  Status = gBS->LocateProtocol(, NULL, 
(VOID**));
+  DEBUG((DEBUG_INFO, "[BdsDxe] Locate Variable Policy protocol - %r\n", 
Status));
   if (!EFI_ERROR (Status)) {
 for (Index = 0; Index < ARRAY_SIZE (mReadOnlyVariables); Index++) {
-  Status = VariableLock->RequestToLock (VariableLock, 
mReadOnlyVariables[Index], );
-  ASSERT_EFI_ERROR (Status);
+  Status = RegisterBasicVariablePolicy(
+ VariablePolicy,
+ ,
+ mReadOnlyVariables[Index],
+ VARIABLE_POLICY_NO_MIN_SIZE,
+ VARIABLE_POLICY_NO_MAX_SIZE,
+ VARIABLE_POLICY_NO_MUST_ATTR,
+ VARIABLE_POLICY_NO_CANT_ATTR,
+ VARIABLE_POLICY_TYPE_LOCK_NOW
+ );
+  ASSERT_EFI_ERROR(Status);
 }
   }
 
-- 
2.31.1.windows.1



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




Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: clean up TPM_ENABLE remnants

2021-06-16 Thread Ard Biesheuvel
(+ Sean, Mike)

On Sat, 12 Jun 2021 at 22:43, Rebecca Cran  wrote:
>
> TPM support hasn't been tested and any lines in the .dsc and .fdf files
> that appear to show support are bogus. Remove them.
>
> This fixes https://bugzilla.tianocore.org/show_bug.cgi?id=3354 .
>
> Signed-off-by: Rebecca Cran 

Strangely enough, this patch gets rejected by PatchCheck for lack of a
Signed-off-by line

https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=24198=results

The patch itself looks good to me

Acked-by: Ard Biesheuvel 

so if anyone else manages to fix the CI issue, feel free to push the
patch with my R-b (and Peter's, given in reply to this message)

(I will go offline for 3 weeks after Friday)

> ---
>  OvmfPkg/Bhyve/BhyveX64.dsc | 64 
>  OvmfPkg/Bhyve/BhyveX64.fdf | 15 -
>  2 files changed, 79 deletions(-)
>
> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> index d8792812ab..cbf896e89b 100644
> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> @@ -31,8 +31,6 @@
>DEFINE SECURE_BOOT_ENABLE  = FALSE
>DEFINE SMM_REQUIRE = FALSE
>DEFINE SOURCE_DEBUG_ENABLE = FALSE
> -  DEFINE TPM_ENABLE  = FALSE
> -  DEFINE TPM_CONFIG_ENABLE   = FALSE
>
>#
># Network definition
> @@ -221,16 +219,8 @@
>
> OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
>XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
>
> -
> -!if $(TPM_ENABLE) == TRUE
> -  Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
> -  
> Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
> -  
> Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf
> -  
> TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
> -!else
>
> Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf
>
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
> -!endif
>
>  [LibraryClasses.common]
>BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> @@ -292,11 +282,6 @@
>
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
>PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
>
> -!if $(TPM_ENABLE) == TRUE
> -  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> -  Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf
> -!endif
> -
>
> MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
>
>  [LibraryClasses.common.DXE_CORE]
> @@ -366,9 +351,6 @@
>  !endif
>PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
>MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf
> -!if $(TPM_ENABLE) == TRUE
> -  Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf
> -!endif
>
>  [LibraryClasses.common.UEFI_APPLICATION]
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> @@ -563,22 +545,12 @@
>
>gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00
>
> -!if $(TPM_ENABLE) == TRUE
> -  gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 
> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
> -!endif
> -
># MdeModulePkg resolution sets up the system display resolution
>gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|0
>gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|0
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|0
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|0
>
> -[PcdsDynamicHii]
> -!if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE
> -  
> gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS
> -  
> gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x8|3|NV,BS
> -!endif
> -
>  
> 
>  #
>  # Components Section - list of all EDK II Modules needed by this Platform.
> @@ -618,19 +590,6 @@
>  
>}
>
> -!if $(TPM_ENABLE) == TRUE
> -  OvmfPkg/Bhyve/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> -  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {
> -
> -  
> HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf
> -  NULL|SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.inf
> -  
> NULL|SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.inf
> -  
> NULL|SecurityPkg/Library/HashInstanceLibSha384/HashInstanceLibSha384.inf
> -  
> NULL|SecurityPkg/Library/HashInstanceLibSha512/HashInstanceLibSha512.inf
> -  NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf
> -  }
> -!endif
> -
>#
># DXE Phase modules
>#
> @@ -653,9 +612,6 @@
>  
>  !if 

Re: [edk2-devel] [PATCH v2 1/4] StandaloneMmPkg: Core: Spelling error in comment

2021-06-16 Thread Ard Biesheuvel
On Mon, 14 Jun 2021 at 20:34, Kun Qin  wrote:
>
> From: Sean Brogan 
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3445
>
> This change fixed a misspelling that was not caught by spell check.
>
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Jiewen Yao 
> Cc: Supreeth Venkatesh 
> Cc: Sean Brogan 
>
> Signed-off-by: Sean Brogan 
> Signed-off-by: Kun Qin 
> Reviewed-by: Ard Biesheuvel 

Merged patches 1 - 3


Thanks,

> ---
>
> Notes:
> v2:
> - Added signed-off-by from Kun [Ard]
> - Added reviewed-by tag [Ard]
>
>  StandaloneMmPkg/Core/Dispatcher.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/StandaloneMmPkg/Core/Dispatcher.c 
> b/StandaloneMmPkg/Core/Dispatcher.c
> index dbd5332fa9d3..7e4bf5e94025 100644
> --- a/StandaloneMmPkg/Core/Dispatcher.c
> +++ b/StandaloneMmPkg/Core/Dispatcher.c
> @@ -4,7 +4,7 @@
>Step #1 - When a FV protocol is added to the system every driver in the FV
>  is added to the mDiscoveredList. The Before, and After Depex are
>  pre-processed as drivers are added to the mDiscoveredList. If an 
> Apriori
> -file exists in the FV those drivers are addeded to the
> +file exists in the FV those drivers are added to the
>  mScheduledQueue. The mFwVolList is used to make sure a
>  FV is only processed once.
>
> --
> 2.31.1.windows.1
>


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




Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: Remove Xen remnants

2021-06-16 Thread Ard Biesheuvel
On Sat, 12 Jun 2021 at 23:08, Rebecca Cran  wrote:
>
> Several Xen remnants were left over from adapting the Ovmf code for
> Bhyve. Remove them.
>
> Signed-off-by: Rebecca Cran 

Hi Rebecca,

This fails to apply. Is it perhaps conflicting with your TPM removal patch?

> ---
>  OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h |  7 ---
>  OvmfPkg/Bhyve/BhyveX64.dsc   |  1 -
>  OvmfPkg/Bhyve/PlatformPei/Platform.h | 17 -
>  3 files changed, 25 deletions(-)
>
> diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h 
> b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> index 994ee2c7cd..87c9bdafba 100644
> --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h
> @@ -18,7 +18,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>
>  typedef struct {
> @@ -46,12 +45,6 @@ BhyveInstallAcpiTable(
>OUT  UINTN *TableKey
>);
>
> -EFI_STATUS
> -EFIAPI
> -InstallXenTables (
> -  IN   EFI_ACPI_TABLE_PROTOCOL   *AcpiProtocol
> -  );
> -
>  EFI_STATUS
>  EFIAPI
>  InstallAcpiTables (
> diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
> index d8792812ab..25420d8261 100644
> --- a/OvmfPkg/Bhyve/BhyveX64.dsc
> +++ b/OvmfPkg/Bhyve/BhyveX64.dsc
> @@ -219,7 +219,6 @@
>
> S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
>SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
>
> OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
> -  XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf
>
>
>  !if $(TPM_ENABLE) == TRUE
> diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.h 
> b/OvmfPkg/Bhyve/PlatformPei/Platform.h
> index 8239ca05ac..e0327202a5 100644
> --- a/OvmfPkg/Bhyve/PlatformPei/Platform.h
> +++ b/OvmfPkg/Bhyve/PlatformPei/Platform.h
> @@ -98,28 +98,11 @@ InstallClearCacheCallback (
>VOID
>);
>
> -EFI_STATUS
> -InitializeXen (
> -  VOID
> -  );
> -
> -BOOLEAN
> -XenDetect (
> -  VOID
> -  );
> -
>  VOID
>  AmdSevInitialize (
>VOID
>);
>
> -extern BOOLEAN mXen;
> -
> -VOID
> -XenPublishRamRegions (
> -  VOID
> -  );
> -
>  extern EFI_BOOT_MODE mBootMode;
>
>  extern BOOLEAN mS3Supported;
> --
> 2.32.0
>
>


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




Re: [edk2-devel] [PATCH RESEND v1 0/2] ArmVirtPkg: Enable PCIe support for Kvmtool

2021-06-16 Thread Ard Biesheuvel
On Tue, 15 Jun 2021 at 17:21,  wrote:
>
> From: Pierre Gondois 
>
> PCIe support has been added to the Kvmtool virtual machine
> manager. Therefore, add a PciHostBridgeUtilityLib and enable
> PCIe support for Kvmtool firmware.
>
> The patches were re-send as the devel@edk2.groups.io was not included.
>
> The patches can be seen at: 
> https://github.com/PierreARM/edk2/tree/1413_Enable_ArmVirt_Pci_v1
> The results of the CI can be seen at: 
> https://github.com/tianocore/edk2/pull/1718
>
> Sami Mujawar (2):
>   ArmVirtPkg: Add PCIe host bridge utility lib for ArmVirtPkg
>   ArmVirtPkg: Enable PCIe support for Kvmtool
>

For the series,

Acked-by: Ard Biesheuvel 

>  ArmVirtPkg/ArmVirtKvmTool.dsc |  35 ++-
>  ArmVirtPkg/ArmVirtKvmTool.fdf |  11 +-
>  .../ArmVirtPciHostBridgeUtilityLib.c  | 219 ++
>  .../ArmVirtPciHostBridgeUtilityLib.inf|  39 
>  4 files changed, 301 insertions(+), 3 deletions(-)
>  create mode 100644 
> ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.c
>  create mode 100644 
> ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
>
> --
> 2.17.1
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76598): https://edk2.groups.io/g/devel/message/76598
Mute This Topic: https://groups.io/mt/83558261/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] ArmPkg: Move cache defs used in Universal/Smbios into ArmCache.h

2021-06-16 Thread Ard Biesheuvel
On Mon, 14 Jun 2021 at 20:57, Rebecca Cran  wrote:
>
> Many of the cache definitions in ArmLibPrivate.h are being used outside
> of ArmLib, in Universal/Smbios. Move them into ArmCache.h to make them
> public, and remove the include of ArmLibPrivate.h from files in
> Universal/Smbios.
>
> Signed-off-by: Rebecca Cran 

Acked-by: Ard Biesheuvel 

> ---
>  ArmPkg/Include/IndustryStandard/ArmCache.h  | 
> 112 ++
>  ArmPkg/Include/Library/ArmLib.h |  
> 36 +-
>  ArmPkg/Library/ArmLib/ArmLibPrivate.h   | 
> 123 
>  ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c|   
> 2 +-
>  ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorAArch64.c   |   
> 2 +-
>  ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm.c   |   
> 2 +-
>  ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c |   
> 2 +-
>  7 files changed, 148 insertions(+), 131 deletions(-)
>
> diff --git a/ArmPkg/Include/IndustryStandard/ArmCache.h 
> b/ArmPkg/Include/IndustryStandard/ArmCache.h
> new file mode 100644
> index ..f9de46b5bffd
> --- /dev/null
> +++ b/ArmPkg/Include/IndustryStandard/ArmCache.h
> @@ -0,0 +1,112 @@
> +/** @file
> +
> +  Copyright (c) 2020 - 2021, NUVIA Inc. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef ARM_CACHE_H_
> +#define ARM_CACHE_H_
> +
> +#include 
> +
> +// The ARM Architecture Reference Manual for ARMv8-A defines up
> +// to 7 levels of cache, L1 through L7.
> +#define MAX_ARM_CACHE_LEVEL   7
> +
> +/// Defines the structure of the CSSELR (Cache Size Selection) register
> +typedef union {
> +  struct {
> +UINT32InD   :1;  ///< Instruction not Data bit
> +UINT32Level :3;  ///< Cache level (zero based)
> +UINT32TnD   :1;  ///< Allocation not Data bit
> +UINT32Reserved  :27; ///< Reserved, RES0
> +  } Bits; ///< Bitfield definition of the register
> +  UINT32 Data; ///< The entire 32-bit value
> +} CSSELR_DATA;
> +
> +/// The cache type values for the InD field of the CSSELR register
> +typedef enum
> +{
> +  /// Select the data or unified cache
> +  CsselrCacheTypeDataOrUnified = 0,
> +  /// Select the instruction cache
> +  CsselrCacheTypeInstruction,
> +  CsselrCacheTypeMax
> +} CSSELR_CACHE_TYPE;
> +
> +/// Defines the structure of the CCSIDR (Current Cache Size ID) register
> +typedef union {
> +  struct {
> +UINT64LineSize   :3;  ///< Line size (Log2(Num bytes in 
> cache) - 4)
> +UINT64Associativity  :10; ///< Associativity - 1
> +UINT64NumSets:15; ///< Number of sets in the cache -1
> +UINT64Unknown:4;  ///< Reserved, UNKNOWN
> +UINT64Reserved   :32; ///< Reserved, RES0
> +  } BitsNonCcidx; ///< Bitfield definition of the register when FEAT_CCIDX 
> is not supported.
> +  struct {
> +UINT64LineSize   :3;  ///< Line size (Log2(Num bytes in 
> cache) - 4)
> +UINT64Associativity  :21; ///< Associativity - 1
> +UINT64Reserved1  :8;  ///< Reserved, RES0
> +UINT64NumSets:24; ///< Number of sets in the cache -1
> +UINT64Reserved2  :8;  ///< Reserved, RES0
> +  } BitsCcidxAA64; ///< Bitfield definition of the register when FEAT_IDX is 
> supported.
> +  struct {
> +UINT64LineSize   : 3;
> +UINT64Associativity  : 21;
> +UINT64Reserved   : 8;
> +UINT64Unallocated: 32;
> +  } BitsCcidxAA32;
> +  UINT64 Data; ///< The entire 64-bit value
> +} CCSIDR_DATA;
> +
> +/// Defines the structure of the AARCH32 CCSIDR2 register.
> +typedef union {
> +  struct {
> +UINT32 NumSets   :24; ///< Number of sets in the cache - 1
> +UINT32 Reserved  :8;  ///< Reserved, RES0
> +  } Bits; ///< Bitfield definition of the register
> +  UINT32 Data; ///< The entire 32-bit value
> +} CCSIDR2_DATA;
> +
> +/** Defines the structure of the CLIDR (Cache Level ID) register.
> + *
> + * The lower 32 bits are the same for both AARCH32 and AARCH64
> + * so we can use the same structure for both.
> +**/
> +typedef union {
> +  struct {
> +UINT32Ctype1   : 3; ///< Level 1 cache type
> +UINT32Ctype2   : 3; ///< Level 2 cache type
> +UINT32Ctype3   : 3; ///< Level 3 cache type
> +UINT32Ctype4   : 3; ///< Level 4 cache type
> +UINT32Ctype5   : 3; ///< Level 5 cache type
> +UINT32Ctype6   : 3; ///< Level 6 cache type
> +UINT32Ctype7   : 3; ///< Level 7 cache type
> +UINT32LoUIS: 3; ///< Level of Unification Inner Shareable
> +UINT32LoC  : 3; ///< Level of Coherency
> +UINT32LoUU : 3; ///< Level of Unification Uniprocessor
> +UINT32Icb  : 3; ///< Inner Cache Boundary
> +  } Bits; ///< Bitfield 

Re: [edk2-devel] [edk2-platforms][PATCH v2 16/32] AmpereAltraPkg: Add PciHostBridge driver

2021-06-16 Thread Ard Biesheuvel
On Tue, 15 Jun 2021 at 17:54, Nhi Pham  wrote:
>
> On 6/9/21 12:29, Ard Biesheuvel wrote:
> > On Wed, 26 May 2021 at 12:12, Nhi Pham  wrote:
> >> From: Vu Nguyen 
> >>
> >> The roles of this driver:
> >> * Consume PcieCoreLib to initialize all enable PCIe controllers.
> >> * Produce neccessary protocols like RootBridgeIo an ResourceAllocation
> >>which will be used later by PciBus.
> >>
> >> Cc: Thang Nguyen 
> >> Cc: Chuong Tran 
> >> Cc: Phong Vo 
> >> Cc: Leif Lindholm 
> >> Cc: Michael D Kinney 
> >> Cc: Ard Biesheuvel 
> >> Cc: Nate DeSimone 
> >>
> >> Signed-off-by: Vu Nguyen 
> > Why do you need a re-implementation of PciHostBridgeDxe for any of
> > this? There is very little h/w specific code there, and it is all
> > customizable using PciHostBridgeLib and PciSegmentLib (among others)
> >
> > There are a couple of examples of this in edk2-platforms - please take
> > a look at those, and if that does not give you enough wiggle room,
> > let's see if we can accommodate your needs in PciHostBridgeDxe itself.
> >
> Hi Leif, Ard,
>
> Thanks for your comments. The current implementation which has little
> deltas comparing with the standard one has been well-tested. It's a good
> idea that we need to re-implement it based on Ard's suggestion, but it
> will take time and we need to make sure that it is well-tested
> internally before getting it out.

That is reasonable.

> So, we want to keep this current
> implementation but we will start looking at working the
> re-implementation in the future.
>

I would prefer to wait for this to happen, rather than merge 4000+
lines of code which are almost identical to the original, without any
agreement on when it can be removed again.

Thanks,
Ard.


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




Re: [edk2-devel] [edk2-non-osi][PATCH 1/1] Platform/RaspberryPi: Update TF-A to v2.5

2021-06-16 Thread Ard Biesheuvel
Acked-by: Ard Biesheuvel 

Pushed as 9c509e9b00cc..e1bb27fb825b

Thanks!


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




Re: [edk2-devel] [Patch] StandaloneMmPkg: Fixed communicating from TF-A failed issue

2021-06-16 Thread Ard Biesheuvel
On Wed, 16 Jun 2021 at 07:30, Omkar Kulkarni  wrote:
>
>
> On 6/10/21 6:44 AM, Ming Huang via groups.io wrote:
> > On 6/9/21 3:10 PM, Ard Biesheuvel wrote:
> > > On Tue, 8 Jun 2021 at 16:21, Ming Huang 
> > wrote:
> > >>
> > >> TF-A: TrustedFirmware-a
> > >> SPM: Secure Partition Manager(MM)
> > >>
> > >> For AArch64, when SPM enable in TF-A, TF-A may communicate to MM
> > with
> > >> buffer address (PLAT_SPM_BUF_BASE). The address is different from
> > >> PcdMmBufferBase which use in edk2.
> > >
> > > Then why do we have PcdMmBufferBase?
> >
> > ArmPkg use this Pcd for the base address of non-secure communication
> > buffer.
> >
> > >
> > > Is it possible to set PcdMmBufferBase to the correct value?
> >
> > The secure communication may interrupt the non-secure communication. if
> > we use the same address (PcdMmBufferBase and PLAT_SPM_BUF_BASE), the
> > date in communication buffer may be corrupted.
> >
> > Best Regards,
> > Ming
>
> In case where an interrupt handler executing from EL3 makes a call into 
> StandaloneMM, the handler in EL3 makes an spm call into StandaloneMM using 
> PLAT_SPM_BUF_BASE buffer base address. This PLAT_SPM_BUF_BASE is a shared 
> buffer between EL3 and S-EL0. This is where the following check fails and 
> leads to spm call failure. So this change would help resolve this issue.
>

But is it the right fix? Why would EDK2 even be aware of how EL3 and
S-EL0 communicate with each other, and where the buffer is located?


> >
> > >
> > >> Checking address will let TF-A communicate failed to MM. So remove
> > >> below checking code:
> > >> if (NsCommBufferAddr < mNsCommBuffer.PhysicalStart) {
> > >>   return EFI_ACCESS_DENIED;
> > >> }
> > >>
> > >> Signed-off-by: Ming Huang 
> > >> ---
> > >>  StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c |
> > 4
> > >> 
> > >>  1 file changed, 4 deletions(-)
> > >>
> > >> diff --git
> > >> a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
> > >> b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
> > >> index 63fbe26642..fe98d3181d 100644
> > >> ---
> > a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
> > >> +++
> > b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
> > >> @@ -103,10 +103,6 @@ PiMmStandaloneArmTfCpuDriverEntry (
> > >>  return EFI_INVALID_PARAMETER;
> > >>}
> > >>
> > >> -  if (NsCommBufferAddr < mNsCommBuffer.PhysicalStart) {
> > >> -return EFI_ACCESS_DENIED;
> > >> -  }
> > >> -
> > >>if ((NsCommBufferAddr + sizeof (EFI_MM_COMMUNICATE_HEADER)) >=
> > >>(mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize)) {
> > >>  return EFI_INVALID_PARAMETER;
> > >> --
> > >> 2.17.1
> > >>
> >
> >
> > 
> >
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76594): https://edk2.groups.io/g/devel/message/76594
Mute This Topic: https://groups.io/mt/83396678/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] BaseTools GenFw: Keep read only alloc section as text when convert ELF

2021-06-16 Thread Bob Feng
Create a new PR. https://github.com/tianocore/edk2/pull/1725

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Bob Feng
Sent: Wednesday, June 16, 2021 6:53 PM
To: Liming Gao ; devel@edk2.groups.io
Cc: Ni, Ray 
Subject: Re: [edk2-devel] [patch v2 1/1] BaseTools GenFw: Keep read only alloc 
section as text when convert ELF

Created a PR. https://github.com/tianocore/edk2/pull/1724

-Original Message-
From: Liming Gao 
Sent: Wednesday, June 16, 2021 3:58 PM
To: devel@edk2.groups.io
Cc: gaoliming ; Feng, Bob C ; 
Ni, Ray 
Subject: [patch v2 1/1] BaseTools GenFw: Keep read only alloc section as text 
when convert ELF

From: gaoliming 

This is the fix of the regression issue at c6b872c6.
Based on ELF spec, readonly alloc section is .rodata section. It is used.
This fix is to add back original check logic for ELF section. Now, the readonly 
alloc section and execute alloc section are regarded as .text.

Signed-off-by: Liming Gao 
Cc: Bob Feng 
Cc: Ray Ni 
Reviewed-by: Bob Feng 
---
 In v2, update commit message to pass patch check.

 BaseTools/Source/C/GenFw/Elf32Convert.c | 3 ++-  
BaseTools/Source/C/GenFw/Elf64Convert.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c 
b/BaseTools/Source/C/GenFw/Elf32Convert.c
index 314f8233234d..d917a444c82d 100644
--- a/BaseTools/Source/C/GenFw/Elf32Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf32Convert.c
@@ -238,7 +238,8 @@ IsTextShdr (
   Elf_Shdr *Shdr
   )
 {
-  return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC));
+  return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC)) ||
+   ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == 
+ SHF_ALLOC));
 }
 
 STATIC
diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c 
b/BaseTools/Source/C/GenFw/Elf64Convert.c
index 8b09db7b690b..33031ec8f6e7 100644
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
@@ -246,7 +246,8 @@ IsTextShdr (
   Elf_Shdr *Shdr
   )
 {
-  return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC));
+  return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC)) ||
+   ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == 
+ SHF_ALLOC));
 }
 
 STATIC
--
2.27.0.windows.1









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




[edk2-devel] reg: Static Code Analyzer Issues

2021-06-16 Thread Sivaraman Nainar
Hello Maciej:

This is regarding the Code analyzer issue reported on the PxeBcDhcp4CallBack() 
and PxeBcDhcp6CallBack() functions of UEFIPXEBC Driver.

In both the functions the allowed event are Dhcp4RcvdOffer, Dhcp4SelectOffer, 
Dhcp4SendDiscover, Dhcp4RcvdAck. If any other event comes as input it will exit 
in beginning itself.


  if ((Dhcp4Event != Dhcp4RcvdOffer) &&

  (Dhcp4Event != Dhcp4SelectOffer) &&

  (Dhcp4Event != Dhcp4SendDiscover) &&

  (Dhcp4Event != Dhcp4RcvdAck)) {

return EFI_SUCCESS;

Later below switch case handling the default case which is not reachable. This 
is applicable for both the callback functions.

switch (Dhcp4Event) {



default:

break;

  }

I assume this code is a not reachable code and can be removed. Please feedback.

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


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




Re: [edk2-devel] [RESEND PATCH v2] BaseTools: Add support for RISCV GOT/PLT relocations

2021-06-16 Thread Pete Batard

Sunil, Daniel, thanks for the patch.

I confirm that this addresses the 0x13 and 0x14 relocation issues that I 
was seeing.


However, this patch appears to introduces new R_RISCV_PCREL_LO12_S 
relocation errors that I was not seeing previously, so I still can't 
manage to get a successful compilation.


Especially the stream of 0x13 and 0x14 relocation errors I was getting 
at 
https://github.com/pbatard/ntfs-3g/runs/2278190652?check_suite_focus=true has 
now switched to (tested on up to date Ubuntu with latest EDK2):


-
"GenFw" -e UEFI_DRIVER -o 
/usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/OUTPUT/ntfs.efi 
/usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll

GenFw: ERROR 3000: Invalid
  WriteSections64(): 
/usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll 
unsupported ELF EM_RISCV64 relocation 0x19.

GenFw: ERROR 3000: Invalid
  WriteSections64(): 
/usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll 
unsupported ELF EM_RISCV64 relocation 0x19.

GenFw: ERROR 3000: Invalid
  WriteSections64(): 
/usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll 
unsupported ELF EM_RISCV64 relocation 0x19.

GenFw: ERROR 3000: Invalid
  WriteRelocations64(): 
/usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll 
unsupported ELF EM_RISCV64 relocation 0x19.

GenFw: ERROR 3000: Invalid
  WriteRelocations64(): 
/usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll 
unsupported ELF EM_RISCV64 relocation 0x19.

GenFw: ERROR 3000: Invalid
  WriteRelocations64(): 
/usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/DEBUG/ntfs.dll 
unsupported ELF EM_RISCV64 relocation 0x19.
make: *** [GNUmakefile:553: 
/usr/src/ntfs-3g/Build/RELEASE_GCC5/RISCV64/uefi-driver/uefi_driver/OUTPUT/ntfs.efi] 
Error 2

-

So, in effect, some of the earlier relocation errors appear to have 
morphed into 0x19/R_RISCV_PCREL_LO12_S ones...


I can open a new bug for this issue if you prefer.

Regards,

/Pete

On 2021.06.15 03:26, Daniel Schaefer wrote:

Great commit message, thanks Sunil!
Maintainers, please take a look and let us know if there's any other 
concern.
This patch lets us build the RISC-V platforms using modern toolchains 
that are provided directly by the distributions, rather than building 
your own from source.


Thanks,
Daniel

*From:* Sunil V L 
*Sent:* Friday, June 11, 2021 22:08
*To:* devel@edk2.groups.io 
*Cc:* Chang, Abner (HPS SW/FW Technologist) ; 
Schaefer, Daniel ; Bob Feng 
; Liming Gao ; Yuwei 
Chen ; Heinrich Schuchardt 
*Subject:* Re: [RESEND PATCH v2] BaseTools: Add support for RISCV 
GOT/PLT relocations

Hi,
     I just edited the commit message to indicate the module and CC the
     maintainers. Could I get the feedback please?
Thanks
Sunil

On Fri, Jun 11, 2021 at 07:35:03PM +0530, Sunil V L wrote:
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096 




This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20
relocations generated by PIE enabled compiler. This also needed
changes to R_RISCV_32 and R_RISCV_64 relocations as explained in
https://github.com/riscv/riscv-gnu-toolchain/issues/905#issuecomment-846682710 




Changes in v2:
   - Addressed Daniel's comment on formatting

Testing:
1) Debian GCC 8.3.0 and booted sifive_u and QMEU virt models.
2) Debian 10.2.0 and booted QEMU virt model.
3) riscv-gnu-tool chain 9.2 and booted QEMU virt model.

Signed-off-by: Sunil V L 

Acked-by: Abner Chang 
Reviewed-by: Daniel Schaefer 
Tested-by: 

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
Cc: Heinrich Schuchardt 
---
  BaseTools/Source/C/GenFw/Elf64Convert.c | 44 +
  1 file changed, 38 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c 
b/BaseTools/Source/C/GenFw/Elf64Convert.c
index d097db8632..d684318269 100644
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
@@ -129,6 +129,8 @@ STATIC UINT32 mDebugOffset;
  STATIC UINT8   *mRiscVPass1Targ = NULL;
  STATIC Elf_Shdr    *mRiscVPass1Sym = NULL;
  STATIC Elf64_Half  mRiscVPass1SymSecIndex = 0;
+STATIC INT32   mRiscVPass1Offset;
+STATIC INT32   mRiscVPass1GotFixup;
 
  //

  // Initialization Function
@@ -479,11 +481,11 @@ WriteSectionRiscV64 (
  break;
 
    case R_RISCV_32:

-    *(UINT32 *)Targ = (UINT32)((UINT64)(*(UINT32 *)Targ) - SymShdr->sh_addr + 
mCoffSectionsOffset[Sym->st_shndx]);
+    *(UINT64 *)Targ = Sym->st_value + Rel->r_addend;
  break;
 
    case R_RISCV_64:

-    

Re: [edk2-devel] [patch v2 1/1] BaseTools GenFw: Keep read only alloc section as text when convert ELF

2021-06-16 Thread Bob Feng
Created a PR. https://github.com/tianocore/edk2/pull/1724

-Original Message-
From: Liming Gao  
Sent: Wednesday, June 16, 2021 3:58 PM
To: devel@edk2.groups.io
Cc: gaoliming ; Feng, Bob C ; 
Ni, Ray 
Subject: [patch v2 1/1] BaseTools GenFw: Keep read only alloc section as text 
when convert ELF

From: gaoliming 

This is the fix of the regression issue at c6b872c6.
Based on ELF spec, readonly alloc section is .rodata section. It is used.
This fix is to add back original check logic for ELF section. Now, the readonly 
alloc section and execute alloc section are regarded as .text.

Signed-off-by: Liming Gao 
Cc: Bob Feng 
Cc: Ray Ni 
Reviewed-by: Bob Feng 
---
 In v2, update commit message to pass patch check.

 BaseTools/Source/C/GenFw/Elf32Convert.c | 3 ++-  
BaseTools/Source/C/GenFw/Elf64Convert.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c 
b/BaseTools/Source/C/GenFw/Elf32Convert.c
index 314f8233234d..d917a444c82d 100644
--- a/BaseTools/Source/C/GenFw/Elf32Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf32Convert.c
@@ -238,7 +238,8 @@ IsTextShdr (
   Elf_Shdr *Shdr
   )
 {
-  return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC));
+  return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC)) ||
+   ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == 
+ SHF_ALLOC));
 }
 
 STATIC
diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c 
b/BaseTools/Source/C/GenFw/Elf64Convert.c
index 8b09db7b690b..33031ec8f6e7 100644
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
@@ -246,7 +246,8 @@ IsTextShdr (
   Elf_Shdr *Shdr
   )
 {
-  return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC));
+  return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC)) ||
+   ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == 
+ SHF_ALLOC));
 }
 
 STATIC
--
2.27.0.windows.1




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

2021-06-16 Thread Wu, Hao A
 -Original Message-
> From: Ni, Ray 
> Sent: Wednesday, June 16, 2021 3:15 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A 
> Subject: [PATCH 2/2] Maintainers.txt: Add reviewers for ACPI and SMBIOS
> modules
> 
> Per discussion with MdeModulePkg package maintainer, add
> Zhiguang as one of the reviewers for ACPI and SMBIOS modules.
> 
> Signed-off-by: Ray Ni 
> Cc: Hao A Wu 
> ---
>  Maintainers.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 264b47edd9..2622cd51a3 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -235,6 +235,7 @@ R: Ray Ni 
>  MdeModulePkg: ACPI modules
> 
>  F: MdeModulePkg/Include/*Acpi*.h
> 
>  F: MdeModulePkg/Universal/Acpi/
> 
> +R: Zhiguang Liu 
> 
>  R: Dandan Bi 
> 
>  R: Liming Gao 
> 
> 
> 
> @@ -388,6 +389,7 @@ R: Zhichao Gao 
> 
> 
>  MdeModulePkg: SMBIOS modules
> 
>  F: MdeModulePkg/Universal/Smbios*/
> 
> +R: Zhiguang Liu 
> 


Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu


>  R: Dandan Bi 
> 
>  R: Star Zeng 
> 
>  R: Zhichao Gao 
> 
> --
> 2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76589): https://edk2.groups.io/g/devel/message/76589
Mute This Topic: https://groups.io/mt/83575471/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] Maintainers.txt: Add Reviewers for Universal Payload definitions

2021-06-16 Thread Wu, Hao A
> -Original Message-
> From: Ni, Ray 
> Sent: Wednesday, June 16, 2021 3:15 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A 
> Subject: [PATCH 1/2] Maintainers.txt: Add Reviewers for Universal Payload
> definitions
> 
> Signed-off-by: Ray Ni 
> Cc: Hao A Wu 
> ---
>  Maintainers.txt | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index a359919fef..264b47edd9 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -227,6 +227,11 @@ W:
> https://github.com/tianocore/tianocore.github.io/wiki/MdeModulePkg
>  M: Jian J Wang 
> 
>  M: Hao A Wu 
> 
> 
> 
> +MdeModulePkg: Universal Payload definitions
> 
> +F: MdeModulePkg/Include/UniversalPayload/
> 
> +R: Zhiguang Liu 
> 
> +R: Ray Ni 


Hello Ray,

Could you help to put this new "Universal Payload definitions" reviewers 
information after the "MdeModulePkg: UEFI Variable modules" block?
Let us keep the alphabetical order in this file.

With this handled:
Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu


> 
> +
> 
>  MdeModulePkg: ACPI modules
> 
>  F: MdeModulePkg/Include/*Acpi*.h
> 
>  F: MdeModulePkg/Universal/Acpi/
> 
> --
> 2.31.1.windows.1



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




[edk2-devel] [patch v2 1/1] BaseTools GenFw: Keep read only alloc section as text when convert ELF

2021-06-16 Thread gaoliming
From: gaoliming 

This is the fix of the regression issue at c6b872c6.
Based on ELF spec, readonly alloc section is .rodata section. It is used.
This fix is to add back original check logic for ELF section. Now,
the readonly alloc section and execute alloc section are regarded as .text.

Signed-off-by: Liming Gao 
Cc: Bob Feng 
Cc: Ray Ni 
Reviewed-by: Bob Feng 
---
 In v2, update commit message to pass patch check.

 BaseTools/Source/C/GenFw/Elf32Convert.c | 3 ++-
 BaseTools/Source/C/GenFw/Elf64Convert.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c 
b/BaseTools/Source/C/GenFw/Elf32Convert.c
index 314f8233234d..d917a444c82d 100644
--- a/BaseTools/Source/C/GenFw/Elf32Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf32Convert.c
@@ -238,7 +238,8 @@ IsTextShdr (
   Elf_Shdr *Shdr
   )
 {
-  return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC));
+  return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC)) ||
+   ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == SHF_ALLOC));
 }
 
 STATIC
diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c 
b/BaseTools/Source/C/GenFw/Elf64Convert.c
index 8b09db7b690b..33031ec8f6e7 100644
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
@@ -246,7 +246,8 @@ IsTextShdr (
   Elf_Shdr *Shdr
   )
 {
-  return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC));
+  return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC)) ||
+   ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == SHF_ALLOC));
 }
 
 STATIC
-- 
2.27.0.windows.1




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




[edk2-devel] [PATCH 0/2] Add reviewers for MdeModulePkg

2021-06-16 Thread Ni, Ray
Ray Ni (2):
  Maintainers.txt: Add Reviewers for Universal Payload definitions
  Maintainers.txt: Add reviewers for ACPI and SMBIOS modules

 Maintainers.txt | 7 +++
 1 file changed, 7 insertions(+)

-- 
2.31.1.windows.1



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




[edk2-devel] [PATCH 2/2] Maintainers.txt: Add reviewers for ACPI and SMBIOS modules

2021-06-16 Thread Ni, Ray
Per discussion with MdeModulePkg package maintainer, add
Zhiguang as one of the reviewers for ACPI and SMBIOS modules.

Signed-off-by: Ray Ni 
Cc: Hao A Wu 
---
 Maintainers.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 264b47edd9..2622cd51a3 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -235,6 +235,7 @@ R: Ray Ni 
 MdeModulePkg: ACPI modules
 F: MdeModulePkg/Include/*Acpi*.h
 F: MdeModulePkg/Universal/Acpi/
+R: Zhiguang Liu 
 R: Dandan Bi 
 R: Liming Gao 
 
@@ -388,6 +389,7 @@ R: Zhichao Gao 
 
 MdeModulePkg: SMBIOS modules
 F: MdeModulePkg/Universal/Smbios*/
+R: Zhiguang Liu 
 R: Dandan Bi 
 R: Star Zeng 
 R: Zhichao Gao 
-- 
2.31.1.windows.1



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




[edk2-devel] [PATCH 1/2] Maintainers.txt: Add Reviewers for Universal Payload definitions

2021-06-16 Thread Ni, Ray
Signed-off-by: Ray Ni 
Cc: Hao A Wu 
---
 Maintainers.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index a359919fef..264b47edd9 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -227,6 +227,11 @@ W: 
https://github.com/tianocore/tianocore.github.io/wiki/MdeModulePkg
 M: Jian J Wang 
 M: Hao A Wu 
 
+MdeModulePkg: Universal Payload definitions
+F: MdeModulePkg/Include/UniversalPayload/
+R: Zhiguang Liu 
+R: Ray Ni 
+
 MdeModulePkg: ACPI modules
 F: MdeModulePkg/Include/*Acpi*.h
 F: MdeModulePkg/Universal/Acpi/
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76584): https://edk2.groups.io/g/devel/message/76584
Mute This Topic: https://groups.io/mt/83575469/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 0/5] EDK2 Code First: PI Specification: Update EFI_MM_COMMUNICATE_HEADER

2021-06-16 Thread Marvin Häuser

Good day,

May I ask about two small things?

1) Was there any rationale as to e.g. code compatibility with choosing 
UINT64 for the data length? I understand that this is the maximum of the 
two as of currently, but I wonder whether a message length that exceeds 
the UINT32 range (4 GB!) can possibly be considered sane or a good idea.


2) Is it feasible yet with the current set of supported compilers to 
support flexible arrays?


Thank you for your work!

Best regards,
Marvin

On 10.06.21 03:42, Kun Qin wrote:

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

In PI Spec v1.7 Errata A, Vol.4, Sec 5.7 MM Communication Protocol, the
MessageLength field of EFI_MM_COMMUNICATE_HEADER (also derived as
EFI_SMM_COMMUNICATE_HEADER) is currently defined as type UINTN.

But this structure, as a generic definition, could be used for both PEI
and DXE MM communication. Thus for a system that supports PEI MM launch,
but operates PEI in 32bit mode and MM foundation in 64bit, the current
EFI_MM_COMMUNICATE_HEADER definition will cause structure parse error due
to UINTN being used.

The suggested change is to make the MessageLength field defined with
definitive size as below:
```
typedef struct {
EFI_GUID  HeaderGuid;
UINT64MessageLength;
UINT8 Data[ANYSIZE_ARRAY];
} EFI_MM_COMMUNICATE_HEADER;
```

Patch v1 branch: 
https://github.com/kuqin12/edk2/tree/BZ3398-MmCommunicate-Length

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Andrew Fish 
Cc: Laszlo Ersek 
Cc: Leif Lindholm 

Kun Qin (5):
   EDK2 Code First: PI Specification: EFI_MM_COMMUNICATE_HEADER Update
   MdeModulePkg: PiSmmIpl: Update MessageLength calculation for
 MmCommunicate
   MdeModulePkg: MemoryProfileInfo: Updated MessageLength calculation
   MdeModulePkg: SmiHandlerProfileInfo: Updated MessageLength calculation
   MdePkg: MmCommunication: Extend MessageLength field size to UINT64

  MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c | 20 
+++--
  MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c |  8 +-
  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 13 
++-
  BZ3430-SpecChange.md   | 88 

  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf   |  1 +
  MdePkg/Include/Protocol/MmCommunication.h  |  3 +-
  6 files changed, 124 insertions(+), 9 deletions(-)
  create mode 100644 BZ3430-SpecChange.md





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




Re: [edk2-devel] [PATCH v3 0/3] Add PayloadLoaderPeim which can load ELF payload

2021-06-16 Thread Ni, Ray
Since the V3 did a very straightforward change which is to change PLD_ to
UNIVERSAL_PAYLOAD_.
I will carry all the Reviewed-by/Acked-by from V2 and merge directly.

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ni, Ray
> Sent: Wednesday, June 16, 2021 2:59 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v3 0/3] Add PayloadLoaderPeim which can load
> ELF payload
> 
> v3:
>   Change PLD_ to UNIVERSAL_PAYLOAD_ based on Mike's comments.
> 
> v2:
>   Separate the patch set from the patch that adds CLANGDWARF toolchain.
> Add missing function header commments.
> Change DEBUG_ERROR to DEBUG_INFO for information debug message.
> 
> 
> Ray Ni (3):
>   MdeModulePkg/UniversalPayload: Add definition for extra info in
> payload
>   UefiPayloadPkg: Add PayloadLoaderPeim which can load ELF payload
>   PeiCore: Remove assertion when failing to load PE image
> 
>  MdeModulePkg/Core/Pei/Image/Image.c   |   5 +-
>  .../Include/UniversalPayload/ExtraData.h  |  28 +
>  .../UniversalPayload/UniversalPayload.h   |  24 +
>  MdeModulePkg/MdeModulePkg.dec |   3 +
>  UefiPayloadPkg/PayloadLoaderPeim/ElfLib.h | 122 +++
>  .../PayloadLoaderPeim/ElfLib/Elf32.h  | 252 +
>  .../PayloadLoaderPeim/ElfLib/Elf32Lib.c   | 451 
>  .../PayloadLoaderPeim/ElfLib/Elf64.h  | 254 +
>  .../PayloadLoaderPeim/ElfLib/Elf64Lib.c   | 460 
>  .../PayloadLoaderPeim/ElfLib/ElfCommon.h  | 983 ++
>  .../PayloadLoaderPeim/ElfLib/ElfLib.c | 473 +
>  .../PayloadLoaderPeim/ElfLib/ElfLibInternal.h | 109 ++
>  .../PayloadLoaderPeim/PayloadLoaderPeim.c | 187 
>  .../PayloadLoaderPeim/PayloadLoaderPeim.inf   |  59 ++
>  14 files changed, 3406 insertions(+), 4 deletions(-)
>  create mode 100644 MdeModulePkg/Include/UniversalPayload/ExtraData.h
>  create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib.h
>  create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32.h
>  create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
>  create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64.h
>  create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
>  create mode 100644
> UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfCommon.h
>  create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
>  create mode 100644
> UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLibInternal.h
>  create mode 100644
> UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
>  create mode 100644
> UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.inf
> 
> --
> 2.31.1.windows.1
> 
> 
> 
> 
> 



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




[edk2-devel] [PATCH v3 3/3] PeiCore: Remove assertion when failing to load PE image

2021-06-16 Thread Ni, Ray
EFI_PEI_LOAD_FILE_PPI is invoked by DxeIpl for loading DxeCore.
It's possible that the instance produced by PeiCore fails to load but
other instances of EFI_PEI_LOAD_FILE_PPI can load.

Signed-off-by: Ray Ni 
Cc: Jian J Wang 
Acked-by: Hao A Wu 
Cc: Dandan Bi 
Cc: Liming Gao 
---
 MdeModulePkg/Core/Pei/Image/Image.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/Image/Image.c 
b/MdeModulePkg/Core/Pei/Image/Image.c
index 1d15774527..5af3895191 100644
--- a/MdeModulePkg/Core/Pei/Image/Image.c
+++ b/MdeModulePkg/Core/Pei/Image/Image.c
@@ -1,7 +1,7 @@
 /** @file
   Pei Core Load Image Support
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -661,9 +661,6 @@ PeiLoadImageLoadImage (
 
   );
 
-  ASSERT_EFI_ERROR (Status);
-
-
   if (EFI_ERROR (Status)) {
 return Status;
   }
-- 
2.31.1.windows.1



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




[edk2-devel] [PATCH v3 2/3] UefiPayloadPkg: Add PayloadLoaderPeim which can load ELF payload

2021-06-16 Thread Ni, Ray
Per universal payload spec, the payload is in ELF format.
The patch adds a payload loader that supports to load ELF image.

The location of extra data sections whose names start with "upld."
is stored in UNIVERSAL_PAYLOAD_EXTRA_DATA HOB.

Signed-off-by: Maurice Ma 
Signed-off-by: Ray Ni 
Cc: Maurice Ma 
Reviewed-by: Guo Dong 
Cc: Benjamin You 
---
 UefiPayloadPkg/PayloadLoaderPeim/ElfLib.h | 122 +++
 .../PayloadLoaderPeim/ElfLib/Elf32.h  | 252 +
 .../PayloadLoaderPeim/ElfLib/Elf32Lib.c   | 451 
 .../PayloadLoaderPeim/ElfLib/Elf64.h  | 254 +
 .../PayloadLoaderPeim/ElfLib/Elf64Lib.c   | 460 
 .../PayloadLoaderPeim/ElfLib/ElfCommon.h  | 983 ++
 .../PayloadLoaderPeim/ElfLib/ElfLib.c | 473 +
 .../PayloadLoaderPeim/ElfLib/ElfLibInternal.h | 109 ++
 .../PayloadLoaderPeim/PayloadLoaderPeim.c | 187 
 .../PayloadLoaderPeim/PayloadLoaderPeim.inf   |  59 ++
 10 files changed, 3350 insertions(+)
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfCommon.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLibInternal.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.inf

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib.h 
b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib.h
new file mode 100644
index 00..9cfc2912cf
--- /dev/null
+++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib.h
@@ -0,0 +1,122 @@
+/** @file
+  ELF library
+
+  Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef ELF_LIB_H_
+#define ELF_LIB_H_
+
+#include 
+
+#define  ELF_CLASS32   1
+#define  ELF_CLASS64   2
+
+#define  ELF_PT_LOAD   1
+
+typedef struct {
+  RETURN_STATUS ParseStatus; ///< Return the status after 
ParseElfImage().
+  UINT8 *FileBase;   ///< The source location in memory.
+  UINTN FileSize;///< The size including sections that 
don't require loading.
+  UINT8 *PreferredImageAddress;  ///< The preferred image to be 
loaded. No relocation is needed if loaded to this address.
+  BOOLEAN   ReloadRequired;  ///< The image needs a new memory 
location for running.
+  UINT8 *ImageAddress;   ///< The destination memory address 
set by caller.
+  UINTN ImageSize;   ///< The memory size for loading and 
execution.
+  UINT32EiClass;
+  UINT32ShNum;
+  UINT32PhNum;
+  UINTN ShStrOff;
+  UINTN ShStrLen;
+  UINTN EntryPoint;  ///< Return the actual entry point 
after LoadElfImage().
+} ELF_IMAGE_CONTEXT;
+
+
+typedef struct {
+  UINT32  PtType;
+  UINTN   Offset;
+  UINTN   Length;
+  UINTN   MemLen;
+  UINTN   MemAddr;
+  UINTN   Alignment;
+} SEGMENT_INFO;
+
+/**
+  Parse the ELF image info.
+
+  @param[in]  ImageBase  Memory address of an image.
+  @param[out] ElfCt  The EFL image context pointer.
+
+  @retval EFI_INVALID_PARAMETER   Input parameters are not valid.
+  @retval EFI_UNSUPPORTED Unsupported binary type.
+  @retval EFI_LOAD_ERROR  ELF binary loading error.
+  @retval EFI_SUCCESS ELF binary is loaded successfully.
+**/
+EFI_STATUS
+EFIAPI
+ParseElfImage (
+  IN  VOID *ImageBase,
+  OUT ELF_IMAGE_CONTEXT*ElfCt
+  );
+
+/**
+  Load the ELF segments to specified address in ELF header.
+
+  This function loads ELF image segments into memory address specified
+  in ELF program header.
+
+  @param[in]  ElfCt   ELF image context pointer.
+
+  @retval EFI_INVALID_PARAMETER   Input parameters are not valid.
+  @retval EFI_UNSUPPORTED Unsupported binary type.
+  @retval EFI_LOAD_ERROR  ELF binary loading error.
+  @retval EFI_SUCCESS ELF binary is loaded successfully.
+**/
+EFI_STATUS
+EFIAPI
+LoadElfImage (
+  IN  ELF_IMAGE_CONTEXT   *ElfCt
+  );
+
+/**
+  Get a ELF section name from its index.
+
+  @param[in]  ElfCt   ELF image context pointer.
+  @param[in]  SectionIndexELF section index.
+  @param[out] SectionName The pointer to the section name.
+
+  @retval EFI_INVALID_PARAMETER   ElfCt or SecName is NULL.
+  @retval EFI_NOT_FOUND   Could not find the section.
+  @retval EFI_SUCCESS Section name was filled successfully.
+**/
+EFI_STATUS
+EFIAPI
+GetElfSectionName (
+  IN  ELF_IMAGE_CONTEXT *ElfCt,
+  IN  

[edk2-devel] [PATCH v3 1/3] MdeModulePkg/UniversalPayload: Add definition for extra info in payload

2021-06-16 Thread Ni, Ray
The payload is in ELF format per the universal payload spec.
UNIVERSAL_PAYLOAD_INFO_HEADER is stored in the ELF payload as a separate
section named ".upld_info".

Extra data needed by payload is stored in sections whose name starts
with ".upld.".

Signed-off-by: Ray Ni 
Cc: Maurice Ma 
Cc: Guo Dong 
Reviewed-by: Hao A Wu 
---
 .../Include/UniversalPayload/ExtraData.h  | 28 +++
 .../UniversalPayload/UniversalPayload.h   | 24 
 MdeModulePkg/MdeModulePkg.dec |  3 ++
 3 files changed, 55 insertions(+)
 create mode 100644 MdeModulePkg/Include/UniversalPayload/ExtraData.h

diff --git a/MdeModulePkg/Include/UniversalPayload/ExtraData.h 
b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
new file mode 100644
index 00..146ec845f6
--- /dev/null
+++ b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
@@ -0,0 +1,28 @@
+/** @file
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#ifndef EXTRA_DATA_H_
+#define EXTRA_DATA_H_
+
+extern GUID gUniversalPayloadExtraDataGuid;
+
+#pragma pack(1)
+
+typedef struct {
+  CHAR8Identifier[16];
+  EFI_PHYSICAL_ADDRESS Base;
+  UINT64   Size;
+} UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY;
+
+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER   PldHeader;
+  UINT32 Count;
+  UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY Entry[0];
+} UNIVERSAL_PAYLOAD_EXTRA_DATA;
+
+#pragma pack()
+
+#endif
diff --git a/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h 
b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
index e661306a9b..bc8a3e0cf8 100644
--- a/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
+++ b/MdeModulePkg/Include/UniversalPayload/UniversalPayload.h
@@ -11,8 +11,32 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #ifndef UNIVERSAL_PAYLOAD_H_
 #define UNIVERSAL_PAYLOAD_H_
 
+/**
+  Main entry point to Universal Payload.
+
+  @param HobList  Pointer to the beginning of the HOB List from boot loader.
+**/
+typedef  VOID   (EFIAPI *UNIVERSAL_PAYLOAD_ENTRY) (VOID *HobList);
+
+#define UNIVERSAL_PAYLOAD_IDENTIFIER   SIGNATURE_32('U', 'P', 
'L', 'D')
+#define UNIVERSAL_PAYLOAD_INFO_SEC_NAME".upld_info"
+#define UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX".upld."
+#define UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX_LENGTH (sizeof 
(UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX) - 1)
+
 #pragma pack(1)
 
+typedef struct {
+  UINT32  Identifier;
+  UINT32  HeaderLength;
+  UINT16  SpecRevision;
+  UINT8   Reserved[2];
+  UINT32  Revision;
+  UINT32  Attribute;
+  UINT32  Capability;
+  CHAR8   ProducerId[16];
+  CHAR8   ImageId[16];
+} UNIVERSAL_PAYLOAD_INFO_HEADER;
+
 typedef struct {
   UINT8Revision;
   UINT8Reserved;
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 8c0885955b..10602a8f79 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -419,6 +419,9 @@ [Guids]
   ## Include/UniversalPayload/AcpiTable.h
   gUniversalPayloadAcpiTableGuid = { 0x9f9a9506, 0x5597, 0x4515, { 0xba, 0xb6, 
0x8b, 0xcd, 0xe7, 0x84, 0xba, 0x87 } }
 
+  ## Include/UniversalPayload/ExtraData.h
+  gUniversalPayloadExtraDataGuid = {0x15a5baf6, 0x1c91, 0x467d, {0x9d, 0xfb, 
0x31, 0x9d, 0x17, 0x8d, 0x4b, 0xb4}}
+
 [Ppis]
   ## Include/Ppi/AtaController.h
   gPeiAtaControllerPpiGuid   = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 
0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
-- 
2.31.1.windows.1



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




[edk2-devel] [PATCH v3 0/3] Add PayloadLoaderPeim which can load ELF payload

2021-06-16 Thread Ni, Ray
v3:
  Change PLD_ to UNIVERSAL_PAYLOAD_ based on Mike's comments.

v2:
  Separate the patch set from the patch that adds CLANGDWARF toolchain.
Add missing function header commments.
Change DEBUG_ERROR to DEBUG_INFO for information debug message.


Ray Ni (3):
  MdeModulePkg/UniversalPayload: Add definition for extra info in
payload
  UefiPayloadPkg: Add PayloadLoaderPeim which can load ELF payload
  PeiCore: Remove assertion when failing to load PE image

 MdeModulePkg/Core/Pei/Image/Image.c   |   5 +-
 .../Include/UniversalPayload/ExtraData.h  |  28 +
 .../UniversalPayload/UniversalPayload.h   |  24 +
 MdeModulePkg/MdeModulePkg.dec |   3 +
 UefiPayloadPkg/PayloadLoaderPeim/ElfLib.h | 122 +++
 .../PayloadLoaderPeim/ElfLib/Elf32.h  | 252 +
 .../PayloadLoaderPeim/ElfLib/Elf32Lib.c   | 451 
 .../PayloadLoaderPeim/ElfLib/Elf64.h  | 254 +
 .../PayloadLoaderPeim/ElfLib/Elf64Lib.c   | 460 
 .../PayloadLoaderPeim/ElfLib/ElfCommon.h  | 983 ++
 .../PayloadLoaderPeim/ElfLib/ElfLib.c | 473 +
 .../PayloadLoaderPeim/ElfLib/ElfLibInternal.h | 109 ++
 .../PayloadLoaderPeim/PayloadLoaderPeim.c | 187 
 .../PayloadLoaderPeim/PayloadLoaderPeim.inf   |  59 ++
 14 files changed, 3406 insertions(+), 4 deletions(-)
 create mode 100644 MdeModulePkg/Include/UniversalPayload/ExtraData.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfCommon.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLibInternal.h
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
 create mode 100644 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.inf

-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76578): https://edk2.groups.io/g/devel/message/76578
Mute This Topic: https://groups.io/mt/83575150/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] BaseTools GenFw: Keep read only alloc section as text section when convert ELF

2021-06-16 Thread Bob Feng
Hi Liming,

There are some warning reported from PatchCheck.py, would you update the commit 
message?

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Bob Feng
Sent: Tuesday, June 15, 2021 2:49 PM
To: Liming Gao ; devel@edk2.groups.io
Cc: Ni, Ray 
Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools GenFw: Keep read only alloc 
section as text section when convert ELF

Reviewed-by: Bob Feng 

-Original Message-
From: Liming Gao 
Sent: Wednesday, June 9, 2021 6:06 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Ni, Ray 
Subject: [PATCH 1/1] BaseTools GenFw: Keep read only alloc section as text 
section when convert ELF

This is the fix of the regression issue at c6b872c6.
Based on ELF spec, readonly alloc section is .rodata section. It is requried.
This fix is to add back original check logic for ELF section. Now, the readonly 
alloc section and execute alloc section are regarded as .text section.

Signed-off-by: Liming Gao 
Cc: Bob Feng 
Cc: Ray Ni 
---
 With this fix, previous fix commit ec1cffd9 is not required. But, the checker 
added  by commit ec1cffd9 is correct for ACPI data conversion. So, I don't plan 
to revert it.

 BaseTools/Source/C/GenFw/Elf32Convert.c | 3 ++-  
BaseTools/Source/C/GenFw/Elf64Convert.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c 
b/BaseTools/Source/C/GenFw/Elf32Convert.c
index 314f8233234d..d917a444c82d 100644
--- a/BaseTools/Source/C/GenFw/Elf32Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf32Convert.c
@@ -238,7 +238,8 @@ IsTextShdr (
   Elf_Shdr *Shdr
   )
 {
-  return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC));
+  return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC)) ||
+   ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == 
+ SHF_ALLOC));
 }
 
 STATIC
diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c 
b/BaseTools/Source/C/GenFw/Elf64Convert.c
index 8b09db7b690b..33031ec8f6e7 100644
--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
@@ -246,7 +246,8 @@ IsTextShdr (
   Elf_Shdr *Shdr
   )
 {
-  return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC));
+  return (BOOLEAN) (((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) == 
(SHF_EXECINSTR | SHF_ALLOC)) ||
+   ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) == 
+ SHF_ALLOC));
 }
 
 STATIC
--
2.27.0.windows.1









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




[edk2-devel] SIMPLE_TEXT_OUTPUT_PROTOCOL and Video Resolution

2021-06-16 Thread David F.
Hello,

I've found that most implementation of UEFI don't automatically change
the resolution when setting the mode with STOP (Simple Text Output
Protocol) .  You can use GOP to change it after the mode but that
causes other problems.  For example, using surface pro 7 in this case,
with 4K screen.  The default text mode is 342x96 which puts it in
2736x1824 mode which you'd expect and the text is tiny.  But now you
set the mode to 0 which is 80x25 and it actually sets the mode to
2736x1824 if not already in that resolution and uses a 80x25 area in
the center of the screen, still tiny text you can hardly read.  If you
then say you want GOP in 640x480 mode (which is available as GOP mode
1 on this system, it will make the font larger but you can't see
anything because it's still offset to the middle of the 2736x1824 area
and you're only seeing the 640x480 upper left of that area on the
screen.   Likewise if you have it in 342x96 so it's fully in the upper
left corner of the screen and change the mode to say 800x600
(available as GOP mode 2 on this system) it will make the text
readable but the text can go off the screen in both directions because
it's still 342x96 when the 100x31 STOP mode would be the correct one
(which happens to be mode 2 on this system).

Shouldn't setting the STOP mode handle adjusting the resolution since
that's the main reason you want to change the mode so the size shown
on the screen changes to something you can read.

Any tricks? I've tried a bunch of things, resetting the controller,
using the Reset() protocol function, and other things but nothing
works.  As soon as you use STOP to set the mode, it is back to high
resolution and using an area centered in the screen and changing the
resolution after that leaves it in the area centered in the high res
screen and not in the upper left area.

Thanks.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76576): https://edk2.groups.io/g/devel/message/76576
Mute This Topic: https://groups.io/mt/83575008/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: Improve bootloader memrange parsing

2021-06-16 Thread Patrick Rudolph
Hi Guo,
The PciHostBridgeDxe expects the PCI Aperature and MMCONF to be marked
as EfiMemoryMappedIO,
however as the bootloader provides an e820 compatible memory map, it's
actually marked as
EfiReservedMemoryType. The PciHostBridgeDxe asserts on this incorrect
memory type.
This is what the patch tries to fix by marking MMIO (between TOLUD and
4GiB) as EfiMemoryMappedIO.

I don't think that the mentioned patch (UefiPayloadPkg: UefiPayload
retrieve PCI root bridge
from Guid Hob) would change that, as the same memory ranges are still
being incorrectly marked
reserved by UefiPayloadEntry.

Even with TOLUD guessing not working the OS wouldn't see a difference
as EfiMemoryMappedIO and
EfiReservedMemoryType both appear as reserved to the OS, so it's still
the same memory from OS point of view.
In case TOLUD is estimated too high, MMIO would be marked as Reserved,
so it's the same situation as now and
DXE drivers might fail.
In case TOLUD is estimated too low, Reserved DRAM would be marked as
MMIO, however I can't think of a DXE
that would actually care, it would skip the region as it would be
marked reserved.

Thanks,
Patrick

On Wed, Jun 16, 2021 at 12:20 AM Dong, Guo  wrote:
>
>
> Could you provide more info on the issues in fixed by this patch?
> There is a UEFI payload patch (under code review) to support the bootloader 
> to provide a HOB
> on the PCI resources, this way the UEFI payload doesn't need collect 
> resources again by parsing
> all the PCI devices. Not sure if that patch (UefiPayloadPkg: UefiPayload 
> retrieve PCI root bridge
> from Guid Hob) could avoid the issues.
>
> In this patch, as it mentioned some information (system memory or MMIO) is 
> missing in the
> bootloader E820 style table. Guessing the TOLUD might work in most cases, but 
> may fail since
> the assumptions.
>
> I saw this patch fixed the memory type for ACPI memory. I think we could have 
> this fix if the
> TOLUD guessing could be avoided.
>
> Thanks,
> Guo
>
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Patrick
> > Rudolph
> > Sent: Tuesday, June 15, 2021 6:23 AM
> > To: devel@edk2.groups.io
> > Cc: Ma, Maurice ; Dong, Guo
> > ; You, Benjamin 
> > Subject: [edk2-devel] [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_TYPEType;
> >
> > +  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;
> >
> > +  }
> >