Re: [edk2-devel] [PATCH v4 2/6] UefiCpuPkg/CpuExceptionHandlerLib: Use single SEC/PEI version

2023-04-05 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Ard Biesheuvel 
> Sent: Monday, April 3, 2023 10:29 PM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Ni, Ray ; Andrew
> Fish ; Kinney, Michael D ;
> Liu, Zhiguang ; Rebecca Cran
> ; Tom Lendacky ;
> Marvin Häuser 
> Subject: [PATCH v4 2/6] UefiCpuPkg/CpuExceptionHandlerLib: Use single
> SEC/PEI version
> 
> Currently, we use the non-Xcode5 version of ExceptionHandlerAsm.nasm
> only for the SEC and PEI phases, and this version was not compatible
> with the XCODE or LLD linkers, which do not permit absolute relocations
> in read-only sections.
> 
> Given that SEC and PEI code typically executes in place from flash and
> does not use page alignment for sections, we can simply emit the code
> carrying the absolute symbol references into the .data segment instead.
> This works around the linker's objections, and the resulting image will
> be mapped executable in its entirety anyway. Since this is only needed
> for XCODE, let's make this change conditionally using a preprocessor
> macro.
> 
> Let's rename the .nasm file to reflect the fact that is used for the
> SecPei flavor of this library only, and while at it, remove some
> unnecessary absolute references.
> 
> Also update the Xcode specific version of this library, and use this
> source file instead. This is necesessary, as the Xcode specific version
> modifies its own code at runtime, which is not permitted in SEC or PEI.
> Note that this also removes CET support from the Xcode5 specific build
> of the SEC/PEI version of this library, but this is not needed this
> early in any case, and this aligns it with other toolchains, which use
> this version of the library, which does not have CET support either.
> 
> 1. Change for non-XCODE SecPeiCpuExceptionHandlerLib:
> . Use SecPeiExceptionHandlerAsm.nasm (renamed from
>   ExceptionHandlerAsm.nasm)
> . Removed some unnecessary absolute references
>   (32 IDT stubs are still in .text.)
> 
> 2. Change for XCODE SecPeiCpuExceptionHandlerLib:
> . Use SecPeiExceptionHandlerAsm.nasm instead of
>   Xcode5ExceptionHandlerAsm.nasm
> . CET logic is not in SecPeiExceptionHandlerAsm.nasm (but aligns to
>   non-XCODE lib instance)
> . Fixed a bug that does runtime fixup in TEXT section in SPI flash.
> . Emitted the code carrying the absolute symbol references into the
>   .data which XCODE or LLD linkers allow.
> . Then fixup can be done by other build tools such as GenFv if the code
>   runs in SPI flash, or by PE coff loader if the code is loaded to
>   memory.
> 
> Signed-off-by: Ard Biesheuvel 
> ---
> 
> UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib
> .inf |  4 +++-
> 
> UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{ExceptionHandlerAsm.na
> sm => SecPeiExceptionHandlerAsm.nasm} | 12 
> 
> UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHa
> ndlerLib.inf   |  4 +++-
>  3 files changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandler
> Lib.inf
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandler
> Lib.inf
> index df44371fe018e06d..e7b1144f694183b7 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandler
> Lib.inf
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandler
> Lib.inf
> @@ -28,7 +28,7 @@ [Sources.Ia32]
>Ia32/ArchInterruptDefs.h
> 
> 
> 
>  [Sources.X64]
> 
> -  X64/ExceptionHandlerAsm.nasm
> 
> +  X64/SecPeiExceptionHandlerAsm.nasm
> 
>X64/ArchExceptionHandler.c
> 
>X64/ArchInterruptDefs.h
> 
> 
> 
> @@ -58,3 +58,5 @@ [Pcd]
>  [FeaturePcd]
> 
>gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard##
> CONSUMES
> 
> 
> 
> +[BuildOptions]
> 
> +  XCODE:*_*_X64_NASM_FLAGS = -D NO_ABSOLUTE_RELOCS_IN_TEXT
> 
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.n
> asm
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/SecPeiExceptionHandler
> Asm.nasm
> similarity index 94%
> rename from
> UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nas
> m
> rename to
> UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/SecPeiExceptionHandlerA
> sm.nasm
> index aaf8d622e6f3b8f1..5c7a59c99d3210f1 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.n
> asm
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/SecPeiExceptionHandler
> Asm.nasm
> @@ -27,7 +27,9 @@ extern ASM_PFX(CommonExceptionHandler)
>  SECTION .data
> 
> 
> 
>  DEFAULT REL
> 
> +%ifndef NO_ABSOLUTE_RELOCS_IN_TEXT
> 
>  SECTION .text
> 
> +%endif
> 
> 
> 
>  ALIGN   8
> 
> 
> 
> @@ -51,6 +53,9 @@ HookAfterStubHeaderBegin:
>  pushrax
> 
>  mov rax, HookAfterStubHeaderEnd
> 
>  jmp rax
> 
> +
> 
> +SECTION .text
> 
> +
> 
>  HookAfterStubHeaderEnd:
> 
>  mov rax, rsp
> 
>  and sp,  0xfff0; make sure 16-byte 

Re: [edk2-devel] [PATCH 0/5] Platforms cleanup v1

2023-04-05 Thread Sunil V L
On Thu, Apr 06, 2023 at 01:15:21PM +0800, Chai, Evan wrote:
> Booting to uefi shell is verfied in Qemu mode, 
> The qemu command be refered to '5a> Boot on QEMU' in
> https://github.com/riscv-admin/riscv-uefi-edk2-docs
> 
Thanks! Evan for fixing this. The series LGTM.

Reviewed-by: Sunil V L 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102598): https://edk2.groups.io/g/devel/message/102598
Mute This Topic: https://groups.io/mt/98015394/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 5/5] Platform/ Siliocn/: Fix building failure caused by wrong lib.

2023-04-05 Thread Chai, Evan
RiscVSbiLib was implemented in MdePkg/Library/BaseRiscVSbiLib.

Cc: Daniel Schaefer 
Cc: Sunil V L 
Cc: Andrei Warkentin 
Signed-off-by: Evan Chai 
---
 Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c
  | 4 +++-
 Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf  
  | 4 +++-
 Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf  
  | 3 ++-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc 
  | 4 ++--
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc   
  | 4 ++--
 
Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
 | 2 ++
 Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf 
  | 3 ++-
 7 files changed, 16 insertions(+), 8 deletions(-)

diff --git 
a/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c 
b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c
index 524b0a63..30ec8a8b 100644
--- a/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -2,13 +2,15 @@
   Reset System Library functions for RISC-V
 
   Copyright (c) 2021, Hewlett Packard Development LP. All rights reserved.
+  Copyright (c) 2023, Intel Corporation. All rights reserved.
+
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
 #include 
 #include 
