From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.web11.11962.1583142227707848738 for ; Mon, 02 Mar 2020 01:43:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=zCl4nigo; spf=pass (domain: linaro.org, ip: 209.85.221.46, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wr1-f46.google.com with SMTP id t11so5241584wrw.5 for ; Mon, 02 Mar 2020 01:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1D+jyJc/Z3QZZqYqfhBMD/6cZwGQNq/cObYXOOkYROw=; b=zCl4nigoWiworwkdDOW5b5BoEGp8oFngudLMGf9K73KUSDdf41ChVEysBekLuIGSad 43N4mliQRcB+nH87Ku82GS9xC51d/4yae2gVQTyhvxB1cwjTt+Jeair1FXSsjb7DJHPK sHhC8fwe9hAbQaB0ehe5wZltcC/ulmPiCgVfFraO/P6Hm2uFy0pVQ89zyy50Omgx0brH D+26I7hwjk1Iw7h/vn1GsM8Q7JGBF7eeX0ZbLQXN2gpPUSVF7C0B9gC3wEfMA7eL1HWq saljJqCo4uz/+b1oghNMANFgARXHZRa5nL1fBLznuVQXh+3urZVsFyy3G/UfwFurn9xq MvpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1D+jyJc/Z3QZZqYqfhBMD/6cZwGQNq/cObYXOOkYROw=; b=FtINpXFUXNk6oPoWRvcfdR2yPNn2OP1jtfZCBaCIwhm2UkAXwQQ8QYHZToUpvJUgOk X2Es7LKbJHCQWw4sjW+xM98oO+T/j5lASdM0RFThbFk8aKRy03ILaTIwWnTaAhCmn2pE 4aORqC5vAfb+LV32XacqCCdMg2BI0Gwwa4/CISN+IAylhZrBaZARymiTkG/CGNmxWxCQ iv7yzxfzdZSE8jtwd92kUSCXO4N4mEoVh9Li8f012mkUbexxk9BEvw9IY6cCZf5t2I6M /DT2840vC1tj2MkyM0Ah0hCaRgSX3IvUJVyWGFdRGcCIxUAAjhfmAD5hPOaved5mWQ0k yERQ== X-Gm-Message-State: APjAAAXMdKzKmGOcF5HTb7bAclDfkT0iISAqHVzql7Guf31QfER3iRP2 vhyREWGh6p7qR0kGrXLZcwJ46d+iFuwnmPU4sTAbKg== X-Google-Smtp-Source: APXvYqynw/WjaB+4AGI+wkQaj/xNManHfc6howoEzTVK5VXj8fGS6+F5/kUoptrTr+ggE3CwbZlnHZ5gYsYpWDQ8fcE= X-Received: by 2002:adf:f84a:: with SMTP id d10mr21843098wrq.208.1583142226249; Mon, 02 Mar 2020 01:43:46 -0800 (PST) MIME-Version: 1.0 References: <87400517-c541-f7e2-7187-798dbad001ca@redhat.com> In-Reply-To: <87400517-c541-f7e2-7187-798dbad001ca@redhat.com> From: "Ard Biesheuvel" Date: Mon, 2 Mar 2020 10:43:35 +0100 Message-ID: Subject: Re: setting PcdPlatformBootTimeOut in PlatformBootManagerLib To: Laszlo Ersek Cc: Ray Ni , edk2-devel-groups-io Content-Type: text/plain; charset="UTF-8" On Mon, 2 Mar 2020 at 10:40, Laszlo Ersek wrote: > > On 03/02/20 00:13, Laszlo Ersek wrote: > > Hi Ray, > > > > OvmfPkg and ArmVirtPkg platforms set PcdPlatformBootTimeOut in their > > PlatformBootManagerLib instances, in BeforeConsole(). This generally > > works, except for one aspect: in BdsEntry(), the Timeout UEFI variable > > is set from the PCD before BeforeConsole() is called. > > > > The Timeout variable is in this case purely informative, but I'd still > > like it to reflect the PCD's value. Given that I'd like to keep the > > subject PcdSet16S() call in PlatformBootManagerLib, I see two options: > > > > (1) Modify BdsEntry(): re-check the value of the PCD a bit before > > BdsWait() -- when the PCD is really needed --, and if it has changed > > relative to the first seen value, store the new PCD value to the UEFI > > variable *again*. > > > > This would keep platforms happy that expect Timeout to already carry the > > PCDs value upon entering BeforeConsole(), and it would allow platforms > > to re-set the PCD (and Timeout too) in either BeforeConsole() or > > AfterConsole(). > > > > (2) Alternatively, add a CONSTRUCTOR function to the > > PlatformBootManagerLib instances for setting the PCD before BdsEntry() > > is invoked at all. I'm a bit concerned about this, as we'd have to > > ensure that *all* the lib instances that participate in this PCD setting > > (including the lib instances that let us calculate the value) have > > CONSTRUCTOR functions (otherwise the topological sorting of CONSTRUCTOR > > calls is not complete). > > (3) We could also just rewrite Timeout ourselves, in > PlatformBootManagerLib, where we set the PCD. > 'Rewrite' as in access the global variable? Or access the HII guts of the 'timeout' entry in the menus?