From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web11.20524.1590695873625038198 for ; Thu, 28 May 2020 12:57:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ln5V1PUi; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590695872; 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: in-reply-to:in-reply-to:references:references; bh=heeWlbU8g73+Cro3vIn6UHbMf6tamZWAmCo6pM1EFRQ=; b=Ln5V1PUiFsuA00n13T/Zyz2mBBlEdEZnZnZKdSPEtQMMPLDQKWF0EFSR1aN1v0uwuiFEh2 MzV0AzbuA/FpQ1R3pbc+YyDs9AXnlp+Yl+m9UiwqyLk1zrWiVo1r5L0JV1nNShwu5pwxUB X6LQ5h8TliD2XXgMz6NwVFppyGhZnDg= 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-170-xJIFob7KNPiqeVqlv5likw-1; Thu, 28 May 2020 15:57:48 -0400 X-MC-Unique: xJIFob7KNPiqeVqlv5likw-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80986800688; Thu, 28 May 2020 19:57:47 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-101.ams2.redhat.com [10.36.112.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 159C15C1B0; Thu, 28 May 2020 19:57:45 +0000 (UTC) Subject: Re: [PATCH v2 3/5] MdeModulePkg/BootManagerUiLib: show inactive boot options To: Ard Biesheuvel , devel@edk2.groups.io Cc: jon@solid-run.com, Leif Lindholm , Ray Ni , Zhichao Gao References: <20200528091741.14610-1-ard.biesheuvel@arm.com> <20200528091741.14610-4-ard.biesheuvel@arm.com> From: "Laszlo Ersek" Message-ID: Date: Thu, 28 May 2020 21:57:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200528091741.14610-4-ard.biesheuvel@arm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 On 05/28/20 11:17, Ard Biesheuvel wrote: > UEFI boot options may exist but have the LOAD_OPTION_ACTIVE flag > cleared. This means that the boot option should not be selected > by default, but it does not mean it should be omitted from the > boot selection presented by the boot manager: for this purpose, > another flag LOAD_OPTION_HIDDEN exists. > > Given that the latter flag exists solely for the purpose of omitting > boot options from the boot selection menu, and LOAD_OPTION_XXX flags > can be combined if desired, hiding inactive boot options as well is > a mistake, and violates the intent of paragraph 3.1.3 of the UEFI > specification (revision 2.8 errata A). Let's fix this by dropping > the LOAD_OPTION_ACTIVE check from the code that populates the boot > selection menu. > > Signed-off-by: Ard Biesheuvel > --- > MdeModulePkg/Library/BootManagerUiLib/BootManager.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c > index 13b40e11b396..4b2c4c77a124 100644 > --- a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c > +++ b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c > @@ -535,9 +535,9 @@ UpdateBootManager ( > mKeyInput++; > > // > - // Don't display the hidden/inactive boot option > + // Don't display hidden boot options, but retain inactive ones. > // > - if (((BootOption[Index].Attributes & LOAD_OPTION_HIDDEN) != 0) || ((BootOption[Index].Attributes & LOAD_OPTION_ACTIVE) == 0)) { > + if ((BootOption[Index].Attributes & LOAD_OPTION_HIDDEN) != 0) { > continue; > } > > Reviewed-by: Laszlo Ersek