-#include 
+#include 
 
 /**
   This function causes a system-wide reset (cold reset), in which
diff --git 
a/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf 
b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf
index 8987adb9..605d9efd 100644
--- a/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf
+++ b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf
@@ -2,6 +2,8 @@
 #  Library instance for ResetSystem library class for RISC-V using SBI ecalls
 #
 #  Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights 
reserved.
+#  Copyright (c) 2023, Intel Corporation. All rights reserved.
+#
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 
@@ -29,4 +31,4 @@
 
 [LibraryClasses]
   DebugLib
-  RiscVEdk2SbiLib
+  RiscVSbiLib
diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf 
b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf
index 1e8d53f4..8eef9fbb 100644
--- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf
+++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf
@@ -2,6 +2,7 @@
 #  RISC-V SEC module.
 #
 #  Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights 
reserved.
+#  Copyright (c) 2023, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -52,7 +53,7 @@
   RiscVCpuLib
   RiscVOpensbiLib
   RiscVOpensbiPlatformLib
-  RiscVEdk2SbiLib
+  RiscVSbiLib
 
 [FixedPcd]
   gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvBase
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc 
b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
index 95bf5ac4..4dc24386 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
@@ -148,10 +148,10 @@
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
 !endif
   RiscVCpuLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/RiscVCpuLib.inf
-  
RiscVEdk2SbiLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.inf
+  RiscVSbiLib|MdePkg/Library/BaseRiscVSbiLib/BaseRiscVSbiLib.inf
   
RiscVPlatformTimerLib|Platform/SiFive/U5SeriesPkg/Library/RiscVPlatformTimerLib/RiscVPlatformTimerLib.inf
   
MachineModeTimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVReadMachineModeTimer/EmulatedMachineModeTimerLib/EmulatedMachineModeTimerLib.inf
-  
CpuExceptionHandlerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerDxeLib.inf
+  
CpuExceptionHandlerLib|UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/BaseRiscV64CpuExceptionHandlerLib.inf
 
   # Flattened Device Tree (FDT) access library
   FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
diff --git 
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc 
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
index 099c4e22..9dff112d 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
@@ -149,11 +149,11 @@
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
 !endif
   RiscVCpuLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/RiscVCpuLib.inf
-  
RiscVEdk2SbiLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.inf
+  RiscVSbiLib|MdePkg/Library/BaseRiscVSbiLib/BaseRiscVSbiLib.inf
   

[edk2-devel] [edk2-platforms][PATCH 4/5] Silicon/RISC-V: remove redundant function code from RiscVCpuLib

2023-04-05 Thread Chai, Evan
They had been implemented in MdePkg/Library/BaseLib

Cc: Daniel Schaefer 
Cc: Sunil V L 
Cc: Andrei Warkentin 
Signed-off-by: Evan Chai 
---
 Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h | 20 
+---
 Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/Cpu.S | 41 
+
 2 files changed, 2 insertions(+), 59 deletions(-)

diff --git a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h 
b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h
index efe85489..f1555843 100644
--- a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h
+++ b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h
@@ -2,6 +2,7 @@
   RISC-V CPU library definitions.
 
   Copyright (c) 2016 - 2022, Hewlett Packard Enterprise Development LP. All 
rights reserved.
+  Copyright (c) 2023, Intel Corporation. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
@@ -96,23 +97,4 @@ RiscVReadMachineImplementId (
   VOID
   );
 
-VOID
-  RiscVSetSupervisorAddressTranslationRegister (UINT64);
-
-VOID
-  RiscVSetSupervisorScratch (UINT64);
-
-UINT64
-RiscVGetSupervisorScratch (
-  VOID
-  );
-
-VOID
-  RiscVSetSupervisorStvec (UINT64);
-
-UINT64
-RiscVGetSupervisorStvec (
-  VOID
-  );
-
 #endif
diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/Cpu.S 
b/Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/Cpu.S
index e242c9b8..52ef0788 100644
--- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/Cpu.S
+++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/Cpu.S
@@ -3,6 +3,7 @@
 // RISC-V CPU functions.
 //
 // Copyright (c) 2016 - 2021, Hewlett Packard Enterprise Development LP. All 
rights reserved.
+// Copyright (c) 2023, Intel Corporation. All rights reserved.
 //
 // SPDX-License-Identifier: BSD-2-Clause-Patent
 //
@@ -101,43 +102,3 @@ ASM_FUNC (RiscVReadMachineImplementId)
 csrr a0, RISCV_CSR_MACHINE_MIMPID
 ret
 
-//
-// Set Supervisor mode scratch.
-// @param a0 : Value set to Supervisor mode scratch
-//
-ASM_FUNC (RiscVSetSupervisorScratch)
-csrrw a1, RISCV_CSR_SUPERVISOR_SSCRATCH, a0
-ret
-
-//
-// Get Supervisor mode scratch.
-// @retval a0 : Value in Supervisor mode scratch
-//
-ASM_FUNC (RiscVGetSupervisorScratch)
-csrr a0, RISCV_CSR_SUPERVISOR_SSCRATCH
-ret
-
-//
-// Set Supervisor mode trap vector.
-// @param a0 : Value set to Supervisor mode trap vector
-//
-ASM_FUNC (RiscVSetSupervisorStvec)
-csrrw a1, RISCV_CSR_SUPERVISOR_STVEC, a0
-ret
-
-//
-// Get Supervisor mode scratch.
-// @retval a0 : Value in Supervisor mode trap vector
-//
-ASM_FUNC (RiscVGetSupervisorStvec)
-csrr a0, RISCV_CSR_SUPERVISOR_STVEC
-ret
-
-//
-// Set Supervisor Address Translation and
-// Protection Register.
-//
-ASM_FUNC (RiscVSetSupervisorAddressTranslationRegister)
-csrw  RISCV_CSR_SUPERVISOR_SATP, a0
-ret
-
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102596): https://edk2.groups.io/g/devel/message/102596
Mute This Topic: https://groups.io/mt/98099331/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 3/5] Silicon/RISC-V: remove redundant RiscVTimerLib

2023-04-05 Thread Chai, Evan
It will be replaced by UefiCpuPkg/Library/BaseRiscV64CpuTimerLib.

Cc: Daniel Schaefer 
Cc: Sunil V L 
Cc: Andrei Warkentin 
Signed-off-by: Evan Chai 
---
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc  |  11 
++-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf  |   1 +
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc|  11 
++-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf|   1 +
 Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf |  35 
---
 Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/RiscVTimerLib.c   | 199 
---
 Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc   |   6 
+-
 7 files changed, 15 insertions(+), 249 deletions(-)

diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc 
b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
index c26b4608..95bf5ac4 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
@@ -2,6 +2,7 @@
 #  RISC-V EFI on SiFive VC707 (U500) RISC-V platform
 #
 #  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All 
rights reserved.
+#  Copyright (c) 2023, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -228,7 +229,7 @@
   
RiscVCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf
 
 [LibraryClasses.common.DXE_CORE]
-  
TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf
+  TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
   HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
   
MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
@@ -245,7 +246,7 @@
 
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
-  
TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf
+  TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
@@ -265,7 +266,7 @@
 
 [LibraryClasses.common.UEFI_DRIVER]
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
-  
TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf
+  TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
@@ -280,7 +281,7 @@
 
 [LibraryClasses.common.DXE_DRIVER]
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
-  
TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf
+  TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
@@ -300,7 +301,7 @@
 
 [LibraryClasses.common.UEFI_APPLICATION]
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
-  
TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf
+  TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
 !ifdef $(DEBUG_ON_SERIAL_PORT)
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf 
b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
index b17c960d..684d5cae 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
@@ -2,6 +2,7 @@
 #  Flash definition file on SiFive VC707 (U500) RISC-V platform
 #
 #  Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All 
rights reserved.
+#  Copyright (c) 2023, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
diff --git 
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc 
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
index 4487913f..099c4e22 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
+++ 

[edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/RISC-V/ProcessorPkg: remove redundant CpuDxe driver

2023-04-05 Thread Chai, Evan
UefiCpuPkg/CpuDxeRiscV64 will replace it later.

Cc: Daniel Schaefer 
Cc: Sunil V L 
Cc: Andrei Warkentin 
Signed-off-by: Evan Chai 
---
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc   |   2 +-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf   |   2 +-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc |   2 +-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf |   2 +-
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c| 310 
--
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.h| 198 
--
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf  |  49 
-
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.uni  |  13 
-
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxeExtra.uni |  14 
--
 9 files changed, 4 insertions(+), 588 deletions(-)

diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc 
b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
index fc1ed012..efcfdd35 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
@@ -466,7 +466,7 @@
   #
   # RISC-V Core module
   #
-  Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf
+  UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf
   Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf
   MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
 
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf 
b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
index 4ce19279..da4d3379 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
@@ -151,7 +151,7 @@ INF  
Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServi
 
 # RISC-V Core Drivers
 INF  Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
-INF  Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf
+INF  UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf
 INF  Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf
 
 INF  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
diff --git 
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc 
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
index e59955d0..d92f8166 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
@@ -465,7 +465,7 @@
   #
   # RISC-V Core module
   #
-  Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf
+  UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf
   Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf
   MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
 
diff --git 
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf 
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
index c58fa635..237ed74a 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
@@ -151,7 +151,7 @@ INF  
Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServi
 
 # RISC-V Core Drivers
 INF  Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
-INF  Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf
+INF  UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf
 INF  Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf
 
 INF  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c 
b/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c
deleted file mode 100644
index 8d4d406e..
--- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/** @file
-  RISC-V CPU DXE driver.
-
-  Copyright (c) 2016 - 2022, Hewlett Packard Enterprise Development LP. All 
rights reserved.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "CpuDxe.h"
-
-//
-// Global Variables
-//
-STATIC BOOLEAN mInterruptState = FALSE;
-STATIC EFI_HANDLE  mCpuHandle  = NULL;
-
-EFI_CPU_ARCH_PROTOCOL  gCpu = {
-  CpuFlushCpuDataCache,
-  CpuEnableInterrupt,
-  CpuDisableInterrupt,
-  

[edk2-devel] [edk2-platforms][PATCH 2/5] Platform/Sifive: remove redundant TimerDxe from Platform

2023-04-05 Thread Chai, Evan
It will be replaced by UefiCpuPkg/CpuTimerDxeRiscV64.

Cc: Daniel Schaefer 
Cc: Sunil V L 
Cc: Andrei Warkentin 
Signed-off-by: Evan Chai 
---
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc   |   2 +-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf   |   2 +-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc |   2 +-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf |   2 +-
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c   | 311 
---
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.h   | 174 
--
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.uni |  14 
--
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf  |  54 
--
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerExtra.uni|  12 

 9 files changed, 4 insertions(+), 569 deletions(-)

diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc 
b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
index efcfdd35..c26b4608 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
@@ -460,7 +460,7 @@
   #
   # RISC-V Platform module
   #
-  Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
+  UefiCpuPkg/CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf
   
Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
 
   #
diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf 
b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
index da4d3379..b17c960d 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf
@@ -150,7 +150,7 @@ INF  
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
 INF  
Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
 
 # RISC-V Core Drivers
-INF  Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
+INF  UefiCpuPkg/CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf
 INF  UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf
 INF  Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf
 
diff --git 
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc 
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
index d92f8166..4487913f 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
@@ -459,7 +459,7 @@
   #
   # RISC-V Platform module
   #
-  Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
+  UefiCpuPkg/CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf
   
Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
 
   #
diff --git 
a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf 
b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
index 237ed74a..9ae89647 100644
--- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
+++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
@@ -150,7 +150,7 @@ INF  
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
 INF  
Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
 
 # RISC-V Core Drivers
-INF  Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
+INF  UefiCpuPkg/CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf
 INF  UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf
 INF  Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf
 
diff --git a/Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c 
b/Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c
deleted file mode 100644
index deb57992..
--- a/Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/** @file
-  RISC-V Timer Architectural Protocol for U5 series platform.
-
-  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights 
reserved.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "Timer.h"
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-BOOLEAN TimerHandlerReentry = FALSE;
-
-//
-// The handle onto which the Timer Architectural Protocol will be installed
-//
-STATIC EFI_HANDLE mTimerHandle = NULL;
-

[edk2-devel] [edk2-platforms][PATCH 0/5] Platforms cleanup v2

2023-04-05 Thread Chai, Evan
Booting to uefi shell is verfied in Qemu mode, 
The qemu command be refered to '5a> Boot on QEMU' in
https://github.com/riscv-admin/riscv-uefi-edk2-docs

Evan Chai (5):
  Silicon/RISC-V/ProcessorPkg: remove redundant CpuDxe driver
  Platform/Sifive: remove redundant TimerDxe from Platform
  Silicon/RISC-V: remove redundant RiscVTimerLib
  Silicon/RISC-V: remove redundant function code from RiscVCpuLib
  Platform/ Siliocn/: Fix building failure caused by wrong lib.

 Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c
  |   4 +++-
 Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf  
  |   4 +++-
 Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf  
  |   3 ++-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc 
  |  19 ++-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf 
  |   5 +++--
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc   
  |  19 ++-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf   
  |   5 +++--
 
Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
 |   2 ++
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c 
  | 311 
---
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.h 
  | 174 
--
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.uni   
  |  14 --
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
  |  54 --
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerExtra.uni  
  |  12 
 Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h  
  |  20 +---
 Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/Cpu.S  
  |  41 +
 Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf
  |  35 ---
 Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/RiscVTimerLib.c  
  | 199 
---
 Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc  
  |   6 +-
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c  
  | 310 
--
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.h  
  | 198 
--
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf
  |  49 -
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.uni
  |  13 -
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxeExtra.uni   
  |  14 --
 Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf 
  |   3 ++-
 24 files changed, 41 insertions(+), 1473 deletions(-)
 delete mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c
 delete mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.h
 delete mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.uni
 delete mode 100644 
Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
 delete mode 100644 
Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerExtra.uni
 delete mode 100644 
Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf
 

[edk2-devel] [PATCH 0/5] Platforms cleanup v1

2023-04-05 Thread Chai, Evan
Booting to uefi shell is verfied in Qemu mode, 
The qemu command be refered to '5a> Boot on QEMU' in
https://github.com/riscv-admin/riscv-uefi-edk2-docs

Evan Chai (5):
  Silicon/RISC-V/ProcessorPkg: remove redundant CpuDxe driver
  Platform/Sifive: remove redundant TimerDxe from Platform
  Silicon/RISC-V: remove redundant RiscVTimerLib
  Silicon/RISC-V: remove redundant function code from RiscVCpuLib
  Platform/ Siliocn/: Fix building failure caused by wrong lib.

 Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c
  |   4 +++-
 Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf  
  |   4 +++-
 Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf  
  |   3 ++-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc 
  |  19 ++-
 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf 
  |   5 +++--
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc   
  |  19 ++-
 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf   
  |   5 +++--
 
Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
 |   2 ++
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c 
  | 311 
---
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.h 
  | 174 
--
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.uni   
  |  14 --
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
  |  54 --
 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerExtra.uni  
  |  12 
 Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h  
  |  20 +---
 Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/Cpu.S  
  |  41 +
 Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf
  |  35 ---
 Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/RiscVTimerLib.c  
  | 199 
---
 Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc  
  |   6 +-
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c  
  | 310 
--
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.h  
  | 198 
--
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf
  |  49 -
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.uni
  |  13 -
 Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxeExtra.uni   
  |  14 --
 Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf 
  |   3 ++-
 24 files changed, 41 insertions(+), 1473 deletions(-)
 delete mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c
 delete mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.h
 delete mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.uni
 delete mode 100644 
Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf
 delete mode 100644 
Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerExtra.uni
 delete mode 100644 
Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf
 

Re: [edk2-devel] [PATCH 0/5] Platforms cleanup v1

2023-04-05 Thread Sunil V L
Hi Evan,

On Sun, Apr 02, 2023 at 11:15:37PM +0800, Chai, Evan wrote:
> *** BLURB HERE ***
>
This should be replaced with some valid cover letter for the series.
Also, please add [edk2-platforms] in the subject for the patch set.

Thanks,
Sunil


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




Re: [edk2-devel] [PATCH v6 2/3] MdePkg: add SBI-based SerialPortLib for RISC-V

2023-04-05 Thread Sunil V L
Hi Andrei,

I had couple of questions on previous version of this patch. Adding them
inline again in case you had missed them. Please check if they are
valid.

Also, I think it would be better to have single directory
BaseSerialPortLibRiscVSbiLib and inside that we can have both INF files.
This way we can share UNI files etc between both libraries.

On Tue, Apr 04, 2023 at 11:43:58AM -0500, Andrei Warkentin wrote:
> These are implementations of SerialPortLib using SBI console services.
> - BaseSerialPortLibRiscVSbiLib is appropriate for SEC/PEI (XIP) environments
> - BaseSerialPortLibRiscVSbiLibRam is appropriate for PrePI/DXE environments
> 
> Tested with:
> - Qemu RiscVVirt (non-DBCN case, backed by UART)
> - TinyEMU + RiscVVirt (non-DBCN case, HTIF)
> - TinyEMU + RiscVVirt (DBCN case, HTIF)
> 
> Cc: Daniel Schaefer 
> Cc: Sunil V L 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Acked-by: Gerd Hoffmann 
> Signed-off-by: Andrei Warkentin 
> ---
>  MdePkg/MdePkg.dsc
>   |   2 +
>  MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.inf 
>   |  39 +++
>  
> MdePkg/Library/BaseSerialPortLibRiscVSbiLibRam/BaseSerialPortLibRiscVSbiLibRam.inf
>  |  36 +++
>  MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.c   
>   | 233 
>  
> MdePkg/Library/BaseSerialPortLibRiscVSbiLibRam/BaseSerialPortLibRiscVSbiLibRam.c
>| 288 
>  MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.uni 
>   |  16 ++
>  
> MdePkg/Library/BaseSerialPortLibRiscVSbiLibRam/BaseSerialPortLibRiscVSbiLibRam.uni
>  |  16 ++
>  7 files changed, 630 insertions(+)
> 
> diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
> index 0ac7618b4623..ceccc078ff04 100644
> --- a/MdePkg/MdePkg.dsc
> +++ b/MdePkg/MdePkg.dsc
> @@ -192,5 +192,7 @@ [Components.ARM, Components.AARCH64]
>  
>  [Components.RISCV64]
>MdePkg/Library/BaseRiscVSbiLib/BaseRiscVSbiLib.inf
> +  
> MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.inf
> +  
> MdePkg/Library/BaseSerialPortLibRiscVSbiLibRam/BaseSerialPortLibRiscVSbiLibRam.inf
>  
>  [BuildOptions]
> diff --git 
> a/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.inf
>  
> b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.inf
> new file mode 100644
> index ..09cf59f190f6
> --- /dev/null
> +++ 
> b/MdePkg/Library/BaseSerialPortLibRiscVSbiLib/BaseSerialPortLibRiscVSbiLib.inf
> @@ -0,0 +1,39 @@
> +## @file
> +#  Serial Port Library backed by SBI console.
> +#
> +#  Meant for SEC and PEI (XIP) environments.
> +#
> +#  Due to limitations of SBI console interface and XIP environments
> +#  (on use of globals), this library instance does not implement reading
> +#  and polling the serial port. See PrePiDxeSerialPortLibRiscVSbi for
> +#  the full-featured variant meant for PrePi and DXE environments.
> +#
> +#  Copyright (c) 2023, Intel Corporation. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001B
> +  BASE_NAME  = BaseSerialPortLibRiscVSbiLib
> +  MODULE_UNI_FILE= BaseSerialPortLibRiscVSbiLib.uni
> +  FILE_GUID  = 639fad38-4bfd-4eb9-9f09-e97c7947d480
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = SerialPortLib | SEC PEI_CORE PEIM
> +
> +
> +#
> +#  VALID_ARCHITECTURES   = RISCV64
> +#
> +
> +[Sources]
> +  BaseSerialPortLibRiscVSbiLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +
> +[LibraryClasses]
> +  RiscVSbiLib
> diff --git 
> a/MdePkg/Library/BaseSerialPortLibRiscVSbiLibRam/BaseSerialPortLibRiscVSbiLibRam.inf
>  
> b/MdePkg/Library/BaseSerialPortLibRiscVSbiLibRam/BaseSerialPortLibRiscVSbiLibRam.inf
> new file mode 100644
> index ..b7ad1548a309
> --- /dev/null
> +++ 
> b/MdePkg/Library/BaseSerialPortLibRiscVSbiLibRam/BaseSerialPortLibRiscVSbiLibRam.inf
> @@ -0,0 +1,36 @@
> +## @file
> +#  Serial Port Library backed by SBI console.
> +#
> +#  Meant for PrePi and DXE environments (where globals are allowed). See
> +#  BaseSerialPortLibRiscVSbiLib for a reduced variant appropriate for SEC
> +#  and PEI (XIP) environments.
> +#
> +#  Copyright (c) 2023, Intel Corporation. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001B
> +  BASE_NAME  = BaseSerialPortLibRiscVSbiLibRam
> +  MODULE_UNI_FILE= BaseSerialPortLibRiscVSbiLibRam.uni
> +  FILE_GUID  = 872af743-ab56-45b4-a065-602567f4820c
> +  MODULE_TYPE= BASE
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = SerialPortLib | SEC DXE_CORE 

Re: [edk2-devel] [RFC PATCH 1/1] MdePkg: Add a libc implementation

2023-04-05 Thread Michael D Kinney
Hi Pedro,

Thank you for starting this.

I recall some challenges with the Openssl libc wrapper, so let's work on that 
one last.

If we can get a libc wrapper that is compatible with Brotli, regular expression,
jannson, and fdtlib that would be a huge step forward.

Can you test your code against these 3 use cases that are already in edk2?

* MdeModulePkg\Library\BrotliCustomDecompressLib
* MdeModulePkg\Universal\RegularExpressionDxe
* RedfishPkg\PrivateInclude\Crt

Mike

> -Original Message-
> From: Pedro Falcato 
> Sent: Thursday, March 30, 2023 7:31 PM
> To: devel@edk2.groups.io
> Cc: Pedro Falcato ; Kinney, Michael D 
> ; Gao, Liming
> ; Liu, Zhiguang ; Lin, 
> Benny 
> Subject: [RFC PATCH 1/1] MdePkg: Add a libc implementation
> 
> Add LibcLib, a libc implementation meant to centralize all libc bits in
> edk2.
> 
> Work in progress, does not support Windows targets (CLANGPDB and MSVC)
> just yet.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Benny Lin 
> Signed-off-by: Pedro Falcato 
> ---
>  Wrote this to fulfill the new needs for BaseFdtLib and libfdt.
>  It's very much a work in progress. Please test (I have no way to test this,
>  and I have not attempted to replace OpenSSL stuff just yet). It's not 
> perfect,
>  but I attempted to be as correct as possible. Please, comment.
> 
>  Some details:
>  1) I attempted to be as standards-correct as possible, used __name and _Name 
> to avoid namespace polution.
> I (unfortunately) had to include Base.h for NULL, because defining my own 
> would possibly spell disaster
> if someone included a C standard header and Base.h.
>  2) ProcessorBind.h implicitly polutes the global namespace. I don't think 
> this is fixable.
>  3) In some places, I wrote my own functions when I could redirect to 
> BaseMemoryLib stuff.
> The amount of possible points of failure made me nervous (max string size 
> PCD, etc). To be discussed.
>  4) This should fulfill BaseFdtLib's needs. I went a bit more in-depth where 
> I could (without wasting too much time).
> Of course, this means it's still missing a *HUGE* chunk of libc. I don't 
> think I'm aiming to write a full libc here
> (haha).
> Just the common bits that may be useful for edk2.
>  5) As discussed before (in the context of compiler intrinsics), GCC and 
> clang require memcpy, memset, and some others for
> valid
> codegen. This should possibly be done implicitly by BaseTools.
>  6) Again, please, comment or contribute. If anyone wants to send PRs or 
> checkout directly, feel free:
> https://github.com/heatd/edk2/tree/wip-libc
> 
>  MdePkg/Include/limits.h |  69 ++
>  MdePkg/Include/stdbool.h|  17 
>  MdePkg/Include/stddef.h |  26 +
>  MdePkg/Include/stdint.h | 116 +++
>  MdePkg/Include/stdlib.h |  21 
>  MdePkg/Include/string.h |  86 +
>  MdePkg/Include/types.h  |  27 ++
>  MdePkg/Library/LibcLib/LibcLib.inf  |  38 
>  MdePkg/Library/LibcLib/Stdlib/strtoul.c | 121 
>  MdePkg/Library/LibcLib/String/memchr.c  |  19 
>  MdePkg/Library/LibcLib/String/memcmp.c  |  19 
>  MdePkg/Library/LibcLib/String/memcpy.c  |  29 ++
>  MdePkg/Library/LibcLib/String/memset.c  |  21 
>  MdePkg/Library/LibcLib/String/strchr.c  |  56 +++
>  MdePkg/Library/LibcLib/String/strcmp.c  |  27 ++
>  MdePkg/Library/LibcLib/String/strcpy.c  |  59 
>  MdePkg/Library/LibcLib/String/strlen.c  |  16 
>  MdePkg/MdeLibs.dsc.inc  |   1 +
>  MdePkg/MdePkg.dec   |   4 +
>  MdePkg/MdePkg.dsc   |   1 +
>  20 files changed, 773 insertions(+)
>  create mode 100644 MdePkg/Include/limits.h
>  create mode 100644 MdePkg/Include/stdbool.h
>  create mode 100644 MdePkg/Include/stddef.h
>  create mode 100644 MdePkg/Include/stdint.h
>  create mode 100644 MdePkg/Include/stdlib.h
>  create mode 100644 MdePkg/Include/string.h
>  create mode 100644 MdePkg/Include/types.h
>  create mode 100644 MdePkg/Library/LibcLib/LibcLib.inf
>  create mode 100644 MdePkg/Library/LibcLib/Stdlib/strtoul.c
>  create mode 100644 MdePkg/Library/LibcLib/String/memchr.c
>  create mode 100644 MdePkg/Library/LibcLib/String/memcmp.c
>  create mode 100644 MdePkg/Library/LibcLib/String/memcpy.c
>  create mode 100644 MdePkg/Library/LibcLib/String/memset.c
>  create mode 100644 MdePkg/Library/LibcLib/String/strchr.c
>  create mode 100644 MdePkg/Library/LibcLib/String/strcmp.c
>  create mode 100644 MdePkg/Library/LibcLib/String/strcpy.c
>  create mode 100644 MdePkg/Library/LibcLib/String/strlen.c
> 
> diff --git a/MdePkg/Include/limits.h b/MdePkg/Include/limits.h
> new file mode 100644
> index ..f87b870e6cbc
> --- /dev/null
> +++ b/MdePkg/Include/limits.h
> @@ -0,0 +1,69 @@
> +/** @file
> +  ISO C limits.h
> +
> +  Copyright (c) 

Re: [edk2-devel] [RFC] [edk2-openssl fork] Add openssl fork repo to Tianocore to support OpenSSL11_EOL

2023-04-05 Thread Yao, Jiewen
Thanks Leif. Your understanding is right.
The openssl fork will be used by edk2-staging repo only.
The openssl fork will NOT be by edk2 repo.


Creating project specific fork is not unique.
For example, we already have other fork in tianocore - 
https://github.com/tianocore/rust
For example, we already have fork for openssl - 
https://github.com/open-quantum-safe/openssl

The idea here is similar.

Thank you
Yao, Jiewen


> -Original Message-
> From: Leif Lindholm 
> Sent: Thursday, April 6, 2023 2:32 AM
> To: devel@edk2.groups.io; kra...@redhat.com
> Cc: Yao, Jiewen 
> Subject: Re: [edk2-devel] [RFC] [edk2-openssl fork] Add openssl fork repo to
> Tianocore to support OpenSSL11_EOL
> 
> On Wed, Apr 05, 2023 at 13:39:21 +0200, Gerd Hoffmann wrote:
> > On Wed, Apr 05, 2023 at 01:37:23AM +, Yao, Jiewen wrote:
> > > Hi
> > > This is follow up for the "Openssl1.1 replacement proposal"
> https://edk2.groups.io/g/devel/topic/96741156.
> > > openssl 3.0 POC result is shown at https://github.com/tianocore/edk2-
> staging/blob/OpenSSL11_EOL/CryptoPkg/Readme-OpenSSL3.0.md
> > > The size increase is reduced to ~10%.
> > >
> > > In order to achieve maximum size optimization for openssl 3.0, we
> > > updated openssl 3.0 branch and recorded to
> > > https://github.com/liyi77/openssl/tree/openssl-3.0-POC.
> > > To help the community review and feedback the openssl 3.0 change
> > > and plan to openssl upstream in the future, we should avoid
> > > personal branch usage.
> >
> > I fail to see the point.  To get the openssl changes merged upstream
> > you needed engage with the openssl community, and I don't see how a
> > tianocore openssl repository helps with that.
> 
> Here is my understanding:
> - There is a concern that this change may break existing use-cases,
>   and the proposal is to collate current state of work - undergoing
>   upstreaming to openssl - so that the tianocore community (and
>   downstream consumers) can start testing it with minimal amount of
>   faff.
> - There is *no* plan for the edk2 repository to switch to using this
>   submodule.
> 
> If that understanding is correct, as long as the README.md is updated
> to clearly state that this repository is for integration and
> verification purposes only - at the very top - I think this is a good
> thing.
> 
> /
> Leif


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102587): https://edk2.groups.io/g/devel/message/102587
Mute This Topic: https://groups.io/mt/98074585/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 00/13] BaseTools,CryptoPkg,MdePkg,OvmfPkg: Delete CLANG35,CLANG38,GCC48,GCC49, rename GCC5 to GCC, update CLANGDWARF, delete VS 2008-2013, EBC

2023-04-05 Thread Rebecca Cran

Okay, I'll do that.

Do I need to do the same with the CLANG35 and CLANG38 toolchains, 
marking them deprecated before removing them?



--

Rebecca Cran


On 4/5/23 6:57 PM, gaoliming wrote:

Rebecca:
  If you plan to change GCC49 tool chain to GCCNOLTO name, I would suggest to 
take the same rule that adds GCCNOLTO tool chain first.

  We still have downstream AARCH64 platforms to use GCC49 tool chain now.

Thanks
Liming

-邮件原件-
发件人: devel@edk2.groups.io  代表 Ard
Biesheuvel
发送时间: 2023年4月5日 18:22
收件人: Rebecca Cran 
抄送: Kinney, Michael D ; Pedro Falcato
; devel@edk2.groups.io; Leif Lindholm
; Gao, Liming ;
Oliver Smith-Denny ; Jiang, Guomin
; Lu, Xiaoyu1 ; Wang, Jian J
; Yao, Jiewen ; Ard
Biesheuvel ; Justen, Jordan L
; Gerd Hoffmann ; Feng,
Bob C ; Andrew Fish 
主题: Re: 回复: 回复: [edk2-devel] [PATCH v2 00/13]
BaseTools,CryptoPkg,MdePkg,OvmfPkg: Delete
CLANG35,CLANG38,GCC48,GCC49, rename GCC5 to GCC, update
CLANGDWARF, delete VS 2008-2013, EBC

On Tue, 4 Apr 2023 at 20:36, Rebecca Cran  wrote:

Thanks, deprecating it for a while makes a lot of sense. We can consider
removing it in 6-12 months maybe?


I would at least wait for a stable release to appear that supports
both GCC5 and GCC/GCCNOLTO, and then perhaps queue the removal (and
document it) for the subsequent one?










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




[edk2-devel] Event: TianoCore Community Meeting - APAC/NAMO - Thursday, April 6, 2023 #cal-reminder

2023-04-05 Thread Group Notification
*Reminder: TianoCore Community Meeting - APAC/NAMO*

*When:*
Thursday, April 6, 2023
7:30pm to 8:30pm
(UTC-07:00) America/Los Angeles

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

*Organizer:* Miki Demeter

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

*Description:*



Microsoft Teams meeting

*Join on your computer or mobile app*

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

Meeting ID: 283 318 374 436
Passcode: 633zLo

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

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 119 493 012 8

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

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




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




Re: [edk2-devel] [PATCH V1 1/1] OvmfPkg/PlatformPei: Skip PlatformInitEmuVariableNvStore in SEV guest

2023-04-05 Thread Min Xu
On April 3, 2023 7:21 PM, Gerd Hoffmann wrote:
> > > I agree that the efi variable store is not secure without smm. But
> > > after 58eb8517ad7b be introduced, the -D SECURE_BOOT_ENABLE doesn't
> > > work with SEV. System just hangs in "NvVarStore FV headers were invalid."
> > Hi, Joeyli
> > ASSERT is triggered in DEBUG version. In RELEASE version ASSERT is skipped
> and an error code is returned. So system will not hang.
> > So another solution is simply remove the ASSERT. Then an error message is
> dumped out and system continues.
> >
> > @Gerd Hoffmann @Tom Lendacky @joeyli What's your thought?
> 
> Maybe we just need to call ReserveEmuVariableNvStore a bit later?
> 
I think we can still call ReserveEmuVariableNvStore at PEI phase, but move the 
initialization of EmuVariableNvStore to 
https://github.com/tianocore/edk2/blob/master/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c#L780-L783
@Tom Lendacky  At this moment, is SEV guest available to read the content from 
VarStore?

Thanks
Min


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




Re: [edk2-devel] [PATCH tianocore-docs v3 2/2] Readme.md: Update the Gitbook documentation section

2023-04-05 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 



> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
> Sent: Wednesday, April 5, 2023 6:06 PM
> To: devel@edk2.groups.io; Ard Biesheuvel ; 
> Demeter, Miki ; Kinney,
> Michael D ; Leif Lindholm 
> 
> Cc: Rebecca Cran 
> Subject: [edk2-devel] [PATCH tianocore-docs v3 2/2] Readme.md: Update the 
> Gitbook documentation section
> 
> We no longer use Gitbook for publishing the documentation.
> Update the section to direct users to use the mailing list to
> send feedback, and since we use GitHub Flavored Markdown, remove the
> link to Gitbook.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Rebecca Cran 
> ---
>  Readme.md | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/Readme.md b/Readme.md
> index 1e4a5d25bd6f..494b23af3ac7 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -30,12 +30,11 @@ documentation.
> 
>  # EDK II GitBook Documents
> 
> -These are the latest draft revisions published using 
> [Gitbook](https://legacy.gitbook.com/).
> +These are the latest draft revisions.
>  The source content for these documents are in GIT repositories in the
>  [Tianocore-docs](https://github.com/tianocore-docs) organization hosted by 
> [GitHub](https://github.com).
> -Feedback on these documents may be provided using the 
> [Gitbook](https://www.gitbook.com) commenting feature
> -available when reading the **HTML** versions of the documents. Document 
> issues and feature requests can also
> -be entered in [Tianocore Bugzilla](https://bugzilla.tianocore.org).
> +Feedback on these documents may be provided via the mailing list.
> +Document issues and feature requests can also be entered in [Tianocore 
> Bugzilla](https://bugzilla.tianocore.org).
> 
>  * **_EDK II Build Specification_** \[
>  [HTML   ](https://tianocore-docs.github.io/edk2-BuildSpecification/draft/),
> --
> 2.39.2 (Apple Git-143)
> 
> 
> 
> 
> 



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




回复: [edk2-devel] [PATCH v3 0/4] Enable BTI support in memory attributes table

2023-04-05 Thread gaoliming via groups.io
Ard:
 Can you submit one BZ for this new feature? I will add it into the stable tag 
feature planning. 

 For this patch set, Reviewed-by: Liming Gao 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Ard
> Biesheuvel
> 发送时间: 2023年4月4日 23:40
> 收件人: devel@edk2.groups.io
> 抄送: Ard Biesheuvel ; Michael Kinney
> ; Liming Gao ;
> Jiewen Yao ; Michael Kubacki
> ; Sean Brogan
> ; Rebecca Cran ;
> Leif Lindholm ; Sami Mujawar
> ; Taylor Beebe ; Marvin
> Häuser ; Bob Feng ; Oliver
> Smith-Denny 
> 主题: [edk2-devel] [PATCH v3 0/4] Enable BTI support in memory attributes
> table
> 
> Implement version 2 of the memory attributes table, which now contains a
> 
> flag informing the OS whether or not code regions may be mapped with CFI
> 
> mitigations such as IBT or BTI enabled.
> 
> 
> 
> This series covers the remaining parts after the AArch64 specific
> 
> changes were merged:
> 
> 
> 
> - Update the BaseTools to emit the appropriate PE/COFF annotation when a
> 
>   BTI/IBT compatible ELF executable is converted to PE/COFF
> 
> - Take this PE/COFF annotation into account when populating the memory
> 
>   attributes table in the DXE core
> 
> 
> 
> TODO:
> 
> - X64 changes to make the code IBT compatible and emit the ELF note
> 
> - Figure out how to generate such executables with native PE toolchains
> 
> - Implement BTI/IBT enforcement at boot time - this is something I
> 
>   intend to look into next.
> 
> 
> 
> Can be tested with the CLANG38 toolchain (both Clang compiler and LLD
> 
> linker, version 3.8 or newer) with the following build options.
> 
> 
> 
> [BuildOptions]
> 
>   GCC:*_*_AARCH64_PP_FLAGS = -mbranch-protection=bti
> 
>   GCC:*_*_AARCH64_CC_FLAGS = -mbranch-protection=bti
> 
>   GCC:*_*_AARCH64_DLINK_FLAGS = -fuse-ld=lld
> -Wl,--no-relax,--no-pie,-z,bti-report=error
> 
> 
> 
> Changes since v2:
> 
> - increase DllCharacteristicsEx field to 4 bytes
> 
> - add Oliver's Rb
> 
> 
> 
> If no comments or objections have been raised by the end of the week, I
> 
> will go ahead and merge this - thanks.
> 
> 
> 
> Cc: Michael Kinney 
> 
> Cc: Liming Gao 
> 
> Cc: Jiewen Yao 
> 
> Cc: Michael Kubacki 
> 
> Cc: Sean Brogan 
> 
> Cc: Rebecca Cran 
> 
> Cc: Leif Lindholm 
> 
> Cc: Sami Mujawar 
> 
> Cc: Taylor Beebe 
> 
> Cc: Marvin Häuser 
> 
> Cc: Bob Feng 
> 
> Cc: Oliver Smith-Denny 
> 
> 
> 
> Ard Biesheuvel (4):
> 
>   BaseTools/GenFw: Parse IBT/BTI support status from ELF note
> 
>   BaseTools/GenFw: Add DllCharacteristicsEx field to debug data
> 
>   MdePkg/PeCoffLib: Capture DLL characteristics fields in image context
> 
>   MdeModulePkg: Enable forward edge CFI in mem attributes table
> 
> 
> 
>  BaseTools/Source/C/GenFw/Elf64Convert.c   | 104
> +---
> 
>  BaseTools/Source/C/GenFw/GenFw.c  |   3 +-
> 
>  BaseTools/Source/C/GenFw/elf_common.h |   9 ++
> 
>  BaseTools/Source/C/Include/IndustryStandard/PeImage.h |  13 ++-
> 
>  MdeModulePkg/Core/Dxe/DxeMain.h   |   2 +
> 
>  MdeModulePkg/Core/Dxe/Image/Image.c   |  10 ++
> 
>  MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c|   8 +-
> 
>  MdePkg/Include/IndustryStandard/PeImage.h |  13 ++-
> 
>  MdePkg/Include/Library/PeCoffLib.h|   6 ++
> 
>  MdePkg/Library/BasePeCoffLib/BasePeCoff.c |  46
> ++---
> 
>  10 files changed, 186 insertions(+), 28 deletions(-)
> 
> 
> 
> --
> 
> 2.39.2
> 
> 
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#102491):
> https://edk2.groups.io/g/devel/message/102491
> Mute This Topic: https://groups.io/mt/98062730/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 (#102582): https://edk2.groups.io/g/devel/message/102582
Mute This Topic: https://groups.io/mt/98096794/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] 回复: [Patch v2 05/12] MdePkg: Add gmock examples

2023-04-05 Thread gaoliming via groups.io
Acked-by: Liming Gao 

> -邮件原件-
> 发件人: Michael D Kinney 
> 发送时间: 2023年4月5日 2:22
> 收件人: devel@edk2.groups.io
> 抄送: Chris Johnson ; Liming Gao
> ; Zhiguang Liu 
> 主题: [Patch v2 05/12] MdePkg: Add gmock examples
> 
> From: Chris Johnson 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4389
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Chris Johnson 
> ---
>  MdePkg/MdePkg.dec |  1 +
>  MdePkg/Test/MdePkgHostTest.dsc|  2 +
>  .../Include/GoogleTest/Library/MockUefiLib.h  | 39 +
>  .../Library/MockUefiRuntimeServicesTableLib.h | 42 +++
>  .../GoogleTest/MockUefiLib/MockUefiLib.cpp| 12 ++
>  .../GoogleTest/MockUefiLib/MockUefiLib.inf| 33 +++
>  .../MockUefiRuntimeServicesTableLib.cpp   | 40
> ++
>  .../MockUefiRuntimeServicesTableLib.inf   | 33 +++
>  8 files changed, 202 insertions(+)
>  create mode 100644
> MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h
>  create mode 100644
> MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRuntimeServicesTa
> bleLib.h
>  create mode 100644
> MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.cpp
>  create mode 100644
> MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.inf
>  create mode 100644
> MdePkg/Test/Mock/Library/GoogleTest/MockUefiRuntimeServicesTableLib/
> MockUefiRuntimeServicesTableLib.cpp
>  create mode 100644
> MdePkg/Test/Mock/Library/GoogleTest/MockUefiRuntimeServicesTableLib/
> MockUefiRuntimeServicesTableLib.inf
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 2d643bede1d7..2a1d7694aa18 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -26,6 +26,7 @@ [Defines]
>  [Includes]
>Include
>Test/UnitTest/Include
> +  Test/Mock/Include
> 
>  [Includes.IA32]
>Include/Ia32
> diff --git a/MdePkg/Test/MdePkgHostTest.dsc
> b/MdePkg/Test/MdePkgHostTest.dsc
> index b8b186dd8b17..35e3ef6d9729 100644
> --- a/MdePkg/Test/MdePkgHostTest.dsc
> +++ b/MdePkg/Test/MdePkgHostTest.dsc
> @@ -34,3 +34,5 @@ [Components]
># Build HOST_APPLICATION Libraries
>#
>MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> +  MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.inf
> +
> MdePkg/Test/Mock/Library/GoogleTest/MockUefiRuntimeServicesTableLib/
> MockUefiRuntimeServicesTableLib.inf
> diff --git a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h
> b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h
> new file mode 100644
> index ..dec2c93e1b34
> --- /dev/null
> +++ b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h
> @@ -0,0 +1,39 @@
> +/** @file
> +  Google Test mocks for UefiLib
> +
> +  Copyright (c) 2022, Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +**/
> +
> +#ifndef MOCK_UEFI_LIB_H_
> +#define MOCK_UEFI_LIB_H_
> +
> +#include 
> +#include 
> +extern "C" {
> +#include 
> +#include 
> +}
> +
> +struct MockUefiLib {
> +  MOCK_INTERFACE_DECLARATION (MockUefiLib);
> +
> +  MOCK_FUNCTION_DECLARATION (
> +EFI_STATUS,
> +GetVariable2,
> +(IN CONST CHAR16*Name,
> + IN CONST EFI_GUID  *Guid,
> + OUT VOID   **Value,
> + OUT UINTN  *Size OPTIONAL)
> +);
> +
> +  MOCK_FUNCTION_DECLARATION (
> +EFI_STATUS,
> +GetEfiGlobalVariable2,
> +(IN CONST CHAR16  *Name,
> + OUT VOID **Value,
> + OUT UINTN*Size OPTIONAL)
> +);
> +};
> +
> +#endif
> diff --git
> a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRuntimeServices
> TableLib.h
> b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRuntimeServices
> TableLib.h
> new file mode 100644
> index ..afdfc6b85597
> --- /dev/null
> +++
> b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRuntimeServices
> TableLib.h
> @@ -0,0 +1,42 @@
> +/** @file
> +  Google Test mocks for UefiRuntimeServicesTableLib
> +
> +  Copyright (c) 2022, Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +**/
> +
> +#ifndef MOCK_UEFI_RUNTIME_SERVICES_TABLE_LIB_H_
> +#define MOCK_UEFI_RUNTIME_SERVICES_TABLE_LIB_H_
> +
> +#include 
> +#include 
> +extern "C" {
> +#include 
> +#include 
> +}
> +
> +struct MockUefiRuntimeServicesTableLib {
> +  MOCK_INTERFACE_DECLARATION (MockUefiRuntimeServicesTableLib);
> +
> +  MOCK_FUNCTION_DECLARATION (
> +EFI_STATUS,
> +gRT_GetVariable,
> +(IN  CHAR16*VariableName,
> + IN  EFI_GUID  *VendorGuid,
> + OUT UINT32*Attributes OPTIONAL,
> + IN OUT  UINTN *DataSize,
> + OUT VOID  *Data)
> +);
> +
> +  MOCK_FUNCTION_DECLARATION (
> +EFI_STATUS,
> +gRT_SetVariable,
> +(IN CHAR16*VariableName,
> + IN EFI_GUID  *VendorGuid,
> + IN UINT32Attributes,
> + IN UINTN DataSize,
> + IN VOID  *Data)
> +);
> +};
> +
> +#endif
> diff --git
> 

