public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build
@ 2023-06-20 11:11 Li, Yi
  2023-06-20 14:35 ` [edk2-devel] " Gerd Hoffmann
  2023-06-21  0:40 ` Pedro Falcato
  0 siblings, 2 replies; 8+ messages in thread
From: Li, Yi @ 2023-06-20 11:11 UTC (permalink / raw)
  To: devel; +Cc: Yi Li, Ard Biesheuvel, Jiewen Yao, Jordan Justen, Gerd Hoffmann

The effect of LTO is limited with optimization turned off, and blocked
the upgrade of Openssl3.0. We already skipped this build with VS2019,
skip the GCC NOOPT build also.

Signed-off-by: Yi Li <yi1.li@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
 .../PlatformCI/.azurepipelines/Ubuntu-GCC5.yml  | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml b/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
index ad43f9fad2..5809152d26 100644
--- a/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
+++ b/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
@@ -109,13 +109,16 @@ jobs:
             Build.Target: "RELEASE"
             Run.Flags: $(run_flags)
             Run: $(should_run)
-          OVMF_IA32X64_FULL_NOOPT:
-            Build.File: "$(package)/PlatformCI/PlatformBuild.py"
-            Build.Arch: "IA32,X64"
-            Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
-            Build.Target: "NOOPT"
-            Run.Flags: $(run_flags)
-            Run: $(should_run)
+          # This currently creates a very large image which is too big for the FDF declared range,
+          # skip this build for now.
+          #
+          # OVMF_IA32X64_FULL_NOOPT:
+          #   Build.File: "$(package)/PlatformCI/PlatformBuild.py"
+          #   Build.Arch: "IA32,X64"
+          #   Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
+          #   Build.Target: "NOOPT"
+          #   Run.Flags: $(run_flags)
+          #   Run: $(should_run)
 
           AMDSEV_X64_DEBUG:
             Build.File: "$(package)/PlatformCI/AmdSevBuild.py"
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build
  2023-06-20 11:11 [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build Li, Yi
@ 2023-06-20 14:35 ` Gerd Hoffmann
  2023-06-21  4:16   ` Yao, Jiewen
  2023-06-21  0:40 ` Pedro Falcato
  1 sibling, 1 reply; 8+ messages in thread
From: Gerd Hoffmann @ 2023-06-20 14:35 UTC (permalink / raw)
  To: devel, yi1.li; +Cc: Ard Biesheuvel, Jiewen Yao, Jordan Justen

On Tue, Jun 20, 2023 at 07:11:39PM +0800, Li, Yi wrote:
> The effect of LTO is limited with optimization turned off, and blocked
> the upgrade of Openssl3.0. We already skipped this build with VS2019,
> skip the GCC NOOPT build also.
> 
> Signed-off-by: Yi Li <yi1.li@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>

Acked-by: Gerd Hoffmann <kraxel@redhat.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build
  2023-06-20 11:11 [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build Li, Yi
  2023-06-20 14:35 ` [edk2-devel] " Gerd Hoffmann
@ 2023-06-21  0:40 ` Pedro Falcato
  2023-06-21  4:03   ` Li, Yi
  2023-06-21  7:55   ` Gerd Hoffmann
  1 sibling, 2 replies; 8+ messages in thread
From: Pedro Falcato @ 2023-06-21  0:40 UTC (permalink / raw)
  To: edk2-devel-groups-io, yi1.li
  Cc: Ard Biesheuvel, Jiewen Yao, Jordan Justen, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 2472 bytes --]

On Tue, 20 Jun 2023, 12:11 Li, Yi, <yi1.li@intel.com> wrote:

> The effect of LTO is limited with optimization turned off, and blocked
> the upgrade of Openssl3.0. We already skipped this build with VS2019,
> skip the GCC NOOPT build also.
>
Hi,

If LTO is the problem here, have you given ffunction-sections +
fdata-sections + gc-sections a spin?

It may end up working, though I genuinely don't remember if the GCC
toolchain has that on regardless (and wont be able to check foe the next
few days)...


> Signed-off-by: Yi Li <yi1.li@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  .../PlatformCI/.azurepipelines/Ubuntu-GCC5.yml  | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
> b/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
> index ad43f9fad2..5809152d26 100644
> --- a/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
> +++ b/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
> @@ -109,13 +109,16 @@ jobs:
>              Build.Target: "RELEASE"
>              Run.Flags: $(run_flags)
>              Run: $(should_run)
> -          OVMF_IA32X64_FULL_NOOPT:
> -            Build.File: "$(package)/PlatformCI/PlatformBuild.py"
> -            Build.Arch: "IA32,X64"
> -            Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1
> BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1
> BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
> -            Build.Target: "NOOPT"
> -            Run.Flags: $(run_flags)
> -            Run: $(should_run)
> +          # This currently creates a very large image which is too big
> for the FDF declared range,
> +          # skip this build for now.
> +          #
> +          # OVMF_IA32X64_FULL_NOOPT:
> +          #   Build.File: "$(package)/PlatformCI/PlatformBuild.py"
> +          #   Build.Arch: "IA32,X64"
> +          #   Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1
> BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1
> BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
> +          #   Build.Target: "NOOPT"
> +          #   Run.Flags: $(run_flags)
> +          #   Run: $(should_run)
>
>            AMDSEV_X64_DEBUG:
>              Build.File: "$(package)/PlatformCI/AmdSevBuild.py"
> --
> 2.31.1.windows.1
>
>
>
> 
>
>
>

[-- Attachment #2: Type: text/html, Size: 3840 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build
  2023-06-21  0:40 ` Pedro Falcato
@ 2023-06-21  4:03   ` Li, Yi
  2023-06-21  7:55   ` Gerd Hoffmann
  1 sibling, 0 replies; 8+ messages in thread
From: Li, Yi @ 2023-06-21  4:03 UTC (permalink / raw)
  To: devel@edk2.groups.io, pedro.falcato@gmail.com
  Cc: Ard Biesheuvel, Yao, Jiewen, Justen, Jordan L, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 3522 bytes --]

