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 86DCE21B00DEC for ; Mon, 27 Nov 2017 10:59:52 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 6B64D85545; Mon, 27 Nov 2017 19:04:14 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-232.rdu2.redhat.com [10.10.120.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id E14915EDE8; Mon, 27 Nov 2017 19:04:12 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Ard Biesheuvel , Jordan Justen Date: Mon, 27 Nov 2017 20:03:54 +0100 Message-Id: <20171127190354.13699-3-lersek@redhat.com> In-Reply-To: <20171127190354.13699-1-lersek@redhat.com> References: <20171127190354.13699-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 27 Nov 2017 19:04:14 +0000 (UTC) Subject: [PATCH 2/2] OvmfPkg/QemuBootOrderLib: let an OFW devpath match multiple UEFI boot opts 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: Mon, 27 Nov 2017 18:59:52 -0000 This means that SetBootOrderFromQemu() will preserve all UEFI boot options matched by any given OFW devpath, such as PXEv4, HTTPv4, PXEv6 and HTTPv6 boot options for the same NIC. Currently we stop the matching / appending for the OFW devpath coming from the outer loop whenever we find the first UEFI boot option match in the inner loop. (The previous patch was about multiple OFW devpaths matching a single UEFI boot option (which should never happen). This patch is about a single OFW devpath matching multiple UEFI boot options. With the "break" statement removed here, the small optimization from the last patch becomes a bit more relevant, because now the inner loop always counts up to ActiveCount.) Cc: Ard Biesheuvel Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek --- OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c index a9a62e9d4007..366104adf535 100644 --- a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c +++ b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c @@ -1863,31 +1863,30 @@ SetBootOrderFromQemu ( for (Idx = 0; Idx < ActiveCount; ++Idx) { if (!ActiveOption[Idx].Appended && Match ( Translated, TranslatedSize, // contains length, not size, in CHAR16's here ActiveOption[Idx].BootOption->FilePath ) ) { // // match found, store ID and continue with next OpenFirmware path // Status = BootOrderAppend (&BootOrder, &ActiveOption[Idx]); if (Status != RETURN_SUCCESS) { goto ErrorFreeExtraPciRoots; } - break; } } // scanned all active boot options } // translation successful TranslatedSize = ARRAY_SIZE (Translated); Status = TranslateOfwPath (&FwCfgPtr, ExtraPciRoots, Translated, &TranslatedSize); } // scanning of OpenFirmware paths done if (Status == RETURN_NOT_FOUND && BootOrder.Produced > 0) { // // No more OpenFirmware paths, some matches found: rewrite BootOrder NvVar. // Some of the active boot options that have not been selected over fw_cfg // should be preserved at the end of the boot order. // -- 2.14.1.3.gb7cf6e02401b