From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::231; helo=mail-it0-x231.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DE0EA221660F7 for ; Fri, 1 Dec 2017 02:49:13 -0800 (PST) Received: by mail-it0-x231.google.com with SMTP id u62so2004646ita.2 for ; Fri, 01 Dec 2017 02:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DIPoCYaGbDaTiYTuCjlppdakC4XxjWoFUJkvYHF2Pj8=; b=SRqz7I/tTQNXg/Zb0TtTfkHdz/31GKQcAtsRotQzEqjSpAAj8PGxAUgsva3GzoAK3U DdKBeL/9ev8QKKDxKe35eYysV3TT3G8JgAHgXRTblzF+MBnRo6SMSlEVWflig7bl3HNt D4Ug0fHsV2OWAva+wszugzUjWwKhofqHiei4s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DIPoCYaGbDaTiYTuCjlppdakC4XxjWoFUJkvYHF2Pj8=; b=YY4OBrxUmiYQQ4CRhD9mELMRf6LvnKLXLa/AAg2uIWcgxV++oapSJ5OhXOVWedUx/+ zM4bbMoW/BqukXelzi+3FlVuXfSA6WAUzYqQzyjP39UBj26tKxenQfBKpNhAKmO9VsCm HUmnJtJgSIgRpfanY95jHqwYBG7HKwGU+k8paOEjCJX5zrcgOJh/lBFVHJ0NcUtIxEs4 GlSJ2qXmTRLmaUy47Ad4uyxrKLMuH8GMyatFo9sIPG4aBk+iXgten2JhN9UUtgctJp6M yIrp6L1ayAEB6qvRm4JhPuAh4h8rQCLCfbOuCE17vc5qDDA/JKhypNG7+Z3lKqh3F+fL bwow== X-Gm-Message-State: AKGB3mJE8gaeduQ/aHjJz+JBZQtKwh7bYbPOMxKURkm9HP3iLcPuTUWn 5vs/bbmtXuwAAmH+qQdIgBjK3E5wlI8Jh5AlcEgpbPRy X-Google-Smtp-Source: AGs4zMbZQnY9bMsTaMQHIz0JaiQ9ERFwNCu7L5lDSuLXQJKdIwrs2GXwMS0vqcx4qiTS/vaFI+NhjCFD7F9qTN8gp74= X-Received: by 10.36.31.212 with SMTP id d203mr1227881itd.48.1512125619173; Fri, 01 Dec 2017 02:53:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.104.16 with HTTP; Fri, 1 Dec 2017 02:53:38 -0800 (PST) In-Reply-To: References: <20171130163029.19743-1-lersek@redhat.com> <20171130163029.19743-4-lersek@redhat.com> From: Ard Biesheuvel Date: Fri, 1 Dec 2017 10:53:38 +0000 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 , Anthony Perard , Jordan Justen , Julien Grall 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:49:14 -0000 Content-Type: text/plain; charset="UTF-8" On 1 December 2017 at 10:52, Laszlo Ersek wrote: > 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? > 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.