public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	edk2-devel-01 <edk2-devel@lists.01.org>
Subject: Re: [PATCH v2 3/8] OvmfPkg: conditionally disable reserved memory varstore emulation at build
Date: Fri, 1 Dec 2017 12:41:47 +0100	[thread overview]
Message-ID: <d584b5b7-be8c-21b2-fc18-be30c155f304@redhat.com> (raw)
In-Reply-To: <CAKv+Gu-YXXycOwDKP51HA10h1_Eyt26NE-ROU1MXF0V6azhrTQ@mail.gmail.com>

On 12/01/17 11:53, Ard Biesheuvel wrote:
> On 1 December 2017 at 10:52, Laszlo Ersek <lersek@redhat.com> wrote:
>> On 12/01/17 09:51, Ard Biesheuvel wrote:
>>> On 30 November 2017 at 16:30, Laszlo Ersek <lersek@redhat.com> wrote:
>>>> (All of the below is only relevant for SMM_REQUIRE=FALSE.)
>>>>
>>>> For the emulated variable store, PlatformPei allocates reserved memory (as
>>>> early as possible, so that the address remains the same during reboot),
>>>> and PcdEmuVariableNvStoreReserved carries the address to
>>>> EmuVariableFvbRuntimeDxe.
>>>>
>>>> In addition, QemuFlashFvbServicesRuntimeDxe is always launched before
>>>> EmuVariableFvbRuntimeDxe, so that if flash variables are available,
>>>> QemuFlashFvbServicesRuntimeDxe can set PcdFlashNvStorageVariableBase64
>>>> first, and EmuVariableFvbRuntimeDxe can exit early. This ordering is
>>>> currently enforced by adding QemuFlashFvbServicesRuntimeDxe to the APRIORI
>>>> DXE file.
>>>>
>>>> All of this is unnecessary when MEM_VARSTORE_EMU_ENABLE is set to FALSE.
>>>> In such a build,
>>>>
>>>> - (almost) remove the dynamic default for PcdEmuVariableNvStoreReserved
>>>>   (we can't really do this because the PcdSet64() in
>>>>   ReserveEmuVariableNvStore() wouldn't compile),
>>>>
>>>
>>> If that is the only concern, and the value is irrelevant, you could
>>> make it a patchable PCD instead
>>
>> This sounds interesting; I've never used patchable PCDs. Can you please
>> elaborate?
>>
>> Do you mean that for (SMM_REQUIRE==TRUE ||
>> MEM_VARSTORE_EMU_ENABLE==FALSE), the DSC file should list
>> PcdEmuVariableNvStoreReserved somewhere else?
>>
> 
> Yes.
> 
>> Does PcdSet work on patchable PCDs?
>>
> 
> Yes. It's a bit icky because the value does not actually propagate to
> other modules, but that doesn't matter in this case.

Hm, this sounds like a recipe. We have two sets of affected PCDs:

- PcdEmuVariableNvStoreReserved --> in the "flash required" builds, make
it patchable, don't bother setting a good value at build time, and the
PcdSet calls will compile (but won't ever be reached due to code logic)

- PcdFlashNvStorageVariableBase64, PcdFlashNvStorageFtwWorkingBase,
PcdFlashNvStorageFtwSpareBase: in the "flash required" builds, make them
patchable, *try* to set the right default values at build time, with SET
commands, and the PcdSet calls will compile (but won't ever be reached
due to code logic)

That could let us drop FlashNvStorageAddressLib. (On patch #6, only the
commit message would change.)

Thanks,
Laszlo


  reply	other threads:[~2017-12-01 11:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30 16:30 [PATCH v2 0/8] OvmfPkg: add the Variable PEIM, defragment the UEFI memmap Laszlo Ersek
2017-11-30 16:30 ` [PATCH v2 1/8] OvmfPkg: introduce PcdMemVarstoreEmuEnable feature flag Laszlo Ersek
2017-12-01  8:44   ` Ard Biesheuvel
2017-11-30 16:30 ` [PATCH v2 2/8] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: check PcdMemVarstoreEmuEnable Laszlo Ersek
2017-12-01  8:44   ` Ard Biesheuvel
2017-11-30 16:30 ` [PATCH v2 3/8] OvmfPkg: conditionally disable reserved memory varstore emulation at build Laszlo Ersek
2017-12-01  8:51   ` Ard Biesheuvel
2017-12-01 10:52     ` Laszlo Ersek
2017-12-01 10:53       ` Ard Biesheuvel
2017-12-01 11:41         ` Laszlo Ersek [this message]
2017-12-02  8:53           ` Ard Biesheuvel
2017-11-30 16:30 ` [PATCH v2 4/8] OvmfPkg: introduce FlashNvStorageAddressLib Laszlo Ersek
2017-12-01  8:55   ` Ard Biesheuvel
2017-12-01 11:03     ` Laszlo Ersek
2017-12-01 11:28       ` Laszlo Ersek
2017-11-30 16:30 ` [PATCH v2 5/8] OvmfPkg: include FaultTolerantWritePei and VariablePei Laszlo Ersek
2017-11-30 16:30 ` [PATCH v2 6/8] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: don't set flash PCDs if SMM or no-emu Laszlo Ersek
2017-11-30 16:30 ` [PATCH v2 7/8] OvmfPkg/PlatformPei: remedy UEFI memory map fragmentation Laszlo Ersek
2017-11-30 16:30 ` [PATCH v2 8/8] OvmfPkg/README: document MEM_VARSTORE_EMU_ENABLE and memmap defrag Laszlo Ersek
2017-11-30 19:00 ` [PATCH v2 0/8] OvmfPkg: add the Variable PEIM, defragment the UEFI memmap Jordan Justen
2017-12-01  8:42   ` Ard Biesheuvel
2017-12-01 10:48     ` Laszlo Ersek
2017-12-01 10:44   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d584b5b7-be8c-21b2-fc18-be30c155f304@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox