From nobody Thu May 16 10:42:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75666+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75666+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1622051396; cv=none; d=zohomail.com; s=zohoarc; b=YupbWGTsSAiZeKIVs6r+cCi8PlY427L80AokwxNcqbSxCj1qJXd70JdbaofhTSQOAHVhkAI/K4hrFeLYKULYnnOGJdeInLPvYqLHwbZhhelS6NxQiDf+qNoIju1WRr+ufRKc1AHxnQYsV66rNgeMJ/72pSNBlTExnnWDTV9P134= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622051396; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=bePb0uY/1sgiZ9qDn4sPx/USGMz/+7DuQ6jG44Yu/2c=; b=PgA5R46hn87nCTcwjdXk0HZ7Dn1bsfQAV+jt/AxZGZp3zca/hHjosSgwbTD1lLXSURPzZohGixJpyOdNmbWimH911i5eO/Sthff8WEHoaHbsblsljXBqs2l0q4ZHM3xu/DzMEFdevJGX5j9h3xZiTl3377QW6ZlBZHCKs65F1n4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75666+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16220513969141012.0664971692883; Wed, 26 May 2021 10:49:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id N9e8YY1788612xj94HdcG0rp; Wed, 26 May 2021 10:49:55 -0700 X-Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mx.groups.io with SMTP id smtpd.web11.175.1622048911529220638 for ; Wed, 26 May 2021 10:08:32 -0700 X-Received: by mail-pl1-f178.google.com with SMTP id z4so934567plg.8 for ; Wed, 26 May 2021 10:08:31 -0700 (PDT) X-Gm-Message-State: M7jMP2vPwMOg8nCJ97MiRtO5x1787277AA= X-Google-Smtp-Source: ABdhPJx6wC62qrWwRVXfSXAgjGF5bXBaHS8bn5JTL/u3rpuQ2fHEnvAu4rTCM4hMmvjc5M3wNr5swA== X-Received: by 2002:a17:902:d2ce:b029:f4:4a5:9a8b with SMTP id n14-20020a170902d2ceb02900f404a59a8bmr36521446plc.70.1622048910602; Wed, 26 May 2021 10:08:30 -0700 (PDT) X-Received: from localhost.localdomain (c-73-48-255-158.hsd1.ca.comcast.net. [73.48.255.158]) by smtp.googlemail.com with ESMTPSA id z9sm13517110pji.47.2021.05.26.10.08.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 May 2021 10:08:30 -0700 (PDT) From: "Devon Bautista" To: devel@edk2.groups.io Cc: Devon Bautista Subject: [edk2-devel] [PATCH v1] OvmfPkg: Add build options for 8MB and 16MB X64 OVMF images Date: Wed, 26 May 2021 10:08:12 -0700 Message-Id: <7bfd4b82fc725302beb37e13c4a89d389c34ec34.1622048433.git.dbautista@newmexicoconsortium.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,dbautista@newmexicoconsortium.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622051395; bh=TrQuTUnjfODDd1ABHvIJI+zGgltb1RsKXwv5qfbFii8=; h=Cc:Date:From:Reply-To:Subject:To; b=hDW0E5GvlMBLLWU0ytw9cB3YSRD31nY2HdoXZIhD0f2tz23qYXHwJXfOqFiXaDLgZeY jW7LfKVr+wmSWFLRHxnx7c1RB6b58Ob5SN7X8RoAjEqtt9D0fyXKwbcKYSjGCLrKLOEgT qPWeStTMyBng6zS1YlBgPA7jnu9apikA+1Y= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Currently, the largest volume size for building OVMF images is 4MB. With the growth of the Linuxboot project, maintainers have had to maintain a fork containing this patch which allows larger image sizes in order for Linuxboot developers/users to have enough space to experiment with and test including their own Linux kernel in the DXE section of OVMF firmware. Testing using OVMF is valuable since it allows testing in QEMU and thus does not require any hardware to do so. This patch allows specifying '-D FD_SIZE_8MB' or '-D FD_SIZE_16MB' to the OVMF build script in order to add the ability to build 8MB or 16MB x86_64 (X64) OVMF images, respectively. Signed-off-by: Devon Bautista --- OvmfPkg/OvmfPkgDefines.fdf.inc | 34 ++++++++++++++++++++++++++++++++++ OvmfPkg/OvmfPkgX64.dsc | 10 +++++++++- OvmfPkg/VarStore.fdf.inc | 16 ++++++++-------- 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/OvmfPkg/OvmfPkgDefines.fdf.inc b/OvmfPkg/OvmfPkgDefines.fdf.inc index 35fd454b97..da37758934 100644 --- a/OvmfPkg/OvmfPkgDefines.fdf.inc +++ b/OvmfPkg/OvmfPkgDefines.fdf.inc @@ -66,6 +66,40 @@ DEFINE SECFV_OFFSET =3D 0x003CC000 DEFINE SECFV_SIZE =3D 0x34000 !endif =20 +!if $(FD_SIZE_IN_KB) =3D=3D 8192 +DEFINE VARS_SIZE =3D 0x84000 +DEFINE VARS_BLOCKS =3D 0x84 +DEFINE VARS_LIVE_SIZE =3D 0x40000 +DEFINE VARS_SPARE_SIZE =3D 0x42000 + +DEFINE FW_BASE_ADDRESS =3D 0xFF800000 +DEFINE FW_SIZE =3D 0x00800000 +DEFINE FW_BLOCKS =3D 0x800 +DEFINE CODE_BASE_ADDRESS =3D 0xFF884000 +DEFINE CODE_SIZE =3D 0x0077C000 +DEFINE CODE_BLOCKS =3D 0x77C +DEFINE FVMAIN_SIZE =3D 0x00748000 +DEFINE SECFV_OFFSET =3D 0x007CC000 +DEFINE SECFV_SIZE =3D 0x34000 +!endif + +!if $(FD_SIZE_IN_KB) =3D=3D 16384 +DEFINE VARS_SIZE =3D 0x84000 +DEFINE VARS_BLOCKS =3D 0x84 +DEFINE VARS_LIVE_SIZE =3D 0x40000 +DEFINE VARS_SPARE_SIZE =3D 0x42000 + +DEFINE FW_BASE_ADDRESS =3D 0xFF000000 +DEFINE FW_SIZE =3D 0x01000000 +DEFINE FW_BLOCKS =3D 0x1000 +DEFINE CODE_BASE_ADDRESS =3D 0xFF084000 +DEFINE CODE_SIZE =3D 0x00F7C000 +DEFINE CODE_BLOCKS =3D 0xF7C +DEFINE FVMAIN_SIZE =3D 0x00F48000 +DEFINE SECFV_OFFSET =3D 0x00FCC000 +DEFINE SECFV_SIZE =3D 0x34000 +!endif + SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress =3D $(FW_BASE_ADDR= ESS) SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize =3D $(FW_SIZE) SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize =3D $(BLOCK_SIZE) diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 999738dc39..28351e2f56 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -66,11 +66,19 @@ !else !ifdef $(FD_SIZE_4MB) DEFINE FD_SIZE_IN_KB =3D 4096 +!else +!ifdef $(FD_SIZE_8MB) + DEFINE FD_SIZE_IN_KB =3D 8192 +!else +!ifdef $(FD_SIZE_16MB) + DEFINE FD_SIZE_IN_KB =3D 16384 !else DEFINE FD_SIZE_IN_KB =3D 4096 !endif !endif !endif +!endif +!endif =20 [BuildOptions] GCC:RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG @@ -501,7 +509,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000 !endif !endif -!if $(FD_SIZE_IN_KB) =3D=3D 4096 +!if $(FD_SIZE_IN_KB) =3D=3D 4096 || $(FD_SIZE_IN_KB) =3D=3D 8196 || $(FD_S= IZE_IN_KB) =3D=3D 16384 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x8400 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x8400 !if $(NETWORK_TLS_ENABLE) =3D=3D FALSE diff --git a/OvmfPkg/VarStore.fdf.inc b/OvmfPkg/VarStore.fdf.inc index a1e524e393..70db929478 100644 --- a/OvmfPkg/VarStore.fdf.inc +++ b/OvmfPkg/VarStore.fdf.inc @@ -11,7 +11,7 @@ !if ($(FD_SIZE_IN_KB) =3D=3D 1024) || ($(FD_SIZE_IN_KB) =3D=3D 2048) 0x00000000|0x0000e000 !endif -!if $(FD_SIZE_IN_KB) =3D=3D 4096 +!if ($(FD_SIZE_IN_KB) =3D=3D 4096) || ($(FD_SIZE_IN_KB) =3D=3D 8192) || ($= (FD_SIZE_IN_KB) =3D=3D 16384) 0x00000000|0x00040000 !endif #NV_VARIABLE_STORE @@ -29,7 +29,7 @@ DATA =3D { # FvLength: 0x20000 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, !endif -!if $(FD_SIZE_IN_KB) =3D=3D 4096 +!if ($(FD_SIZE_IN_KB) =3D=3D 4096) || ($(FD_SIZE_IN_KB) =3D=3D 8192) || ($= (FD_SIZE_IN_KB) =3D=3D 16384) # FvLength: 0x84000 0x00, 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, !endif @@ -41,7 +41,7 @@ DATA =3D { # CheckSum 0x19, 0xF9, !endif -!if $(FD_SIZE_IN_KB) =3D=3D 4096 +!if ($(FD_SIZE_IN_KB) =3D=3D 4096) || ($(FD_SIZE_IN_KB) =3D=3D 8192) || ($= (FD_SIZE_IN_KB) =3D=3D 16384) # CheckSum 0xAF, 0xB8, !endif @@ -51,7 +51,7 @@ DATA =3D { # Blockmap[0]: 0x20 Blocks * 0x1000 Bytes / Block 0x20, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, !endif -!if $(FD_SIZE_IN_KB) =3D=3D 4096 +!if ($(FD_SIZE_IN_KB) =3D=3D 4096) || ($(FD_SIZE_IN_KB) =3D=3D 8192) || ($= (FD_SIZE_IN_KB) =3D=3D 16384) # Blockmap[0]: 0x84 Blocks * 0x1000 Bytes / Block 0x84, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, !endif @@ -70,7 +70,7 @@ DATA =3D { # This can speed up the Variable Dispatch a bit. 0xB8, 0xDF, 0x00, 0x00, !endif -!if $(FD_SIZE_IN_KB) =3D=3D 4096 +!if ($(FD_SIZE_IN_KB) =3D=3D 4096) || ($(FD_SIZE_IN_KB) =3D=3D 8192) || ($= (FD_SIZE_IN_KB) =3D=3D 16384) # Size: 0x40000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariabl= eSize) - # 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) =3D 0x3ffb8 # This can speed up the Variable Dispatch a bit. @@ -83,7 +83,7 @@ DATA =3D { !if ($(FD_SIZE_IN_KB) =3D=3D 1024) || ($(FD_SIZE_IN_KB) =3D=3D 2048) 0x0000e000|0x00001000 !endif -!if $(FD_SIZE_IN_KB) =3D=3D 4096 +!if ($(FD_SIZE_IN_KB) =3D=3D 4096) || ($(FD_SIZE_IN_KB) =3D=3D 8192) || ($= (FD_SIZE_IN_KB) =3D=3D 16384) 0x00040000|0x00001000 !endif #NV_EVENT_LOG @@ -91,7 +91,7 @@ DATA =3D { !if ($(FD_SIZE_IN_KB) =3D=3D 1024) || ($(FD_SIZE_IN_KB) =3D=3D 2048) 0x0000f000|0x00001000 !endif -!if $(FD_SIZE_IN_KB) =3D=3D 4096 +!if ($(FD_SIZE_IN_KB) =3D=3D 4096) || ($(FD_SIZE_IN_KB) =3D=3D 8192) || ($= (FD_SIZE_IN_KB) =3D=3D 16384) 0x00041000|0x00001000 !endif #NV_FTW_WORKING @@ -109,7 +109,7 @@ DATA =3D { !if ($(FD_SIZE_IN_KB) =3D=3D 1024) || ($(FD_SIZE_IN_KB) =3D=3D 2048) 0x00010000|0x00010000 !endif -!if $(FD_SIZE_IN_KB) =3D=3D 4096 +!if ($(FD_SIZE_IN_KB) =3D=3D 4096) || ($(FD_SIZE_IN_KB) =3D=3D 8192) || ($= (FD_SIZE_IN_KB) =3D=3D 16384) 0x00042000|0x00042000 !endif #NV_FTW_SPARE --=20 2.21.0 -=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 (#75666): https://edk2.groups.io/g/devel/message/75666 Mute This Topic: https://groups.io/mt/83106841/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-