Re: [edk2-devel] [PATCH v6 08/16] Add GCC and GCCNOLTO toolchains to tools_def.txt and update packages

2023-05-01 Thread Yao, Jiewen
Hi
Have you evaluated size impact with this new compiler option? Especially crypto 
library.
Bigger? Smaller?

Why we add "-flto" for "NOLTO" ?
> > +  *_GCCNOLTO_IA32_CC_FLAGS = -flto
> > +  *_GCCNOLTO_IA32_DLINK_FLAGS = -flto



> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Rebecca
> Cran
> Sent: Tuesday, May 2, 2023 8:06 AM
> To: Yao, Jiewen ; Wang, Jian J
> ; Lu, Xiaoyu1 ; Jiang,
> Guomin ; Andrew Fish ; Ni,
> Ray ; Chiu, Chasel ; Desimone,
> Nathaniel L ; Zeng, Star
> 
> Cc: devel@edk2.groups.io
> Subject: Re: [edk2-devel] [PATCH v6 08/16] Add GCC and GCCNOLTO
> toolchains to tools_def.txt and update packages
> 
> Jiewen Yao, Jian J Wang, Xiaoyu Lu, Guomin Jiang: Could one of you add a
> Reviewed-by tag for the CryptoPkg changes please?
> 
> 
> Andrew Fish, Ray Ni: Could one of you add a Reviewed-by tag for the
> EmulatorPkg changes please?
> 
> 
> Chasel Chiu, Nate DeSimone, Star Zeng: Could one of you add a
> Reviewed-by tag for the IntelFsp2Pkg changes please?
> 
> 
> --
> Rebecca Cran
> 
> 
> On 5/1/23 10:08, Rebecca Cran wrote:
> > Add a 'GCC' toolchain that's a copy of the existing GCC5 definition.
> > Add a 'GCCNOLTO' toolchain that's a copy of the existing GCC49
> > toolchain.q
> >
> > Update build flags in CryptoPkg, EmulatorPkg, IntelFsp2Pkg and
> > UnitTestFrameworkPkg to add flags for the new toolchains.
> >
> > Signed-off-by: Rebecca Cran 
> > ---
> >   UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc |   4 +
> >   IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc   |   8 +-
> >   CryptoPkg/Library/OpensslLib/OpensslLib.inf   |   1 +
> >   CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf  |   1 +
> >   CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf |   1 +
> >   CryptoPkg/Library/OpensslLib/OpensslLibFull.inf   |   1 +
> >   CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf  |   2 +
> >   EmulatorPkg/Unix/Host/Host.inf|   2 +
> >   BaseTools/Conf/tools_def.template | 366
> 
> >   9 files changed, 385 insertions(+), 1 deletion(-)
> >
> > diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> > index 7866c36e6693..9bdbbf3a222c 100644
> > --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> > +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> > @@ -31,6 +31,10 @@ [BuildOptions]
> >   !endif
> > GCC:*_GCC5_*_CC_FLAGS = --coverage
> > GCC:*_GCC5_*_DLINK_FLAGS = --coverage
> > +  GCC:*_GCCNOLTO_*_CC_FLAGS = --coverage
> > +  GCC:*_GCCNOLTO_*_DLINK_FLAGS = --coverage
> > +  GCC:*_GCC_*_CC_FLAGS = --coverage
> > +  GCC:*_GCC_*_DLINK_FLAGS = --coverage
> >   [BuildOptions.common.EDKII.HOST_APPLICATION]
> > #
> > # MSFT
> > diff --git a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
> b/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
> > index 31558121185d..34409f8b80d5 100644
> > --- a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
> > +++ b/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
> > @@ -461,10 +461,16 @@ [Components.IA32]
> >
> ##
> #
> >   [BuildOptions]
> >   # Append build options for EDK and EDKII drivers (= is Append, == is
> Replace)
> > -  # Enable link-time optimization when building with GCC49
> > +  # Enable link-time optimization when building with GCC49 or GCCNOLTO
> > *_GCC49_IA32_CC_FLAGS = -flto
> > *_GCC49_IA32_DLINK_FLAGS = -flto
> > +  *_GCCNOLTO_IA32_CC_FLAGS = -flto
> > +  *_GCCNOLTO_IA32_DLINK_FLAGS = -flto
> > *_GCC5_IA32_CC_FLAGS = -fno-pic
> > *_GCC5_IA32_DLINK_FLAGS = -no-pie
> > *_GCC5_IA32_ASLCC_FLAGS = -fno-pic
> > *_GCC5_IA32_ASLDLINK_FLAGS = -no-pie
> > +  *_GCC_IA32_CC_FLAGS = -fno-pic
> > +  *_GCC_IA32_DLINK_FLAGS = -no-pie
> > +  *_GCC_IA32_ASLCC_FLAGS = -fno-pic
> > +  *_GCC_IA32_ASLDLINK_FLAGS = -no-pie
> > diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> > index 86a00b1c4b2a..0669f3035b85 100644
> > --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> > +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
> > @@ -644,6 +644,7 @@ [BuildOptions]
> > GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized -
> Wno-error=incompatible-pointer-types -Wno-error=pointer-sign -Wno-
> error=implicit-function-declaration -Wno-error=ignored-pragma-optimize
> > # Revisit after switching to 3.0 branch
> > GCC:*_GCC5_*_CC_FLAGS= -Wno-unused-but-set-variable
> > +  GCC:*_GCC_*_CC_FLAGS = -Wno-unused-but-set-variable
> >
> > # suppress the following warnings in openssl so we don't break the build
> with warnings-as-errors:
> > # 1295: Deprecated declaration  - give arg types
> > diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
> b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
> > index 2e4f95909b51..45fd4799d748 100644
> > --- a/CryptoPkg/Library/Openssl

[edk2-devel] [PATCH 1/1] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: refine flash detection

2023-05-01 Thread Gerd Hoffmann
Check whenever flash is actually writable.

Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c 
b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c
index 54f859de9ff9..a577aea55614 100644
--- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c
+++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c
@@ -114,9 +114,17 @@ QemuFlashDetected (
   DEBUG ((DEBUG_INFO, "QemuFlashDetected => FD behaves as RAM\n"));
   *Ptr = OriginalUint8;
 } else if (ProbeUint8 == CLEARED_ARRAY_STATUS) {
-  DEBUG ((DEBUG_INFO, "QemuFlashDetected => FD behaves as FLASH\n"));
-  FlashDetected = TRUE;
-  *Ptr  = READ_ARRAY_CMD;
+  *Ptr   = WRITE_BYTE_CMD;
+  *Ptr   = OriginalUint8;
+  *Ptr   = READ_STATUS_CMD;
+  ProbeUint8 = *Ptr;
+  *Ptr   = READ_ARRAY_CMD;
+  if (ProbeUint8 & 0x10 /* programming error */) {
+DEBUG ((DEBUG_INFO, "QemuFlashDetected => FD behaves as FLASH, 
write-protected\n"));
+  } else {
+DEBUG ((DEBUG_INFO, "QemuFlashDetected => FD behaves as FLASH, 
writable\n"));
+FlashDetected = TRUE;
+  }
 }
   }
 
-- 
2.40.0



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




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Integrate UiApp and BootManagerMenuApp into MultiFv BdsFv

2023-05-01 Thread Guo, Gua
Reviewed-by:Gua Guo 

-Original Message-
From: Lin, MarsX  
Sent: Tuesday, May 2, 2023 11:29 AM
To: devel@edk2.groups.io
Cc: Lin, MarsX ; Dong, Guo ; Ni, Ray 
; Rhodes, Sean ; Lu, James 
; Guo, Gua 
Subject: [PATCH] UefiPayloadPkg: Integrate UiApp and BootManagerMenuApp into 
MultiFv BdsFv

From: MarsX Lin 

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

To put UiApp.inf and BootManagerMenuApp.inf to proper FV(BDSFV)

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 

Signed-off-by: MarsX Lin 
---
 .../PlatformBootManager.c | 55 ---
 .../PlatformBootManagerLib.inf|  4 --
 UefiPayloadPkg/UefiPayloadEntry/PrintHob.c| 25 +
 .../UniversalPayloadEntry.inf |  1 -
 UefiPayloadPkg/UefiPayloadPkg.dec |  2 -
 UefiPayloadPkg/UefiPayloadPkg.dsc |  9 ++-
 UefiPayloadPkg/UefiPayloadPkg.fdf |  9 ++-
 7 files changed, 12 insertions(+), 93 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 62637ae6aa..31d1d29435 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -9,8 +9,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 

 #include "PlatformBootManager.h"

 #include "PlatformConsole.h"

-#include 

-#include 

 

 /**

   Signal EndOfDxe event and install SMM Ready to lock protocol.

@@ -296,56 +294,3 @@ PlatformBootManagerUnableToBoot (
 {

   return;

 }

-

-/**

-  Get/update PcdBootManagerMenuFile from GUID HOB which will be assigned in 
bootloader.

-

-  @param  ImageHandle   The firmware allocated handle for the EFI image.

-  @param  SystemTable   A pointer to the EFI System Table.

-

-  @retval EFI_SUCCESS   The entry point is executed successfully.

-  @retval other Some error occurs.

-

-**/

-EFI_STATUS

-EFIAPI

-PlatformBootManagerLibConstructor (

-  IN EFI_HANDLEImageHandle,

-  IN EFI_SYSTEM_TABLE  *SystemTable

-  )

-{

-  EFI_STATUS   Status;

-  UINTNSize;

-  VOID *GuidHob;

-  UNIVERSAL_PAYLOAD_GENERIC_HEADER *GenericHeader;

-  UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU  *BootManagerMenuFile;

-

-  GuidHob = GetFirstGuidHob (&gEdkiiBootManagerMenuFileGuid);

-

-  if (GuidHob == NULL) {

-//

-// If the HOB is not create, the default value of PcdBootManagerMenuFile 
will be used.

-//

-return EFI_SUCCESS;

-  }

-

-  GenericHeader = (UNIVERSAL_PAYLOAD_GENERIC_HEADER *)GET_GUID_HOB_DATA 
(GuidHob);

-  if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) > GET_GUID_HOB_DATA_SIZE 
(GuidHob)) || (GenericHeader->Length > GET_GUID_HOB_DATA_SIZE (GuidHob))) {

-return EFI_NOT_FOUND;

-  }

-

-  if (GenericHeader->Revision == UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU_REVISION) 
{

-BootManagerMenuFile = (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU 
*)GET_GUID_HOB_DATA (GuidHob);

-if (BootManagerMenuFile->Header.Length < 
UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU, 
FileName)) {

-  return EFI_NOT_FOUND;

-}

-

-Size   = sizeof (BootManagerMenuFile->FileName);

-Status = PcdSetPtrS (PcdBootManagerMenuFile, &Size, 
&BootManagerMenuFile->FileName);

-ASSERT_EFI_ERROR (Status);

-  } else {

-return EFI_NOT_FOUND;

-  }

-

-  return EFI_SUCCESS;

-}

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index f9626175e2..b9387a4d36 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -13,7 +13,6 @@
   MODULE_TYPE= DXE_DRIVER

   VERSION_STRING = 1.0

   LIBRARY_CLASS  = PlatformBootManagerLib|DXE_DRIVER

-  CONSTRUCTOR= PlatformBootManagerLibConstructor

 

 #

 # The following information is for reference only and not required by the 
build tools.

@@ -47,11 +46,9 @@
   HiiLib

   PrintLib

   PlatformHookLib

-  HobLib

 

 [Guids]

   gEfiEndOfDxeEventGroupGuid

-  gEdkiiBootManagerMenuFileGuid

 

 [Protocols]

   gEfiGenericMemTestProtocolGuid  ## CONSUMES

@@ -74,5 +71,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits

   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity

   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits

-  gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile

   gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape

diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c 
b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
index e959be5d95..3b2b7788d4 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/

Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

2023-05-01 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[Public]

Thanks Isaac for correcting and pushing the patch.

-Original Message-
From: Oram, Isaac W 
Sent: 02 May 2023 05:42
To: devel@edk2.groups.io; Oram, Isaac W ; Attar, 
AbdulLateef (Abdul Lateef) 
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: RE: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table 
based on PCD values

[Public]

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


Pushed as 64b06a4d19..d39c665fe3

Note I had trouble extracting the patch.  I had to ignore whitespace and then 
fixup line endings to pass python \edk2\BaseTools\Scripts\PatchCheck.py -1

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Monday, May 1, 2023 5:08 PM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table 
based on PCD values

Reviewed-by: Isaac Oram 

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef) 
Sent: Friday, April 28, 2023 2:46 AM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: RE: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD 
values

[Public]

Hi Maintainers,
Please review the patch.
Thanks
AbduL

-Original Message-
From: Abdul Lateef Attar 
Sent: 10 April 2023 15:56
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang, Abner 
; Sai Chaganty ; Isaac Oram 
; Nate DeSimone ; 
Liming Gao 
Subject: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

From: Abdul Lateef Attar 

Update the SPCR table based on PCD values, such as base address, register bit 
width, access size and address space id etc, along with OEM data.

Cc: Abner Chang 
Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Abdul Lateef Attar 
---
 .../SpcrAcpiDxe/SpcrAcpiDxe.inf   | 13 ++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 26 +++
 2 files changed, 39 insertions(+)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
index 3fc84959a015..9a4f95e86bbf 100644
--- 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ AcpiDxe.inf
@@ -2,6 +2,7 @@
 # SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
 #
 # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -26,6 +27,7 @@ 
[LibraryClasses]

 [Packages]
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
   SpcrFeaturePkg/SpcrFeaturePkg.dec

 [Sources]
@@ -38,5 +40,16 @@ [Protocols]
   gEfiSerialIoProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMES

+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
+
 [Depex]
   TRUE
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 7ad0c058c844..51449d0fad9e 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -3,6 +3,7 @@
   SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).

   Copyright (c) 2004 - 2020, Intel Corporation. All rights reserved.
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
+ reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -368,6 +369,7 @@ OutOfBandACPITableConstruction (
   UINT32   FlowControl;
   VENDOR_DEVICE_PATH   *Vendor;
   UINT8Index;
+  UINT64   AcpiTableOemId;

   Handle  = NULL;

@@ -456,6 +458,30 @@ OutOfBandACPITableConstruction (
 goto out;
   }

+  // Base register details
+  gSpcrInfo.BaseAddress.Address = PcdGet64 (PcdSerialRegisterBase);
+ gSpcrInfo.BaseAddress.RegisterBitWidth = PcdGet8
+ (PcdSerialRegis

[edk2-devel] [PATCH] UefiPayloadPkg: Integrate UiApp and BootManagerMenuApp into MultiFv BdsFv

2023-05-01 Thread marsx . lin
From: MarsX Lin 

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

To put UiApp.inf and BootManagerMenuApp.inf to proper FV(BDSFV)

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 

Signed-off-by: MarsX Lin 
---
 .../PlatformBootManager.c | 55 ---
 .../PlatformBootManagerLib.inf|  4 --
 UefiPayloadPkg/UefiPayloadEntry/PrintHob.c| 25 +
 .../UniversalPayloadEntry.inf |  1 -
 UefiPayloadPkg/UefiPayloadPkg.dec |  2 -
 UefiPayloadPkg/UefiPayloadPkg.dsc |  9 ++-
 UefiPayloadPkg/UefiPayloadPkg.fdf |  9 ++-
 7 files changed, 12 insertions(+), 93 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 62637ae6aa..31d1d29435 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -9,8 +9,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include "PlatformBootManager.h"
 #include "PlatformConsole.h"
-#include 
-#include 
 
 /**
   Signal EndOfDxe event and install SMM Ready to lock protocol.
@@ -296,56 +294,3 @@ PlatformBootManagerUnableToBoot (
 {
   return;
 }
-
-/**
-  Get/update PcdBootManagerMenuFile from GUID HOB which will be assigned in 
bootloader.
-
-  @param  ImageHandle   The firmware allocated handle for the EFI image.
-  @param  SystemTable   A pointer to the EFI System Table.
-
-  @retval EFI_SUCCESS   The entry point is executed successfully.
-  @retval other Some error occurs.
-
-**/
-EFI_STATUS
-EFIAPI
-PlatformBootManagerLibConstructor (
-  IN EFI_HANDLEImageHandle,
-  IN EFI_SYSTEM_TABLE  *SystemTable
-  )
-{
-  EFI_STATUS   Status;
-  UINTNSize;
-  VOID *GuidHob;
-  UNIVERSAL_PAYLOAD_GENERIC_HEADER *GenericHeader;
-  UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU  *BootManagerMenuFile;
-
-  GuidHob = GetFirstGuidHob (&gEdkiiBootManagerMenuFileGuid);
-
-  if (GuidHob == NULL) {
-//
-// If the HOB is not create, the default value of PcdBootManagerMenuFile 
will be used.
-//
-return EFI_SUCCESS;
-  }
-
-  GenericHeader = (UNIVERSAL_PAYLOAD_GENERIC_HEADER *)GET_GUID_HOB_DATA 
(GuidHob);
-  if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) > GET_GUID_HOB_DATA_SIZE 
(GuidHob)) || (GenericHeader->Length > GET_GUID_HOB_DATA_SIZE (GuidHob))) {
-return EFI_NOT_FOUND;
-  }
-
-  if (GenericHeader->Revision == UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU_REVISION) 
{
-BootManagerMenuFile = (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU 
*)GET_GUID_HOB_DATA (GuidHob);
-if (BootManagerMenuFile->Header.Length < 
UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU, 
FileName)) {
-  return EFI_NOT_FOUND;
-}
-
-Size   = sizeof (BootManagerMenuFile->FileName);
-Status = PcdSetPtrS (PcdBootManagerMenuFile, &Size, 
&BootManagerMenuFile->FileName);
-ASSERT_EFI_ERROR (Status);
-  } else {
-return EFI_NOT_FOUND;
-  }
-
-  return EFI_SUCCESS;
-}
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index f9626175e2..b9387a4d36 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -13,7 +13,6 @@
   MODULE_TYPE= DXE_DRIVER
   VERSION_STRING = 1.0
   LIBRARY_CLASS  = PlatformBootManagerLib|DXE_DRIVER