Hello, I didn’t mean LTO doesn't work.

For the NOOPT build target, we did not enable LTO or any optimization flag:
DEBUG_GCC5_IA32_DLINK_FLAGS    = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386
NOOPT_GCC5_IA32_DLINK_FLAGS    = DEF(GCC5_IA32_X64_DLINK_FLAGS) -Wl,-m,elf_i386,--oformat=elf32-i386 -O0

Adding more flags to NOOPT may affect other builds and unittest debug. So I tend to skip this build target.

Regards,
Yi

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Pedro Falcato
Sent: Wednesday, June 21, 2023 8:40 AM
To: edk2-devel-groups-io <devel@edk2.groups.io>; Li, Yi1 <yi1.li@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Yao, Jiewen <jiewen.yao@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>; Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [edk2-devel] [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build

On Tue, 20 Jun 2023, 12:11 Li, Yi, <yi1.li@intel.com<mailto:yi1.li@intel.com>> wrote:
The effect of LTO is limited with optimization turned off, and blocked
the upgrade of Openssl3.0. We already skipped this build with VS2019,
skip the GCC NOOPT build also.
Hi,

If LTO is the problem here, have you given ffunction-sections + fdata-sections + gc-sections a spin?

It may end up working, though I genuinely don't remember if the GCC toolchain has that on regardless (and wont be able to check foe the next few days)...


Signed-off-by: Yi Li <yi1.li@intel.com<mailto:yi1.li@intel.com>>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org<mailto:ardb%2Btianocore@kernel.org>>
Cc: Jiewen Yao <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>
Cc: Jordan Justen <jordan.l.justen@intel.com<mailto:jordan.l.justen@intel.com>>
Cc: Gerd Hoffmann <kraxel@redhat.com<mailto:kraxel@redhat.com>>
---
 .../PlatformCI/.azurepipelines/Ubuntu-GCC5.yml  | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml b/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
index ad43f9fad2..5809152d26 100644
--- a/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
+++ b/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
@@ -109,13 +109,16 @@ jobs:
             Build.Target: "RELEASE"
             Run.Flags: $(run_flags)
             Run: $(should_run)
-          OVMF_IA32X64_FULL_NOOPT:
-            Build.File: "$(package)/PlatformCI/PlatformBuild.py"
-            Build.Arch: "IA32,X64"
-            Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
-            Build.Target: "NOOPT"
-            Run.Flags: $(run_flags)
-            Run: $(should_run)
+          # This currently creates a very large image which is too big for the FDF declared range,
+          # skip this build for now.
+          #
+          # OVMF_IA32X64_FULL_NOOPT:
+          #   Build.File: "$(package)/PlatformCI/PlatformBuild.py"
+          #   Build.Arch: "IA32,X64"
+          #   Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
+          #   Build.Target: "NOOPT"
+          #   Run.Flags: $(run_flags)
+          #   Run: $(should_run)

           AMDSEV_X64_DEBUG:
             Build.File: "$(package)/PlatformCI/AmdSevBuild.py"
--
2.31.1.windows.1







[-- Attachment #2: Type: text/html, Size: 8238 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build
  2023-06-20 14:35 ` [edk2-devel] " Gerd Hoffmann
@ 2023-06-21  4:16   ` Yao, Jiewen
  0 siblings, 0 replies; 8+ messages in thread
From: Yao, Jiewen @ 2023-06-21  4:16 UTC (permalink / raw)
  To: Gerd Hoffmann, devel@edk2.groups.io, Li, Yi1
  Cc: Ard Biesheuvel, Justen, Jordan L

[-- Attachment #1: Type: text/plain, Size: 979 bytes --]

Reviewed-by: Jiewen.yao@intel.com

________________________________
发件人: Gerd Hoffmann <kraxel@redhat.com>
发送时间: 星期二, 六月 20, 2023 10:41 下午
收件人: devel@edk2.groups.io <devel@edk2.groups.io>; Li, Yi1 <yi1.li@intel.com>
抄送: Ard Biesheuvel <ardb+tianocore@kernel.org>; Yao, Jiewen <jiewen.yao@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>
主题: Re: [edk2-devel] [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build

On Tue, Jun 20, 2023 at 07:11:39PM +0800, Li, Yi wrote:
> The effect of LTO is limited with optimization turned off, and blocked
> the upgrade of Openssl3.0. We already skipped this build with VS2019,
> skip the GCC NOOPT build also.
>
> Signed-off-by: Yi Li <yi1.li@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>

Acked-by: Gerd Hoffmann <kraxel@redhat.com>


[-- Attachment #2: Type: text/html, Size: 1893 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build
  2023-06-21  0:40 ` Pedro Falcato
  2023-06-21  4:03   ` Li, Yi
@ 2023-06-21  7:55   ` Gerd Hoffmann
  2023-06-21 14:13     ` Pedro Falcato
  1 sibling, 1 reply; 8+ messages in thread
From: Gerd Hoffmann @ 2023-06-21  7:55 UTC (permalink / raw)
  To: Pedro Falcato
  Cc: edk2-devel-groups-io, yi1.li, Ard Biesheuvel, Jiewen Yao,
	Jordan Justen

On Wed, Jun 21, 2023 at 01:40:06AM +0100, Pedro Falcato wrote:
> On Tue, 20 Jun 2023, 12:11 Li, Yi, <yi1.li@intel.com> wrote:
> 
> > The effect of LTO is limited with optimization turned off, and blocked
> > the upgrade of Openssl3.0. We already skipped this build with VS2019,
> > skip the GCC NOOPT build also.
> >
> Hi,
> 
> If LTO is the problem here, have you given ffunction-sections +
> fdata-sections + gc-sections a spin?

lto alone works and reduces size a bit, also turning on optimizations
has a much bigger effect though.  Which I suspect happens because gcc
detects constant expressions then, calculates them at compile time
instead of runtime, which in turn removes function calls in code paths
never taken.

take care,
  Gerd


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build
  2023-06-21  7:55   ` Gerd Hoffmann
@ 2023-06-21 14:13     ` Pedro Falcato
  2023-06-27 10:14       ` Ard Biesheuvel
  0 siblings, 1 reply; 8+ messages in thread
From: Pedro Falcato @ 2023-06-21 14:13 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: edk2-devel-groups-io, yi1.li, Ard Biesheuvel, Jiewen Yao,
	Jordan Justen

On Wed, Jun 21, 2023 at 8:55 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Wed, Jun 21, 2023 at 01:40:06AM +0100, Pedro Falcato wrote:
> > On Tue, 20 Jun 2023, 12:11 Li, Yi, <yi1.li@intel.com> wrote:
> >
> > > The effect of LTO is limited with optimization turned off, and blocked
> > > the upgrade of Openssl3.0. We already skipped this build with VS2019,
> > > skip the GCC NOOPT build also.
> > >
> > Hi,
> >
> > If LTO is the problem here, have you given ffunction-sections +
> > fdata-sections + gc-sections a spin?
>
> lto alone works and reduces size a bit, also turning on optimizations
> has a much bigger effect though.  Which I suspect happens because gcc
> detects constant expressions then, calculates them at compile time
> instead of runtime, which in turn removes function calls in code paths
> never taken.

Right, LTO is of course a lot less limited when it comes to this and
may give out further size reductions. But if we can't enable LTO (as
in NOOPT), gc-sections /may/ help here; gc-sections will *not* affect
debugging whatsoever.
Of course, whether this works is pure speculation; I personally
haven't tested this.

-- 
Pedro

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [edk2-devel] [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build
  2023-06-21 14:13     ` Pedro Falcato
@ 2023-06-27 10:14       ` Ard Biesheuvel
  0 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2023-06-27 10:14 UTC (permalink / raw)
  To: Pedro Falcato
  Cc: Gerd Hoffmann, edk2-devel-groups-io, yi1.li, Ard Biesheuvel,
	Jiewen Yao, Jordan Justen

On Wed, 21 Jun 2023 at 16:13, Pedro Falcato <pedro.falcato@gmail.com> wrote:
>
> On Wed, Jun 21, 2023 at 8:55 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> > On Wed, Jun 21, 2023 at 01:40:06AM +0100, Pedro Falcato wrote:
> > > On Tue, 20 Jun 2023, 12:11 Li, Yi, <yi1.li@intel.com> wrote:
> > >
> > > > The effect of LTO is limited with optimization turned off, and blocked
> > > > the upgrade of Openssl3.0. We already skipped this build with VS2019,
> > > > skip the GCC NOOPT build also.
> > > >
> > > Hi,
> > >
> > > If LTO is the problem here, have you given ffunction-sections +
> > > fdata-sections + gc-sections a spin?
> >
> > lto alone works and reduces size a bit, also turning on optimizations
> > has a much bigger effect though.  Which I suspect happens because gcc
> > detects constant expressions then, calculates them at compile time
> > instead of runtime, which in turn removes function calls in code paths
> > never taken.
>
> Right, LTO is of course a lot less limited when it comes to this and
> may give out further size reductions. But if we can't enable LTO (as
> in NOOPT), gc-sections /may/ help here; gc-sections will *not* affect
> debugging whatsoever.
> Of course, whether this works is pure speculation; I personally
> haven't tested this.
>

I don't mind this change, but could we also bump the FV size for NOOPT
builds only? Or does that create problems elsewhere?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-27 10:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-20 11:11 [PATCH] OvmfPkg/PlatformCI: Skip GCC5_OVMF_IA32X64_FULL_NOOPT build Li, Yi
2023-06-20 14:35 ` [edk2-devel] " Gerd Hoffmann
2023-06-21  4:16   ` Yao, Jiewen
2023-06-21  0:40 ` Pedro Falcato
2023-06-21  4:03   ` Li, Yi
2023-06-21  7:55   ` Gerd Hoffmann
2023-06-21 14:13     ` Pedro Falcato
2023-06-27 10:14       ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox