From nobody Sat Apr 27 02:59:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47128+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47128+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1568219050; cv=none; d=zoho.com; s=zohoarc; b=Gu/dzkf5VKcHbM501/7SSCv2cW2xBlAOqTmPyMAXNtUntFWz26ccZ0f4w9LwIc/pdsI6MGUXrctMdeFbbyn2QQtJ/fq8eKeZBlEuqzYRdP9QkADoKjhI5FpwG2b64HrAUk0LKVmN7B8xr8XqwXjq1004EHVE8A6T3ILSSQRuyqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568219050; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=AqIdZDouZ5yOvUshLCTo7f9lPhbgu+aACjRBFWA2ruk=; b=EZuIJFx+41RQbAfIYJSpS/CAwUBJ8WJv6LnrGj/EbLL4/idUjvIeh5cG08DuWq4yujgU7bFKUlS7T8jysWA7Q09v0d/A7epRQVmGynfRSdtmDAaL+pdA2DO3a+bVXE3N17K8kLJjfg583u+rIlih7j8b1IwuF0O76+QW2bIypzM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47128+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1568219050810151.19161408873072; Wed, 11 Sep 2019 09:24:10 -0700 (PDT) Return-Path: X-Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by groups.io with SMTP; Wed, 11 Sep 2019 09:24:09 -0700 X-Received: by mail-wm1-f68.google.com with SMTP id p7so4214222wmp.4 for ; Wed, 11 Sep 2019 09:24:08 -0700 (PDT) X-Gm-Message-State: APjAAAWECr6NXHTMjKO0gyRVaoOdRgHUIzueunHcOr1FvpopHEsMGVOk w19EQuUTz6uNdwPZjXXjcChCy+0nVbfBX9Hh X-Google-Smtp-Source: APXvYqz5QtpVZoWHVkz/+uQQJ5La6VN0kAnSw7BfCDE+9vFMZXEaXOQ/0Ki/xIKsIqDZp1NxbuJrxw== X-Received: by 2002:a1c:1981:: with SMTP id 123mr4538172wmz.88.1568219047310; Wed, 11 Sep 2019 09:24:07 -0700 (PDT) X-Received: from e111045-lin.nice.arm.com ([148.69.85.38]) by smtp.gmail.com with ESMTPSA id b7sm3001590wrj.28.2019.09.11.09.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2019 09:24:06 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, lersek@redhat.com, philmd@redhat.com, Ard Biesheuvel Subject: [edk2-devel] [PATCH v2] ArmVirtPkg: increase FD/FV size for NOOPT builds Date: Wed, 11 Sep 2019 17:23:54 +0100 Message-Id: <20190911162354.22107-1-ard.biesheuvel@linaro.org> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1568219049; bh=wVw7pKLOkWe5J+ceZM7TqXSv0OXXS/s72jMb82mbxII=; h=Cc:Date:From:Reply-To:Subject:To; b=lmqBvu6MNBOH/pOBtWrFoX4Nu1Yq/gSQv7uWDBYelnM5gNkU8laFWp+ZGqYiVAYjfqO UKvGVALxTcRmO6EqzrHCKmxHAO3GDgK0jy/HoDTCLtTkw4NEforrWdzxs7r1k+A7xlhI4 m8SLq/TFVnpOAdCdjAfua4pFSMcDp6SDjs8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" After upgrading the CI system we use for building the ArmVirtPkg targets, we started seeing failures due to the NOOPT build running out of space when using the CLANG38 toolchain definition combined with clang 7. We really don't want to increase the FD/FV sizes in general to accommodate this, so parameterize the relevant quantities and increase them by 50% for NOOPT builds. Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- v2: implement suggestions by Laszlo on 1) how to parameterize this further, and b) to avoid adding another .inc file update kernel header field, as pointed out by Philippe ArmVirtPkg/ArmVirt.dsc.inc | 28 ++++++++++++++++++++ ArmVirtPkg/ArmVirtQemu.fdf | 14 +++++++--- ArmVirtPkg/ArmVirtQemuKernel.fdf | 19 ++++++++++--- ArmVirtPkg/ArmVirtXen.fdf | 14 +++++++--- 4 files changed, 66 insertions(+), 9 deletions(-) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index a4ae25d982a2..d6b58e5c018b 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -10,6 +10,34 @@ [Defines] DEFINE DEBUG_PRINT_ERROR_LEVEL =3D 0x8000004F =20 + # + # Flash size selection. Setting FD_SIZE_IN_KB on the command line direct= ly to + # one of the supported values, in place of any of the convenience macros= , is + # permitted. + # +!if $(TARGET) =3D=3D NOOPT + DEFINE FD_SIZE_3MB =3D TRUE +!endif + +!ifdef $(FD_SIZE_2MB) + DEFINE FD_SIZE_IN_KB =3D 2048 +!else +!ifdef $(FD_SIZE_3MB) + DEFINE FD_SIZE_IN_KB =3D 3072 +!else + DEFINE FD_SIZE_IN_KB =3D 2048 +!endif +!endif + +!if $(FD_SIZE_IN_KB) =3D=3D 2048 + DEFINE FD_SIZE =3D 0x200000 + DEFINE FD_NUM_BLOCKS =3D 0x200 +!endif +!if $(FD_SIZE_IN_KB) =3D=3D 3072 + DEFINE FD_SIZE =3D 0x300000 + DEFINE FD_NUM_BLOCKS =3D 0x300 +!endif + [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,B= uildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICA= TION] GCC:*_*_*_DLINK_FLAGS =3D -z common-page-size=3D0x1000 =20 diff --git a/ArmVirtPkg/ArmVirtQemu.fdf b/ArmVirtPkg/ArmVirtQemu.fdf index c2169cb7964b..d3950c8be05e 100644 --- a/ArmVirtPkg/ArmVirtQemu.fdf +++ b/ArmVirtPkg/ArmVirtQemu.fdf @@ -20,14 +20,22 @@ # ##########################################################################= ###### =20 +[Defines] +!if $(FD_SIZE_IN_KB) =3D=3D 2048 + DEFINE FVMAIN_COMPACT_SIZE =3D 0x1ff000 +!endif +!if $(FD_SIZE_IN_KB) =3D=3D 3072 + DEFINE FVMAIN_COMPACT_SIZE =3D 0x2ff000 +!endif + [FD.QEMU_EFI] BaseAddress =3D 0x00000000|gArmTokenSpaceGuid.PcdFdBaseAddress # QEMU a= ssigns 0 - 0x8000000 for a BootROM -Size =3D 0x00200000|gArmTokenSpaceGuid.PcdFdSize # The si= ze in bytes of the FLASH Device +Size =3D $(FD_SIZE)|gArmTokenSpaceGuid.PcdFdSize # The si= ze in bytes of the FLASH Device ErasePolarity =3D 1 =20 # This one is tricky, it must be: BlockSize * NumBlocks =3D Size BlockSize =3D 0x00001000 -NumBlocks =3D 0x200 +NumBlocks =3D $(FD_NUM_BLOCKS) =20 ##########################################################################= ###### # @@ -59,7 +67,7 @@ DATA =3D { !endif } =20 -0x00001000|0x001ff000 +0x00001000|$(FVMAIN_COMPACT_SIZE) gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize FV =3D FVMAIN_COMPACT =20 diff --git a/ArmVirtPkg/ArmVirtQemuKernel.fdf b/ArmVirtPkg/ArmVirtQemuKerne= l.fdf index f675b6d65ee1..46ec967e1cc0 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.fdf +++ b/ArmVirtPkg/ArmVirtQemuKernel.fdf @@ -20,14 +20,22 @@ # ##########################################################################= ###### =20 +[Defines] +!if $(FD_SIZE_IN_KB) =3D=3D 2048 + DEFINE FVMAIN_COMPACT_SIZE =3D 0x1f8000 +!endif +!if $(FD_SIZE_IN_KB) =3D=3D 3072 + DEFINE FVMAIN_COMPACT_SIZE =3D 0x2f8000 +!endif + [FD.QEMU_EFI] BaseAddress =3D 0x00000000|gArmTokenSpaceGuid.PcdFdBaseAddress # QEMU a= ssigns 0 - 0x8000000 for a BootROM -Size =3D 0x00200000|gArmTokenSpaceGuid.PcdFdSize # The si= ze in bytes of the FLASH Device +Size =3D $(FD_SIZE)|gArmTokenSpaceGuid.PcdFdSize # The si= ze in bytes of the FLASH Device ErasePolarity =3D 1 =20 # This one is tricky, it must be: BlockSize * NumBlocks =3D Size BlockSize =3D 0x00001000 -NumBlocks =3D 0x200 +NumBlocks =3D $(FD_NUM_BLOCKS) =20 ##########################################################################= ###### # @@ -56,7 +64,12 @@ DATA =3D { 0x01, 0x00, 0x00, 0x10, # code0: adr x1, . 0xff, 0x1f, 0x00, 0x14, # code1: b 0x8000 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB +!if $(FD_SIZE_IN_KB) =3D=3D 2048 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 2 MB +!endif +!if $(FD_SIZE_IN_KB) =3D=3D 3072 + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 3 MB +!endif 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # flags 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res2 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res3 @@ -81,7 +94,7 @@ DATA =3D { !endif } =20 -0x00008000|0x001f8000 +0x00008000|$(FVMAIN_COMPACT_SIZE) gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize FV =3D FVMAIN_COMPACT =20 diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf index 79f681cde028..2bbb64abde6b 100644 --- a/ArmVirtPkg/ArmVirtXen.fdf +++ b/ArmVirtPkg/ArmVirtXen.fdf @@ -20,14 +20,22 @@ # ##########################################################################= ###### =20 +[Defines] +!if $(FD_SIZE_IN_KB) =3D=3D 2048 + DEFINE FVMAIN_COMPACT_SIZE =3D 0x1fe000 +!endif +!if $(FD_SIZE_IN_KB) =3D=3D 3072 + DEFINE FVMAIN_COMPACT_SIZE =3D 0x2fe000 +!endif + [FD.XEN_EFI] BaseAddress =3D 0x00000000|gArmTokenSpaceGuid.PcdFdBaseAddress -Size =3D 0x00200000|gArmTokenSpaceGuid.PcdFdSize +Size =3D $(FD_SIZE)|gArmTokenSpaceGuid.PcdFdSize ErasePolarity =3D 1 =20 # This one is tricky, it must be: BlockSize * NumBlocks =3D Size BlockSize =3D 0x00001000 -NumBlocks =3D 0x200 +NumBlocks =3D $(FD_NUM_BLOCKS) =20 ##########################################################################= ###### # @@ -81,7 +89,7 @@ DATA =3D { !endif } =20 -0x00002000|0x001fe000 +0x00002000|$(FVMAIN_COMPACT_SIZE) gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize FV =3D FVMAIN_COMPACT =20 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47128): https://edk2.groups.io/g/devel/message/47128 Mute This Topic: https://groups.io/mt/34105412/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-