-  CONSTRUCTOR= PlatformBootManagerLibConstructor
 
 #
 # The following information is for reference only and not required by the 
build tools.
@@ -47,11 +46,9 @@
   HiiLib
   PrintLib
   PlatformHookLib
-  HobLib
 
 [Guids]
   gEfiEndOfDxeEventGroupGuid
-  gEdkiiBootManagerMenuFileGuid
 
 [Protocols]
   gEfiGenericMemTestProtocolGuid  ## CONSUMES
@@ -74,5 +71,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
-  gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile
   gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape
diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c 
b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
index e959be5d95..3b2b7788d4 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #define ROW_LIMITER  16
 
@@ -437,27 +436,6 @@ PrintMemoryTypeInfoGuidHob (
   return EFI_SUCCESS;
 }
 
-/**
-  Print the information in EdkiiBootManagerMenuFileGuid.
-  @param[in] HobRaw  A pointer to the start of 
gEdkiiBootManagerMenuFileGuid HOB.
-  @param[in] HobLength   The size of the HOB da

Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

2023-05-01 Thread Isaac Oram
Pushed as 64b06a4d19..d39c665fe3

Note I had trouble extracting the patch.  I had to ignore whitespace and then 
fixup line endings to pass
python \edk2\BaseTools\Scripts\PatchCheck.py -1

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Monday, May 1, 2023 5:08 PM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table 
based on PCD values

Reviewed-by: Isaac Oram 

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef) 
Sent: Friday, April 28, 2023 2:46 AM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: RE: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD 
values

[Public]

Hi Maintainers,
Please review the patch.
Thanks
AbduL

-Original Message-
From: Abdul Lateef Attar 
Sent: 10 April 2023 15:56
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang, Abner 
; Sai Chaganty ; Isaac Oram 
; Nate DeSimone ; 
Liming Gao 
Subject: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

From: Abdul Lateef Attar 

Update the SPCR table based on PCD values, such as base address, register bit 
width, access size and address space id etc, along with OEM data.

Cc: Abner Chang 
Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Abdul Lateef Attar 
---
 .../SpcrAcpiDxe/SpcrAcpiDxe.inf   | 13 ++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 26 +++
 2 files changed, 39 insertions(+)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
index 3fc84959a015..9a4f95e86bbf 100644
--- 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ AcpiDxe.inf
@@ -2,6 +2,7 @@
 # SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
 #
 # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -26,6 +27,7 @@ 
[LibraryClasses]

 [Packages]
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
   SpcrFeaturePkg/SpcrFeaturePkg.dec

 [Sources]
@@ -38,5 +40,16 @@ [Protocols]
   gEfiSerialIoProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMES

+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
+
 [Depex]
   TRUE
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 7ad0c058c844..51449d0fad9e 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -3,6 +3,7 @@
   SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).

   Copyright (c) 2004 - 2020, Intel Corporation. All rights reserved.
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -368,6 +369,7 @@ OutOfBandACPITableConstruction (
   UINT32   FlowControl;
   VENDOR_DEVICE_PATH   *Vendor;
   UINT8Index;
+  UINT64   AcpiTableOemId;

   Handle  = NULL;

@@ -456,6 +458,30 @@ OutOfBandACPITableConstruction (
 goto out;
   }

+  // Base register details
+  gSpcrInfo.BaseAddress.Address = PcdGet64 (PcdSerialRegisterBase); 
+ gSpcrInfo.BaseAddress.RegisterBitWidth = PcdGet8 
+ (PcdSerialRegisterAccessWidth);  gSpcrInfo.BaseAddress.AccessSize =
+ (UINT8)PcdGet32 (PcdSerialRegisterStride);  if (PcdGetBool 
(PcdSerialUseMmio)) {
+gSpcrInfo.BaseAddress.AddressSpaceId = EFI_ACPI_3_0_SYSTEM_MEMORY; 
+ }
+
+  // OEM info
+  CopyMem (
+(VOID *) &gSpcrInfo.Header.OemId,
+PcdGetPtr (PcdAcpiDefaultOemId),
+sizeof (gSpcrInfo.Header.OemId)
+);
+  AcpiTableOemId = PcdGet64 (PcdAcpiDefaultOemTableId);  CopyMem (
+(VOID *) &gSpcrInfo.Header.OemTableId,
+(VOID *) &AcpiTableOemId,
+sizeof (gSpcrInfo.He

Re: [edk2-devel] [PATCH v6 08/16] Add GCC and GCCNOLTO toolchains to tools_def.txt and update packages

2023-05-01 Thread Rebecca Cran
I should add that I need reviews from CryptoPkg maintainers/reviewers on 
three patches: 8/16, 15/16, 16/16.



Thanks!

Rebecca Cran


On 5/1/23 18:06, Rebecca Cran wrote:
Jiewen Yao, Jian J Wang, Xiaoyu Lu, Guomin Jiang: Could one of you add 
a Reviewed-by tag for the CryptoPkg changes please?



Andrew Fish, Ray Ni: Could one of you add a Reviewed-by tag for the 
EmulatorPkg changes please?



Chasel Chiu, Nate DeSimone, Star Zeng: Could one of you add a 
Reviewed-by tag for the IntelFsp2Pkg changes please?






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




Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

2023-05-01 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef)  
Sent: Friday, April 28, 2023 2:46 AM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: RE: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD 
values

[Public]

Hi Maintainers,
Please review the patch.
Thanks
AbduL

-Original Message-
From: Abdul Lateef Attar 
Sent: 10 April 2023 15:56
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang, Abner 
; Sai Chaganty ; Isaac Oram 
; Nate DeSimone ; 
Liming Gao 
Subject: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

From: Abdul Lateef Attar 

Update the SPCR table based on PCD values, such as base address, register bit 
width, access size and address space id etc, along with OEM data.

Cc: Abner Chang 
Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Abdul Lateef Attar 
---
 .../SpcrAcpiDxe/SpcrAcpiDxe.inf   | 13 ++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 26 +++
 2 files changed, 39 insertions(+)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
index 3fc84959a015..9a4f95e86bbf 100644
--- 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ AcpiDxe.inf
@@ -2,6 +2,7 @@
 # SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
 #
 # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -26,6 +27,7 @@ 
[LibraryClasses]

 [Packages]
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
   SpcrFeaturePkg/SpcrFeaturePkg.dec

 [Sources]
@@ -38,5 +40,16 @@ [Protocols]
   gEfiSerialIoProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMES

+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
+
 [Depex]
   TRUE
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 7ad0c058c844..51449d0fad9e 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -3,6 +3,7 @@
   SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).

   Copyright (c) 2004 - 2020, Intel Corporation. All rights reserved.
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -368,6 +369,7 @@ OutOfBandACPITableConstruction (
   UINT32   FlowControl;
   VENDOR_DEVICE_PATH   *Vendor;
   UINT8Index;
+  UINT64   AcpiTableOemId;

   Handle  = NULL;

@@ -456,6 +458,30 @@ OutOfBandACPITableConstruction (
 goto out;
   }

+  // Base register details
+  gSpcrInfo.BaseAddress.Address = PcdGet64 (PcdSerialRegisterBase); 
+ gSpcrInfo.BaseAddress.RegisterBitWidth = PcdGet8 
+ (PcdSerialRegisterAccessWidth);  gSpcrInfo.BaseAddress.AccessSize =
+ (UINT8)PcdGet32 (PcdSerialRegisterStride);  if (PcdGetBool 
(PcdSerialUseMmio)) {
+gSpcrInfo.BaseAddress.AddressSpaceId = EFI_ACPI_3_0_SYSTEM_MEMORY; 
+ }
+
+  // OEM info
+  CopyMem (
+(VOID *) &gSpcrInfo.Header.OemId,
+PcdGetPtr (PcdAcpiDefaultOemId),
+sizeof (gSpcrInfo.Header.OemId)
+);
+  AcpiTableOemId = PcdGet64 (PcdAcpiDefaultOemTableId);  CopyMem (
+(VOID *) &gSpcrInfo.Header.OemTableId,
+(VOID *) &AcpiTableOemId,
+sizeof (gSpcrInfo.Header.OemTableId)
+);
+  gSpcrInfo.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+  gSpcrInfo.Header.CreatorId   = PcdGet32 (PcdAcpiDefaultCreatorId);
+  gSpcrInfo.Header.CreatorRevision = PcdGet32 
+ (PcdAcpiDefaultCreatorRevision);
+
   //
   // Add table
   //
--
2.25.1



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

Re: [edk2-devel] [PATCH v6 08/16] Add GCC and GCCNOLTO toolchains to tools_def.txt and update packages

2023-05-01 Thread Rebecca Cran
Jiewen Yao, Jian J Wang, Xiaoyu Lu, Guomin Jiang: Could one of you add a 
Reviewed-by tag for the CryptoPkg changes please?



Andrew Fish, Ray Ni: Could one of you add a Reviewed-by tag for the 
EmulatorPkg changes please?



Chasel Chiu, Nate DeSimone, Star Zeng: Could one of you add a 
Reviewed-by tag for the IntelFsp2Pkg changes please?



--
Rebecca Cran


On 5/1/23 10:08, Rebecca Cran wrote:

Add a 'GCC' toolchain that's a copy of the existing GCC5 definition.
Add a 'GCCNOLTO' toolchain that's a copy of the existing GCC49
toolchain.q

Update build flags in CryptoPkg, EmulatorPkg, IntelFsp2Pkg and
UnitTestFrameworkPkg to add flags for the new toolchains.

Signed-off-by: Rebecca Cran 
---
  UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc |   4 +
  IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc   |   8 +-
  CryptoPkg/Library/OpensslLib/OpensslLib.inf   |   1 +
  CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf  |   1 +
  CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf |   1 +
  CryptoPkg/Library/OpensslLib/OpensslLibFull.inf   |   1 +
  CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf  |   2 +
  EmulatorPkg/Unix/Host/Host.inf|   2 +
  BaseTools/Conf/tools_def.template | 366 

  9 files changed, 385 insertions(+), 1 deletion(-)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc 
b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index 7866c36e6693..9bdbbf3a222c 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -31,6 +31,10 @@ [BuildOptions]
  !endif
GCC:*_GCC5_*_CC_FLAGS = --coverage
GCC:*_GCC5_*_DLINK_FLAGS = --coverage
+  GCC:*_GCCNOLTO_*_CC_FLAGS = --coverage
+  GCC:*_GCCNOLTO_*_DLINK_FLAGS = --coverage
+  GCC:*_GCC_*_CC_FLAGS = --coverage
+  GCC:*_GCC_*_DLINK_FLAGS = --coverage
  [BuildOptions.common.EDKII.HOST_APPLICATION]
#
# MSFT
diff --git a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc 
b/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
index 31558121185d..34409f8b80d5 100644
--- a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
+++ b/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
@@ -461,10 +461,16 @@ [Components.IA32]
  
###
  [BuildOptions]
  # Append build options for EDK and EDKII drivers (= is Append, == is Replace)
-  # Enable link-time optimization when building with GCC49
+  # Enable link-time optimization when building with GCC49 or GCCNOLTO
*_GCC49_IA32_CC_FLAGS = -flto
*_GCC49_IA32_DLINK_FLAGS = -flto
+  *_GCCNOLTO_IA32_CC_FLAGS = -flto
+  *_GCCNOLTO_IA32_DLINK_FLAGS = -flto
*_GCC5_IA32_CC_FLAGS = -fno-pic
*_GCC5_IA32_DLINK_FLAGS = -no-pie
*_GCC5_IA32_ASLCC_FLAGS = -fno-pic
*_GCC5_IA32_ASLDLINK_FLAGS = -no-pie
+  *_GCC_IA32_CC_FLAGS = -fno-pic
+  *_GCC_IA32_DLINK_FLAGS = -no-pie
+  *_GCC_IA32_ASLCC_FLAGS = -fno-pic
+  *_GCC_IA32_ASLDLINK_FLAGS = -no-pie
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 86a00b1c4b2a..0669f3035b85 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -644,6 +644,7 @@ [BuildOptions]
GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized 
-Wno-error=incompatible-pointer-types -Wno-error=pointer-sign 
-Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize
# Revisit after switching to 3.0 branch
GCC:*_GCC5_*_CC_FLAGS= -Wno-unused-but-set-variable
+  GCC:*_GCC_*_CC_FLAGS = -Wno-unused-but-set-variable
  
# suppress the following warnings in openssl so we don't break the build with warnings-as-errors:

# 1295: Deprecated declaration  - give arg types
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
index 2e4f95909b51..45fd4799d748 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
@@ -692,6 +692,7 @@ [BuildOptions]
GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized 
-Wno-error=incompatible-pointer-types -Wno-error=pointer-sign 
-Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize
# Revisit after switching to 3.0 branch
GCC:*_GCC5_*_CC_FLAGS= -Wno-unused-but-set-variable
+  GCC:*_GCC_*_CC_FLAGS = -Wno-unused-but-set-variable
  
# suppress the following warnings in openssl so we don't break the build with warnings-as-errors:

# 1295: Deprecated declaration  - give arg types
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 637d4769e8ca..44292f589b6c 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -594,6 +594,7 @@ [BuildOptions]
GCC:*_CLANGPDB_*_CC_FLAG

[edk2-devel] Now: Tools, CI, Code base construction meeting series - Monday, May 1, 2023 #cal-notice

2023-05-01 Thread Group Notification
*Tools, CI, Code base construction meeting series*

*When:*
Monday, May 1, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://github.com/tianocore/edk2/discussions/2614

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

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


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




[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, May 1, 2023 #cal-reminder

2023-05-01 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, May 1, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://github.com/tianocore/edk2/discussions/2614

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

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103826): https://edk2.groups.io/g/devel/message/103826
Mute This Topic: https://groups.io/mt/98604752/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] [edk2-docs] edk2-docs.gitbook.io offline

2023-05-01 Thread Demeter, Miki
If you find ones on the CVE website. Please file a BZ report and list the CVE# 
and the corrected link. I can update CVEs to reflect the correct links

-miki

--
Miki Demeter (she/her/Miki)
Security Researcher / FW Developer
FST
Intel Corporation

Co-Chair, Network of Intel African-Ancestry(NIA) - Oregon
NIA-Oregon

Portland Women in Tech Best Speaker


From: devel@edk2.groups.io  on behalf of Rebecca Cran 

Date: Friday, April 28, 2023 at 6:02 AM
To: devel@edk2.groups.io , Kinney, Michael D 
, jolly_thomp...@xitroo.com 

Subject: Re: [edk2-devel] [edk2-docs] edk2-docs.gitbook.io offline
On 4/27/23 10:31, Michael D Kinney wrote:
>
> Hello,
>
> All docs were migrated to github tianocore-docs organization about 3
> years ago.
>
> https://github.com/tianocore-docs
>
> The following 2 wiki page has links to all the documents
>
> https://tianocore-docs.github.io/
>
> https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Draft-Specification
>
> The docs in gitbook.io were out of date, so they have now been
> disabled, so please update your links.
>
> If there are any document that are missing from these pages, please
> let us know.
>
Hopefully the gitbook.io results will drop off Google soon.

It's a shame we can't do a HTTP 301 redirect for the old gitbook.io
links, because pages such as
https://www.cve.org/CVERecord?id=CVE-2019-0160 are unlikely to be updated.


The pages on tianocore-docs.github.io have an empty 'description' header
which is probably why both the gitbook.io and github source files are
higher in the results.

I'll see if it's possible to fix that.




EDK II Platform Description (DSC) File Specification ยท
GitBook





--

Rebecca Cran







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103825): https://edk2.groups.io/g/devel/message/103825
Mute This Topic: https://groups.io/mt/98539178/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 V1 1/1] OvmfPkg/PlatformPei: Skip PlatformInitEmuVariableNvStore in SEV guest

2023-05-01 Thread Lendacky, Thomas via groups.io

On 4/28/23 03:41, Gerd Hoffmann wrote:

   Hi,


I'd have to dig much deeper to see if there's a way to identify whether a
VARS file was specified on the Qemu command line. I *think* (please correct
me if I'm missing something) for SEV and SEV-ES it would be straight forward
to try and access the memory as shared and check the headers. If they're
valid, then a VARS file was specified on the command line and should remain
mapped shared. If they aren't valid, a VARS file wasn't specified and you
have either the full OVMF.fd file or just the OVMF_CODE.fd with memory
backing the VARS that, in either case, should be mapped private.


OVMF_CODE.fd + OVMF_VARS.fd is *identical* to just OVMF.fd, i.e. the
guest will see valid varstore headers in both cases.


It is identical except in how they are mapped. With a split OVMF_CODE.fd / 
OVMF_VARS.fd, the OVMF_CODE.fd file is mapped private and the OVMF_VARS.fd 
is mapped shared because the hypervisor is updating the contents of 
OVMF_VARS.fd. With OVMF.fd, the whole file is mapped private because 
updates to the variables are not retained, so the hypervisor isn't 
updating the contents.


I'll give the patch below a try in the next day or two.

Thanks,
Tom



The split into code part and vars part allows to (a) easily update the
code without screwing up the vars, and (b) map both with different
properties, i.e. code read-only and vars read/write.

Does the patch below help?

take care,
   Gerd

 From 3971f9453ded3032f5918dc9d181ecc0b6f97862 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann 
Date: Fri, 28 Apr 2023 10:34:23 +0200
Subject: [PATCH 1/1] [testing] try setup mmio in QemuFlashBeforeProbe (dxe)

---
  .../QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c | 15 ---
  1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c 
b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c
index d57f7ca25ccf..3a6280ab9c3a 100644
--- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c
+++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c
@@ -37,9 +37,18 @@ QemuFlashBeforeProbe (
IN  UINTN FdBlockCount
)
  {
-  //
-  // Do nothing
-  //
+  EFI_STATUS  Status;
+
+  if (MemEncryptSevIsEnabled ()) {
+Status = MemEncryptSevClearMmioPageEncMask (
+ 0,
+ BaseAddress,
+ EFI_SIZE_TO_PAGES (FdBlockSize * FdBlockCount)
+ );
+if (EFI_ERROR(Status)) {
+  DEBUG ((DEBUG_WARN, "%a: MemEncryptSevClearMmioPageEncMask: %r\n", 
__func__, Status));
+}
+  }
  }
  
  /**



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103824): https://edk2.groups.io/g/devel/message/103824
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 v6 00/16] BaseTools,CryptoPkg,EmulatorPkg,MdePkg,others: Delete CLANG35,CLANG38,VS2008-2013,EBC, deprecate GCC48,GCC49,GCC5, add GCC and GCCNOLTO, update CLANGDWARF

2023-05-01 Thread Michael D Kinney
Hi Rebecca,

Thank you for all the updates.

Series Reviewed-by: Michael D Kinney 
Series Tested-by: Michael D Kinney 

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Rebecca
> Cran
> Sent: Monday, May 1, 2023 9:08 AM
> To: devel@edk2.groups.io; Gao, Liming ; Feng,
> Bob C ; Chen, Christine ;
> Kinney, Michael D ; Michael Kubacki
> ; Sean Brogan
> ; Chiu, Chasel ;
> Desimone, Nathaniel L ; Zeng, Star
> ; Andrew Fish ; Ni, Ray
> ; Leif Lindholm ; Liu,
> Zhiguang ; Wang, Jian J ;
> Lu, Xiaoyu1 ; Jiang, Guomin
> ; Guo, Gua ; Ard Biesheuvel
> ; Pedro Falcato ; Gerd
> Hoffmann ; mhaeu...@posteo.de
> Cc: Rebecca Cran 
> Subject: [edk2-devel] [PATCH v6 00/16]
> BaseTools,CryptoPkg,EmulatorPkg,MdePkg,others: Delete
> CLANG35,CLANG38,VS2008-2013,EBC, deprecate GCC48,GCC49,GCC5, add
> GCC and GCCNOLTO, update CLANGDWARF
> 
> Update the toolchain definitions:
> 
> - Delete the CLANG35 and CLANG38 toolchains, and replace CLANG38 with
>   CLANGDWARF, updating it to support ARM and AARCH64 in addition to X64
> and IA32.
> 
> - Mark GCC48, GCC49 and GCC5 as deprecated.
> 
> - Add GCC and GCCNOLTO toolchain definitions.
> 
> - Remove VS2008, VS2010, VS2012 and VS2013.
> 
> - Remove EBC compiler definitions. Full removal of EBC support from the
>   various packages etc. will be done in a follow-up patch series.
> 
> - Remove unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS
> definitions.
> 
> - Remove unused CYGWIN_ definitions.
> 
> Personal GitHub PR: https://github.com/tianocore/edk2/pull/4240
> GitHub branch: https://github.com/bcran/edk2/tree/clangdwarf
> 
> Note: CI is now passing.
> 
> Changes from v1 to v2
> =
> 
> - Added a commit to delete GCC48 and GCC49, rename GCC5 to GCC and
>   update the flags for other toolchains to work with the new GCC
>   definitions.
> 
> - Bumped VERSION from 2.00 to 3.00 to inform users that they should
>   update their Conf/tools_def.txt.
> 
> Changes from v2 to v3
> =
> 
> - Keep GCC48, GCC49 and GCC5 but mark them deprecated, including with
>   warnings at the start and end of running a build.
> 
> - Dropped the commit fixing the IA32 build of UefiPayloadPkg, because it
>   causes CI to fail due to building both IA32 and X64 at the same time:
> 
>   "Module built under multiple ARCHs [IA32, X64]. Not able to determine
> which output to put into flash for Module..."
> 
> - Added more information to the VERSION section in tools_def.template.
> 
> - Various fixes to the CLANGDWARF flags.
> 
> Changes from v3 to v4
> =
> 
> - Use lld for -a ARM -t CLANGDWARF.
> 
> Changes from v4 to v5
> =
> 
> - Fixed CLANGDWARF on Windows when llvm is installed with the llvm.org
>   installer and isn't installed in Visual Studio: use llvm-objcopy and the
>   tools prefix.
> 
> - Added flags for GCCNOLTO to UnitTestFrameworkPkgHost.dsc.inc
> 
> - Added GCC flags to CryptoPkg/Library/OpensslLib/*.inf
> 
> Changes from v5 to v6
> =
> 
> - Reworked CLANGDWARF toolchain definitions. I made mistakes when
> updating
>   them and accidentally changed the IA32 and X64 definitions.
> 
> - Dropped the changes to build.py. The edk2-BaseTools repo should be
>   updated first, and _then_ the edk2 BaseTools can be changed.
> 
> - Split the updates to CryptoPkg build flags into separate commits,
>   copying the CLANGPDB flags to CLANGDWARF.
> 
> - Fixed non-ASCII character in 5/16 commit message.
> 
> - Removed trailing whitespace in tools_def.template.
> 
> Rebecca Cran (16):
>   BaseTools: Remove VS2008, 2010, 2012 and 2013 toolchain definitions
>   BaseTools: Remove VS2008-VS2013 remnants
>   MdePkg: Remove VS2008-VS2013 remnants
>   edksetup.bat: Remove VS2008-VS2013 remnants
>   BaseTools: Remove unused IPHONE_TOOLS and
> SOURCERY_CYGWIN_TOOLS defs
>   BaseTools: Remove EBC (EFI Byte Code) compiler definitions
>   BaseTools: Update VS toolchain descriptions in tools_def.txt.template
>   Add GCC and GCCNOLTO toolchains to tools_def.txt and update packages
>   BaseTools/Conf/tools_def.template: Add section for deprecated
> toolchains
>   BaseTools: Add ARM and AARCH64 CLANGDWARF support in
> tools_def.template
>   BaseTools: As with CLANGDWARF IA32 and X64, use lld for ARM and
> AARCH64
>   BaseTools: Remove CLANG35 toolchain from tools_def.template
>   BaseTools: Delete CLANG38 from tools_def.template
>   BaseTools/Conf/tools_def.template: Bump VERSION to 3.00
>   CryptoPkg: Delete CLANG35 and CLANG38 build flags
>   CryptoPkg: Copy CLANGPDB build flags to CLANGDWARF
> 
>  UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc   |4 +
>  IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc |8 +-
>  CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf |3 +-
>  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf  |3 +-
>  CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf  |3 +-
>  CryptoPkg/Library/BaseCryptLib/SecCryptLib.i

Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: CpuDxe: Sync GCD Capabilities With Page Table Attributes

2023-05-01 Thread Michael D Kinney
Thanks for the quick feedback.  Ray is out this week.  I will work with Ray to 
arrange a time slot, hopefully next week that works for everyone.

Mike

> -Original Message-
> From: Oliver Smith-Denny 
> Sent: Monday, May 1, 2023 10:53 AM
> To: Ard Biesheuvel ; devel@edk2.groups.io; Kinney,
> Michael D 
> Cc: Ni, Ray ; Leif Lindholm ;
> Ard Biesheuvel ; Sami Mujawar
> ; Michael Kubacki
> ; Sean Brogan
> 
> Subject: Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: CpuDxe: Sync GCD
> Capabilities With Page Table Attributes
> 
> On 5/1/2023 10:50 AM, Ard Biesheuvel wrote:
> > On Mon, 1 May 2023 at 19:49, Michael D Kinney
> >  wrote:
> >>
> >> Hi,
> >>
> >> These UEFI Memory Map, GCD, and Page Table interactions can be
> complex and I
> >> agree there are some UEFI/PI spec clarifications that may help.
> >>
> >> Ray hosts a TianoCore design meeting when needed.  Do you think a
> meeting with
> >> an open discussion on these topics would help, or do we prefer to
> continue with
> >> email discussions?
> >>
> >
> > I'll gladly join a call to discuss this if we can find a timeslot that
> > works for everyone in terms of time zone. (I'm on Paris time)
> 
> I also think a call would be great, I certainly would benefit from
> learning more here :). I'm sure various members of my team would
> be interested in joining, happy to be flexible on timeslot (we are
> generally in PST).
> 
> Thanks,
> Oliver


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103822): https://edk2.groups.io/g/devel/message/103822
Mute This Topic: https://groups.io/mt/98505340/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 v1 1/1] ArmPkg: CpuDxe: Sync GCD Capabilities With Page Table Attributes

2023-05-01 Thread Oliver Smith-Denny

On 5/1/2023 10:50 AM, Ard Biesheuvel wrote:

On Mon, 1 May 2023 at 19:49, Michael D Kinney
 wrote:


Hi,

These UEFI Memory Map, GCD, and Page Table interactions can be complex and I
agree there are some UEFI/PI spec clarifications that may help.

Ray hosts a TianoCore design meeting when needed.  Do you think a meeting with
an open discussion on these topics would help, or do we prefer to continue with
email discussions?



I'll gladly join a call to discuss this if we can find a timeslot that
works for everyone in terms of time zone. (I'm on Paris time)


I also think a call would be great, I certainly would benefit from
learning more here :). I'm sure various members of my team would
be interested in joining, happy to be flexible on timeslot (we are
generally in PST).

Thanks,
Oliver


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




Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: CpuDxe: Sync GCD Capabilities With Page Table Attributes

2023-05-01 Thread Ard Biesheuvel
On Mon, 1 May 2023 at 19:49, Michael D Kinney
 wrote:
>
> Hi,
>
> These UEFI Memory Map, GCD, and Page Table interactions can be complex and I
> agree there are some UEFI/PI spec clarifications that may help.
>
> Ray hosts a TianoCore design meeting when needed.  Do you think a meeting with
> an open discussion on these topics would help, or do we prefer to continue 
> with
> email discussions?
>

I'll gladly join a call to discuss this if we can find a timeslot that
works for everyone in terms of time zone. (I'm on Paris time)


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




Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: CpuDxe: Sync GCD Capabilities With Page Table Attributes

2023-05-01 Thread Michael D Kinney
Hi,

These UEFI Memory Map, GCD, and Page Table interactions can be complex and I
agree there are some UEFI/PI spec clarifications that may help.

Ray hosts a TianoCore design meeting when needed.  Do you think a meeting with
an open discussion on these topics would help, or do we prefer to continue with
email discussions?

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Oliver
> Smith-Denny
> Sent: Monday, May 1, 2023 10:04 AM
> To: Ard Biesheuvel 
> Cc: devel@edk2.groups.io; Leif Lindholm ; Ard
> Biesheuvel ; Sami Mujawar
> ; Michael Kubacki
> ; Sean Brogan
> 
> Subject: Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: CpuDxe: Sync GCD
> Capabilities With Page Table Attributes
> 
> On 5/1/2023 6:02 AM, Ard Biesheuvel wrote:
> > On Wed, 26 Apr 2023 at 02:09, Oliver Smith-Denny
> >  wrote:
> >>
> >> When ArmPkg's CpuDxe driver initializes, it attempts to sync the
> >> GCD with the page table. However, unlike when the UefiCpuPkg's
> >> CpuDxe initializes, the Arm version does not update the GCD
> >> capabilities with EFI_MEMORY_[RO|RP|XP] (this could also set
> >> the capabilities to be the existing page table attributes for
> >> this range, but the UefiCpuPkg CpuDxe sets the above attributes
> >> as they are software constructs, possible to set for any memory
> >> hardware).
> >>
> >> As a result, when the GCD attributes are attempted to be set
> >> against the old GCD capabilities, attributes that are set in the
> >> page table can get lost because the new attributes are not in the
> >> old GCD capabilities (and yet they are already set in the page
> >> table) meaning that the attempted sync between the GCD and the
> >> page table was a failure and drivers querying one vs the other
> >> will see different state. This can lead to RWX memory regions
> >> even with the no-execute policy set, because core drivers (such
> >> as NonDiscoverablePciDeviceIo, to be fixed up in a later patchset)
> >> allocate pages, query the GCD attributes, attempt to set a new
> >> cache attribute and end up clearing the XP bit in the page table
> >> because the GCD attributes do not have XP set.
> >>
> >> This patch follows the UefiCpuPkg pattern and adds
> >> EFI_MEMORY_[RO|RP|XP] to the GCD capabilities during CpuDxe
> >> initialization. This ensures that memory regions which already have
> >> these attributes set get them set in the GCD attributes, properly
> >> syncing between the GCD and the page table.
> >>
> >> This mitigates the issue seen, however, additional investigations
> >> into setting the GCD attributes earlier and maintaining a better
> >> sync between the GCD and the page table are being done.
> >>
> >> Feedback on this proposal is greatly appreciated, particularly
> >> any pitfalls or more architectural solutions to issues seen
> >> with syncing the GCD and the page table.
> >>
> >
> > I think this is conceptually correct. However, I've played with this
> > in the past, and IIRC, these attributes are inherited by the EFI
> > memory map too, and not updated when allocations are made. This means
> > that all code and data regions will be listed as RP, RO and XP in the
> > EFI memory map, which is going to confuse Linux at the very least, and
> > potentially other OSes as well.
> 
> Thanks for the detailed response, I appreciate it!
> A clarification here: my patch follows what the x86 code does (see
> https://github.com/tianocore/edk2/blob/56e9828380b7425678a080bd3a08e
> 7c741af67ba/UefiCpuPkg/CpuDxe/CpuPageTable.c#LL994C1-L1077C27),
> where the capabilities of each region are updated to include RP, RO, and
> XP. However, the attributes of each region are only updated to include
> these flags if the page table has the attributes set for this region.
> I.e. we are only allowing for the possibility of these bits to be
> set, but not actually setting them in the attributes unless the page
> table already has them set. So, at the very least, we should be
> matching what x86 does (so OS's should not be broken), unless
> the other discrepancies in the x86 and Arm memory attribute handling
> cause issue.
> 
> The main thing my change is intended to address is the case where
> code that uses the GCD instead of the page table (such as the
> NonDiscoverablePciDeviceIo driver I mentioned) attempts to set
> a CPU memory attribute (such as UC) and ends up clearing the XP bit
> that was set in the page table, but wasn't in the GCD (because it was
> never properly synced with the page table). This could also be solved
> by going to each caller and updating it to set the GCD capabilities
> before it sets the GCD attributes (and perhaps they should be, already).
> However, this puts the burden of maintaining memory protections such
> as XP on each caller, instead of handling it at a core level (now,
> there are of course complete design changes that could make this more
> effective, but this was an attempt at a simple first step).
> 
> My understanding is that the EFI memory map is built on demand b

Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: CpuDxe: Sync GCD Capabilities With Page Table Attributes

2023-05-01 Thread Oliver Smith-Denny

On 5/1/2023 6:02 AM, Ard Biesheuvel wrote:

On Wed, 26 Apr 2023 at 02:09, Oliver Smith-Denny
 wrote:


When ArmPkg's CpuDxe driver initializes, it attempts to sync the
GCD with the page table. However, unlike when the UefiCpuPkg's
CpuDxe initializes, the Arm version does not update the GCD
capabilities with EFI_MEMORY_[RO|RP|XP] (this could also set
the capabilities to be the existing page table attributes for
this range, but the UefiCpuPkg CpuDxe sets the above attributes
as they are software constructs, possible to set for any memory
hardware).

As a result, when the GCD attributes are attempted to be set
against the old GCD capabilities, attributes that are set in the
page table can get lost because the new attributes are not in the
old GCD capabilities (and yet they are already set in the page
table) meaning that the attempted sync between the GCD and the
page table was a failure and drivers querying one vs the other
will see different state. This can lead to RWX memory regions
even with the no-execute policy set, because core drivers (such
as NonDiscoverablePciDeviceIo, to be fixed up in a later patchset)
allocate pages, query the GCD attributes, attempt to set a new
cache attribute and end up clearing the XP bit in the page table
because the GCD attributes do not have XP set.

This patch follows the UefiCpuPkg pattern and adds
EFI_MEMORY_[RO|RP|XP] to the GCD capabilities during CpuDxe
initialization. This ensures that memory regions which already have
these attributes set get them set in the GCD attributes, properly
syncing between the GCD and the page table.

This mitigates the issue seen, however, additional investigations
into setting the GCD attributes earlier and maintaining a better
sync between the GCD and the page table are being done.

Feedback on this proposal is greatly appreciated, particularly
any pitfalls or more architectural solutions to issues seen
with syncing the GCD and the page table.



I think this is conceptually correct. However, I've played with this
in the past, and IIRC, these attributes are inherited by the EFI
memory map too, and not updated when allocations are made. This means
that all code and data regions will be listed as RP, RO and XP in the
EFI memory map, which is going to confuse Linux at the very least, and
potentially other OSes as well.


Thanks for the detailed response, I appreciate it!
A clarification here: my patch follows what the x86 code does (see
https://github.com/tianocore/edk2/blob/56e9828380b7425678a080bd3a08e7c741af67ba/UefiCpuPkg/CpuDxe/CpuPageTable.c#LL994C1-L1077C27),
where the capabilities of each region are updated to include RP, RO, and
XP. However, the attributes of each region are only updated to include
these flags if the page table has the attributes set for this region.
I.e. we are only allowing for the possibility of these bits to be
set, but not actually setting them in the attributes unless the page
table already has them set. So, at the very least, we should be
matching what x86 does (so OS's should not be broken), unless
the other discrepancies in the x86 and Arm memory attribute handling
cause issue.

The main thing my change is intended to address is the case where
code that uses the GCD instead of the page table (such as the
NonDiscoverablePciDeviceIo driver I mentioned) attempts to set
a CPU memory attribute (such as UC) and ends up clearing the XP bit
that was set in the page table, but wasn't in the GCD (because it was
never properly synced with the page table). This could also be solved
by going to each caller and updating it to set the GCD capabilities
before it sets the GCD attributes (and perhaps they should be, already).
However, this puts the burden of maintaining memory protections such
as XP on each caller, instead of handling it at a core level (now,
there are of course complete design changes that could make this more
effective, but this was an attempt at a simple first step).

My understanding is that the EFI memory map is built on demand by calls
to GetMemoryMap from the page descriptor list, which is updated
thoughout bootservices, i.e. that it isn't pulling from the GCD. I will
go back and trace through this logic again.



Generally, the EFI and PI specs are very vague when it comes to
defining whether memory region attributes apply to the memory region
itself ("this memory can be mapped as read-only or non-exec") or its
contents ("these pages can be mapped read-only because the code does
not expect to be able to write to it").

Before we have some clarification and some rigid wording in the spec
as to what these attributes actually mean for non-allocated regions vs
allocated ones, I don't think we can use them like this.
Alternatively, we could update the GCD core so these attributes are
not inherited by the EFI memory map.

Another potential concern is fragmentation: the GCD memory map has
very few entries usually under the current usage model, but keeping
track of all memory permission attributes is going

Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library.

2023-05-01 Thread Chiu, Chasel

Hi Leif,

Would you please share your ideas and respond Mike's question too?

Thanks,
Chasel



> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chiu, Chasel
> Sent: Tuesday, April 25, 2023 10:22 PM
> To: devel@edk2.groups.io; Kinney, Michael D ;
> Leif Lindholm 
> Cc: Lin, Benny ; Leif Lindholm
> ; Gao, Liming ; Liu,
> Zhiguang ; Pedro Falcato 
> Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library.
> 
> 
> Hello,
> 
> Since platform may also define other FDT structures, this EDK2 library may not
> be able to convert all the FDT structures to little endian.
> We might define a generic MACRO in library like
> CONVERT_FDT_DATA_TO_LITTLE_ENDIAN which can be used for all structure
> data, but it will be almost like calling SwapBytes** directly.
> Any other suggestion?
> 
> Thanks,
> Chasel
> 
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Michael D
> > Kinney
> > Sent: Monday, April 24, 2023 10:41 AM
> > To: Leif Lindholm ; devel@edk2.groups.io
> > Cc: Lin, Benny ; Leif Lindholm
> > ; Gao, Liming ;
> Liu,
> > Zhiguang ; Pedro Falcato
> ;
> > Kinney, Michael D 
> > Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library.
> >
> > Hi Leif,
> >
> > Do you have a proposal or small example on what you want to see
> > in the library?
> >
> > Mike
> >
> > > -Original Message-
> > > From: Leif Lindholm 
> > > Sent: Monday, April 24, 2023 10:29 AM
> > > To: devel@edk2.groups.io; Kinney, Michael D 
> > > Cc: Lin, Benny ; Leif Lindholm
> > ; Gao, Liming ;
> Liu,
> > > Zhiguang ; Pedro Falcato
> > 
> > > Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library.
> > >
> > > Apologies, I was refactoring a git tree and switched off the world :)
> > >
> > > Well, being a bit late to the party ... my view is it would be
> > > preferable if we put the byteswapping in the library.
> > >
> > > The DT format is *defined* to be big-endian, 32-bit cells. So frankly,
> > > I have no problems with pushing responsibility onto individual
> > > platforms if they have decided to be "clever" by ignoring that -
> > > if that gets rid of a bunch of boilerplate for sensibly behaving 
> > > platforms.
> > >
> > > Maybe another excuse for getting
> > > https://github.com/tianocore/edk2-
> > platforms/blob/master/Silicon/NXP/Library/IoAccessLib/IoAccessLib.c
> > > into MdePkg?
> > >
> > > /
> > > Leif
> > >
> > > On Thu, Apr 20, 2023 at 16:44:03 +, Michael D Kinney wrote:
> > > > Hi Leif,
> > > >
> > > > What is your opinion on FDT being big endian.
> > > >
> > > > Do we want the lib to help with that aspect, or leave it up to the 
> > > > consumer
> of
> > the lib to
> > > > convert as needed?  Seems like an area that could be very error prone 
> > > > if we
> > are not
> > > > careful.
> > > >
> > > > Mike
> > > >
> > > > > -Original Message-
> > > > > From: Lin, Benny 
> > > > > Sent: Wednesday, April 19, 2023 9:25 PM
> > > > > To: Kinney, Michael D ;
> > devel@edk2.groups.io
> > > > > Cc: Gao, Liming ; Liu, Zhiguang
> > ; Pedro Falcato 
> > > > > Subject: RE: [PATCH v3 2/3] MdePkg: Support FDT library.
> > > > >
> > > > >
> > > > >
> > > > > >-Original Message-
> > > > > >From: Kinney, Michael D 
> > > > > >Sent: Thursday, April 20, 2023 5:04 AM
> > > > > >To: Lin, Benny ; devel@edk2.groups.io
> > > > > >Cc: Gao, Liming ; Liu, Zhiguang
> > ; Pedro Falcato
> > > ; Kinney,
> > > > > Michael D 
> > > > > >Subject: RE: [PATCH v3 2/3] MdePkg: Support FDT library.
> > > > > >
> > > > > >Responses below
> > > > > >
> > > > > >Mike
> > > > > >
> > > > > >> -Original Message-
> > > > > >> From: Lin, Benny 
> > > > > >> Sent: Wednesday, April 19, 2023 10:12 AM
> > > > > >> To: Kinney, Michael D ;
> > > > > >> devel@edk2.groups.io
> > > > > >> Cc: Gao, Liming ; Liu, Zhiguang
> > > > > >> ; Pedro Falcato
> 
> > > > > >> Subject: RE: [PATCH v3 2/3] MdePkg: Support FDT library.
> > > > > >>
> > > > > >> Please find my feedback below.
> > > > > >> We can remove FDT_RESERVE_ENTRY but keep FDT_NODE_HEADER,
> > what do you think?
> > > > > >>
> > > > > >> QQQ
> > > > > >> Benny
> > > > > >>
> > > > > >> >-Original Message-
> > > > > >> >From: Kinney, Michael D 
> > > > > >> >Sent: Wednesday, April 19, 2023 11:54 PM
> > > > > >> >To: Lin, Benny ; devel@edk2.groups.io
> > > > > >> >Cc: Gao, Liming ; Liu, Zhiguang
> > > > > >> >; Pedro Falcato
> ;
> > > > > >> >Kinney,
> > > > > >> Michael D 
> > > > > >> >Subject: RE: [PATCH v3 2/3] MdePkg: Support FDT library.
> > > > > >> >
> > > > > >> >A few comments below.
> > > > > >> >
> > > > > >> >Mike
> > > > > >> >
> > > > > >> >> -Original Message-
> > > > > >> >> From: Lin, Benny 
> > > > > >> >> Sent: Sunday, April 16, 2023 10:35 PM
> > > > > >> >> To: devel@edk2.groups.io
> > > > > >> >> Cc: Lin, Benny ; Kinney, Michael D
> > > > > >> >> ; Gao, Liming
> > > > > >> >> ; Liu, Zhiguang
> > ;
> > > > > >> >> Pedro Falcato 
> > > > > >> >> Subject: [PATCH v3 2/3] MdeP

[edk2-devel] [PATCH v6 13/16] BaseTools: Delete CLANG38 from tools_def.template

2023-05-01 Thread Rebecca Cran
Clang 3.8 is a very old release and is no longer relevant. Delete the
CLANG38 toolchain from tools_def.template.

Signed-off-by: Rebecca Cran 
---
 BaseTools/Conf/tools_def.template | 233 ++--
 1 file changed, 22 insertions(+), 211 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 6f4a4c2096eb..cde5d14513c1 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -169,13 +169,6 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 #   Intel(r) ACPI Compiler from
 #   https://acpica.org/downloads
 #
-#   CLANG38  -Linux-  Requires:
-# Clang v3.8, LLVMgold plugin and GNU binutils 
2.26 targeting x86_64-linux-gnu, aarch64-linux-gnu or arm-linux-gnueabi
-# Clang v3.9 or later, LLVMgold plugin and GNU 
binutils 2.28 targeting x86_64-linux-gnu, aarch64-linux-gnu or arm-linux-gnueabi
-#Optional:
-# Required to build platforms or ACPI tables:
-#   Intel(r) ACPI Compiler from
-#   https://acpica.org/downloads
 #   CLANGPDB -Linux, Windows, Mac-  Requires:
 # Clang 9 or above from http://releases.llvm.org/
 #Optional:
@@ -1731,194 +1724,6 @@ RELEASE_GCC_AARCH64_DLINK_XIPFLAGS = -z 
common-page-size=0x20
 DEBUG_GCC_LOONGARCH64_CC_FLAGS = DEF(GCC5_LOONGARCH64_CC_FLAGS)
 RELEASE_GCC_LOONGARCH64_CC_FLAGS   = DEF(GCC5_LOONGARCH64_CC_FLAGS) 
-Wno-unused-but-set-variable -Wno-unused-variable
 
-
-#
-# Clang 3.8 - This configuration is used to compile under Linux to produce
-#  PE/COFF binaries using LLVM/Clang 3.8 with Link Time Optimization enabled
-#
-
-*_CLANG38_*_*_FAMILY= GCC
-*_CLANG38_*_MAKE_PATH   = make
-*_CLANG38_*_*_DLL   = ENV(CLANG38_DLL)
-*_CLANG38_*_ASL_PATH= DEF(UNIX_IASL_BIN)
-
-*_CLANG38_*_APP_FLAGS   =
-*_CLANG38_*_ASL_FLAGS   = DEF(IASL_FLAGS)
-*_CLANG38_*_ASL_OUTFLAGS= DEF(IASL_OUTFLAGS)
-*_CLANG38_*_DEPS_FLAGS  = DEF(GCC_DEPS_FLAGS)
-DEFINE CLANG38_IA32_PREFIX  = ENV(CLANG38_BIN)
-DEFINE CLANG38_X64_PREFIX   = ENV(CLANG38_BIN)
-
-DEFINE CLANG38_IA32_TARGET  = -target i686-pc-linux-gnu
-DEFINE CLANG38_X64_TARGET   = -target x86_64-pc-linux-gnu
-
-DEFINE CLANG38_WARNING_OVERRIDES= -Wno-parentheses-equality 
-Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare 
-Wno-empty-body -Wno-unused-const-variable -Wno-varargs 
-Wno-unknown-warning-option -Wno-unused-but-set-variable 
-Wno-unused-const-variable -Wno-unaligned-access
-DEFINE CLANG38_ALL_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) 
DEF(CLANG38_WARNING_OVERRIDES) -fno-stack-protector -mms-bitfields -Wno-address 
-Wno-shift-negative-value -Wno-unknown-pragmas 
-Wno-incompatible-library-redeclaration -fno-asynchronous-unwind-tables 
-mno-sse -mno-mmx -msoft-float -mno-implicit-float  
-ftrap-function=undefined_behavior_has_been_optimized_away_by_clang 
-funsigned-char -fno-ms-extensions -Wno-null-dereference
-
-###
-# CLANG38 IA32 definitions
-###
-*_CLANG38_IA32_OBJCOPY_PATH = objcopy
-*_CLANG38_IA32_CC_PATH  = DEF(CLANG38_IA32_PREFIX)clang
-*_CLANG38_IA32_SLINK_PATH   = DEF(CLANG38_IA32_PREFIX)llvm-ar
-*_CLANG38_IA32_DLINK_PATH   = DEF(CLANG38_IA32_PREFIX)clang
-*_CLANG38_IA32_ASLDLINK_PATH= DEF(CLANG38_IA32_PREFIX)clang
-*_CLANG38_IA32_ASM_PATH = DEF(CLANG38_IA32_PREFIX)clang
-*_CLANG38_IA32_PP_PATH  = DEF(CLANG38_IA32_PREFIX)clang
-*_CLANG38_IA32_VFRPP_PATH   = DEF(CLANG38_IA32_PREFIX)clang
-*_CLANG38_IA32_ASLCC_PATH   = DEF(CLANG38_IA32_PREFIX)clang
-*_CLANG38_IA32_ASLPP_PATH   = DEF(CLANG38_IA32_PREFIX)clang
-*_CLANG38_IA32_RC_PATH  = objcopy
-
-*_CLANG38_IA32_ASLCC_FLAGS  = DEF(GCC_ASLCC_FLAGS) -m32 -fno-lto 
DEF(CLANG38_IA32_TARGET)
-*_CLANG38_IA32_ASLDLINK_FLAGS   = DEF(GCC5_IA32_X64_ASLDLINK_FLAGS) 
-Wl,-m,elf_i386
-*_CLANG38_IA32_ASM_FLAGS= DEF(GCC5_ASM_FLAGS) -m32 -march=i386 
DEF(CLANG38_IA32_TARGET)
-*_CLANG38_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
-*_CLANG38_IA32_OBJCOPY_FLAGS=
-*_CLANG38_IA32_NASM_FLAGS   = -f elf32
-*_CLANG38_IA32_PP_FLAGS = DEF(GCC_PP_FLAGS) 
DEF(CLANG38_IA32_TARGET)
-*_CLANG38_IA32_ASLPP_FLAGS  = DEF(GCC_ASLPP_FLAGS) 
DEF(CLANG38_IA32_TARGET)
-*_CLANG38_IA32_VFRPP_FLAGS  = DEF(GCC_VFRPP_FLAGS) 
DEF(CLANG38_IA32_TARGET)
-
-DEBUG_CLANG38_IA32_CC_FLAGS = DEF(CLANG38_ALL_CC_FLAGS

[edk2-devel] [PATCH v6 16/16] CryptoPkg: Copy CLANGPDB build flags to CLANGDWARF

2023-05-01 Thread Rebecca Cran
The CLANGDWARF toolchain was broken due to missing build flags in
CryptoPkg. Update the various inf files to copy the flags used for
CLANGPDB to CLANGDWARF.

Signed-off-by: Rebecca Cran 
---
 CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 1 +
 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf  | 1 +
 CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf  | 1 +
 CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf  | 1 +
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf  | 1 +
 CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLib.inf | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf| 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf   | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibFull.inf | 1 +
 CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf| 1 +
 11 files changed, 11 insertions(+)

diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index 910f5a4a2a7a..515dc7983d07 100644
--- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -111,5 +111,6 @@ [BuildOptions]
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
+  GCC:*_CLANGDWARF_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index 3ac52b479d58..0ad58a0c843d 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -98,5 +98,6 @@ [BuildOptions]
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
+  GCC:*_CLANGDWARF_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
index 97840df5aa73..fedf8fc45b34 100644
--- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
@@ -107,5 +107,6 @@ [BuildOptions]
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
+  GCC:*_CLANGDWARF_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
index 83f9709851df..cd85e1db23a6 100644
--- a/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
@@ -82,5 +82,6 @@ [BuildOptions]
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
+  GCC:*_CLANGDWARF_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
index e9b65aee37bf..f8389a362059 100644
--- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
@@ -106,3 +106,4 @@ [BuildOptions]
   XCODE:*_*_*_CC_FLAGS = -mmmx -msse -std=c99
 
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
+  GCC:*_CLANGDWARF_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
diff --git a/CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf
index be717a49d636..b4217236bb9f 100644
--- a/CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf
@@ -79,5 +79,6 @@ [BuildOptions]
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
+  GCC:*_CLANGDWARF_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 1a469c8e6968..beada1ebaf56 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -640,6 +640,7 @@ [BuildOptions]
   GCC:*_*_RISCV64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized 
-Wno-format -Wno-error=unused-but-set-variable
   GCC:*_*_LOONGARCH64_CC_FLAGS = $(OPENSSL_FLAGS) 
-Wno-error=maybe-uninitialized -Wno-format -Wno-error=unused-but-set-variable
   GCC:*_CLANGPDB_*_

[edk2-devel] [PATCH v6 15/16] CryptoPkg: Delete CLANG35 and CLANG38 build flags

2023-05-01 Thread Rebecca Cran
Since CLANG35 and CLANG38 toolchains have been deleted, remove build
flags for them from CryptoPkg.

Signed-off-by: Rebecca Cran 
---
 CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 2 --
 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf  | 2 --
 CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf  | 2 --
 CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf  | 2 --
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf  | 2 --
 CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf | 2 --
 CryptoPkg/Library/OpensslLib/OpensslLib.inf | 2 --
 CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf| 2 --
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf   | 2 --
 CryptoPkg/Library/OpensslLib/OpensslLibFull.inf | 2 --
 CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf| 2 --
 11 files changed, 22 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index 5be1724f0852..910f5a4a2a7a 100644
--- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -110,8 +110,6 @@ [BuildOptions]
   #
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
-  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
-  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index 66261138a00b..3ac52b479d58 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -97,8 +97,6 @@ [BuildOptions]
   #
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
-  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
-  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
index 07dbc0e7a8bd..97840df5aa73 100644
--- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
@@ -106,8 +106,6 @@ [BuildOptions]
   #
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
-  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
-  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
index 4ad59b7bbc59..83f9709851df 100644
--- a/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
@@ -81,8 +81,6 @@ [BuildOptions]
   #
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
-  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
-  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
index ab1993087167..e9b65aee37bf 100644
--- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
@@ -105,6 +105,4 @@ [BuildOptions]
 
   XCODE:*_*_*_CC_FLAGS = -mmmx -msse -std=c99
 
-  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
-  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
diff --git a/CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf
index 80261794470f..be717a49d636 100644
--- a/CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf
@@ -78,8 +78,6 @@ [BuildOptions]
   #
   # suppress the following warnings so we do not break the build with 
warnings-as-errors:
   #
-  GCC:*_CLANG35_*_CC_FLAGS = -std=c99
-  GCC:*_CLANG38_*_CC_FLAGS = -std=c99
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=incompatible-pointer-types
 
   XCODE:*_*_*_CC_FLAGS = -std=c99
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 0669f3035b85..1a469c8e6968 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -639,8 +639,6 @@ [BuildOptions]
   GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized 
-Wno-format -Wno-error=unused-but-set-variable -Wno-error=format
   GCC:*_*_RISCV64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized 
-Wno-format -Wno-error=unused-but-set-variable
   GCC:*_*_LOONGARCH64_CC_FLAGS = $(OP

[edk2-devel] [PATCH v6 14/16] BaseTools/Conf/tools_def.template: Bump VERSION to 3.00

2023-05-01 Thread Rebecca Cran
Bump VERSION to 3.00 and explain the changes made to the toolchains.

Signed-off-by: Rebecca Cran 
Reviewed-by: Liming Gao 
---
 BaseTools/Conf/tools_def.template | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index cde5d14513c1..1b3a9e7a540a 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -15,8 +15,13 @@
 #
 # 2.00 - Initial version with changes for CI
 #  - Change RC path to use plugin
+# 3.00 - Update toolchains
+#  - Add support for ARM and AARCH64 to CLANGDWARF
+#  - Remove VS2008, VS2010, VS2012, VS2013, CLANG35, CLANG38, EBC
+#  - Add GCC and GCCNOLTO
+#  - Deprecate GCC48, GCC49 and GCC5.
 #
-#!VERSION=2.00
+#!VERSION=3.00
 
 IDENTIFIER = Default TOOL_CHAIN_CONF
 
-- 
2.39.2



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




[edk2-devel] [PATCH v6 12/16] BaseTools: Remove CLANG35 toolchain from tools_def.template

2023-05-01 Thread Rebecca Cran
Clang 3.5 is a very old release and is no longer relevant. Remove the
CLANG35 toolchain from tools_def.template.

Signed-off-by: Rebecca Cran 
---
 BaseTools/Conf/tools_def.template | 88 
 1 file changed, 88 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 9013ecc7cc66..6f4a4c2096eb 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -169,12 +169,6 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 #   Intel(r) ACPI Compiler from
 #   https://acpica.org/downloads
 #
-#   CLANG35 -Linux,Windows-  Requires:
-# Clang v3.5 or later, and GNU binutils targeting 
aarch64-linux-gnu or arm-linux-gnueabi
-#Optional:
-# Required to build platforms or ACPI tables:
-#   Intel(r) ACPI Compiler from
-#   https://acpica.org/downloads
 #   CLANG38  -Linux-  Requires:
 # Clang v3.8, LLVMgold plugin and GNU binutils 
2.26 targeting x86_64-linux-gnu, aarch64-linux-gnu or arm-linux-gnueabi
 # Clang v3.9 or later, LLVMgold plugin and GNU 
binutils 2.28 targeting x86_64-linux-gnu, aarch64-linux-gnu or arm-linux-gnueabi
@@ -1737,88 +1731,6 @@ RELEASE_GCC_AARCH64_DLINK_XIPFLAGS = -z 
common-page-size=0x20
 DEBUG_GCC_LOONGARCH64_CC_FLAGS = DEF(GCC5_LOONGARCH64_CC_FLAGS)
 RELEASE_GCC_LOONGARCH64_CC_FLAGS   = DEF(GCC5_LOONGARCH64_CC_FLAGS) 
-Wno-unused-but-set-variable -Wno-unused-variable
 
-
-#
-# CLANG35   - This configuration is used to compile under Linux to produce
-# PE/COFF binaries using the clang compiler and assembler (v3.5 
and up)
-# and GNU linker
-#
-
-*_CLANG35_*_*_FAMILY = GCC
-
-*_CLANG35_*_MAKE_PATH= make
-*_CLANG35_*_*_DLL= ENV(CLANG35_DLL)
-*_CLANG35_*_ASL_PATH = DEF(UNIX_IASL_BIN)
-
-*_CLANG35_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
-*_CLANG35_*_ASLCC_FLAGS  = DEF(GCC_ASLCC_FLAGS)
-*_CLANG35_*_APP_FLAGS=
-*_CLANG35_*_ASL_FLAGS= DEF(IASL_FLAGS)
-*_CLANG35_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
-*_CLANG35_*_DTCPP_FLAGS  = DEF(GCC_DTCPP_FLAGS)
-
-*_CLANG35_*_CC_PATH  = ENV(CLANG35_BIN)clang
-*_CLANG35_*_ASM_PATH = ENV(CLANG35_BIN)clang
-*_CLANG35_*_PP_PATH  = ENV(CLANG35_BIN)clang
-*_CLANG35_*_VFRPP_PATH   = ENV(CLANG35_BIN)clang
-*_CLANG35_*_ASLCC_PATH   = ENV(CLANG35_BIN)clang
-*_CLANG35_*_ASLPP_PATH   = ENV(CLANG35_BIN)clang
-*_CLANG35_*_DLINK_PATH   = ENV(CLANG35_BIN)clang
-*_CLANG35_*_ASLDLINK_PATH= ENV(CLANG35_BIN)clang
-*_CLANG35_*_DEPS_FLAGS   = DEF(GCC_DEPS_FLAGS)
-
-DEFINE CLANG35_ARM_TARGET= -target arm-linux-gnueabi
-DEFINE CLANG35_AARCH64_TARGET= -target aarch64-linux-gnu
-
-DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality 
-Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare 
-Wno-empty-body -Wno-unknown-warning-option -Wno-unused-but-set-variable 
-Wno-unused-const-variable
-DEFINE CLANG35_ARM_CC_FLAGS  = DEF(GCC_ARM_CC_FLAGS) 
DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES)
-DEFINE CLANG35_AARCH64_CC_FLAGS  = DEF(GCC_AARCH64_CC_FLAGS) 
DEF(CLANG35_AARCH64_TARGET) -mcmodel=small DEF(CLANG35_WARNING_OVERRIDES)
-
-##
-# CLANG35 ARM definitions
-##
-*_CLANG35_ARM_SLINK_PATH = ENV(CLANG35_ARM_PREFIX)ar
-*_CLANG35_ARM_RC_PATH= ENV(CLANG35_ARM_PREFIX)objcopy
-
-*_CLANG35_ARM_ASLCC_FLAGS= DEF(GCC_ASLCC_FLAGS)
-*_CLANG35_ARM_ASLDLINK_FLAGS = DEF(CLANG35_ARM_TARGET) 
DEF(GCC_ARM_ASLDLINK_FLAGS)
-*_CLANG35_ARM_ASM_FLAGS  = DEF(GCC_ASM_FLAGS) DEF(CLANG35_ARM_TARGET) 
$(PLATFORM_FLAGS) -Qunused-arguments
-*_CLANG35_ARM_DLINK_FLAGS= DEF(CLANG35_ARM_TARGET) 
DEF(GCC_ARM_DLINK_FLAGS)
-*_CLANG35_ARM_DLINK2_FLAGS   = DEF(GCC_DLINK2_FLAGS_COMMON) 
-Wl,--defsym=PECOFF_HEADER_SIZE=0x220
-*_CLANG35_ARM_PLATFORM_FLAGS = -march=armv7-a -mkernel -Qunused-arguments
-*_CLANG35_ARM_PP_FLAGS   = DEF(GCC_PP_FLAGS) DEF(CLANG35_ARM_TARGET) 
$(PLATFORM_FLAGS)
-*_CLANG35_ARM_RC_FLAGS   = DEF(GCC_ARM_RC_FLAGS)
-*_CLANG35_ARM_VFRPP_FLAGS= DEF(GCC_VFRPP_FLAGS) 
DEF(CLANG35_ARM_TARGET) $(PLATFORM_FLAGS)
-*_CLANG35_ARM_ASLPP_FLAGS= DEF(GCC_ASLPP_FLAGS) DEF(CLANG35_ARM_TARGET)
-*_CLANG35_ARM_CC_XIPFLAGS= DEF(GCC_ARM_CC_XIPFLAGS)
-
-  DEBUG_CLANG35_ARM_CC_FLAGS = DEF(CLANG35_ARM_CC_FLAGS) $(PLATFORM_FLAGS) 
-O1
-RELEASE_CLANG35_ARM_CC_FLAGS = DEF(CLANG35_ARM_CC_FLAGS) $(PLATFORM_FLAGS) 
-Oz
-  NOOPT_CLANG35_

[edk2-devel] [PATCH v6 11/16] BaseTools: As with CLANGDWARF IA32 and X64, use lld for ARM and AARCH64

2023-05-01 Thread Rebecca Cran
As with the IA32 and X64 CLANGDWARF toolchain definitions, use ld.lld
for ARM and AARCH64.

Add -Wl,--no-pie,--no-relax to the command line to fix linking when
using lld.

Signed-off-by: Rebecca Cran 
---
 BaseTools/Conf/tools_def.template | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 7f44e10a429a..9013ecc7cc66 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -2243,11 +2243,11 @@ DEFINE CLANGDWARF_ARM_DLINK_FLAGS   = 
DEF(CLANGDWARF_ARM_TARGET) DEF(GCC_ARM_DLI
 *_CLANGDWARF_ARM_CC_XIPFLAGS= DEF(GCC_ARM_CC_XIPFLAGS)
 
   DEBUG_CLANGDWARF_ARM_CC_FLAGS = DEF(CLANGDWARF_ARM_CC_FLAGS) 
$(PLATFORM_FLAGS) -flto -O1
-  DEBUG_CLANGDWARF_ARM_DLINK_FLAGS  = DEF(CLANGDWARF_ARM_DLINK_FLAGS) -flto 
-Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm 
-Wl,-plugin-opt=-pass-through=-llto-arm
+  DEBUG_CLANGDWARF_ARM_DLINK_FLAGS  = DEF(CLANGDWARF_ARM_DLINK_FLAGS) -flto 
-Wl,-O1 -fuse-ld=lld -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm 
-Wl,-plugin-opt=-pass-through=-llto-arm -Wl,--no-pie,--no-relax
   NOOPT_CLANGDWARF_ARM_CC_FLAGS = DEF(CLANGDWARF_ARM_CC_FLAGS) 
$(PLATFORM_FLAGS) -O0
-  NOOPT_CLANGDWARF_ARM_DLINK_FLAGS  = DEF(CLANGDWARF_ARM_DLINK_FLAGS)
+  NOOPT_CLANGDWARF_ARM_DLINK_FLAGS  = DEF(CLANGDWARF_ARM_DLINK_FLAGS) 
-fuse-ld=lld -Wl,--no-pie,--no-relax
 RELEASE_CLANGDWARF_ARM_CC_FLAGS = DEF(CLANGDWARF_ARM_CC_FLAGS) 
$(PLATFORM_FLAGS) -flto -O3
-RELEASE_CLANGDWARF_ARM_DLINK_FLAGS  = DEF(CLANGDWARF_ARM_DLINK_FLAGS) -flto 
-Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm 
-Wl,-plugin-opt=-pass-through=-llto-arm
+RELEASE_CLANGDWARF_ARM_DLINK_FLAGS  = DEF(CLANGDWARF_ARM_DLINK_FLAGS) -flto 
-Wl,-O3 -fuse-ld=lld -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm 
-Wl,-plugin-opt=-pass-through=-llto-arm -Wl,--no-pie,--no-relax
 
 ##
 # CLANGDWARF AARCH64 definitions
@@ -2289,11 +2289,11 @@ DEFINE CLANGDWARF_AARCH64_DLINK_FLAGS  = 
DEF(CLANGDWARF_AARCH64_TARGET) DEF(GCC_
 *_CLANGDWARF_AARCH64_CC_XIPFLAGS= DEF(GCC_AARCH64_CC_XIPFLAGS)
 
   DEBUG_CLANGDWARF_AARCH64_CC_FLAGS= DEF(CLANGDWARF_AARCH64_CC_FLAGS) 
$(PLATFORM_FLAGS) -flto -O1
-  DEBUG_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) 
-flto -Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 
-Wl,-plugin-opt=-pass-through=-llto-aarch64
+  DEBUG_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) 
-flto -Wl,-O1 -fuse-ld=lld -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 
-Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wl,--no-pie,--no-relax
   NOOPT_CLANGDWARF_AARCH64_CC_FLAGS= DEF(CLANGDWARF_AARCH64_CC_FLAGS) 
$(PLATFORM_FLAGS) -O0
-  NOOPT_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS)
+  NOOPT_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) 
-fuse-ld=lld -Wl,--no-pie,--no-relax
 RELEASE_CLANGDWARF_AARCH64_CC_FLAGS= DEF(CLANGDWARF_AARCH64_CC_FLAGS) 
$(PLATFORM_FLAGS) -flto -O3
-RELEASE_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) 
-flto -Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 
-Wl,-plugin-opt=-pass-through=-llto-aarch64
+RELEASE_CLANGDWARF_AARCH64_DLINK_FLAGS = DEF(CLANGDWARF_AARCH64_DLINK_FLAGS) 
-flto -Wl,-O3 -fuse-ld=lld -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 
-Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wl,--no-pie,--no-relax
 
 #
 #
-- 
2.39.2



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




[edk2-devel] [PATCH v6 10/16] BaseTools: Add ARM and AARCH64 CLANGDWARF support in tools_def.template

2023-05-01 Thread Rebecca Cran
Add ARM and AARCH64 support to CLANGDWARF in tools_def.template, copying
the CLANG38 definitions.

Signed-off-by: Rebecca Cran 
---
 BaseTools/Conf/tools_def.template | 90 
 1 file changed, 90 insertions(+)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index c32c64f5ced6..7f44e10a429a 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -2205,6 +2205,96 @@ NOOPT_CLANGDWARF_X64_CC_FLAGS = 
DEF(CLANG38_ALL_CC_FLAGS) -m64 "-DEFIAPI
 NOOPT_CLANGDWARF_X64_DLINK_FLAGS  = DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) 
-Wl,-O0 -Wl,-melf_x86_64 -Wl,--oformat,elf64-x86-64 -Wl,-pie -mcmodel=small 
-Wl,--apply-dynamic-relocs
 NOOPT_CLANGDWARF_X64_DLINK2_FLAGS = DEF(CLANGDWARF_X64_DLINK2_FLAGS) -O0 
-fuse-ld=lld
 
+##
+# CLANGDWARF ARM definitions
+##
+DEFINE CLANGDWARF_ARM_TARGET= -target arm-linux-gnueabi
+DEFINE CLANGDWARF_ARM_CC_FLAGS  = DEF(GCC_ARM_CC_FLAGS) 
DEF(CLANGDWARF_ARM_TARGET) DEF(CLANGDWARF_WARNING_OVERRIDES) -mno-movt
+DEFINE CLANGDWARF_ARM_DLINK_FLAGS   = DEF(CLANGDWARF_ARM_TARGET) 
DEF(GCC_ARM_DLINK_FLAGS)
+
+*_CLANGDWARF_ARM_PP_FLAGS   = DEF(GCC_PP_FLAGS)
+*_CLANGDWARF_ARM_ASLCC_FLAGS= DEF(GCC_ASLCC_FLAGS)
+*_CLANGDWARF_ARM_APP_FLAGS  =
+*_CLANGDWARF_ARM_ASL_FLAGS  = DEF(IASL_FLAGS)
+*_CLANGDWARF_ARM_ASL_OUTFLAGS   = DEF(IASL_OUTFLAGS)
+*_CLANGDWARF_ARM_DTCPP_FLAGS= DEF(GCC_DTCPP_FLAGS)
+
+*_CLANGDWARF_ARM_CC_PATH= ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_ARM_ASM_PATH   = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_ARM_PP_PATH= ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_ARM_VFRPP_PATH = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_ARM_ASLCC_PATH = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_ARM_ASLPP_PATH = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_ARM_DLINK_PATH = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_ARM_ASLDLINK_PATH  = ENV(CLANGDWARF_BIN)clang
+
+*_CLANGDWARF_ARM_SLINK_PATH = ENV(CLANGDWARF_BIN)llvm-ar
+*_CLANGDWARF_ARM_RC_PATH= ENV(CLANGDWARF_ARM_PREFIX)objcopy
+
+*_CLANGDWARF_ARM_ASLCC_FLAGS= DEF(GCC_ASLCC_FLAGS) -fno-lto
+*_CLANGDWARF_ARM_ASLDLINK_FLAGS = DEF(CLANGDWARF_ARM_TARGET) 
DEF(GCC_ARM_ASLDLINK_FLAGS)
+*_CLANGDWARF_ARM_ASM_FLAGS  = DEF(GCC_ASM_FLAGS) 
DEF(CLANGDWARF_ARM_TARGET) $(PLATFORM_FLAGS) -Qunused-arguments
+*_CLANGDWARF_ARM_DLINK2_FLAGS   = DEF(GCC_DLINK2_FLAGS_COMMON) 
-Wl,--defsym=PECOFF_HEADER_SIZE=0x220
+*_CLANGDWARF_ARM_PLATFORM_FLAGS = -march=armv7-a
+*_CLANGDWARF_ARM_PP_FLAGS   = DEF(GCC_PP_FLAGS) 
DEF(CLANGDWARF_ARM_TARGET) $(PLATFORM_FLAGS)
+*_CLANGDWARF_ARM_RC_FLAGS   = DEF(GCC_ARM_RC_FLAGS)
+*_CLANGDWARF_ARM_VFRPP_FLAGS= DEF(GCC_VFRPP_FLAGS) 
DEF(CLANGDWARF_ARM_TARGET) $(PLATFORM_FLAGS)
+*_CLANGDWARF_ARM_ASLPP_FLAGS= DEF(GCC_ASLPP_FLAGS) 
DEF(CLANGDWARF_ARM_TARGET)
+*_CLANGDWARF_ARM_CC_XIPFLAGS= DEF(GCC_ARM_CC_XIPFLAGS)
+
+  DEBUG_CLANGDWARF_ARM_CC_FLAGS = DEF(CLANGDWARF_ARM_CC_FLAGS) 
$(PLATFORM_FLAGS) -flto -O1
+  DEBUG_CLANGDWARF_ARM_DLINK_FLAGS  = DEF(CLANGDWARF_ARM_DLINK_FLAGS) -flto 
-Wl,-O1 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm 
-Wl,-plugin-opt=-pass-through=-llto-arm
+  NOOPT_CLANGDWARF_ARM_CC_FLAGS = DEF(CLANGDWARF_ARM_CC_FLAGS) 
$(PLATFORM_FLAGS) -O0
+  NOOPT_CLANGDWARF_ARM_DLINK_FLAGS  = DEF(CLANGDWARF_ARM_DLINK_FLAGS)
+RELEASE_CLANGDWARF_ARM_CC_FLAGS = DEF(CLANGDWARF_ARM_CC_FLAGS) 
$(PLATFORM_FLAGS) -flto -O3
+RELEASE_CLANGDWARF_ARM_DLINK_FLAGS  = DEF(CLANGDWARF_ARM_DLINK_FLAGS) -flto 
-Wl,-O3 -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm 
-Wl,-plugin-opt=-pass-through=-llto-arm
+
+##
+# CLANGDWARF AARCH64 definitions
+##
+DEFINE CLANGDWARF_AARCH64_TARGET= -target aarch64-linux-gnu
+DEFINE CLANGDWARF_AARCH64_CC_FLAGS  = DEF(GCC_AARCH64_CC_FLAGS) 
DEF(CLANGDWARF_AARCH64_TARGET) -mcmodel=small DEF(CLANGDWARF_WARNING_OVERRIDES)
+DEFINE CLANGDWARF_AARCH64_DLINK_FLAGS  = DEF(CLANGDWARF_AARCH64_TARGET) 
DEF(GCC_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000
+
+*_CLANGDWARF_AARCH64_PP_FLAGS   = DEF(GCC_PP_FLAGS)
+*_CLANGDWARF_AARCH64_ASLCC_FLAGS= DEF(GCC_ASLCC_FLAGS)
+*_CLANGDWARF_AARCH64_APP_FLAGS  =
+*_CLANGDWARF_AARCH64_ASL_FLAGS  = DEF(IASL_FLAGS)
+*_CLANGDWARF_AARCH64_ASL_OUTFLAGS   = DEF(IASL_OUTFLAGS)
+*_CLANGDWARF_AARCH64_DTCPP_FLAGS= DEF(GCC_DTCPP_FLAGS)
+
+*_CLANGDWARF_AARCH64_CC_PATH= ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_AARCH64_ASM_PATH   = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_AARCH64_PP_PATH= ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_AARCH64_VFRPP_PATH = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_AARCH64_ASLCC_PATH = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_AARCH64_ASLPP_PATH = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_AARCH64_DLINK_PATH = ENV(CLANGDWARF_BIN)clang
+*_CLANGDWARF_AARCH64_ASLDLINK_PATH  = ENV(CLANGDWARF_BIN)clang

[edk2-devel] [PATCH v6 09/16] BaseTools/Conf/tools_def.template: Add section for deprecated toolchains

2023-05-01 Thread Rebecca Cran
In order to make it clear for anyone reading tools_def.template, add
a section for deprecated tool chains and move GCC48, GCC49 and GCC5
into it.

Signed-off-by: Rebecca Cran 
Reviewed-by: Liming Gao 
---
 BaseTools/Conf/tools_def.template | 31 +++-
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index f85120244267..c32c64f5ced6 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -156,19 +156,13 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 #Note:
 # Building of XIP firmware images for ARM/ARM64 is 
not currently supported (only applications).
 # /FILEALIGN:4096 and other changes are needed for 
ARM firmware builds.
-#   GCC48   -Linux,Windows-  Requires:
-# GCC 4.8 targeting x86_64-linux-gnu, 
aarch64-linux-gnu, or arm-linux-gnueabi
-#Optional:
-# Required to build platforms or ACPI tables:
-#   Intel(r) ACPI Compiler from
-#   https://acpica.org/downloads
-#   GCC49   -Linux,Windows-  Requires:
+#   GCCNOLTO-Linux,Windows-  Requires:
 # GCC 4.9 targeting x86_64-linux-gnu, 
aarch64-linux-gnu, or arm-linux-gnueabi
 #Optional:
 # Required to build platforms or ACPI tables:
 #   Intel(r) ACPI Compiler from
 #   https://acpica.org/downloads
-#   GCC5-Linux,Windows-  Requires:
+#   GCC -Linux,Windows-  Requires:
 # GCC 5 with LTO support, targeting 
x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnueabi, riscv64-linux-gnu or 
loongarch64-linux-gnu
 #Optional:
 # Required to build platforms or ACPI tables:
@@ -207,6 +201,27 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 #   Intel(r) ACPI Compiler (iasl.exe) from
 #   https://acpica.org/downloads
 #
+# Deprecated Tool Chains
+# ==
+#   GCC48   -Linux,Windows-  Requires:
+# GCC 4.8 targeting x86_64-linux-gnu, 
aarch64-linux-gnu, or arm-linux-gnueabi
+#Optional:
+# Required to build platforms or ACPI tables:
+#   Intel(r) ACPI Compiler from
+#   https://acpica.org/downloads
+#   GCC49   -Linux,Windows-  Requires:
+# GCC 4.9 targeting x86_64-linux-gnu, 
aarch64-linux-gnu, or arm-linux-gnueabi
+#Optional:
+# Required to build platforms or ACPI tables:
+#   Intel(r) ACPI Compiler from
+#   https://acpica.org/downloads
+#   GCC5-Linux,Windows-  Requires:
+# GCC 5 with LTO support, targeting 
x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnueabi, riscv64-linux-gnu or 
loongarch64-linux-gnu
+#Optional:
+# Required to build platforms or ACPI tables:
+#   Intel(r) ACPI Compiler from
+#   https://acpica.org/downloads
+#
 

 

 #
-- 
2.39.2



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




[edk2-devel] [PATCH v6 07/16] BaseTools: Update VS toolchain descriptions in tools_def.txt.template

2023-05-01 Thread Rebecca Cran
Update the Visual Studio toolchain descriptions in
tools_def.txt.template:

- The WinDDK is no longer needed.
- Update 3 is required for VS 2015.
- VS 2005 has been removed.

Signed-off-by: Rebecca Cran 
Reviewed-by: Liming Gao 
---
 BaseTools/Conf/tools_def.template | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 167829e8260d..d0fa158552df 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -128,8 +128,7 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 # Supported Tool Chains
 # =
 #   VS2015  -win32-  Requires:
-# Microsoft Visual Studio 2015 Professional Edition
-# Microsoft Windows Server 2003 Driver Development 
Kit (Microsoft WINDDK) version 3790.1830
+# Microsoft Visual Studio 2015 Professional 
Edition, Update 3
 #Optional:
 # Required to build platforms or ACPI tables:
 #   Intel(r) ACPI Compiler (iasl.exe) from
@@ -197,13 +196,11 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 #   nasm compiler from
 #   NASM -- http://www.nasm.us/
 #   VS2015x86   -win64-  Requires:
-# Microsoft Visual Studio 2015 (x86) Update 2 or 
above
-# Microsoft Windows Server 2003 Driver Development 
Kit (Microsoft WINDDK) version 3790.1830
+# Microsoft Visual Studio 2015 (x86) Update 3 or 
above
 #Optional:
 # Required to build platforms or ACPI tables:
 #   Intel(r) ACPI Compiler (iasl.exe) from
 #   https://acpica.org/downloads
-# * Commented out - All versions of VS2005 use the same standard install 
directory
 #
 

 

-- 
2.39.2



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




[edk2-devel] [PATCH v6 08/16] Add GCC and GCCNOLTO toolchains to tools_def.txt and update packages

2023-05-01 Thread Rebecca Cran
Add a 'GCC' toolchain that's a copy of the existing GCC5 definition.
Add a 'GCCNOLTO' toolchain that's a copy of the existing GCC49
toolchain.

Update build flags in CryptoPkg, EmulatorPkg, IntelFsp2Pkg and
UnitTestFrameworkPkg to add flags for the new toolchains.

Signed-off-by: Rebecca Cran 
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc |   4 +
 IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc   |   8 +-
 CryptoPkg/Library/OpensslLib/OpensslLib.inf   |   1 +
 CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf  |   1 +
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf |   1 +
 CryptoPkg/Library/OpensslLib/OpensslLibFull.inf   |   1 +
 CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf  |   2 +
 EmulatorPkg/Unix/Host/Host.inf|   2 +
 BaseTools/Conf/tools_def.template | 366 

 9 files changed, 385 insertions(+), 1 deletion(-)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc 
b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index 7866c36e6693..9bdbbf3a222c 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -31,6 +31,10 @@ [BuildOptions]
 !endif
   GCC:*_GCC5_*_CC_FLAGS = --coverage
   GCC:*_GCC5_*_DLINK_FLAGS = --coverage
+  GCC:*_GCCNOLTO_*_CC_FLAGS = --coverage
+  GCC:*_GCCNOLTO_*_DLINK_FLAGS = --coverage
+  GCC:*_GCC_*_CC_FLAGS = --coverage
+  GCC:*_GCC_*_DLINK_FLAGS = --coverage
 [BuildOptions.common.EDKII.HOST_APPLICATION]
   #
   # MSFT
diff --git a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc 
b/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
index 31558121185d..34409f8b80d5 100644
--- a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
+++ b/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
@@ -461,10 +461,16 @@ [Components.IA32]
 
###
 [BuildOptions]
 # Append build options for EDK and EDKII drivers (= is Append, == is Replace)
-  # Enable link-time optimization when building with GCC49
+  # Enable link-time optimization when building with GCC49 or GCCNOLTO
   *_GCC49_IA32_CC_FLAGS = -flto
   *_GCC49_IA32_DLINK_FLAGS = -flto
+  *_GCCNOLTO_IA32_CC_FLAGS = -flto
+  *_GCCNOLTO_IA32_DLINK_FLAGS = -flto
   *_GCC5_IA32_CC_FLAGS = -fno-pic
   *_GCC5_IA32_DLINK_FLAGS = -no-pie
   *_GCC5_IA32_ASLCC_FLAGS = -fno-pic
   *_GCC5_IA32_ASLDLINK_FLAGS = -no-pie
+  *_GCC_IA32_CC_FLAGS = -fno-pic
+  *_GCC_IA32_DLINK_FLAGS = -no-pie
+  *_GCC_IA32_ASLCC_FLAGS = -fno-pic
+  *_GCC_IA32_ASLDLINK_FLAGS = -no-pie
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index 86a00b1c4b2a..0669f3035b85 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -644,6 +644,7 @@ [BuildOptions]
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized 
-Wno-error=incompatible-pointer-types -Wno-error=pointer-sign 
-Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize
   # Revisit after switching to 3.0 branch
   GCC:*_GCC5_*_CC_FLAGS= -Wno-unused-but-set-variable
+  GCC:*_GCC_*_CC_FLAGS = -Wno-unused-but-set-variable
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
index 2e4f95909b51..45fd4799d748 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
@@ -692,6 +692,7 @@ [BuildOptions]
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized 
-Wno-error=incompatible-pointer-types -Wno-error=pointer-sign 
-Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize
   # Revisit after switching to 3.0 branch
   GCC:*_GCC5_*_CC_FLAGS= -Wno-unused-but-set-variable
+  GCC:*_GCC_*_CC_FLAGS = -Wno-unused-but-set-variable
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors:
   # 1295: Deprecated declaration  - give arg types
diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf 
b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
index 637d4769e8ca..44292f589b6c 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -594,6 +594,7 @@ [BuildOptions]
   GCC:*_CLANGPDB_*_CC_FLAGS = -std=c99 -Wno-error=uninitialized 
-Wno-error=incompatible-pointer-types -Wno-error=pointer-sign 
-Wno-error=implicit-function-declaration -Wno-error=ignored-pragma-optimize
   # Revisit after switching to 3.0 branch
   GCC:*_GCC5_*_CC_FLAGS= -Wno-unused-but-set-variable
+  GCC:*_GCC_*_CC_FLAGS = -Wno-unused-but-set-variable
 
   # suppress the following warnings in openssl so we don't break the build 
with warnings-as-errors

[edk2-devel] [PATCH v6 06/16] BaseTools: Remove EBC (EFI Byte Code) compiler definitions

2023-05-01 Thread Rebecca Cran
The edk2-stable202302 release was the last to support building
EFI Byte Code drivers. Since the Intel EFI Byte Code Compiler is no
longer available, a decision has been made to remove support for EBC
from edk2.

Remove the definitions for Intel's EBC compiler from
Conf/tools_def.template.

Signed-off-by: Rebecca Cran 
Reviewed-by: Oliver Smith-Denny 
Reviewed-by: Liming Gao 
---
 BaseTools/Conf/tools_def.template | 98 
 1 file changed, 98 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 79038c3784eb..167829e8260d 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -67,10 +67,6 @@ DEFINE WINSDK10_BIN = 
ENV(WINSDK10_PREFIX)DEF(VS_HOST)
 DEFINE WINDDK_BIN16 = ENV(WINDDK3790_PREFIX)bin16
 DEFINE WINDDK_BINX64= ENV(WINDDK3790_PREFIX)win64\x86\amd64
 
-DEFINE EBC_BIN  = C:\Program Files\Intel\EBC\Bin
-DEFINE EBC_BINx86   = C:\Program Files (x86)\Intel\EBC\Bin
-
-
 DEFINE CYGWIN_BIN  = c:/cygwin/bin
 DEFINE CYGWIN_BINIA32  = 
c:/cygwin/opt/tiano/i386-tiano-pe/i386-tiano-pe/bin/
 DEFINE CYGWIN_BINX64   = 
c:/cygwin/opt/tiano/x86_64-pc-mingw64/x86_64-pc-mingw64/bin/
@@ -135,16 +131,12 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 # Microsoft Visual Studio 2015 Professional Edition
 # Microsoft Windows Server 2003 Driver Development 
Kit (Microsoft WINDDK) version 3790.1830
 #Optional:
-# Required to build EBC drivers:
-#   Intel(r) Compiler for Efi Byte Code (Intel(r) 
EBC Compiler)
 # Required to build platforms or ACPI tables:
 #   Intel(r) ACPI Compiler (iasl.exe) from
 #   https://acpica.org/downloads
 #   VS2017  -win32-  Requires:
 # Microsoft Visual Studio 2017 version 15.2 (15.4 
for ARM64) or later
 #Optional:
-# Required to build EBC drivers:
-#   Intel(r) Compiler for Efi Byte Code (Intel(r) 
EBC Compiler)
 # Required to build platforms or ACPI tables:
 #   Intel(r) ACPI Compiler (iasl.exe) from
 #   https://acpica.org/downloads
@@ -154,8 +146,6 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 #   VS2019  -win32-  Requires:
 # Microsoft Visual Studio 2019 version 16.2 or 
later
 #Optional:
-# Required to build EBC drivers:
-#   Intel(r) Compiler for Efi Byte Code (Intel(r) 
EBC Compiler)
 # Required to build platforms or ACPI tables:
 #   Intel(r) ACPI Compiler (iasl.exe) from
 #   https://acpica.org/downloads
@@ -235,22 +225,6 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 

 

 #
-# Intel EFI Byte Code Compiler (Template)
-#
-
-# *_*_EBC_*_FAMILY   = INTEL
-#
-# *_*_EBC_PP_PATH= C:\Program Files\Intel\EBC\Bin\iec.exe
-# *_*_EBC_CC_PATH= C:\Program Files\Intel\EBC\Bin\iec.exe
-# *_*_EBC_SLINK_PATH = C:\Program Files\Intel\EBC\Bin\link.exe
-#
-# *_*_EBC_SLINK_FLAGS= /lib /NOLOGO /MACHINE:EBC
-# *_*_EBC_PP_FLAGS   = /nologo /E /TC /FIAutoGen.h
-# *_*_EBC_CC_FLAGS   = /nologo /FAcs /c /W3 /WX /FIAutoGen.h
-# *_*_EBC_DLINK_FLAGS= "C:\Program 
Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /MACHINE:EBC /OPT:REF /NODEFAULTLIB 
/ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /ALIGN:32 /DRIVER
-#
-
-#
 # Intel ACPI Source Language Compiler (Template)
 #
 

@@ -365,25 +339,6 @@ NOOPT_VS2015_X64_NASM_FLAGS = -O0 -f win64 -g
 RELEASE_VS2015_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 
/IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D 
/SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) 
/SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER 
/MERGE:.rdata=.data
 NOOPT_VS2015_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF 
/OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 
/LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER 
/SAFESEH:NO /BASE:0 /DRIVE

[edk2-devel] [PATCH v6 05/16] BaseTools: Remove unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS defs

2023-05-01 Thread Rebecca Cran
Remove the unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS definitions
from Conf/tools_def.template.

Signed-off-by: Rebecca Cran 
Reviewed-by: Oliver Smith-Denny 
Reviewed-by: Liming Gao 
---
 BaseTools/Conf/tools_def.template | 4 
 1 file changed, 4 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 3b8aa38a5c0f..79038c3784eb 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -102,10 +102,6 @@ DEFINE MSFT_ASLPP_FLAGS= /nologo /E /C /FIAutoGen.h
 DEFINE MSFT_ASLCC_FLAGS= /nologo /c /FIAutoGen.h /TC 
/Dmain=ReferenceAcpiTable
 DEFINE MSFT_ASLDLINK_FLAGS = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable 
/SUBSYSTEM:CONSOLE
 
-DEFINE IPHONE_TOOLS= 
/Developer/Platforms/iPhoneOS.platform/Developer
-
-DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery 
G++ Lite/bin
-
 DEFINE DTCPP_BIN   = ENV(DTCPP_PREFIX)cpp
 DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 
-- 
2.39.2



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




[edk2-devel] [PATCH v6 04/16] edksetup.bat: Remove VS2008-VS2013 remnants

2023-05-01 Thread Rebecca Cran
Since Visual Studio versions older than VS2015 are no longer supported,
remove mention of them from edksetup.bat.

Signed-off-by: Rebecca Cran 
Reviewed-by: Oliver Smith-Denny 
Reviewed-by: Liming Gao 
Reviewed-by: Leif Lindholm 
---
 edksetup.bat | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/edksetup.bat b/edksetup.bat
index 7ad137bb3e9b..2fdf130e00e2 100755
--- a/edksetup.bat
+++ b/edksetup.bat
@@ -148,19 +148,15 @@ if /I "%1"=="ForceRebuild" shift
 if /I "%1"=="VS2019" shift
 if /I "%1"=="VS2017" shift
 if /I "%1"=="VS2015" shift
-if /I "%1"=="VS2013" shift
-if /I "%1"=="VS2012" shift
 if "%1"=="" goto end
 
 :Usage
   @echo.
-  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] 
[Rebuild] [ForceRebuild] [VS2019] [VS2017] [VS2015] [VS2013] [VS2012]"
+  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] 
[Rebuild] [ForceRebuild] [VS2019] [VS2017] [VS2015]"
   @echo.
   @echo Reconfig   Reinstall target.txt, tools_def.txt and 
build_rule.txt.
   @echo RebuildPerform incremental rebuild of BaseTools 
binaries.
   @echo ForceRebuild   Force a full rebuild of BaseTools binaries.
-  @echo VS2012 Set the env for VS2012 build.
-  @echo VS2013 Set the env for VS2013 build.
   @echo VS2015 Set the env for VS2015 build.
   @echo VS2017 Set the env for VS2017 build.
   @echo VS2019 Set the env for VS2019 build.
-- 
2.39.2



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




[edk2-devel] [PATCH v6 00/16] BaseTools,CryptoPkg,EmulatorPkg,MdePkg,others: Delete CLANG35,CLANG38,VS2008-2013,EBC, deprecate GCC48,GCC49,GCC5, add GCC and GCCNOLTO, update CLANGDWARF

2023-05-01 Thread Rebecca Cran
Update the toolchain definitions:

- Delete the CLANG35 and CLANG38 toolchains, and replace CLANG38 with
  CLANGDWARF, updating it to support ARM and AARCH64 in addition to X64
and IA32.

- Mark GCC48, GCC49 and GCC5 as deprecated.

- Add GCC and GCCNOLTO toolchain definitions.

- Remove VS2008, VS2010, VS2012 and VS2013.

- Remove EBC compiler definitions. Full removal of EBC support from the
  various packages etc. will be done in a follow-up patch series.

- Remove unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS definitions.

- Remove unused CYGWIN_ definitions.

Personal GitHub PR: https://github.com/tianocore/edk2/pull/4240
GitHub branch: https://github.com/bcran/edk2/tree/clangdwarf

Note: CI is now passing.

Changes from v1 to v2
=

- Added a commit to delete GCC48 and GCC49, rename GCC5 to GCC and
  update the flags for other toolchains to work with the new GCC
  definitions.

- Bumped VERSION from 2.00 to 3.00 to inform users that they should
  update their Conf/tools_def.txt.

Changes from v2 to v3
=

- Keep GCC48, GCC49 and GCC5 but mark them deprecated, including with
  warnings at the start and end of running a build.

- Dropped the commit fixing the IA32 build of UefiPayloadPkg, because it
  causes CI to fail due to building both IA32 and X64 at the same time:

  "Module built under multiple ARCHs [IA32, X64]. Not able to determine which 
output to put into flash for Module..."

- Added more information to the VERSION section in tools_def.template.

- Various fixes to the CLANGDWARF flags.

Changes from v3 to v4
=

- Use lld for -a ARM -t CLANGDWARF.

Changes from v4 to v5
=

- Fixed CLANGDWARF on Windows when llvm is installed with the llvm.org
  installer and isn't installed in Visual Studio: use llvm-objcopy and the
  tools prefix.

- Added flags for GCCNOLTO to UnitTestFrameworkPkgHost.dsc.inc

- Added GCC flags to CryptoPkg/Library/OpensslLib/*.inf

Changes from v5 to v6
=

- Reworked CLANGDWARF toolchain definitions. I made mistakes when updating
  them and accidentally changed the IA32 and X64 definitions.

- Dropped the changes to build.py. The edk2-BaseTools repo should be
  updated first, and _then_ the edk2 BaseTools can be changed.

- Split the updates to CryptoPkg build flags into separate commits,
  copying the CLANGPDB flags to CLANGDWARF.

- Fixed non-ASCII character in 5/16 commit message.

- Removed trailing whitespace in tools_def.template.

Rebecca Cran (16):
  BaseTools: Remove VS2008, 2010, 2012 and 2013 toolchain definitions
  BaseTools: Remove VS2008-VS2013 remnants
  MdePkg: Remove VS2008-VS2013 remnants
  edksetup.bat: Remove VS2008-VS2013 remnants
  BaseTools: Remove unused IPHONE_TOOLS and SOURCERY_CYGWIN_TOOLS defs
  BaseTools: Remove EBC (EFI Byte Code) compiler definitions
  BaseTools: Update VS toolchain descriptions in tools_def.txt.template
  Add GCC and GCCNOLTO toolchains to tools_def.txt and update packages
  BaseTools/Conf/tools_def.template: Add section for deprecated
toolchains
  BaseTools: Add ARM and AARCH64 CLANGDWARF support in
tools_def.template
  BaseTools: As with CLANGDWARF IA32 and X64, use lld for ARM and
AARCH64
  BaseTools: Remove CLANG35 toolchain from tools_def.template
  BaseTools: Delete CLANG38 from tools_def.template
  BaseTools/Conf/tools_def.template: Bump VERSION to 3.00
  CryptoPkg: Delete CLANG35 and CLANG38 build flags
  CryptoPkg: Copy CLANGPDB build flags to CLANGDWARF

 UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc   |4 +
 IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc |8 +-
 CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf |3 +-
 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf  |3 +-
 CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf  |3 +-
 CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf  |3 +-
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf  |3 +-
 CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf |3 +-
 CryptoPkg/Library/OpensslLib/OpensslLib.inf |4 +-
 CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf|4 +-
 CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf   |4 +-
 CryptoPkg/Library/OpensslLib/OpensslLibFull.inf |4 +-
 CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf|5 +-
 EmulatorPkg/Unix/Host/Host.inf  |2 +
 MdePkg/Include/Ia32/ProcessorBind.h |8 +-
 MdePkg/Include/X64/ProcessorBind.h  |8 +-
 BaseTools/Conf/tools_def.template   | 1909 
+---
 BaseTools/Scripts/SetVisualStudio.bat   |   22 +-
 BaseTools/Scripts/ShowEnvironment.bat   |   44 -
 BaseTools/get_vsvars.bat|   13 -
 BaseTools/set_vsprefix_envs.bat   

[edk2-devel] [PATCH v6 03/16] MdePkg: Remove VS2008-VS2013 remnants

2023-05-01 Thread Rebecca Cran
Since Visual Studio versions older than VS2015 are no longer supported,
remove mention of them from MdePkg.

Signed-off-by: Rebecca Cran 
Reviewed-by: Oliver Smith-Denny 
Reviewed-by: Liming Gao 
---
 MdePkg/Include/Ia32/ProcessorBind.h | 8 ++--
 MdePkg/Include/X64/ProcessorBind.h  | 8 ++--
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/MdePkg/Include/Ia32/ProcessorBind.h 
b/MdePkg/Include/Ia32/ProcessorBind.h
index ee39d1cfe10b..62ca7f8607d3 100644
--- a/MdePkg/Include/Ia32/ProcessorBind.h
+++ b/MdePkg/Include/Ia32/ProcessorBind.h
@@ -88,19 +88,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
   #if defined (_MSC_VER) && _MSC_VER >= 1800
 
-//
-// Disable these warnings for VS2013.
-//
-
 //
 // This warning is for potentially uninitialized local variable, and it may 
cause false
-// positive issues in VS2013 and VS2015 build
+// positive issues in VS2015 build
 //
 #pragma warning ( disable : 4701 )
 
 //
 // This warning is for potentially uninitialized local pointer variable, and 
it may cause
-// false positive issues in VS2013 and VS2015 build
+// false positive issues in VS2015 build
 //
 #pragma warning ( disable : 4703 )
 
diff --git a/MdePkg/Include/X64/ProcessorBind.h 
b/MdePkg/Include/X64/ProcessorBind.h
index f0a4d00142b9..cdbb4fd6d3d1 100644
--- a/MdePkg/Include/X64/ProcessorBind.h
+++ b/MdePkg/Include/X64/ProcessorBind.h
@@ -102,19 +102,15 @@
 
   #if defined (_MSC_VER) && _MSC_VER >= 1800
 
-//
-// Disable these warnings for VS2013.
-//
-
 //
 // This warning is for potentially uninitialized local variable, and it may 
cause false
-// positive issues in VS2013 and VS2015 build
+// positive issues in VS2015 build
 //
 #pragma warning ( disable : 4701 )
 
 //
 // This warning is for potentially uninitialized local pointer variable, and 
it may cause
-// false positive issues in VS2013 and VS2015 build
+// false positive issues in VS2015 build
 //
 #pragma warning ( disable : 4703 )
 
-- 
2.39.2



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




[edk2-devel] [PATCH v6 02/16] BaseTools: Remove VS2008-VS2013 remnants

2023-05-01 Thread Rebecca Cran
Remove remnants of Visual Studio 2008-2013 support from
Conf/tools_def.txt and various batch scripts.

Signed-off-by: Rebecca Cran 
Reviewed-by: Oliver Smith-Denny 
Reviewed-by: Liming Gao 
---
 BaseTools/Conf/tools_def.template | 12 
 BaseTools/Scripts/SetVisualStudio.bat | 22 +--
 BaseTools/Scripts/ShowEnvironment.bat | 44 --
 BaseTools/get_vsvars.bat  | 13 
 BaseTools/set_vsprefix_envs.bat   | 64 
 BaseTools/toolsetup.bat   | 24 +---
 6 files changed, 2 insertions(+), 177 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 92ea4265143f..3b8aa38a5c0f 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -53,18 +53,6 @@ DEFINE RC_PATH= ENV(WINSDK_PATH_FOR_RC_EXE)\rc.exe
 DEFINE WINSDK_BIN   = ENV(WINSDK_PREFIX)
 DEFINE WINSDKx86_BIN= ENV(WINSDKx86_PREFIX)
 
-# Microsoft Visual Studio 2010
-DEFINE WINSDK7_BIN  = ENV(WINSDK7_PREFIX)
-DEFINE WINSDK7x86_BIN   = ENV(WINSDK7x86_PREFIX)
-
-# Microsoft Visual Studio 2012 Update 1 (required for rc.exe that was not 
included in the initial release)
-DEFINE WINSDK71_BIN = ENV(WINSDK71_PREFIX)
-DEFINE WINSDK71x86_BIN  = ENV(WINSDK71x86_PREFIX)
-
-# Microsoft Visual Studio 2013 Professional Edition
-DEFINE WINSDK8_BIN  = ENV(WINSDK8_PREFIX)x86\
-DEFINE WINSDK8x86_BIN   = ENV(WINSDK8x86_PREFIX)x64
-
 # Microsoft Visual Studio 2015 Professional Edition
 DEFINE WINSDK81_BIN = ENV(WINSDK81_PREFIX)x86\
 DEFINE WINSDK81x86_BIN  = ENV(WINSDK81x86_PREFIX)x64
diff --git a/BaseTools/Scripts/SetVisualStudio.bat 
b/BaseTools/Scripts/SetVisualStudio.bat
index 60d493a4110d..fba9f846effb 100755
--- a/BaseTools/Scripts/SetVisualStudio.bat
+++ b/BaseTools/Scripts/SetVisualStudio.bat
@@ -2,7 +2,7 @@
 @REM Windows batch file to set up the Microsoft Visual Studio environment
 @REM
 @REM This script is used to set up one of the Microsoft Visual Studio
-@REM environments, VS2008x86, VS2010x86, VS2012x86 or VS2013x86 for
+@REM environments, VS2015 for
 @REM building the Nt32Pkg/Nt32Pkg.dsc emulation environment to run on
 @REM an X64 version of Windows.
 @REM The system environment variables in this script are set by the
@@ -23,26 +23,6 @@ echo.
@set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 
14.0\VC\bin\x86_amd64"
@goto SetVs
 )
-
-@if defined VS120COMNTOOLS (
-   @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 
12.0\VC\bin\x86_amd64"
-   @goto SetVs
-)
-
-@if defined VS110COMNTOOLS (
-   @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 
11.0\VC\bin\x86_amd64"
-   @goto SetVs
-)
-
-@if defined VS100COMNTOOLS (
-   @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 
10.0\VC\bin\x86_amd64"
-   @goto SetVs
-)
-
-@if defined VS90COMNTOOLS (
-   @set "COMMONTOOLSx64=C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\bin\x86_amd64"
-   @goto SetVs
-)
 @echo.
 @echo No version of Microsoft Visual Studio was found on this system
 @echo.
diff --git a/BaseTools/Scripts/ShowEnvironment.bat 
b/BaseTools/Scripts/ShowEnvironment.bat
index b91886b6a955..1301d5fcb11b 100755
--- a/BaseTools/Scripts/ShowEnvironment.bat
+++ b/BaseTools/Scripts/ShowEnvironment.bat
@@ -80,50 +80,6 @@ if defined SRC_CONF @goto SetEnv
 @goto End
 
 :CheckVsVer
-@set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 9.0\"
-@if "%VSINSTALLDIR%"=="%TEST_VS%" (
-@echo TOOL_CHAIN_TAG   = VS2008x86
-@goto :EOF
-)
-@set "TEST_VS=C:\Program Files\Microsoft Visual Studio 9.0\"
-@if "%VSINSTALLDIR%"=="%TEST_VS%" (
-@echo TOOL_CHAIN_TAG   = VS2008
-@goto :EOF
-)
-
-@set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\"
-@if "%VSINSTALLDIR%"=="%TEST_VS%" (
-@echo TOOL_CHAIN_TAG   = VS2010x86
-@goto :EOF
-)
-@set "TEST_VS=C:\Program Files\Microsoft Visual Studio 10.0\"
-@if "%VSINSTALLDIR%"=="%TEST_VS%" (
-@echo TOOL_CHAIN_TAG   = VS2010
-@goto :EOF
-)
-
-@set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\"
-@if "%VSINSTALLDIR%"=="%TEST_VS%" (
-@echo TOOL_CHAIN_TAG   = VS2012x86
-@goto :EOF
-)
-@set "TEST_VS=C:\Program Files\Microsoft Visual Studio 11.0\"
-@if "%VSINSTALLDIR%"=="%TEST_VS%" (
-@echo TOOL_CHAIN_TAG   = VS2012
-@goto :EOF
-)
-
-@set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\"
-@if "%VSINSTALLDIR%"=="%TEST_VS%" (
-@echo TOOL_CHAIN_TAG   = VS2013x86
-@goto :EOF
-)
-@set "TEST_VS=C:\Program Files\Microsoft Visual Studio 12.0\"
-@if "%VSINSTALLDIR%"=="%TEST_VS%" (
-@echo TOOL_CHAIN_TAG   = VS2013
-@goto :EOF
-)
-
 @set "TEST_VS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\"
 @if "%VSINSTALLDIR%"=="%TEST_VS%" (
 @echo TOOL_CHAIN_TAG   = VS2015x86
diff --git a/BaseTools/get_vsvars.bat b/BaseTools/get_vsvars.bat
index 3

[edk2-devel] [PATCH v6 01/16] BaseTools: Remove VS2008, 2010, 2012 and 2013 toolchain definitions

2023-05-01 Thread Rebecca Cran
With recent changes, Visual Studio versions older than VS2015 are
unable to build EDK2 code.

To avoid confusion, remove VS2008, 2010, 2012 and 2013 toolchain
definitions from Conf/tools_def.template, leaving only versions that can
be used to successfully build firmware.

Signed-off-by: Rebecca Cran 
Reviewed-by: Oliver Smith-Denny 
Reviewed-by: Liming Gao 
---
 BaseTools/Conf/tools_def.template | 1005 
 1 file changed, 1005 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 9a5c11f6a385..92ea4265143f 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -21,42 +21,6 @@
 IDENTIFIER = Default TOOL_CHAIN_CONF
 
 # common path macros
-DEFINE VS2008_BIN  = ENV(VS2008_PREFIX)Vc\bin
-DEFINE VS2008_DLL  = ENV(VS2008_PREFIX)Common7\IDE;DEF(VS2008_BIN)
-DEFINE VS2008_BINX64   = DEF(VS2008_BIN)\x86_amd64
-DEFINE VS2008_BIN64= DEF(VS2008_BIN)\x86_ia64
-
-DEFINE VS2008x86_BIN= ENV(VS2008_PREFIX)Vc\bin
-DEFINE VS2008x86_DLL= ENV(VS2008_PREFIX)Common7\IDE;DEF(VS2008x86_BIN)
-DEFINE VS2008x86_BINX64 = DEF(VS2008x86_BIN)\x86_amd64
-DEFINE VS2008x86_BIN64  = DEF(VS2008x86_BIN)\x86_ia64
-
-DEFINE VS2010_BIN  = ENV(VS2010_PREFIX)Vc\bin
-DEFINE VS2010_DLL  = ENV(VS2010_PREFIX)Common7\IDE;DEF(VS2010_BIN)
-DEFINE VS2010_BINX64   = DEF(VS2010_BIN)\x86_amd64
-DEFINE VS2010_BIN64= DEF(VS2010_BIN)\x86_ia64
-
-DEFINE VS2010x86_BIN= ENV(VS2010_PREFIX)Vc\bin
-DEFINE VS2010x86_DLL= ENV(VS2010_PREFIX)Common7\IDE;DEF(VS2010x86_BIN)
-DEFINE VS2010x86_BINX64 = DEF(VS2010x86_BIN)\x86_amd64
-DEFINE VS2010x86_BIN64  = DEF(VS2010x86_BIN)\x86_ia64
-
-DEFINE VS2012_BIN  = ENV(VS2012_PREFIX)Vc\bin
-DEFINE VS2012_DLL  = ENV(VS2012_PREFIX)Common7\IDE;DEF(VS2012_BIN)
-DEFINE VS2012_BINX64   = DEF(VS2012_BIN)\x86_amd64
-
-DEFINE VS2012x86_BIN= ENV(VS2012_PREFIX)Vc\bin
-DEFINE VS2012x86_DLL= ENV(VS2012_PREFIX)Common7\IDE;DEF(VS2012x86_BIN)
-DEFINE VS2012x86_BINX64 = DEF(VS2012x86_BIN)\x86_amd64
-
-DEFINE VS2013_BIN  = ENV(VS2013_PREFIX)Vc\bin
-DEFINE VS2013_DLL  = ENV(VS2013_PREFIX)Common7\IDE;DEF(VS2013_BIN)
-DEFINE VS2013_BINX64   = DEF(VS2013_BIN)\x86_amd64
-
-DEFINE VS2013x86_BIN= ENV(VS2013_PREFIX)Vc\bin
-DEFINE VS2013x86_DLL= ENV(VS2013_PREFIX)Common7\IDE;DEF(VS2013x86_BIN)
-DEFINE VS2013x86_BINX64 = DEF(VS2013x86_BIN)\x86_amd64
-
 DEFINE VS2015_BIN  = ENV(VS2015_PREFIX)Vc\bin
 DEFINE VS2015_DLL  = ENV(VS2015_PREFIX)Common7\IDE;DEF(VS2015_BIN)
 DEFINE VS2015_BINX64   = DEF(VS2015_BIN)\x86_amd64
@@ -112,11 +76,6 @@ DEFINE WINSDK10_BIN = 
ENV(WINSDK10_PREFIX)DEF(VS_HOST)
 # are used by other toolchains.  An example is that ICC on Windows normally
 # uses Microsoft's nmake.exe.
 
-# Some MS_VS_BIN options: DEF(VS2008_BIN), DEF(VS2008x86_BIN)
-DEFINE MS_VS_BIN   = DEF(VS2008_BIN)
-# Some MS_VS_DLL options: DEF(VS2008_DLL), DEF(VS2008x86_DLL)
-DEFINE MS_VS_DLL   = DEF(VS2008_DLL)
-
 DEFINE WINDDK_BIN16 = ENV(WINDDK3790_PREFIX)bin16
 DEFINE WINDDK_BINX64= ENV(WINDDK3790_PREFIX)win64\x86\amd64
 
@@ -188,42 +147,6 @@ DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc
 #
 # Supported Tool Chains
 # =
-#   VS2008  -win32-  Requires:
-# Microsoft Visual Studio 2008 Team Suite Edition
-# Microsoft Windows Server 2003 Driver Development 
Kit (Microsoft WINDDK) version 3790.1830
-#Optional:
-# Required to build EBC drivers:
-#   Intel(r) Compiler for Efi Byte Code (Intel(r) 
EBC Compiler)
-# Required to build platforms or ACPI tables:
-#   Intel(r) ACPI Compiler (iasl.exe) from
-#   https://acpica.org/downloads
-#   VS2010  -win32-  Requires:
-# Microsoft Visual Studio 2010 Premium Edition
-# Microsoft Windows Server 2003 Driver Development 
Kit (Microsoft WINDDK) version 3790.1830
-#Optional:
-# Required to build EBC drivers:
-#   Intel(r) Compiler for Efi Byte Code (Intel(r) 
EBC Compiler)
-# Required to build platforms or ACPI tables:
-#   Intel(r) ACPI Compiler (iasl.exe) from
-#   https://acpica.org/downloads
-#   VS2012  -win32-  Requires:
-# Microsoft Visual Studio 2012 Professional Edition
-# Microsoft Windows Server 2003 Driver Development 
Kit (Microsoft WINDDK) version 3790.1830
-#Optional:
-# Required to build EBC drivers:
-#   Intel(r) Compiler for Efi Byte Code (Intel(r) 
EBC Compiler)
-# Required to build platforms or 

Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: CpuDxe: Sync GCD Capabilities With Page Table Attributes

2023-05-01 Thread Ard Biesheuvel
On Wed, 26 Apr 2023 at 02:09, Oliver Smith-Denny
 wrote:
>
> When ArmPkg's CpuDxe driver initializes, it attempts to sync the
> GCD with the page table. However, unlike when the UefiCpuPkg's
> CpuDxe initializes, the Arm version does not update the GCD
> capabilities with EFI_MEMORY_[RO|RP|XP] (this could also set
> the capabilities to be the existing page table attributes for
> this range, but the UefiCpuPkg CpuDxe sets the above attributes
> as they are software constructs, possible to set for any memory
> hardware).
>
> As a result, when the GCD attributes are attempted to be set
> against the old GCD capabilities, attributes that are set in the
> page table can get lost because the new attributes are not in the
> old GCD capabilities (and yet they are already set in the page
> table) meaning that the attempted sync between the GCD and the
> page table was a failure and drivers querying one vs the other
> will see different state. This can lead to RWX memory regions
> even with the no-execute policy set, because core drivers (such
> as NonDiscoverablePciDeviceIo, to be fixed up in a later patchset)
> allocate pages, query the GCD attributes, attempt to set a new
> cache attribute and end up clearing the XP bit in the page table
> because the GCD attributes do not have XP set.
>
> This patch follows the UefiCpuPkg pattern and adds
> EFI_MEMORY_[RO|RP|XP] to the GCD capabilities during CpuDxe
> initialization. This ensures that memory regions which already have
> these attributes set get them set in the GCD attributes, properly
> syncing between the GCD and the page table.
>
> This mitigates the issue seen, however, additional investigations
> into setting the GCD attributes earlier and maintaining a better
> sync between the GCD and the page table are being done.
>
> Feedback on this proposal is greatly appreciated, particularly
> any pitfalls or more architectural solutions to issues seen
> with syncing the GCD and the page table.
>

I think this is conceptually correct. However, I've played with this
in the past, and IIRC, these attributes are inherited by the EFI
memory map too, and not updated when allocations are made. This means
that all code and data regions will be listed as RP, RO and XP in the
EFI memory map, which is going to confuse Linux at the very least, and
potentially other OSes as well.

Generally, the EFI and PI specs are very vague when it comes to
defining whether memory region attributes apply to the memory region
itself ("this memory can be mapped as read-only or non-exec") or its
contents ("these pages can be mapped read-only because the code does
not expect to be able to write to it").

Before we have some clarification and some rigid wording in the spec
as to what these attributes actually mean for non-allocated regions vs
allocated ones, I don't think we can use them like this.
Alternatively, we could update the GCD core so these attributes are
not inherited by the EFI memory map.

Another potential concern is fragmentation: the GCD memory map has
very few entries usually under the current usage model, but keeping
track of all memory permission attributes is going to inflate its size
substantially.

Also, including EFI_MEMORY_RP only makes sense if we implement a way
to apply it, which ArmCpuDxe currently does not provide.


> PR: https://github.com/tianocore/edk2/pull/4311
> Personal branch: 
> https://github.com/os-d/edk2/tree/osde/sync_aarch64_gcd_capabilities_v1
>
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Michael Kubacki 
> Cc: Sean Brogan 
>
> Signed-off-by: Oliver Smith-Denny 
> ---
>  ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c | 55 +---
>  1 file changed, 49 insertions(+), 6 deletions(-)
>
> diff --git a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c 
> b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c
> index 2e73719dce04..3ef0380e084f 100644
> --- a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c
> +++ b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c
> @@ -90,6 +90,7 @@ SetGcdMemorySpaceAttributes (
>UINTN EndIndex;
>EFI_PHYSICAL_ADDRESS  RegionStart;
>UINT64RegionLength;
> +  UINT64Capabilities;
>
>DEBUG ((
>  DEBUG_GCD,
> @@ -146,14 +147,56 @@ SetGcdMemorySpaceAttributes (
>RegionLength = MemorySpaceMap[Index].BaseAddress + 
> MemorySpaceMap[Index].Length - RegionStart;
>  }
>
> +// Always add RO, RP, and XP as all memory is capable of supporting 
> these types (they are software
> +// constructs, not hardware features) and they are critical to 
> maintaining a security boundary
> +Capabilities = MemorySpaceMap[Index].Capabilities | EFI_MEMORY_RO | 
> EFI_MEMORY_RP | EFI_MEMORY_XP;
> +
>  //
> -// Set memory attributes according to MTRR attribute and the original 
> attribute of descriptor
> +// Update GCD capabilities as these may have changed in the page table 
> since the GCD was created
> +// this follows the same pattern as x86 GCD and Page Table syncing
> 

Re: [edk2-devel] [PATCH v3 4/5] UefiCpuPkg/ResetVector: Modify Page Table in ResetVector

2023-05-01 Thread Ard Biesheuvel
On Fri, 28 Apr 2023 at 08:43, Zhiguang Liu  wrote:
>
> In ResetVector, if create page table, its highest address is fixed
> because after page table, code layout is fixed(4K for normal code,
> and another 4K only contains reset vector code).
> Today's implementation organizes the page table as following if 1G
> page table is used:
>   4G-16K: PML4 page (PML4[0] points to 4G-12K)
>   4G-12K: PDP page
>   CR3 is set to 4G-16K
> When 2M page table is used, the layout is as following:
>   4G-32K: PML4 page (PML4[0] points to 4G-28K)
>   4G-28K: PDP page (PDP entries point to PD pages)
>   4G-24K: PD page mapping 0-1G
>   4G-20K: PD page mapping 1-2G
>   4G-16K: PD page mapping 2-3G
>   4G-12K: PD page mapping 3-4G
>   CR3 is set to 4G-32K
> CR3 doesn't point to a fixed location which is a bit hard to debug at
> runtime.
>
> The new page table layout will always put PML4 in highest address
> When 1G page table is used, the layout is as following:
>   4G-16K: PDP page
>   4G-12K: PML4 page (PML4[0] points to 4G-16K)
> When 2M page table is used, the layout is as following:
>   4G-32K: PD page mapping 0-1G
>   4G-28K: PD page mapping 1-2G
>   4G-24K: PD page mapping 2-3G
>   4G-20K: PD page mapping 3-4G
>   4G-16K: PDP page (PDP entries point to PD pages)
>   4G-12K: PML4 page (PML4[0] points to 4G-16K)
> CR3 is always set to 4G-12K
> So, this patch can improve biodegradability

I am pretty sure you meant to type something else here


> by make sure the init
> CR3 pointing to a fixed address(4G-12K).
>
> Cc: Eric Dong 
> Cc: Ray Ni 
> Cc: Rahul Kumar 
> Cc: Gerd Hoffmann 
> Cc: Debkumar De 
> Cc: Catharine West 
> Signed-off-by: Zhiguang Liu 
> ---
>  .../ResetVector/Vtf0/X64/PageTables.asm   | 32 +--
>  1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm 
> b/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm
> index 469fed0006..4ff68cddef 100644
> --- a/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm
> +++ b/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm
> @@ -41,13 +41,6 @@ BITS64
>
>  ALIGN 16
>
> -Pml4:
> -;
> -; PML4 (1 * 512GB entry)
> -;
> -DQ  PG_NLE(Pdp)
> -TIMES   0x1000 - ($ - Pml4) DB 0
> -
>  %ifdef PAGE_TABLE_1G
>  Pdp:
>  ;
> @@ -59,6 +52,16 @@ Pdp:
>  %assign i i+1
>  %endrep
>  %else
> +Pd:
> +;
> +; Page-Directory (2048 * 2MB entries => 4GB)
> +; Four pages below, each is pointed by one entry in Pdp.
> +;
> +%assign i 0
> +%rep0x800
> +DQ  PTE_2MB(i)
> +%assign i i+1
> +%endrep
>  Pdp:
>  ;
>  ; Page-directory pointer table (4 * 1GB entries => 4GB)
> @@ -69,15 +72,12 @@ Pdp:
>  DQ  PG_NLE(Pd + 0x3000)
>  TIMES   0x1000 - ($ - Pdp) DB 0
>
> -Pd:
> +%endif
> +
> +Pml4:
>  ;
> -; Page-Directory (2048 * 2MB entries => 4GB)
> -; Four pages below, each is pointed by one entry in Pdp.
> +; PML4 (1 * 512GB entry)
>  ;
> -%assign i 0
> -%rep0x800
> -DQ  PTE_2MB(i)
> -%assign i i+1
> -%endrep
> -%endif
> +DQ  PG_NLE(Pdp)
> +TIMES   0x1000 - ($ - Pml4) DB 0
>  EndOfPageTables:
> --
> 2.31.1.windows.1
>
>
>
> 
>
>


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