From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web10.3784.1583104397267614232 for ; Sun, 01 Mar 2020 15:13:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y/wiBupG; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583104396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AkP50mNW0KoS+kU5vqP00dQk6QDe9ljut2FaQlYbhGM=; b=Y/wiBupG1hOwLDuj8BmVxV5+S/ZILvI9Y3OXkYbWFiRNuhzBwGUQBKk7cG4G6v3/w/7ttK mba8o2OKW1/LRh71S72dcbKSRMAApARccXylhi1KtGELAVuLJvKdaG9HfnZbSxSRArPCPN vNkiLwaTwrXixN5HNdopezCFnOW8SnA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-4qfe22OTObuI7EV5gKpZZQ-1; Sun, 01 Mar 2020 18:13:14 -0500 X-MC-Unique: 4qfe22OTObuI7EV5gKpZZQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 658AF800D53; Sun, 1 Mar 2020 23:13:13 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 704BE92D12; Sun, 1 Mar 2020 23:13:12 +0000 (UTC) To: Ray Ni Cc: Ard Biesheuvel , edk2-devel-groups-io From: "Laszlo Ersek" Subject: setting PcdPlatformBootTimeOut in PlatformBootManagerLib Message-ID: Date: Mon, 2 Mar 2020 00:13:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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). Thanks, Laszlo