[edk2-devel] 回复: [Patch v2 10/12] MdePkg/Library/BaseLib: HOST_APPLICATION IA32/X64 only

2023-04-05 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Michael D Kinney 
> 发送时间: 2023年4月5日 2:22
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao ; Zhiguang Liu
> 
> 主题: [Patch v2 10/12] MdePkg/Library/BaseLib: HOST_APPLICATION
> IA32/X64 only
> 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Michael D Kinney 
> ---
>  MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> index 12a5cdcc0a9e..1d53f940f5d0 100644
> --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> @@ -23,7 +23,7 @@ [Defines]
>LIBRARY_CLASS  =
> UnitTestHostBaseLib|HOST_APPLICATION
> 
>  #
> -#  VALID_ARCHITECTURES   = IA32 X64 EBC ARM AARCH64
> RISCV64
> +#  VALID_ARCHITECTURES   = IA32 X64
>  #
> 
>  [Sources]
> --
> 2.39.1.windows.1





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




[edk2-devel] [PATCH tianocore-docs v3 2/2] Readme.md: Update the Gitbook documentation section

2023-04-05 Thread Rebecca Cran
We no longer use Gitbook for publishing the documentation.
Update the section to direct users to use the mailing list to
send feedback, and since we use GitHub Flavored Markdown, remove the
link to Gitbook.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Rebecca Cran 
---
 Readme.md | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/Readme.md b/Readme.md
