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:c06::241; helo=mail-io0-x241.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (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 149AC2034A78E for ; Mon, 27 Nov 2017 23:52:24 -0800 (PST) Received: by mail-io0-x241.google.com with SMTP id i38so39369363iod.2 for ; Mon, 27 Nov 2017 23:56:47 -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=eULj1bKKN8oQS17ZiEOt4mY8oZpgeSk/3BOD23jDpPQ=; b=fuzIhriTduGuZ2Awy3Cf0yp8oxbNkB0Fr0WKQ9LhUElhCX5jxqYSDVhsT+VtuXTspX KUfg69zLqMh+bqnHHliwWvoc+Sk57N0lFtgI3grpJCzEYfsdX7QVz4GvSvjnzud7R/Es kyFtD5P+Z9JC2ioUJBfztSPymLCUYXG2gezV8= 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=eULj1bKKN8oQS17ZiEOt4mY8oZpgeSk/3BOD23jDpPQ=; b=onqOioKONXVKukd2gFCjtkpHpcp0t3YLhibqfvrdZi8c3oincaTNNrM9PPZ7Z6WPsM 7I7ngDTg5k1S/DjIwZDUm4cEaXfeEEIXBkou7lrXpfkqE4KcPZ3/KQWSvSzsSI2xp3kO 3FDQPf2sFtzAYxnzQ/vbBBsooTlJzN3wYCdwJxFnxenfUSDovVgDy29gUTL3OgTf2z3B vj5HVzQ/t7CljZiyYWK4PN0ciYawrZotQUiQDC/KZfMmOv7FQeo/V8TpbzmHhwj9jEW9 XKdjX1zvgsmf0B2tBSItYaM5YWnoF19vciLVVyAwFz/nqpSppIgNIx5KeFRrNrTpV27k de4Q== X-Gm-Message-State: AJaThX62gw/rW8sdysS5fCGTBRFBdZcRvr3gCv3VcQuWR1clTJ5YbwsC vj3KArOkReKbwsRm1UisizliAx52hSKbUgHXJ5TLSw== X-Google-Smtp-Source: AGs4zMb/ry18UUI8CZhFA+YVSQZFXkTcvuXeWuaeaI2VBKe2eqx3X6CiVJgNTYfC3OnlkBJL3V/DFxnavXW+1DmNzO4= X-Received: by 10.107.174.222 with SMTP id n91mr4049603ioo.43.1511855807137; Mon, 27 Nov 2017 23:56:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.104.16 with HTTP; Mon, 27 Nov 2017 23:56:46 -0800 (PST) In-Reply-To: <20171127190354.13699-3-lersek@redhat.com> References: <20171127190354.13699-1-lersek@redhat.com> <20171127190354.13699-3-lersek@redhat.com> From: Ard Biesheuvel Date: Tue, 28 Nov 2017 07:56:46 +0000 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 , Jordan Justen Subject: Re: [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: Tue, 28 Nov 2017 07:52:25 -0000 Content-Type: text/plain; charset="UTF-8" On 27 November 2017 at 19:03, Laszlo Ersek wrote: > 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 Acked-by: Ard Biesheuvel > --- > 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 >