From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org 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 4C5A0220F3C23 for ; Fri, 1 Dec 2017 02:47:52 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CE2E6A7E2; Fri, 1 Dec 2017 10:52:18 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-33.rdu2.redhat.com [10.10.120.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id DBC765C54C; Fri, 1 Dec 2017 10:52:16 +0000 (UTC) To: Ard Biesheuvel Cc: edk2-devel-01 , Anthony Perard , Jordan Justen , Julien Grall References: <20171130163029.19743-1-lersek@redhat.com> <20171130163029.19743-4-lersek@redhat.com> From: Laszlo Ersek Message-ID: Date: Fri, 1 Dec 2017 11:52:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 01 Dec 2017 10:52:18 +0000 (UTC) Subject: Re: [PATCH v2 3/8] OvmfPkg: conditionally disable reserved memory varstore emulation at build 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: Fri, 01 Dec 2017 10:47:52 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/01/17 09:51, Ard Biesheuvel wrote: > On 30 November 2017 at 16:30, Laszlo Ersek 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? Does PcdSet work on patchable PCDs? Thanks! Laszlo