index 1e4a5d25bd6f..494b23af3ac7 100644
--- a/Readme.md
+++ b/Readme.md
@@ -30,12 +30,11 @@ documentation.
 
 # EDK II GitBook Documents
 
-These are the latest draft revisions published using 
[Gitbook](https://legacy.gitbook.com/).
+These are the latest draft revisions.
 The source content for these documents are in GIT repositories in the
 [Tianocore-docs](https://github.com/tianocore-docs) organization hosted by 
[GitHub](https://github.com).
-Feedback on these documents may be provided using the 
[Gitbook](https://www.gitbook.com) commenting feature
-available when reading the **HTML** versions of the documents. Document issues 
and feature requests can also
-be entered in [Tianocore Bugzilla](https://bugzilla.tianocore.org).
+Feedback on these documents may be provided via the mailing list.
+Document issues and feature requests can also be entered in [Tianocore 
Bugzilla](https://bugzilla.tianocore.org).
 
 * **_EDK II Build Specification_** \[
 [HTML   ](https://tianocore-docs.github.io/edk2-BuildSpecification/draft/),
-- 
2.39.2 (Apple Git-143)



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




[edk2-devel] [PATCH tianocore-docs v3 1/2] Readme.md: convert links from Gitbook to Github Pages

2023-04-05 Thread Rebecca Cran
We no longer publish documentation to gitbook.com, instead
using tianocore-docs.github.io. Update the links to point
to the correct locations.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Rebecca Cran 
Reviewed-by: Michael D Kinney 
---
 Readme.md | 117 +---
 1 file changed, 52 insertions(+), 65 deletions(-)

diff --git a/Readme.md b/Readme.md
index e6d35fa41131..1e4a5d25bd6f 100644
--- a/Readme.md
+++ b/Readme.md
@@ -38,121 +38,108 @@ available when reading the **HTML** versions of the 
documents. Document issues a
 be entered in [Tianocore Bugzilla](https://bugzilla.tianocore.org).
 
 * **_EDK II Build Specification_** \[
-[HTML   
](https://www.gitbook.com/read/book/edk2-docs/edk-ii-build-specification),
-[PDF
](https://www.gitbook.com/download/pdf/book/edk2-docs/edk-ii-build-specification),
-[Mobi   
](https://www.gitbook.com/download/mobi/book/edk2-docs/edk-ii-build-specification),
-[ePub   
](https://www.gitbook.com/download/epub/book/edk2-docs/edk-ii-build-specification),
-[Gitbook](https://www.gitbook.com/book/edk2-docs/edk-ii-build-specification),
+[HTML   ](https://tianocore-docs.github.io/edk2-BuildSpecification/draft/),
+[PDF
](https://tianocore-docs.github.io/edk2-BuildSpecification/draft/edk2-BuildSpecification-draft.pdf),
+[Mobi   
](https://tianocore-docs.github.io/edk2-BuildSpecification/draft/edk2-BuildSpecification-draft.mobi),
+[ePub   
](https://tianocore-docs.github.io/edk2-BuildSpecification/draft/edk2-BuildSpecification-draft.epub),
 [GitHub ](https://github.com/tianocore-docs/edk2-BuildSpecification)
 \]
 
 * **_EDK II DEC Specification_** \[
-[HTML   
](https://www.gitbook.com/read/book/edk2-docs/edk-ii-dec-specification),
-[PDF
](https://www.gitbook.com/download/pdf/book/edk2-docs/edk-ii-dec-specification),
-[Mobi   
](https://www.gitbook.com/download/mobi/book/edk2-docs/edk-ii-dec-specification),
-[ePub   
](https://www.gitbook.com/download/epub/book/edk2-docs/edk-ii-dec-specification),
-[Gitbook](https://www.gitbook.com/book/edk2-docs/edk-ii-dec-specification),
+[HTML   ](https://tianocore-docs.github.io/edk2-DecSpecification/draft/),
+[PDF
](https://tianocore-docs.github.io/edk2-DecSpecification/draft/edk2-DecSpecification-draft.pdf),
+[Mobi   
](https://tianocore-docs.github.io/edk2-DecSpecification/draft/edk2-DecSpecification-draft.mobi),
+[ePub   
](https://tianocore-docs.github.io/edk2-DecSpecification/draft/edk2-DecSpecification-draft.epub),
 [GitHub ](https://github.com/tianocore-docs/edk2-DecSpecification)
 \]
 
 * **_EDK II INF Specification_** \[
-[HTML   
](https://www.gitbook.com/read/book/edk2-docs/edk-ii-inf-specification),
-[PDF
](https://www.gitbook.com/download/pdf/book/edk2-docs/edk-ii-inf-specification),
-[Mobi   
](https://www.gitbook.com/download/mobi/book/edk2-docs/edk-ii-inf-specification),
-[ePub   
](https://www.gitbook.com/download/epub/book/edk2-docs/edk-ii-inf-specification),
-[Gitbook](https://www.gitbook.com/book/edk2-docs/edk-ii-inf-specification),
+[HTML   ](https://tianocore-docs.github.io/edk2-InfSpecification/draft/),
+[PDF
](https://tianocore-docs.github.io/edk2-InfSpecification/draft/edk2-InfSpecification-draft.pdf),
+[Mobi   
](https://tianocore-docs.github.io/edk2-InfSpecification/draft/edk2-InfSpecification-draft.mobi),
+[ePub   
](https://tianocore-docs.github.io/edk2-InfSpecification/draft/edk2-InfSpecification-draft.epub),
 [GitHub ](https://github.com/tianocore-docs/edk2-InfSpecification)
 \]
 
 * **_EDK II DSC Specification_** \[
-[HTML   
](https://www.gitbook.com/read/book/edk2-docs/edk-ii-dsc-specification),
-[PDF
](https://www.gitbook.com/download/pdf/book/edk2-docs/edk-ii-dsc-specification),
-[Mobi   
](https://www.gitbook.com/download/mobi/book/edk2-docs/edk-ii-dsc-specification),
-[ePub   
](https://www.gitbook.com/download/epub/book/edk2-docs/edk-ii-dsc-specification),
-[Gitbook](https://www.gitbook.com/book/edk2-docs/edk-ii-dsc-specification/details),
+[HTML   ](https://tianocore-docs.github.io/edk2-DscSpecification/draft/),
+[PDF
](https://tianocore-docs.github.io/edk2-DscSpecification/draft/edk2-DscSpecification-draft.pdf),
+[Mobi   
](https://tianocore-docs.github.io/edk2-DscSpecification/draft/edk2-DscSpecification-draft.mobi),
+[ePub   
](https://tianocore-docs.github.io/edk2-DscSpecification/draft/edk2-DscSpecification-draft.epub),
 [GitHub ](https://github.com/tianocore-docs/edk2-DscSpecification)
 \]
 
 * **_EDK II FDF Specification_** \[
-[HTML   
](https://www.gitbook.com/read/book/edk2-docs/edk-ii-fdf-specification),
-[PDF
](https://www.gitbook.com/download/pdf/book/edk2-docs/edk-ii-fdf-specification),
-[Mobi   
](https://www.gitbook.com/download/mobi/book/edk2-docs/edk-ii-fdf-specification),
-[ePub   
](https://www.gitbook.com/download/epub/book/edk2-docs/edk-ii-fdf-specification),
-[Gitbook](https://www.gitbook.com/book/edk2-docs/edk-ii-fdf-specification),
+[HTML   ](https://tianocore-docs.github.io/edk2-FdfSpecification/draft/),

[edk2-devel] [PATCH tianocore-docs v3 0/2] Fix links to specifications, guides etc.

2023-04-05 Thread Rebecca Cran
We stopped using Gitbook for publishing documentation a
while ago, and now use GitHub Flavored Markdown
and publish pages to Github Pages at tianocore-docs.github.io.

Fix the links to the draft documentation pages,
and update the text to point users to the mailing list
since they can no longer provide feedback via
gitbook.com.

Changes from v1 to v3:

  Removed the link to gitbook.

Rebecca Cran (2):
  Readme.md: convert links from Gitbook to Github Pages
  Readme.md: Update the Gitbook documentation section

 Readme.md | 124 +---
 1 file changed, 55 insertions(+), 69 deletions(-)

-- 
2.39.2 (Apple Git-143)



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




[edk2-devel] [PATCH tianocore-docs v2 0/2] Fix links to specifications, guides etc.

2023-04-05 Thread Rebecca Cran
We stopped using Gitbook for publishing documentation a
while ago, and now use GitHub Flavored Markdown
and publish pages to Github Pages at tianocore-docs.github.io.

Fix the links to the draft documentation pages,
and update the text to point users to the mailing list
since they can no longer provide feedback via
gitbook.com.

Changes from v1 to v2:

  Removed the link to Gitbook in Readme.md.


Rebecca Cran (2):
  Readme.md: convert links from Gitbook to Github Pages
  Readme.md: Update the Gitbook documentation section

 Readme.md | 124 +---
 1 file changed, 55 insertions(+), 69 deletions(-)

-- 
2.39.2 (Apple Git-143)



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




[edk2-devel] [PATCH tianocore-docs v2 0/2] Fix links to specifications, guides etc.

2023-04-05 Thread Rebecca Cran
We stopped using Gitbook for publishing documentation a
while ago, and now use GitHub Flavored Markdown
and publish pages to Github Pages at tianocore-docs.github.io.

Fix the links to the draft documentation pages,
and update the text to point users to the mailing list
since they can no longer provide feedback via
gitbook.com.

Changes from v1 to v2:

  Removed the link to Gitbook in Readme.md.


Rebecca Cran (2):
  Readme.md: convert links from Gitbook to Github Pages
  Readme.md: Update the Gitbook documentation section

 Readme.md | 124 +---
 1 file changed, 55 insertions(+), 69 deletions(-)

-- 
2.39.2 (Apple Git-143)



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




回复: 回复: 回复: [edk2-devel] [PATCH v2 00/13] BaseTools,CryptoPkg,MdePkg,OvmfPkg: Delete CLANG35,CLANG38,GCC48,GCC49, rename GCC5 to GCC, update CLANGDWARF, delete VS 2008-2013, EBC

2023-04-05 Thread gaoliming via groups.io
Rebecca:
 If you plan to change GCC49 tool chain to GCCNOLTO name, I would suggest to 
take the same rule that adds GCCNOLTO tool chain first. 

 We still have downstream AARCH64 platforms to use GCC49 tool chain now. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Ard
> Biesheuvel
> 发送时间: 2023年4月5日 18:22
> 收件人: Rebecca Cran 
> 抄送: Kinney, Michael D ; Pedro Falcato
> ; devel@edk2.groups.io; Leif Lindholm
> ; Gao, Liming ;
> Oliver Smith-Denny ; Jiang, Guomin
> ; Lu, Xiaoyu1 ; Wang, Jian J
> ; Yao, Jiewen ; Ard
> Biesheuvel ; Justen, Jordan L
> ; Gerd Hoffmann ; Feng,
> Bob C ; Andrew Fish 
> 主题: Re: 回复: 回复: [edk2-devel] [PATCH v2 00/13]
> BaseTools,CryptoPkg,MdePkg,OvmfPkg: Delete
> CLANG35,CLANG38,GCC48,GCC49, rename GCC5 to GCC, update
> CLANGDWARF, delete VS 2008-2013, EBC
> 
> On Tue, 4 Apr 2023 at 20:36, Rebecca Cran  wrote:
> >
> > Thanks, deprecating it for a while makes a lot of sense. We can consider
> > removing it in 6-12 months maybe?
> >
> 
> I would at least wait for a stable release to appear that supports
> both GCC5 and GCC/GCCNOLTO, and then perhaps queue the removal (and
> document it) for the subsequent one?
> 
> 
> 
> 





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




回复: [edk2-devel] please help fix building error

2023-04-05 Thread gaoliming via groups.io
Seemly, you still uses Python2.7. Can you try Python 3 ?

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 luming.jin via groups.io
发送时间: 2023年4月5日 19:35
收件人: devel@edk2.groups.io
主题: [edk2-devel] please help fix building error

 

Hello all

I am trying to build but with following error msg, 

Could you please help?

Active Platform  = 
/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/boot/QcomPkg/SocPkg/Makena/AU/Core.dsc
 done!
#

 

build.py...
: error C0DE: Unknown fatal error when processing 
[/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/boot/QcomPkg/Library/EblCmdLib/EblCmdLib.inf
 [AARCH64, CLANG100LINUX, RELEASE]]

(Please send email to devel@edk2.groups.io   for 
help, attaching following call stack trace!)

 

(Python 2.7.18 on linux2) Traceback (most recent call last):
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2599, in Main
MyBuild.Launch()
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2392, in Launch
self._BuildPlatform()
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 1756, in _BuildPlatform
CmdListDict = self._GenFfsCmd(Wa.ArchList)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2006, in _GenFfsCmd
GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, 
ArchList, GlobalData)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/GenFds.py",
 line 544, in GenFfsMakefile
FvObj.AddToBuffer(Buffer=None, Flag=True)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/Fv.py",
 line 127, in AddToBuffer
FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, 
IsMakefile=Flag, FvName=self.UiFvName)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
 line 518, in GenFfs
InputSectList, InputSectAlignments = self.__GenComplexFileSection__(Rule, 
FvChildAddr, FvParentAddr, IsMakefile=IsMakefile)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
 line 969, in __GenComplexFileSection__
SectList, Align = Sect.GenSection(self.OutputPath, self.ModuleGuid, 
SecIndex, self.KeyStringList, self, IsMakefile = IsMakefile)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/EfiSection.py",
 line 321, in GenSection
IsMakefile=IsMakefile
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py",
 line 502, in GenerateSection
if (os.path.getsize(Output) >= GenFdsGlobalVariable.LARGE_FILE_SIZE and
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/Common/LongFilePathOsPath.py",
 line 21, in getsize
return os.path.getsize(LongFilePath(filename))
  File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: 
'/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/Build/MakenaAU/Core/RELEASE_CLANG100LINUX/FV/Ffs/125E61D7-E824-4943-8BE9-1ADD2B197360MorPpiDxe/125E61D7-E824-4943-8BE9-1ADD2B197360SEC2.1.pe32'

 


- Failed -
Build end time: 19:31:20, Apr.05 2023
Build total time: 00:00:05

 

ERROR: buildex::Run  ['python', 
u'/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py',
 u'-p', u'QcomPkg/SocPkg/Makena/AU/Core.dsc', u'-j', 
u'QcomPkg/SocPkg/Makena/AU/build_Core.log', u'-w', u'-a', u'AARCH64', u'-b', 
u'RELEASE', u'-t', u'CLANG100LINUX', 'cleanall', '-D', 'TARGETPKG=SocPkg', 
'-D', 
'EDK2ROOT=/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2',
 '-D', 
'BOOTTOOLS=/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/boot_tools',
 '-D', u'COMPILER=CLANG100LINUX', '-D', 
u'SECTOOLSROOT=/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/common/sectools',
 '-D', 'QCOMDIR=', '-D', 

回复: [edk2-devel] RFC: Adding an alias to format patches with --stat= and --stat-graph-width=

2023-04-05 Thread gaoliming via groups.io
Rebecca:
 I think this is a good solution to setup Edk2 development environment. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Rebecca Cran
> 发送时间: 2023年4月6日 4:54
> 收件人: devel@edk2.groups.io
> 主题: [edk2-devel] RFC: Adding an alias to format patches with --stat= and
> --stat-graph-width=
> 
> I've noticed several patches recently which has ellipses at the start of
> the diffstat filenames.
> 
> When I started contributing to edk2 I remember being asked to always use
> --stat=1000 --stat-graph-width=20 to avoid that problem: it's mentioned
> in
> https://github.com/tianocore/tianocore.github.io/wiki/Laszlo%27s-unkempt-
> git-guide-for-edk2-contributors-and-maintainers.
> 
> I was wondering if we might want to introduce an alias via SetupGit.py
> to add those parameters automatically?
> 
> For example:
> 
> diff --git a/BaseTools/Scripts/SetupGit.py b/BaseTools/Scripts/SetupGit.py
> index 91814199bf..901d2025ab 100644
> --- a/BaseTools/Scripts/SetupGit.py
> +++ b/BaseTools/Scripts/SetupGit.py
> @@ -82,6 +82,7 @@ OPTIONS = [
>   {'section': 'sendemail',   'option': 'chainreplyto', 'value': False},
>   {'section': 'sendemail',   'option': 'thread', 'value': True},
>   {'section': 'sendemail',   'option': 'transferEncoding', 'value':
> '8bit'},
> +{'section': 'alias',   'option': 'fp', 'value': 'format-patch
> -M --stat=1000 --stat-graph-width=20'},^M
>   ]
> 
> 
> --
> Rebecca Cran
> 
> 
> 
> 
> 





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




[edk2-devel] 回复: [PATCH 1/1] BaseTools: Update antlr makefile to use cc by default

2023-04-05 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Rebecca Cran 
> 发送时间: 2023年4月6日 1:03
> 收件人: devel@edk2.groups.io; Bob Feng ; Liming
> Gao ; Yuwei Chen ;
> Michael D Kinney 
> 抄送: Rebecca Cran 
> 主题: [PATCH 1/1] BaseTools: Update antlr makefile to use cc by default
> 
> Update the antlr makefile to remove the explicit setting of CC to either
> clang or gcc. This causes it to use /usr/bin/cc or whatever the user has
> set $(CC) to.
> 
> This removes the last dependency on gcc for BaseTools.
> 
> Signed-off-by: Rebecca Cran 
> ---
>  BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile | 5 -
>  1 file changed, 5 deletions(-)
> 
> diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
> b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
> index 42b603571fab..746d58b5e24e 100644
> --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
> +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
> @@ -164,11 +164,6 @@ PCCTS_H=../h
>  #
>  #   UNIX  (default)
>  #
> -ifneq ($(CLANG),)
> -CC?=$(CLANG_BIN)clang
> -else ifeq ($(origin CC),default)
> -CC=gcc
> -endif
>  COPT=-O
>  ANTLR=${BIN_DIR}/antlr
>  DLG=${BIN_DIR}/dlg
> --
> 2.40.0





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




Re: [edk2-devel] [edk2][PATCH 1/1] MdeModulePkg: Add EDKII Platform Boot Manager Protocol v2

2023-04-05 Thread Rebecca Cran

Tinh,


You appear to be sending emails in quoted-printable format, while we 
prefer them in 8bit encoding: quoted-printable causes issues such as 
equals signs being replaced with "=3D" in the plain text for example.


Could you make sure you've run "python3 BaseTools/Scripts/SetupGit.py" 
for the repo please?


It makes several additions to .git/config, including:


[format]
    coverLetter = True
    numbered = True
    signoff = False
[sendemail]
    chainreplyto = False
    thread = True
    transferEncoding = 8bit
    to = devel@edk2.groups.io


--
Rebecca Cran


On 4/5/23 12:11 AM, Tinh Nguyen via groups.io wrote:

This introduces the EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2,
which adds a new UpdateBootOrder() function to support customizing
the boot options order according to the platform-specific policy.

Signed-off-by: Tinh Nguyen 
---
  MdeModulePkg/Include/Protocol/PlatformBootManager.h | 24 +++-
  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c|  9 
  2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/Protocol/PlatformBootManager.h 
b/MdeModulePkg/Include/Protocol/PlatformBootManager.h
index e527b0ee0eaf..758bc2deb774 100644
--- a/MdeModulePkg/Include/Protocol/PlatformBootManager.h
+++ b/MdeModulePkg/Include/Protocol/PlatformBootManager.h
@@ -1,6 +1,7 @@
  /** @file

  


Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.

+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.

  


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

  


@@ -29,7 +30,8 @@ typedef struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL 
EDKII_PLATFORM_BOOT_MANAGER
  //  All future revisions must be backwards compatible.

  //  If a future version is not back wards compatible it is not the 
same GUID.

  //

-#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION  0x0001

+#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION   0x0001

+#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2  0x0002

  


  //

  // Function Prototypes

@@ -72,9 +74,29 @@ EFI_STATUS
OUT   UINTN*UpdatedBootOptionsCount

);

  


+/**

+  This function allows platform to update the DriverOrder/BootOrder variables.

+  And it is available from version 2 of the EDKII Platform Boot Manager 
protocol.

+

+  @retval EFI_SUCCESS  Platform successfully modifies

+   the DriverOrder/BootOrder variables as wanted.

+  @retval Others   There are some errors that happen. Check the status code

+   for details.

+

+**/

+typedef

+EFI_STATUS

+(EFIAPI *PLATFORM_BOOT_MANAGER_UPDATE_BOOT_ORDER)(

+  IN VOID

+  );

+

  struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL {

UINT64Revision;

PLATFORM_BOOT_MANAGER_REFRESH_ALL_BOOT_OPTIONSRefreshAllBootOptions;

+  //

+  // EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2

+  //

+  PLATFORM_BOOT_MANAGER_UPDATE_BOOT_ORDER   UpdateBootOrder;

  };

  


  extern EFI_GUID  gEdkiiPlatformBootManagerProtocolGuid;

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index bde22fa6590e..67d1d54b3c24 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -4,6 +4,7 @@
  Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.

  Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.

  (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP

+Copyright (c) 2023, Ampere Computing LLC. All rights reserved.

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

  


  **/

@@ -2412,6 +2413,8 @@ EfiBootManagerRefreshAllBootOption (
BootOptions = UpdatedBootOptions;

BootOptionCount = UpdatedBootOptionCount;

  }

+  } else {

+PlatformBootManager = NULL;

}

  


NvBootOptions = EfiBootManagerGetLoadOptions (, 
LoadOptionTypeBoot);

@@ -2453,6 +2456,12 @@ EfiBootManagerRefreshAllBootOption (
  


EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);

EfiBootManagerFreeLoadOptions (NvBootOptions, NvBootOptionCount);

+

+  if ((PlatformBootManager != NULL) &&

+  (PlatformBootManager->Revision >= 
EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2))

+  {

+PlatformBootManager->UpdateBootOrder ();

+  }

  }

  


  /**

--
2.39.2








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




Re: [edk2-devel] [Patch v2 01/12] UnitTestFrameworkPkg: Add subhook submodule required for gmock

2023-04-05 Thread Michael D Kinney
Hi Leif,

Thanks for the review.

The work on this started in 2022, so the copyright dates
should be correct.

Rest of comments addressed below.

Mike


> -Original Message-
> From: Leif Lindholm 
> Sent: Wednesday, April 5, 2023 11:17 AM
> To: devel@edk2.groups.io; Kinney, Michael D 
> Cc: Johnson, Chris N ; Andrew Fish 
> ; Michael Kubacki
> ; Sean Brogan 
> Subject: Re: [edk2-devel] [Patch v2 01/12] UnitTestFrameworkPkg: Add subhook 
> submodule required for gmock
> 
> On Tue, Apr 04, 2023 at 11:22:09 -0700, Michael D Kinney wrote:
> > From: Chris Johnson 
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4389
> >
> > Add subhook submodule that is required to hook internal functions
> > when using gmock.
> >
> > https://github.com/Zeex/subhook
> >
> > Add SubhookLib library class and SubhookLib library instance.
> > Include the SUBHOOK_STATIC define in the SubhookLib INF file so
> > it builds as a static library. Also include the SUBHOOK_STATIC
> > define in SubhookLib.h so all modules using SubhookLib properly
> > link SubhookLib as a static library.
> >
> > Cc: Andrew Fish 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> > Cc: Michael Kubacki 
> > Cc: Sean Brogan 
> > Signed-off-by: Chris Johnson 
> 
> I have some nitpicks below, which you can take into account or
> not. Regardless:
> 
> Reviewed-by: Leif Lindholm 
> 
> > ---
> >  .gitmodules   |  3 ++
> >  ReadMe.rst|  1 +
> >  .../Include/Library/SubhookLib.h  | 15 
> >  .../Library/SubhookLib/SubhookLib.inf | 36 +++
> >  .../Library/SubhookLib/SubhookLib.uni | 11 ++
> >  .../Library/SubhookLib/subhook|  1 +
> >  .../Test/UnitTestFrameworkPkgHostTest.dsc |  1 +
> >  UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec |  2 ++
> >  .../UnitTestFrameworkPkgHost.dsc.inc  |  1 +
> >  9 files changed, 71 insertions(+)
> >  create mode 100644 UnitTestFrameworkPkg/Include/Library/SubhookLib.h
> >  create mode 100644 UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
> >  create mode 100644 UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.uni
> >  create mode 16 UnitTestFrameworkPkg/Library/SubhookLib/subhook
> >
> > diff --git a/.gitmodules b/.gitmodules
> > index 8011a88d9d25..fe8a43be93ba 100644
> > --- a/.gitmodules
> > +++ b/.gitmodules
> > @@ -23,3 +23,6 @@
> >  [submodule "UnitTestFrameworkPkg/Library/GoogleTestLib/googletest"]
> > path = UnitTestFrameworkPkg/Library/GoogleTestLib/googletest
> > url = https://github.com/google/googletest.git
> > +[submodule "UnitTestFrameworkPkg/Library/SubhookLib/subhook"]
> > +   path = UnitTestFrameworkPkg/Library/SubhookLib/subhook
> > +   url = https://github.com/Zeex/subhook.git
> > diff --git a/ReadMe.rst b/ReadMe.rst
> > index 497d96355908..91b9cf3c5e50 100644
> > --- a/ReadMe.rst
> > +++ b/ReadMe.rst
> > @@ -94,6 +94,7 @@ that are covered by additional licenses.
> >  -  `MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
> `__
> >  -  `UnitTestFrameworkPkg/Library/CmockaLib/cmocka 
> >  cmocka/blob/f5e2cd77c88d9f792562888d2b70c5a396bfbf7a/COPYING>`__
> >  -  `UnitTestFrameworkPkg/Library/GoogleTestLib/googletest
> `__
> > +-  `UnitTestFrameworkPkg/Library/SubhookLib/subhook
> `__
> >  -  `RedfishPkg/Library/JsonLib/jansson
> `__
> >
> >  The EDK II Project is composed of packages. The maintainers for each 
> > package
> > diff --git a/UnitTestFrameworkPkg/Include/Library/SubhookLib.h 
> > b/UnitTestFrameworkPkg/Include/Library/SubhookLib.h
> > new file mode 100644
> > index ..46783adfccfb
> > --- /dev/null
> > +++ b/UnitTestFrameworkPkg/Include/Library/SubhookLib.h
> > @@ -0,0 +1,15 @@
> > +/** @file
> > +  SubhookLib class with APIs from the subhook project
> > +
> > +  Copyright (c) 2022, Intel Corporation. All rights reserved.
> 
> 2023?
> 
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#ifndef SUBHOOK_LIB_H_
> > +#define SUBHOOK_LIB_H_
> > +
> > +#define SUBHOOK_STATIC
> > +#include 
> > +
> > +#endif
> > diff --git a/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
> b/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
> > new file mode 100644
> > index ..e8e8ffb90750
> > --- /dev/null
> > +++ b/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
> > @@ -0,0 +1,36 @@
> > +## @file
> > +#  This module provides Subhook Library implementation.
> > +#
> > +#  Copyright (c) 2022, Intel Corporation. All rights reserved.
> 
> 2023?
> 
> > +#  

[edk2-devel] RFC: Adding an alias to format patches with --stat= and --stat-graph-width=

2023-04-05 Thread Rebecca Cran
I've noticed several patches recently which has ellipses at the start of 
the diffstat filenames.


When I started contributing to edk2 I remember being asked to always use 
--stat=1000 --stat-graph-width=20 to avoid that problem: it's mentioned 
in 
https://github.com/tianocore/tianocore.github.io/wiki/Laszlo%27s-unkempt-git-guide-for-edk2-contributors-and-maintainers.


I was wondering if we might want to introduce an alias via SetupGit.py 
to add those parameters automatically?


For example:

diff --git a/BaseTools/Scripts/SetupGit.py b/BaseTools/Scripts/SetupGit.py
index 91814199bf..901d2025ab 100644
--- a/BaseTools/Scripts/SetupGit.py
+++ b/BaseTools/Scripts/SetupGit.py
@@ -82,6 +82,7 @@ OPTIONS = [
 {'section': 'sendemail',   'option': 'chainreplyto', 'value': False},
 {'section': 'sendemail',   'option': 'thread', 'value': True},
 {'section': 'sendemail',   'option': 'transferEncoding', 'value': 
'8bit'},
+    {'section': 'alias',   'option': 'fp', 'value': 'format-patch 
-M --stat=1000 --stat-graph-width=20'},^M

 ]


--
Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102568): https://edk2.groups.io/g/devel/message/102568
Mute This Topic: https://groups.io/mt/98091795/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/Conf/tools_def: Fix linking using CLANGDWARF_IA32

2023-04-05 Thread Rebecca Cran
Pushed as 
https://github.com/tianocore/edk2/commit/2bb693894920e634153275bea60278a9f192a8ef



--
Rebecca Cran


On 4/5/23 11:15 AM, Rebecca Cran wrote:

Reviewed-by: Rebecca Cran 


On 3/30/23 3:48 AM, Patrick Rudolph wrote:

The clang toolchain might default to fPIE/fPIC, which prevents
lld from linking the objects into a binary.

Specify -fno-pie -fno-pic as done on GCC to fix linking.

Test:
Building the Universal Payload using the command
'python UefiPayloadPkg/UniversalPayloadBuild.py -a IA32' actually
works.

Signed-off-by: Patrick Rudolph 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4356
---
  BaseTools/Conf/tools_def.template | 14 +++---
  1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template

index 471eb67c0c..9b59bd75c3 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -2888,7 +2888,7 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS = 
-Wl,--defsym=PECOFF_HEADER_SIZE=0x22
  *_CLANGDWARF_IA32_RC_PATH  = 
DEF(CLANGDWARF_IA32_PREFIX)llvm-rc
    *_CLANGDWARF_IA32_ASLCC_FLAGS  = DEF(GCC_ASLCC_FLAGS) 
-m32 -fno-lto DEF(CLANG38_IA32_TARGET)
-*_CLANGDWARF_IA32_ASLDLINK_FLAGS   = 
DEF(CLANGDWARF_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386 -fuse-ld=lld
+*_CLANGDWARF_IA32_ASLDLINK_FLAGS   = 
DEF(CLANGDWARF_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386 -fuse-ld=lld 
-no-pie
  *_CLANGDWARF_IA32_ASM_FLAGS    = DEF(GCC5_ASM_FLAGS) -m32 
-march=i386 DEF(CLANG38_IA32_TARGET)

  *_CLANGDWARF_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
  *_CLANGDWARF_IA32_OBJCOPY_FLAGS    =
@@ -2897,17 +2897,17 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS    = 
-Wl,--defsym=PECOFF_HEADER_SIZE=0x22
  *_CLANGDWARF_IA32_ASLPP_FLAGS  = DEF(GCC_ASLPP_FLAGS) 
DEF(CLANG38_IA32_TARGET)
  *_CLANGDWARF_IA32_VFRPP_FLAGS  = DEF(GCC_VFRPP_FLAGS) 
DEF(CLANG38_IA32_TARGET)
  -DEBUG_CLANGDWARF_IA32_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS) 
-m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) -g -malign-double
+DEBUG_CLANGDWARF_IA32_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS) 
-fno-pic -fno-pie -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) 
-g -malign-double
  DEBUG_CLANGDWARF_IA32_DLINK_FLAGS  = 
DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -flto -Wl,-O3 -Wl,-melf_i386 
-Wl,--oformat,elf32-i386
-DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS = 
DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld
+DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS = 
DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld -no-pie
  -RELEASE_CLANGDWARF_IA32_CC_FLAGS   = DEF(CLANG38_ALL_CC_FLAGS) 
-m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) -malign-double
+RELEASE_CLANGDWARF_IA32_CC_FLAGS   = DEF(CLANG38_ALL_CC_FLAGS) 
-fno-pic -fno-pie -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) 
-malign-double
  RELEASE_CLANGDWARF_IA32_DLINK_FLAGS    = 
DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -flto -Wl,-O3 -Wl,-melf_i386 
-Wl,--oformat,elf32-i386
-RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS   = 
DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld
+RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS   = 
DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld -no-pie
  -NOOPT_CLANGDWARF_IA32_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS) 
-m32 -O0 -march=i586 DEF(CLANG38_IA32_TARGET) -g -malign-double
+NOOPT_CLANGDWARF_IA32_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS) 
-fno-pic -fno-pie -m32 -O0 -march=i586 DEF(CLANG38_IA32_TARGET) -g 
-malign-double
  NOOPT_CLANGDWARF_IA32_DLINK_FLAGS  = 
DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -Wl,-O0 -Wl,-melf_i386 
-Wl,--oformat,elf32-i386
-NOOPT_CLANGDWARF_IA32_DLINK2_FLAGS = 
DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O0 -fuse-ld=lld
+NOOPT_CLANGDWARF_IA32_DLINK2_FLAGS = 
DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O0 -fuse-ld=lld -no-pie

    ##
  # CLANGDWARF X64 definitions









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102567): https://edk2.groups.io/g/devel/message/102567
Mute This Topic: https://groups.io/mt/97947217/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 00/12] Add gmock support for host-based unit testing

2023-04-05 Thread Oliver Smith-Denny

Thanks for sending this out, looks to be a pretty clean unit
testing interface. We are testing this now with some of
our unit tests and will update with any feedback.

In the meantime, for the patchset:

Reviewed-by: Oliver Smith-Denny 

On 4/4/2023 11:22 AM, Michael D Kinney wrote:

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

PR: https://github.com/tianocore/edk2/pull/4180
Branch: 
https://github.com/mdkinney/edk2/tree/Bug_4389_UnitTestFrameworkPkg_AddGoogleMockSupport

New in v2
==
* SecurityPkg: Add unit test descriptions to SecureBootVariableLibGoogleTest
* MdeModulePkg: Add unit test descriptions to UefiSortLibGoogleTest
* UnitTestFrameworkPkg: Update ReadMe.md based on review findings
   * Fix FunctionMockLib example of the MockUefiLib declaration to align with
 the design code.
   * Fix FunctionMockLib Mocks header file location paths in the tables.
   * Fix FunctionMockLib Mocks example (and description) of the MockUefiLib
 declaration to align with the design code.
   * Fix FunctionMockLib Mocks example (and description) of the MockUefiLib
 INF file to align with the design file.
   * Fix typos in new Code Coverage section.

V1
===
* Add subhook submodule that is required to hook internal functions
   when using gmock.
* Add gmock support to GoogleTestLib
* Add FunctionMockLib library class and library instance
* Add GoogleTest extension to GoogleTestLib.h for CHAR16 type
* Add GoogleTest extension to GoogleTestLib.h for buffer types
* Add gmock documentation
* Add gmock examples
* Fix VS20xx 4122 errors in SecurityPkg unit test
* HOST_APPLICATION only supports IA32/X64

Cc: Michael Kubacki 
Cc: Nate DeSimone 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Jiewen Yao 
Cc: Michael D Kinney 
Cc: Sean Brogan 
Cc: Michael Kubacki 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Signed-off-by: Chris Johnson 

Chris Johnson (7):
   UnitTestFrameworkPkg: Add subhook submodule required for gmock
   .pytool/CISettings.py: Add subhook submodule
   UnitTestFrameworkPkg:  Add gmock support to GoogleTestLib
   UnitTestFrameworkPkg/ReadMe.md: Add gmock documentation
   MdePkg: Add gmock examples
   MdeModulePkg/Library/UefiSortLib: Add GoogleTestLib example
   SecurityPkg: Add gmock example

Michael D Kinney (5):
   SecurityPkg/Library/SecureBootVariableLib: Fix VS20xx 4122 errors
   SecurityPkg/Library/SecureBootVariableLib: HOST_APPLICATION IA32/X64
 only
   MdePkg/Library/BaseLib: HOST_APPLICATION IA32/X64 only
   MdeModulePkg: HOST_APPLICATION IA32/X64 only
   PrmPkg/Library: HOST_APPLICATION IA32/X64 only

  .gitmodules   |3 +
  .pytool/CISettings.py |2 +
  .../MockUefiRuntimeServicesTableLib.inf   |6 +-
  .../GoogleTest/UefiSortLibGoogleTest.cpp  |   61 +
  .../GoogleTest/UefiSortLibGoogleTest.inf  |   31 +
  MdeModulePkg/Test/MdeModulePkgHostTest.dsc|6 +
  .../VariableLockRequestToLockUnitTest.inf |2 +-
  .../Library/BaseLib/UnitTestHostBaseLib.inf   |2 +-
  MdePkg/MdePkg.dec |1 +
  MdePkg/Test/MdePkgHostTest.dsc|2 +
  .../Include/GoogleTest/Library/MockUefiLib.h  |   39 +
  .../Library/MockUefiRuntimeServicesTableLib.h |   42 +
  .../GoogleTest/MockUefiLib/MockUefiLib.cpp|   12 +
  .../GoogleTest/MockUefiLib/MockUefiLib.inf|   33 +
  .../MockUefiRuntimeServicesTableLib.cpp   |   40 +
  .../MockUefiRuntimeServicesTableLib.inf   |   33 +
  .../DxePrmContextBufferLibUnitTestHost.inf|2 +-
  .../DxePrmModuleDiscoveryLibUnitTestHost.inf  |2 +-
  ReadMe.rst|1 +
  .../SecureBootVariableLibGoogleTest.cpp   |  174 +++
  .../SecureBootVariableLibGoogleTest.inf   |   32 +
  .../UnitTest/MockPlatformPKProtectionLib.inf  |6 +-
  .../UnitTest/MockUefiLib.inf  |6 +-
  .../MockUefiRuntimeServicesTableLib.inf   |6 +-
  .../UnitTest/SecureBootVariableLibUnitTest.c  |  172 ++-
  SecurityPkg/SecurityPkg.dec   |1 +
  .../Library/MockPlatformPKProtectionLib.h |   28 +
  .../MockPlatformPKProtectionLib.cpp   |   11 +
  .../MockPlatformPKProtectionLib.inf   |   34 +
  SecurityPkg/Test/SecurityPkgHostTest.dsc  |8 +
  .../Include/Library/FunctionMockLib.h |  131 +++
  .../Include/Library/GoogleTestLib.h   |   96 ++
  .../Include/Library/SubhookLib.h  |   15 +
  .../Library/CmockaLib/CmockaLib.inf   |2 +-
  .../Library/FunctionMockLib/FunctionMockLib.c |7 +
  .../FunctionMockLib/FunctionMockLib.inf   |   31 +
  .../FunctionMockLib/FunctionMockLib.uni   |   11 +
  .../Library/GoogleTestLib/GoogleTestLib.inf   |6 +-
  .../Library/GoogleTestLib/GoogleTestLib.uni   |3 -
  .../SubhookLib.inf}   |   16 +-
  .../Library/SubhookLib/SubhookLib.uni |   11 +
  .../Library/SubhookLib/subhook|1 +

Re: [edk2-devel] [RFC] [edk2-openssl fork] Add openssl fork repo to Tianocore to support OpenSSL11_EOL

2023-04-05 Thread Leif Lindholm
On Wed, Apr 05, 2023 at 13:39:21 +0200, Gerd Hoffmann wrote:
> On Wed, Apr 05, 2023 at 01:37:23AM +, Yao, Jiewen wrote:
> > Hi
> > This is follow up for the "Openssl1.1 replacement proposal" 
> > https://edk2.groups.io/g/devel/topic/96741156.
> > openssl 3.0 POC result is shown at 
> > https://github.com/tianocore/edk2-staging/blob/OpenSSL11_EOL/CryptoPkg/Readme-OpenSSL3.0.md
> > The size increase is reduced to ~10%.
> > 
> > In order to achieve maximum size optimization for openssl 3.0, we
> > updated openssl 3.0 branch and recorded to
> > https://github.com/liyi77/openssl/tree/openssl-3.0-POC.
> > To help the community review and feedback the openssl 3.0 change
> > and plan to openssl upstream in the future, we should avoid
> > personal branch usage.
> 
> I fail to see the point.  To get the openssl changes merged upstream
> you needed engage with the openssl community, and I don't see how a
> tianocore openssl repository helps with that.

Here is my understanding:
- There is a concern that this change may break existing use-cases,
  and the proposal is to collate current state of work - undergoing
  upstreaming to openssl - so that the tianocore community (and
  downstream consumers) can start testing it with minimal amount of
  faff.
- There is *no* plan for the edk2 repository to switch to using this
  submodule.

If that understanding is correct, as long as the README.md is updated
to clearly state that this repository is for integration and
verification purposes only - at the very top - I think this is a good
thing.

/
Leif


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




Re: [edk2-devel] [Patch v2 01/12] UnitTestFrameworkPkg: Add subhook submodule required for gmock

2023-04-05 Thread Leif Lindholm
On Tue, Apr 04, 2023 at 11:22:09 -0700, Michael D Kinney wrote:
> From: Chris Johnson 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4389
> 
> Add subhook submodule that is required to hook internal functions
> when using gmock.
> 
> https://github.com/Zeex/subhook
> 
> Add SubhookLib library class and SubhookLib library instance.
> Include the SUBHOOK_STATIC define in the SubhookLib INF file so
> it builds as a static library. Also include the SUBHOOK_STATIC
> define in SubhookLib.h so all modules using SubhookLib properly
> link SubhookLib as a static library.
> 
> Cc: Andrew Fish 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Michael Kubacki 
> Cc: Sean Brogan 
> Signed-off-by: Chris Johnson 

I have some nitpicks below, which you can take into account or
not. Regardless:

Reviewed-by: Leif Lindholm 

> ---
>  .gitmodules   |  3 ++
>  ReadMe.rst|  1 +
>  .../Include/Library/SubhookLib.h  | 15 
>  .../Library/SubhookLib/SubhookLib.inf | 36 +++
>  .../Library/SubhookLib/SubhookLib.uni | 11 ++
>  .../Library/SubhookLib/subhook|  1 +
>  .../Test/UnitTestFrameworkPkgHostTest.dsc |  1 +
>  UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec |  2 ++
>  .../UnitTestFrameworkPkgHost.dsc.inc  |  1 +
>  9 files changed, 71 insertions(+)
>  create mode 100644 UnitTestFrameworkPkg/Include/Library/SubhookLib.h
>  create mode 100644 UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
>  create mode 100644 UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.uni
>  create mode 16 UnitTestFrameworkPkg/Library/SubhookLib/subhook
> 
> diff --git a/.gitmodules b/.gitmodules
> index 8011a88d9d25..fe8a43be93ba 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -23,3 +23,6 @@
>  [submodule "UnitTestFrameworkPkg/Library/GoogleTestLib/googletest"]
>   path = UnitTestFrameworkPkg/Library/GoogleTestLib/googletest
>   url = https://github.com/google/googletest.git
> +[submodule "UnitTestFrameworkPkg/Library/SubhookLib/subhook"]
> + path = UnitTestFrameworkPkg/Library/SubhookLib/subhook
> + url = https://github.com/Zeex/subhook.git
> diff --git a/ReadMe.rst b/ReadMe.rst
> index 497d96355908..91b9cf3c5e50 100644
> --- a/ReadMe.rst
> +++ b/ReadMe.rst
> @@ -94,6 +94,7 @@ that are covered by additional licenses.
>  -  `MdeModulePkg/Universal/RegularExpressionDxe/oniguruma 
> `__
>  -  `UnitTestFrameworkPkg/Library/CmockaLib/cmocka 
> `__
>  -  `UnitTestFrameworkPkg/Library/GoogleTestLib/googletest 
> `__
> +-  `UnitTestFrameworkPkg/Library/SubhookLib/subhook 
> `__
>  -  `RedfishPkg/Library/JsonLib/jansson 
> `__
>  
>  The EDK II Project is composed of packages. The maintainers for each package
> diff --git a/UnitTestFrameworkPkg/Include/Library/SubhookLib.h 
> b/UnitTestFrameworkPkg/Include/Library/SubhookLib.h
> new file mode 100644
> index ..46783adfccfb
> --- /dev/null
> +++ b/UnitTestFrameworkPkg/Include/Library/SubhookLib.h
> @@ -0,0 +1,15 @@
> +/** @file
> +  SubhookLib class with APIs from the subhook project
> +
> +  Copyright (c) 2022, Intel Corporation. All rights reserved.

2023?

> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef SUBHOOK_LIB_H_
> +#define SUBHOOK_LIB_H_
> +
> +#define SUBHOOK_STATIC
> +#include 
> +
> +#endif
> diff --git a/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf 
> b/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
> new file mode 100644
> index ..e8e8ffb90750
> --- /dev/null
> +++ b/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
> @@ -0,0 +1,36 @@
> +## @file
> +#  This module provides Subhook Library implementation.
> +#
> +#  Copyright (c) 2022, Intel Corporation. All rights reserved.

2023?

> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION = 0x00010005

A bit ancient for a new module.

> +  BASE_NAME   = SubhookLib
> +  MODULE_UNI_FILE = SubhookLib.uni
> +  FILE_GUID   = 70E03378-E140-46A8-8E65-7719DA14A240
> +  MODULE_TYPE = BASE
> +  VERSION_STRING  = 0.1
> +  LIBRARY_CLASS   = SubhookLib|HOST_APPLICATION
> +
> +#
> +#  VALID_ARCHITECTURES   = IA32 X64

Surely not true?

> +#
> +
> +[Sources]
> +  subhook/subhook.c
> +
> +[Packages]
> +  UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> +
> +[BuildOptions]
> +  MSFT:*_*_*_CC_FLAGS == /c /EHsc /Zi /DSUBHOOK_STATIC
> +  MSFT:NOOPT_*_*_CC_FLAGS =  /Od
> +
> +  

Re: [edk2-devel] [PATCH v1 0/1] Define security policy in SECURITY.md file for repository

2023-04-05 Thread Leif Lindholm

On 2023-03-09 19:43, Kun Qin wrote:

This change added a markdown file as a policy guideline for Tianocore EDK2
community to handle security sensitive reports.

Patch v1 branch: https://github.com/kuqin12/edk2/tree/patch-1

Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Miki Demeter 
Cc: Sean Brogan 

Sean Brogan (1):
   Define security policy in SECURITY.md file for repository

  SECURITY.md | 33 
  1 file changed, 33 insertions(+)
  create mode 100644 SECURITY.md


Nitpick: edk2 is alternaltingly capitalised or not in the readme.
But

Reviewed-by: Leif Lindholm 



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




[edk2-devel] please help fix building error

2023-04-05 Thread luming.jin via groups.io
Hello all
I am trying to build but with following error msg,
Could you please help?

Active Platform  = 
/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/boot/QcomPkg/SocPkg/Makena/AU/Core.dsc
 done!
#



build.py...
: error C0DE: Unknown fatal error when processing 
[/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/boot/QcomPkg/Library/EblCmdLib/EblCmdLib.inf
 [AARCH64, CLANG100LINUX, RELEASE]]

(Please send email to devel@edk2.groups.io for help, attaching following call 
stack trace!)



(Python 2.7.18 on linux2) Traceback (most recent call last):
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2599, in Main
MyBuild.Launch()
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2392, in Launch
self._BuildPlatform()
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 1756, in _BuildPlatform
CmdListDict = self._GenFfsCmd(Wa.ArchList)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2006, in _GenFfsCmd
GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, 
ArchList, GlobalData)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/GenFds.py",
 line 544, in GenFfsMakefile
FvObj.AddToBuffer(Buffer=None, Flag=True)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/Fv.py",
 line 127, in AddToBuffer
FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, 
IsMakefile=Flag, FvName=self.UiFvName)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
 line 518, in GenFfs
InputSectList, InputSectAlignments = self.__GenComplexFileSection__(Rule, 
FvChildAddr, FvParentAddr, IsMakefile=IsMakefile)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
 line 969, in __GenComplexFileSection__
SectList, Align = Sect.GenSection(self.OutputPath, self.ModuleGuid, 
SecIndex, self.KeyStringList, self, IsMakefile = IsMakefile)
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/EfiSection.py",
 line 321, in GenSection
IsMakefile=IsMakefile
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py",
 line 502, in GenerateSection
if (os.path.getsize(Output) >= GenFdsGlobalVariable.LARGE_FILE_SIZE and
  File 
"/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/Common/LongFilePathOsPath.py",
 line 21, in getsize
return os.path.getsize(LongFilePath(filename))
  File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: 
'/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/Build/MakenaAU/Core/RELEASE_CLANG100LINUX/FV/Ffs/125E61D7-E824-4943-8BE9-1ADD2B197360MorPpiDxe/125E61D7-E824-4943-8BE9-1ADD2B197360SEC2.1.pe32'



- Failed -
Build end time: 19:31:20, Apr.05 2023
Build total time: 00:00:05



ERROR: buildex::Run  ['python', 
u'/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2/BaseTools/Source/Python/build/build.py',
 u'-p', u'QcomPkg/SocPkg/Makena/AU/Core.dsc', u'-j', 
u'QcomPkg/SocPkg/Makena/AU/build_Core.log', u'-w', u'-a', u'AARCH64', u'-b', 
u'RELEASE', u'-t', u'CLANG100LINUX', 'cleanall', '-D', 'TARGETPKG=SocPkg', 
'-D', 
'EDK2ROOT=/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/edk2',
 '-D', 
'BOOTTOOLS=/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/boot_tools',
 '-D', u'COMPILER=CLANG100LINUX', '-D', 
u'SECTOOLSROOT=/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/common/sectools',
 '-D', 'QCOMDIR=', '-D', 'TARGETID=SocMakena', '-D', u'VAR=AU', '-D', 
'TARGETROOT=QcomPkg/SocPkg/Makena', '-D', 
u'BOOTROOT=/home/luming/01_work/01_project/8295/rse/sa8295p-hqx-4-5-5-1_amss_standard_oem/boot/boot_images/boot',
 '-D', 

Re: [edk2-devel] [PATCH 1/1] BaseTools/Conf/tools_def: Fix linking using CLANGDWARF_IA32

2023-04-05 Thread Rebecca Cran

Reviewed-by: Rebecca Cran 


On 3/30/23 3:48 AM, Patrick Rudolph wrote:

The clang toolchain might default to fPIE/fPIC, which prevents
lld from linking the objects into a binary.

Specify -fno-pie -fno-pic as done on GCC to fix linking.

Test:
Building the Universal Payload using the command
'python UefiPayloadPkg/UniversalPayloadBuild.py -a IA32' actually
works.

Signed-off-by: Patrick Rudolph 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4356
---
  BaseTools/Conf/tools_def.template | 14 +++---
  1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 471eb67c0c..9b59bd75c3 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -2888,7 +2888,7 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS= 
-Wl,--defsym=PECOFF_HEADER_SIZE=0x22
  *_CLANGDWARF_IA32_RC_PATH  = DEF(CLANGDWARF_IA32_PREFIX)llvm-rc
  
  *_CLANGDWARF_IA32_ASLCC_FLAGS  = DEF(GCC_ASLCC_FLAGS) -m32 -fno-lto DEF(CLANG38_IA32_TARGET)

-*_CLANGDWARF_IA32_ASLDLINK_FLAGS   = 
DEF(CLANGDWARF_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386 -fuse-ld=lld
+*_CLANGDWARF_IA32_ASLDLINK_FLAGS   = 
DEF(CLANGDWARF_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386 -fuse-ld=lld -no-pie
  *_CLANGDWARF_IA32_ASM_FLAGS= DEF(GCC5_ASM_FLAGS) -m32 -march=i386 
DEF(CLANG38_IA32_TARGET)
  *_CLANGDWARF_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
  *_CLANGDWARF_IA32_OBJCOPY_FLAGS=
@@ -2897,17 +2897,17 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS= 
-Wl,--defsym=PECOFF_HEADER_SIZE=0x22
  *_CLANGDWARF_IA32_ASLPP_FLAGS  = DEF(GCC_ASLPP_FLAGS) 
DEF(CLANG38_IA32_TARGET)
  *_CLANGDWARF_IA32_VFRPP_FLAGS  = DEF(GCC_VFRPP_FLAGS) 
DEF(CLANG38_IA32_TARGET)
  
-DEBUG_CLANGDWARF_IA32_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) -g -malign-double

+DEBUG_CLANGDWARF_IA32_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS) -fno-pic 
-fno-pie -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) -g -malign-double
  DEBUG_CLANGDWARF_IA32_DLINK_FLAGS  = DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) 
-flto -Wl,-O3 -Wl,-melf_i386 -Wl,--oformat,elf32-i386
-DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS = DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 
-fuse-ld=lld
+DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS = DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 
-fuse-ld=lld -no-pie
  
-RELEASE_CLANGDWARF_IA32_CC_FLAGS   = DEF(CLANG38_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) -malign-double

+RELEASE_CLANGDWARF_IA32_CC_FLAGS   = DEF(CLANG38_ALL_CC_FLAGS) -fno-pic 
-fno-pie -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) -malign-double
  RELEASE_CLANGDWARF_IA32_DLINK_FLAGS= DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) 
-flto -Wl,-O3 -Wl,-melf_i386 -Wl,--oformat,elf32-i386
-RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS   = DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 
-fuse-ld=lld
+RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS   = DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 
-fuse-ld=lld -no-pie
  
-NOOPT_CLANGDWARF_IA32_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS) -m32 -O0 -march=i586 DEF(CLANG38_IA32_TARGET) -g -malign-double

+NOOPT_CLANGDWARF_IA32_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS) -fno-pic 
-fno-pie -m32 -O0 -march=i586 DEF(CLANG38_IA32_TARGET) -g -malign-double
  NOOPT_CLANGDWARF_IA32_DLINK_FLAGS  = DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) 
-Wl,-O0 -Wl,-melf_i386 -Wl,--oformat,elf32-i386
-NOOPT_CLANGDWARF_IA32_DLINK2_FLAGS = DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O0 
-fuse-ld=lld
+NOOPT_CLANGDWARF_IA32_DLINK2_FLAGS = DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O0 
-fuse-ld=lld -no-pie
  
  ##

  # CLANGDWARF X64 definitions



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




Re: [edk2-devel] [PATCH v4 0/6] UefiCpuPkg, OvmfPkg: Simplify CpuExceptionHandlerLib

2023-04-05 Thread Rebecca Cran

Sorry for the delay. I've just sent my reviewed-by.


On 4/4/23 3:46 AM, Ard Biesheuvel wrote:

Thanks all

Ray, any comments on this version? Thanks.

Liming, Rebecca, any comments on the BaseTools changes?



On Tue, 4 Apr 2023 at 09:57, Marvin Häuser  wrote:

FWIW, Reviewed-by: Marvin Häuser 


On 3. Apr 2023, at 16:29, Ard Biesheuvel  wrote:

We have a special version of CpuExceptionHandlerLib for XCODE5, whose
linker (LLD) does not permit absolute symbol references in read-only
sections.

Instead of fixing this up at runtime for all toolchains (which is done
by writing the fixed up values to the .text section, which we'd prefer
to avoid), tweak the SEC/PEI version so it does not need this, and
update the remaining versions to only incorporate this logic when using
the XCODE toolchain.

Changes since v3:
- Add another patch to move PeiCpuExceptionHandlerLib to SEC/PEI version
  of the NASM source file
- Improve commit logs

Changes since v2:
-  As Marvin points out, using '-read_only_relocs suppress' with the X64
   XCODE linker is a terrible idea, as it corrupts the resulting PE
   binaries, so instead, let's do the following:
   . tweak the SEC/PEI version of the library so the relocs are emitted
 into .data when using XCODE;
   . tweak the other versions so the runtime fixups are only done when
 using XCODE
- add acks from Jiewen and Ray

Changes since v1:
- pass linker switches to permit absolute relocations in read-only
  regions, and keep all code in .text

Cc: "Ni, Ray" 
Cc: Andrew Fish 
Cc: "Kinney, Michael D" 
Cc: "Liu, Zhiguang" 
Cc: Rebecca Cran 
Cc: Tom Lendacky 
Cc: Marvin Häuser 

Ard Biesheuvel (6):
  BaseTools/tools_def CLANGDWARF: Permit text relocations
  UefiCpuPkg/CpuExceptionHandlerLib: Use single SEC/PEI version
  UefiCpuPkg/PeiCpuExceptionHandlerLib: Use SEC/PEI specific asm
component
  UefiCpuPkg/CpuExceptionHandlerLib: Make runtime fixups XCODE-only
  OvmfPkg: Drop special Xcode5 version of exception handler library
  UefiCpuPkg/CpuExceptionHandlerLib: Drop special XCODE5 version

BaseTools/Conf/tools_def.template   
 |   2 +-
OvmfPkg/AmdSev/AmdSevX64.dsc
 |   4 -
OvmfPkg/CloudHv/CloudHvX64.dsc  
 |   4 -
OvmfPkg/IntelTdx/IntelTdxX64.dsc
 |   4 -
OvmfPkg/Microvm/MicrovmX64.dsc  
 |   4 -
OvmfPkg/OvmfPkgIa32.dsc 
 |   4 -
OvmfPkg/OvmfPkgIa32X64.dsc  
 |   4 -
OvmfPkg/OvmfPkgX64.dsc  
 |   4 -
OvmfPkg/OvmfXen.dsc 
 |   4 -
UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf 
 |   5 +-
UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf 
 |   4 +-
UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf  
 |   4 +-
UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf 
 |   4 +-
UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm  
 | 116 +---
UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{Xcode5ExceptionHandlerAsm.nasm 
=> SecPeiExceptionHandlerAsm.nasm} | 108 +++---
UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf
 |  65 ---
UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.uni
 |  18 ---
UefiCpuPkg/UefiCpuPkg.dsc   
 |   7 --
18 files changed, 133 insertions(+), 232 deletions(-)
rename 
UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{Xcode5ExceptionHandlerAsm.nasm 
=> SecPeiExceptionHandlerAsm.nasm} (70%)
delete mode 100644 
UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf
delete mode 100644 
UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.uni

--
2.39.2










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

Re: [edk2-devel] [PATCH v4 1/6] BaseTools/tools_def CLANGDWARF: Permit text relocations

2023-04-05 Thread Rebecca Cran

Reviewed-by: Rebecca Cran 


--
Rebecca Cran


On 4/3/23 8:29 AM, Ard Biesheuvel wrote:

We rely on PIE executables to get the codegen that is suitable for
PE/COFF conversion where the resulting executables can be loaded
anywhere in the address space.

However, ELF linkers may default to disallowing text relocations in PIE
executables, as this would require text segments to be updated at
runtime, which is bad for security and increases the copy-on-write
footprint of ELF executables and shared libraries.

However, none of those concerns apply to PE/COFF executables in the
context of EFI, which are copied into memory rather than mmap()'ed, and
fixed up by the loader before launch.

So pass -z notext to the LLD linker to permit runtime relocations in
read-only sections.

Signed-off-by: Ard Biesheuvel 
---
  BaseTools/Conf/tools_def.template | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index ae43101853870c6d..5a3af55bfb09d753 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -2870,7 +2870,7 @@ DEFINE CLANGDWARF_X64_PREFIX= ENV(CLANG_BIN)
  DEFINE CLANGDWARF_IA32_X64_DLINK_COMMON   = -nostdlib -Wl,-q,--gc-sections -z 
max-page-size=0x40
  DEFINE CLANGDWARF_DLINK2_FLAGS_COMMON = 
-Wl,--script=$(EDK_TOOLS_PATH)/Scripts/ClangBase.lds
  DEFINE CLANGDWARF_IA32_X64_ASLDLINK_FLAGS = 
DEF(CLANGDWARF_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 
DEF(CLANGDWARF_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u 
ReferenceAcpiTable
-DEFINE CLANGDWARF_IA32_X64_DLINK_FLAGS= 
DEF(CLANGDWARF_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u 
$(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive
+DEFINE CLANGDWARF_IA32_X64_DLINK_FLAGS= 
DEF(CLANGDWARF_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u 
$(IMAGE_ENTRY_POINT) 
-Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive -Wl,-z,notext
  DEFINE CLANGDWARF_IA32_DLINK2_FLAGS   = 
-Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(CLANGDWARF_DLINK2_FLAGS_COMMON)
  DEFINE CLANGDWARF_X64_DLINK2_FLAGS= 
-Wl,--defsym=PECOFF_HEADER_SIZE=0x228 DEF(CLANGDWARF_DLINK2_FLAGS_COMMON)
  



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




[edk2-devel] [PATCH 1/1] BaseTools: Update antlr makefile to use cc by default

2023-04-05 Thread Rebecca Cran
Update the antlr makefile to remove the explicit setting of CC to either
clang or gcc. This causes it to use /usr/bin/cc or whatever the user has
set $(CC) to.

This removes the last dependency on gcc for BaseTools.

Signed-off-by: Rebecca Cran 
---
 BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile | 5 -
 1 file changed, 5 deletions(-)

diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile 
b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
index 42b603571fab..746d58b5e24e 100644
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
+++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile
@@ -164,11 +164,6 @@ PCCTS_H=../h
 #
 #   UNIX  (default)
 #
-ifneq ($(CLANG),)
-CC?=$(CLANG_BIN)clang
-else ifeq ($(origin CC),default)
-CC=gcc
-endif
 COPT=-O
 ANTLR=${BIN_DIR}/antlr
 DLG=${BIN_DIR}/dlg
-- 
2.40.0



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




[edk2-devel] Event: TianoCore Community Meeting EMEA/NAMO - Thursday, April 6, 2023 #cal-reminder

2023-04-05 Thread Group Notification
*Reminder: TianoCore Community Meeting EMEA/NAMO*

*When:*
Thursday, April 6, 2023
8:00am to 9:00am
(UTC-07:00) America/Los Angeles

*Where:*
Microsoft Teams meeting Join on your computer or mobile app Click here to join 
the meeting Meeting ID: 226 323 011 029 Passcode: hMRCj6 Download Teams | Join 
on the web Join with a video conferencing device te...@conf.intel.com Video 
Conference ID: 112 716 814 3 Alternate VTC instructions Learn More | Meeting 
options

*Organizer:* Miki Demeter

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

*Description:*



Microsoft Teams meeting

*Join on your computer or mobile app*

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

Meeting ID: 226 323 011 029
Passcode: hMRCj6

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

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 112 716 814 3

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

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




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




Re: [edk2-devel] [Patch v2 12/12] PrmPkg/Library: HOST_APPLICATION IA32/X64 only

2023-04-05 Thread Michael D Kinney
I will add a more complete description to the commit messages.

These patches are only for modules of type HOST_APPLICATION that are
used for host-based unit tests that run as a Windows or Linux application.

Many of the other HOST_APPLICATION components that are linked with
these components only list IA32 and X64, so this change is to make
all HOST_APPLICATION components consistent.

The only host-based unit test environments that I am aware have been
tested are 32-bit and 64-bit x86 OS environments.  Additional host
environments could be supported, but would require updates to the
UnitTestFrameworkPkg and perhaps BaseTools and would also require
CI agents or other testing to make sure it is functional and stays
functional.

If anyone is running host based unit tests with additional host os
CPU architectures, then please let the UnitTestFrameworkPkg 
Maintainer know so we can get the components and docs updated.

Also let us know if there are additional host os CPU architectures
that need to be supported for host based unit test execution.

Thanks,

Mike

> -Original Message-
> From: Michael Kubacki 
> Sent: Wednesday, April 5, 2023 5:46 AM
> To: Ard Biesheuvel ; devel@edk2.groups.io; Kinney, Michael D 
> 
> Cc: Desimone, Nathaniel L 
> Subject: Re: [edk2-devel] [Patch v2 12/12] PrmPkg/Library: HOST_APPLICATION 
> IA32/X64 only
> 
> On 4/5/2023 3:50 AM, Ard Biesheuvel wrote:
> > On Tue, 4 Apr 2023 at 20:23, Michael D Kinney
> >  wrote:
> >>
> >
> > This patch has no commit log so it is hard to understand the purpose
> > of this patch.
> 
> I think a message would be helpful as well.
> >
> >
> >> Cc: Michael Kubacki 
> >> Cc: Nate DeSimone 
> >> Signed-off-by: Michael D Kinney 
> >> ---
> >>   .../UnitTest/DxePrmContextBufferLibUnitTestHost.inf | 2 +-
> >>   .../UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf   | 2 +-
> >>   2 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git 
> >> a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTestHost.inf
> b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTestHost.inf
> >> index 7cf6a16867d4..eefaddb10aaf 100644
> >> --- 
> >> a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTestHost.inf
> >> +++ 
> >> b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTestHost.inf
> >> @@ -17,7 +17,7 @@ [Defines]
> >>   #
> >>   # The following information is for reference only and not required by 
> >> the build tools.
> >>   #
> >> -#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
> >
> > AArch64 also supports PRM so why are you removing it here?
> >
> You're correct. The firmware code supports AARCH64. I am not aware of
> these host unit tests being run on a AARCH64 host so I was okay to
> remove this until that was confirmed. Do you have more context Mike?
> >
> >> +#  VALID_ARCHITECTURES   = IA32 X64
> >>   #
> >>
> >>   [Sources]
> >> diff --git 
> >> a/PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf
> b/PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf
> >> index 8aae1f7cd78a..fd4b44a9bf85 100644
> >> --- 
> >> a/PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf
> >> +++ 
> >> b/PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf
> >> @@ -17,7 +17,7 @@ [Defines]
> >>   #
> >>   # The following information is for reference only and not required by 
> >> the build tools.
> >>   #
> >> -#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
> >> +#  VALID_ARCHITECTURES   = IA32 X64
> >>   #
> >>
> >>   [Sources]
> >> --
> >> 2.39.1.windows.1
> >>
> >>
> >>
> >> 
> >>
> >>


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




[edk2-devel] Event: TianoCore edk2-test Bug Triage Meeting - Thursday, April 6, 2023 #cal-reminder

2023-04-05 Thread Group Notification
*Reminder: TianoCore edk2-test Bug Triage Meeting*

*When:*
Thursday, April 6, 2023
10:00pm to 11:00pm
(UTC+08:00) Asia/Shanghai

*Where:*
https://armltd.zoom.us/j/91247522013?pwd=ei9nUndTbG9oWEROS2M1aVREZkpiQT09=addon

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

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

*Description:*


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




Re: [edk2-devel] [RFC] [edk2-openssl fork] Add openssl fork repo to Tianocore to support OpenSSL11_EOL

2023-04-05 Thread Gerd Hoffmann
On Wed, Apr 05, 2023 at 01:37:23AM +, Yao, Jiewen wrote:
> Hi
> This is follow up for the "Openssl1.1 replacement proposal" 
> https://edk2.groups.io/g/devel/topic/96741156.
> openssl 3.0 POC result is shown at 
> https://github.com/tianocore/edk2-staging/blob/OpenSSL11_EOL/CryptoPkg/Readme-OpenSSL3.0.md
> The size increase is reduced to ~10%.
> 
> In order to achieve maximum size optimization for openssl 3.0, we updated 
> openssl 3.0 branch and recorded to 
> https://github.com/liyi77/openssl/tree/openssl-3.0-POC.
> To help the community review and feedback the openssl 3.0 change and plan to 
> openssl upstream in the future, we should avoid personal branch usage.

I fail to see the point.  To get the openssl changes merged upstream
you needed engage with the openssl community, and I don't see how a
tianocore openssl repository helps with that.

Now that the changes needed have been identified I'd strongly suggest
to focus on getting the changes merged to upstream openssl instead of
storing them in a tianocore fork.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102553): https://edk2.groups.io/g/devel/message/102553
Mute This Topic: https://groups.io/mt/98074585/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 00/13] BaseTools,CryptoPkg,MdePkg,OvmfPkg: Delete CLANG35,CLANG38,GCC48,GCC49, rename GCC5 to GCC, update CLANGDWARF, delete VS 2008-2013, EBC

2023-04-05 Thread Ard Biesheuvel
On Tue, 4 Apr 2023 at 20:36, Rebecca Cran  wrote:
>
> Thanks, deprecating it for a while makes a lot of sense. We can consider
> removing it in 6-12 months maybe?
>

I would at least wait for a stable release to appear that supports
both GCC5 and GCC/GCCNOLTO, and then perhaps queue the removal (and
document it) for the subsequent one?


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




Re: [edk2-devel] [PATCH 1/3] BaseTools/Conf/tools_def: Fix linking using CLANGDWARF_IA32

2023-04-05 Thread Sheng Lean Tan
Hi,
Can anyone help to look into this?
Thanks.


On Tue, 4 Apr 2023 at 14:46, Lean Sheng Tan  wrote:

>
> Hi Rebecca/ Marvin,
> Patrick has filed it as a separate patch email here
> https://edk2.groups.io/g/devel/message/102168
> However the email still group them together.
> It is because he could not reproduce any issue anymore that was seen on
> 2nd patch (could be that Rebecca already fixed it).
> Could you help to review and get this merged?
>
> Thanks,
> Sheng
>
>
> On Thu, 30 Mar 2023 at 10:05, Marvin Häuser  wrote:
>
>> Hi Lean,
>>
>> I don’t think individual patches from a series are merged generally. Your
>> 2/3 has open concerns from both Liming and myself.
>>
>> Best regards,
>> Marvin
>>
>> On 30. Mar 2023, at 09:31, Lean Sheng Tan 
>> wrote:
>>
>> 
>> HI Liming,
>> If no further concern, would you mind to help get this patch merged?
>> Thanks!
>>
>> Best Regards,
>> *Lean Sheng Tan*
>>
>>
>> On Tue, 28 Mar 2023 at 07:42, gaoliming via groups.io > byosoft.com...@groups.io> wrote:
>>
>>> Reviewed-by: Liming Gao 
>>>
>>> > -邮件原件-
>>> > 发件人: devel@edk2.groups.io  代表 Patrick
>>> > Rudolph
>>> > 发送时间: 2023年3月17日 22:06
>>> > 抄送: devel@edk2.groups.io; guo.d...@intel.com; gua@intel.com;
>>> > james...@intel.com; ray...@intel.com; mhaeu...@posteo.de;
>>> > a...@kernel.org
>>> > 主题: [edk2-devel] [PATCH 1/3] BaseTools/Conf/tools_def: Fix linking
>>> using
>>> > CLANGDWARF_IA32
>>> >
>>> > The clang toolchain might default to fPIE/fPIC, which prevents
>>> > lld from linking the objects into a binary.
>>> >
>>> > Specify -fno-pie -fno-pic as done on GCC to fix linking.
>>> >
>>> > Test:
>>> > Building the Universal Payload using the command
>>> > 'python UefiPayloadPkg/UniversalPayloadBuild.py -a IA32' actually
>>> > works.
>>> >
>>> > Signed-off-by: Patrick Rudolph 
>>> > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4356
>>> > ---
>>> >  BaseTools/Conf/tools_def.template | 14 +++---
>>> >  1 file changed, 7 insertions(+), 7 deletions(-)
>>> >
>>> > diff --git a/BaseTools/Conf/tools_def.template
>>> > b/BaseTools/Conf/tools_def.template
>>> > index 471eb67c0c..9b59bd75c3 100755
>>> > --- a/BaseTools/Conf/tools_def.template
>>> > +++ b/BaseTools/Conf/tools_def.template
>>> > @@ -2888,7 +2888,7 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS
>>> > = -Wl,--defsym=PECOFF_HEADER_SIZE=0x22
>>> >  *_CLANGDWARF_IA32_RC_PATH  =
>>> > DEF(CLANGDWARF_IA32_PREFIX)llvm-rc
>>> >
>>> >
>>> >
>>> >  *_CLANGDWARF_IA32_ASLCC_FLAGS  = DEF(GCC_ASLCC_FLAGS)
>>> > -m32 -fno-lto DEF(CLANG38_IA32_TARGET)
>>> >
>>> > -*_CLANGDWARF_IA32_ASLDLINK_FLAGS   =
>>> > DEF(CLANGDWARF_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386 -fuse-ld=lld
>>> >
>>> > +*_CLANGDWARF_IA32_ASLDLINK_FLAGS   =
>>> > DEF(CLANGDWARF_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386 -fuse-ld=lld
>>> > -no-pie
>>> >
>>> >  *_CLANGDWARF_IA32_ASM_FLAGS= DEF(GCC5_ASM_FLAGS)
>>> > -m32 -march=i386 DEF(CLANG38_IA32_TARGET)
>>> >
>>> >  *_CLANGDWARF_IA32_RC_FLAGS =
>>> > DEF(GCC_IA32_RC_FLAGS)
>>> >
>>> >  *_CLANGDWARF_IA32_OBJCOPY_FLAGS=
>>> >
>>> > @@ -2897,17 +2897,17 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS
>>> > = -Wl,--defsym=PECOFF_HEADER_SIZE=0x22
>>> >  *_CLANGDWARF_IA32_ASLPP_FLAGS  = DEF(GCC_ASLPP_FLAGS)
>>> > DEF(CLANG38_IA32_TARGET)
>>> >
>>> >  *_CLANGDWARF_IA32_VFRPP_FLAGS  = DEF(GCC_VFRPP_FLAGS)
>>> > DEF(CLANG38_IA32_TARGET)
>>> >
>>> >
>>> >
>>> > -DEBUG_CLANGDWARF_IA32_CC_FLAGS =
>>> > DEF(CLANG38_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
>>> > DEF(CLANG38_IA32_TARGET) -g -malign-double
>>> >
>>> > +DEBUG_CLANGDWARF_IA32_CC_FLAGS =
>>> > DEF(CLANG38_ALL_CC_FLAGS) -fno-pic -fno-pie -m32 -Oz -flto -march=i586
>>> > DEF(CLANG38_IA32_TARGET) -g -malign-double
>>> >
>>> >  DEBUG_CLANGDWARF_IA32_DLINK_FLAGS  =
>>> > DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -flto -Wl,-O3 -Wl,-melf_i386
>>> > -Wl,--oformat,elf32-i386
>>> >
>>> > -DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS =
>>> > DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld
>>> >
>>> > +DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS =
>>> > DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld -no-pie
>>> >
>>> >
>>> >
>>> > -RELEASE_CLANGDWARF_IA32_CC_FLAGS   =
>>> > DEF(CLANG38_ALL_CC_FLAGS) -m32 -Oz -flto -march=i586
>>> > DEF(CLANG38_IA32_TARGET) -malign-double
>>> >
>>> > +RELEASE_CLANGDWARF_IA32_CC_FLAGS   =
>>> > DEF(CLANG38_ALL_CC_FLAGS) -fno-pic -fno-pie -m32 -Oz -flto -march=i586
>>> > DEF(CLANG38_IA32_TARGET) -malign-double
>>> >
>>> >  RELEASE_CLANGDWARF_IA32_DLINK_FLAGS=
>>> > DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -flto -Wl,-O3 -Wl,-melf_i386
>>> > -Wl,--oformat,elf32-i386
>>> >
>>> > -RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS   =
>>> > DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld
>>> >
>>> > +RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS   =
>>> > DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld -no-pie
>>> >
>>> >
>>> >
>>> > -NOOPT_CLANGDWARF_IA32_CC_FLAGS =
>>> > DEF(CLANG38_ALL_CC_FLAGS) -m32 

Re: [edk2-devel] [Patch v2 12/12] PrmPkg/Library: HOST_APPLICATION IA32/X64 only

2023-04-05 Thread Ard Biesheuvel
On Tue, 4 Apr 2023 at 20:23, Michael D Kinney
 wrote:
>

This patch has no commit log so it is hard to understand the purpose
of this patch.


> Cc: Michael Kubacki 
> Cc: Nate DeSimone 
> Signed-off-by: Michael D Kinney 
> ---
>  .../UnitTest/DxePrmContextBufferLibUnitTestHost.inf | 2 +-
>  .../UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git 
> a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTestHost.inf
>  
> b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTestHost.inf
> index 7cf6a16867d4..eefaddb10aaf 100644
> --- 
> a/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTestHost.inf
> +++ 
> b/PrmPkg/Library/DxePrmContextBufferLib/UnitTest/DxePrmContextBufferLibUnitTestHost.inf
> @@ -17,7 +17,7 @@ [Defines]
>  #
>  # The following information is for reference only and not required by the 
> build tools.
>  #
> -#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64

AArch64 also supports PRM so why are you removing it here?


> +#  VALID_ARCHITECTURES   = IA32 X64
>  #
>
>  [Sources]
> diff --git 
> a/PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf
>  
> b/PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf
> index 8aae1f7cd78a..fd4b44a9bf85 100644
> --- 
> a/PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf
> +++ 
> b/PrmPkg/Library/DxePrmModuleDiscoveryLib/UnitTest/DxePrmModuleDiscoveryLibUnitTestHost.inf
> @@ -17,7 +17,7 @@ [Defines]
>  #
>  # The following information is for reference only and not required by the 
> build tools.
>  #
> -#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
> +#  VALID_ARCHITECTURES   = IA32 X64
>  #
>
>  [Sources]
> --
> 2.39.1.windows.1
>
>
>
> 
>
>


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




[edk2-devel] [edk2][PATCH 1/1] MdeModulePkg: Add EDKII Platform Boot Manager Protocol v2

2023-04-05 Thread Tinh Nguyen via groups.io
This introduces the EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2,
which adds a new UpdateBootOrder() function to support customizing
the boot options order according to the platform-specific policy.

Signed-off-by: Tinh Nguyen 
---
 MdeModulePkg/Include/Protocol/PlatformBootManager.h | 24 +++-
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c|  9 
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/Protocol/PlatformBootManager.h 
b/MdeModulePkg/Include/Protocol/PlatformBootManager.h
index e527b0ee0eaf..758bc2deb774 100644
--- a/MdeModulePkg/Include/Protocol/PlatformBootManager.h
+++ b/MdeModulePkg/Include/Protocol/PlatformBootManager.h
@@ -1,6 +1,7 @@
 /** @file

 

   Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.

+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.

 

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

 

@@ -29,7 +30,8 @@ typedef struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL 
EDKII_PLATFORM_BOOT_MANAGER
 //  All future revisions must be backwards compatible.

 //  If a future version is not back wards compatible it is not the 
same GUID.

 //

-#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION  0x0001

+#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION   0x0001

+#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2  0x0002

 

 //

 // Function Prototypes

@@ -72,9 +74,29 @@ EFI_STATUS
   OUT   UINTN*UpdatedBootOptionsCount

   );

 

+/**

+  This function allows platform to update the DriverOrder/BootOrder variables.

+  And it is available from version 2 of the EDKII Platform Boot Manager 
protocol.

+

+  @retval EFI_SUCCESS  Platform successfully modifies

+   the DriverOrder/BootOrder variables as wanted.

+  @retval Others   There are some errors that happen. Check the status code

+   for details.

+

+**/

+typedef

+EFI_STATUS

+(EFIAPI *PLATFORM_BOOT_MANAGER_UPDATE_BOOT_ORDER)(

+  IN VOID

+  );

+

 struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL {

   UINT64Revision;

   PLATFORM_BOOT_MANAGER_REFRESH_ALL_BOOT_OPTIONSRefreshAllBootOptions;

+  //

+  // EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2

+  //

+  PLATFORM_BOOT_MANAGER_UPDATE_BOOT_ORDER   UpdateBootOrder;

 };

 

 extern EFI_GUID  gEdkiiPlatformBootManagerProtocolGuid;

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index bde22fa6590e..67d1d54b3c24 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -4,6 +4,7 @@
 Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.

 Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.

 (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP

+Copyright (c) 2023, Ampere Computing LLC. All rights reserved.

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

 

 **/

@@ -2412,6 +2413,8 @@ EfiBootManagerRefreshAllBootOption (
   BootOptions = UpdatedBootOptions;

   BootOptionCount = UpdatedBootOptionCount;

 }

+  } else {

+PlatformBootManager = NULL;

   }

 

   NvBootOptions = EfiBootManagerGetLoadOptions (, 
LoadOptionTypeBoot);

@@ -2453,6 +2456,12 @@ EfiBootManagerRefreshAllBootOption (
 

   EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);

   EfiBootManagerFreeLoadOptions (NvBootOptions, NvBootOptionCount);

+

+  if ((PlatformBootManager != NULL) &&

+  (PlatformBootManager->Revision >= 
EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2))

+  {

+PlatformBootManager->UpdateBootOrder ();

+  }

 }

 

 /**

--
2.39.2


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