public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Jordan Justen <jordan.l.justen@intel.com>,
	edk2-devel-01 <edk2-devel@lists.01.org>
Subject: Re: [PATCH 5/7] OvmfPkg/PlatformPei: don't allocate reserved mem varstore if SMM_REQUIRE
Date: Thu, 18 May 2017 10:16:00 +0200	[thread overview]
Message-ID: <b153940f-b952-27a7-c0b5-2903f63b4748@redhat.com> (raw)
In-Reply-To: <149487179135.31444.17454219357311957333@jljusten-skl>

On 05/15/17 20:09, Jordan Justen wrote:
> On 2017-05-05 14:02:56, Laszlo Ersek wrote:
>> 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.
>>
>> However, EmuVariableFvbRuntimeDxe is excluded from the SMM_REQUIRE build,
>> and then noone consumes PcdEmuVariableNvStoreReserved. Don't waste
>> reserved memory whenever that's the case.
>>
>> (Even a dynamic default for PcdEmuVariableNvStoreReserved would be
>> unnecessary; but that way the PcdSet64S() call in the
>> ReserveEmuVariableNvStore() function doesn't compile.)
>>
>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  OvmfPkg/OvmfPkgIa32.dsc        | 3 +++
>>  OvmfPkg/OvmfPkgIa32X64.dsc     | 3 +++
>>  OvmfPkg/OvmfPkgX64.dsc         | 3 +++
>>  OvmfPkg/PlatformPei/Platform.c | 4 +++-
>>  4 files changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
>> index 64427716c53c..b46eef6cabc3 100644
>> --- a/OvmfPkg/OvmfPkgIa32.dsc
>> +++ b/OvmfPkg/OvmfPkgIa32.dsc
>> @@ -495,7 +495,10 @@ [PcdsFixedAtBuild]
>>  ################################################################################
>>  
>>  [PcdsDynamicDefault]
>> +  # only set when
>> +  #   ($(SMM_REQUIRE) == FALSE)
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>> +
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
>> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
>> index 887964cd27c2..08f471fbc542 100644
>> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
>> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
>> @@ -501,7 +501,10 @@ [PcdsFixedAtBuild.X64]
>>  ################################################################################
>>  
>>  [PcdsDynamicDefault]
>> +  # only set when
>> +  #   ($(SMM_REQUIRE) == FALSE)
> 
> I don't think we should bother adding these comments into the .dsc.
> 
> Ultimately, I would prefer to always allocate this, even when SMM is
> set to be required. It'd be nice if we could always fallback to
> EmuFvb, but I understand that this might not be possible given how
> difficult it is to determine if QEMU actually has SMM enabled. Anyway,
> I think this patch makes sense until we can potentially fix that.
> (Which may or may not be worth fixing.)
> 
> Series Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

Series committed as 11a6cc5bda81..639c7dd86d1d.

Thank you,
Laszlo

> 
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>> +
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
>> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
>> index dc5fea3577d4..24053e5ff82d 100644
>> --- a/OvmfPkg/OvmfPkgX64.dsc
>> +++ b/OvmfPkg/OvmfPkgX64.dsc
>> @@ -500,7 +500,10 @@ [PcdsFixedAtBuild]
>>  ################################################################################
>>  
>>  [PcdsDynamicDefault]
>> +  # only set when
>> +  #   ($(SMM_REQUIRE) == FALSE)
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
>> +
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
>> diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
>> index 5e983a8dcea9..1b4dc00b0180 100644
>> --- a/OvmfPkg/PlatformPei/Platform.c
>> +++ b/OvmfPkg/PlatformPei/Platform.c
>> @@ -672,7 +672,9 @@ InitializePlatform (
>>    mHostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID);
>>  
>>    if (mBootMode != BOOT_ON_S3_RESUME) {
>> -    ReserveEmuVariableNvStore ();
>> +    if (!FeaturePcdGet (PcdSmmSmramRequire)) {
>> +      ReserveEmuVariableNvStore ();
>> +    }
>>      PeiFvInitialization ();
>>      MemMapInitialization ();
>>      NoexecDxeInitialization ();
>> -- 
>> 2.9.3
>>
>>



  reply	other threads:[~2017-05-18  8:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 21:02 [PATCH 0/7] OvmfPkg: small cleanups and tweaks Laszlo Ersek
2017-05-05 21:02 ` [PATCH 1/7] OvmfPkg/EmuVariableFvbRuntimeDxe: always format an auth varstore header Laszlo Ersek
2017-05-05 21:02 ` [PATCH 2/7] OvmfPkg: remove gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable Laszlo Ersek
2017-05-05 21:02 ` [PATCH 3/7] OvmfPkg/PlatformPei: remove unused PcdVariableStoreSize dependency Laszlo Ersek
2017-05-05 21:02 ` [PATCH 4/7] OvmfPkg: sync PcdVariableStoreSize with PcdFlashNvStorageVariableSize Laszlo Ersek
2017-05-05 21:02 ` [PATCH 5/7] OvmfPkg/PlatformPei: don't allocate reserved mem varstore if SMM_REQUIRE Laszlo Ersek
2017-05-15 18:09   ` Jordan Justen
2017-05-18  8:16     ` Laszlo Ersek [this message]
2017-05-05 21:02 ` [PATCH 6/7] OvmfPkg: resolve PcdLib for all PEIMs individually Laszlo Ersek
2017-05-05 21:02 ` [PATCH 7/7] OvmfPkg: resolve PcdLib for PEIMs to PeiPcdLib by default Laszlo Ersek
2017-05-12  9:05 ` [PATCH 0/7] OvmfPkg: small cleanups and tweaks Gary Lin

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=b153940f-b952-27a7-c0b5-2903f63b4748@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