From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jordan.l.justen@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by ml01.01.org (Postfix) with ESMTPS id 8703D21BC6A23
 for <edk2-devel@lists.01.org>; Mon, 27 Mar 2017 14:47:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=intel;
 t=1490651221; x=1522187221;
 h=mime-version:content-transfer-encoding:to:message-id:
 from:in-reply-to:references:subject:date;
 bh=LEHl8xbFWSvgP44T6N3h8zbskE8e5hkLIYVaA7fnLXM=;
 b=VO0D6QIqA3zzen1D/c4xGDQ0TSsYhCmYD5ze6WbZPB4X72mezrJxQSlW
 Tl6s5hdLjR9JJP5V0kQZ4FfvJcb2qQ==;
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 27 Mar 2017 14:47:01 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.36,233,1486454400"; d="scan'208";a="240970958"
Received: from junghyun-mobl.amr.corp.intel.com (HELO localhost)
 ([10.252.131.12])
 by fmsmga004.fm.intel.com with ESMTP; 27 Mar 2017 14:47:00 -0700
MIME-Version: 1.0
To: Laszlo Ersek <lersek@redhat.com>,  edk2-devel@lists.01.org
Message-ID: <149065122031.28789.9113394760317457361@jljusten-skl>
From: Jordan Justen <jordan.l.justen@intel.com>
In-Reply-To: <a12bbf61-3f55-2fda-b855-58aeb99a4f42@redhat.com>
References: <20170327080544.24748-1-jordan.l.justen@intel.com>
 <a12bbf61-3f55-2fda-b855-58aeb99a4f42@redhat.com>
User-Agent: alot/0.5.1
Date: Mon, 27 Mar 2017 14:47:00 -0700
Subject: Re: [PATCH 00/12] OvmfPkg: Enable variable access in PEI
X-BeenThere: edk2-devel@lists.01.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: EDK II Development  <edk2-devel.lists.01.org>
List-Unsubscribe: <https://lists.01.org/mailman/options/edk2-devel>,
 <mailto:edk2-devel-request@lists.01.org?subject=unsubscribe>
List-Archive: <http://lists.01.org/pipermail/edk2-devel/>
List-Post: <mailto:edk2-devel@lists.01.org>
List-Help: <mailto:edk2-devel-request@lists.01.org?subject=help>
List-Subscribe: <https://lists.01.org/mailman/listinfo/edk2-devel>,
 <mailto:edk2-devel-request@lists.01.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Mar 2017 21:47:01 -0000
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

On 2017-03-27 11:03:42, Laszlo Ersek wrote:
> On 03/27/17 10:05, Jordan Justen wrote:
> > web: https://github.com/jljusten/edk2/tree/pei-vars-v1
> > =

> > git: https://github.com/jljusten/edk2.git pei-vars-v1
> > =

> > This series moves flash detection into PEI to allow the PEI variable
> > access drivers to run. If flash is writable, the PCDs are set to point
> > at the flash memory. If flash is not writable, the PCDs are set to
> > point at a memory buffer.
> =

> Can you please state the use case for the latter option? That is, when
> the PCDs are set to point at the memory buffer.
> =

> In that case, the memory buffer is guaranteed to be empty (modulo
> internal formatting that PlatformPei would do just-in-time), unless the
> VM has just been rebooted within the same QEMU instance.
> =

> In other words, clients of the r/o variable2 PPI will get false results,
> most of the time -- if I understand correctly. After a fresh boot (which
> is most of the boots), no variable will be found in the PEI phase, even
> if the \NvVars file contains it, and the variable services in DXE will
> later find it.
> =

> ... I'm not sure if my understanding above is correct, but if it is,
> then I think this feature only contributes to the confusing nature of
> the memory-emulated variables.

I think we should continue to support the memory vars, even if they
have some obvious drawbacks.

-Jordan

> =

> > =

> > I tested KVM with ROM and writable flash, with S3 sleep/resume. I did
> > not test SMM.
> > =

> > Jordan Justen (10):
> >   OvmfPkg/build.sh: Add support for --disable-flash switch
> >   OvmfPkg QemuFlash: Make QemuFlash.* Base class safe
> >   OvmfPkg QemuFlash: Make QemuFlashDetected external
> >   OvmfPkg QemuFlash: Add DetectFlashBaseLib.inf 'NULL' library
> >   OvmfPkg PlatformPei: Detect and set PcdOvmfFlashVariablesEnable
> >   OvmfPkg/EmuVariableFvbRuntimeDxe: Use PcdOvmfFlashVariablesEnable
> >   OvmfPkg PlatformPei: Set flash variable PCDs
> >   OvmfPkg PlatformPei: Initialize memory based variable store buffer
> >   OvmfPkg: Enable PEI variable access
> >   OvmfPkg QemuFlashFvbServicesRuntimeDxe: Cleanup init now done in PEI
> > =

> > Laszlo Ersek (2):
> >   OvmfPkg: resolve PcdLib for all PEIMs individually
> >   OvmfPkg: resolve PcdLib for PEIMs to PeiPcdLib by default
> > =

> >  OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c             |   4 +-
> >  OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf           |   3 +-
> >  OvmfPkg/OvmfPkgIa32.dsc                            |  27 +-
> >  OvmfPkg/OvmfPkgIa32.fdf                            |   5 +-
> >  OvmfPkg/OvmfPkgIa32X64.dsc                         |  27 +-
> >  OvmfPkg/OvmfPkgIa32X64.fdf                         |   5 +-
> >  OvmfPkg/OvmfPkgX64.dsc                             |  27 +-
> >  OvmfPkg/OvmfPkgX64.fdf                             |   5 +-
> >  OvmfPkg/PlatformPei/Platform.c                     |  34 +--
> >  OvmfPkg/PlatformPei/Platform.h                     |   7 +-
> >  OvmfPkg/PlatformPei/PlatformPei.inf                |  11 +-
> >  OvmfPkg/PlatformPei/Vars.c                         | 283 +++++++++++++=
++++++++
> >  .../DetectFlashNullLib.c                           |  41 +++
> >  .../DetectFlashNullLib.inf                         |  60 +++++
> >  .../FvbServicesRuntimeDxe.inf                      |   4 -
> >  .../FvbServicesSmm.inf                             |   4 -
> >  .../FwBlockService.c                               |  28 +-
> >  OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c |  59 +++--
> >  OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h |  30 ++-
> >  OvmfPkg/build.sh                                   |  10 +-
> >  20 files changed, 530 insertions(+), 144 deletions(-)
> >  create mode 100644 OvmfPkg/PlatformPei/Vars.c
> >  create mode 100644 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashN=
ullLib.c
> >  create mode 100644 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashN=
ullLib.inf
> > =

>=20