From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 A4EE4208F7A4E for ; Mon, 27 Mar 2017 11:03:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1CD0B13AA1; Mon, 27 Mar 2017 18:03:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1CD0B13AA1 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1CD0B13AA1 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-77.phx2.redhat.com [10.3.116.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F1A018984; Mon, 27 Mar 2017 18:03:43 +0000 (UTC) To: Jordan Justen , edk2-devel@lists.01.org References: <20170327080544.24748-1-jordan.l.justen@intel.com> From: Laszlo Ersek Message-ID: Date: Mon, 27 Mar 2017 20:03:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170327080544.24748-1-jordan.l.justen@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 27 Mar 2017 18:03:44 +0000 (UTC) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:03:44 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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. Thanks Laszlo > > 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/DetectFlashNullLib.c > create mode 100644 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf >