From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web12.9045.1630075606060638988 for ; Fri, 27 Aug 2021 07:46:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U8ekm209; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4523260F4C for ; Fri, 27 Aug 2021 14:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630075605; bh=Aq6Td03vuT2C7WtKpRfJcDsXT06gAEq4Q73SoiNYABA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=U8ekm209IbBZCxiSmLnJXEl0vysSxLFlM6x3MSHB8Ic+ZLvCs/Ere3euZSkFopn7g RmyxYIid7oawUp+WSw2pfTMkhFWz9LzISz5h03Fga3ahqj3XxPK0h0LV2I9VOxvy5Q IzDqEyvrFiI+lrmDcVG+VuL+8iETfLVvE57xthwE6P64NiNAu2Ti3oN10sxhU5YMAu hcbLiC6QjNEVA2f9uGdXu+TpalOk5Ol0jQwICL0Yg7yDEfiV77ksTE/f0os13nDTOp twyUZ6zii5gXzlO8xB0sBoEkJ+Ix1STNtL6jihgyw9Y7V9Y/vCKnMKLfdD2u1W+EJp XlNuMgYmKFiPA== Received: by mail-oi1-f177.google.com with SMTP id bi4so6060133oib.9 for ; Fri, 27 Aug 2021 07:46:45 -0700 (PDT) X-Gm-Message-State: AOAM530F8eJ4iM1qP/gd7p6U5hPZOzFfFQs3X6upD8UnOa20VSETZNWN VEzkTKtPEXaLbIFG+DPPIgx/JKyh2bWmg3HykME= X-Google-Smtp-Source: ABdhPJyBnCfm0K0kV46Bjft8GgHJPses/OF3qe4Em97+vEGuDqUhpU22RBsXoa+lQXl8H7+B9C1kGclnD/9Q1kKMzBE= X-Received: by 2002:aca:eb97:: with SMTP id j145mr6714103oih.33.1630075604647; Fri, 27 Aug 2021 07:46:44 -0700 (PDT) MIME-Version: 1.0 References: <3e91ce2b-15c4-d0d7-4ae8-277d61d0c3c6@newmexicoconsortium.org> In-Reply-To: <3e91ce2b-15c4-d0d7-4ae8-277d61d0c3c6@newmexicoconsortium.org> From: "Ard Biesheuvel" Date: Fri, 27 Aug 2021 16:46:33 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: OVMF: NV Variable Store Layout of Larger Build Targets To: Devon Bautista , Gerd Hoffmann Cc: edk2-devel-groups-io , Ard Biesheuvel , Jiewen Yao , Jordan Justen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable (+ Gerd) On Sat, 21 Aug 2021 at 03:10, Devon Bautista wrote: > > Hello All, > > I am currently working with the Linuxboot developers to improve testing k= ernel + initramfs pairs in firmware using OVMF. > > The current maximum image size of an OVMF image is 4MB, which is insuffic= ient for storing even a minimal and compressed kernel and initramfs. To get= around this, we've been maintaining our own fork of EDK2 that adds 8MiB an= d 16MiB OVMF build targets that have enough room in the DXE volume to store= a reasonably-sized kernel and initramfs. However, it would be convenient i= f upstream EDK2 supported these larger OVMF targets. > > In discussing this with the previous OVMF maintainer Laszlo Ersek here, i= t was brought up that: > > The trend of the ever-growing DXE-phase warrants a larger firmware volume= size > 8MiB and 16MiB image sizes seem to be justified because of this QEMU comm= it > > However, as Laszlo mentioned, introducing a larger volume size is compati= bility breaking, and so seizing the opportunity to come up with a larger no= n-volatile variable store layout is necessary. > > That said, I would like to use this thread to discuss among hardware vend= ors an optimal variable store layout for these larger image sizes. > > Best, > Devon > For reference, here is a summary of which sections increased when the 4Mi= B build target was added (taken from commit b24fca05) after the previous 2M= iB limit: > > Description Compression type Size [KB] > ------------------------- ----------------- ---------------------- > Non-volatile data storage open-coded binary 128 -> 528 ( +400) > data > Variable store 56 -> 256 ( +200) > Event log 4 -> 4 ( +0) > Working block 4 -> 4 ( +0) > Spare area 64 -> 264 ( +200) > > FVMAIN_COMPACT uncompressed 1712 -> 3360 (+1648) > FV FFS file LZMA compressed > PEIFV uncompressed 896 -> 896 ( +0) > individual PEI uncompressed > modules > DXEFV uncompressed 10240 -> 10240 ( +0) > individual DXE uncompressed > modules > > SECFV uncompressed 208 -> 208 ( +0) > SEC driver > reset vector code >