From nobody Mon May 20 23:46:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+110811+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110811+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699338010; cv=none; d=zohomail.com; s=zohoarc; b=GAMP4ehRtRembEWK47fLsOkakK4CA8jNB8vdsHxryUMZieIfJeqG+uJA+BQ8YdT4i3BTYqAmsOMXFSq4TRDbsWea1bqL9kHULsGQfGPfuDoC7Hdpri0P3pRkWMD+n8Z6FbnyciqlNamKikripof6xRKO9pYftMf5QW9WdLU5D1M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699338010; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=q1DVtHwdprG8nHjW26LlgQXCYz5iNgvhzNmXUJ+HH0E=; b=nHNlC/lNKXV2qn9uPrg7DxgvyiAc2wYy5sdIRDFIIroTAfKgEcrRuQufARJqG0SlsoKFjE7lGtdNXfhM8RnEQDqNfWyNY0dDbyFT5l+creYW8XG7H+8ZkOOKaFtVEJyJvOAbP4ukkM3CIQ8Q9C7aeBn341eZhxcBuCfruiZOwvI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110811+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169933801030433.44530274973931; Mon, 6 Nov 2023 22:20:10 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=JCHUBAmJQ/hs2YS9yf6Sjc7uC3XvWhsNll+fGBD6xGo=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1699338009; v=1; b=v2M0JATMfnVP3D/Cfk6cnYpNYbdy57LNvkBf+NZVeydNJ79zYuB0+/zV1xSHREzjZz9+OB8M k3+LbdMJTOdJRpKVb4BZ466wswl7QY1yYywtr8Sql3tfelkojwFlwBFKjowTXr2VDYWfI8Lm5r1 3DQx6aGHkXCQPz3wL+GhC+qc= X-Received: by 127.0.0.2 with SMTP id dZOLYY1788612xjnB8P2bt2O; Mon, 06 Nov 2023 22:20:09 -0800 X-Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by mx.groups.io with SMTP id smtpd.web11.4649.1699338008949304128 for ; Mon, 06 Nov 2023 22:20:09 -0800 X-Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7a9857c14c5so192867139f.3 for ; Mon, 06 Nov 2023 22:20:08 -0800 (PST) X-Gm-Message-State: 7MIkU5Yk8YGlT6FOU78h3qEdx1787277AA= X-Google-Smtp-Source: AGHT+IFU6lFv8PDEZEaFD0IZyV39XOvzTlap5d4FdMTbbCfspKGEz/wetZjIqEILgYWGLCzuaeiTWQ== X-Received: by 2002:a05:6e02:1b05:b0:351:b22:af5c with SMTP id i5-20020a056e021b0500b003510b22af5cmr1946777ilv.32.1699338008135; Mon, 06 Nov 2023 22:20:08 -0800 (PST) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1f24:775d:7335:84a5:7d11:9393]) by smtp.gmail.com with ESMTPSA id cb11-20020a0566381b0b00b00463ff175405sm1875508jab.80.2023.11.06.22.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 22:20:07 -0800 (PST) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Ray Ni , Veeresh Sangolli Subject: [edk2-devel] [PATCH v2 1/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix DEADCODE Coverity issue Date: Tue, 7 Nov 2023 11:49:55 +0530 Message-Id: <20231107061959.113213-2-rsingh@ventanamicro.com> In-Reply-To: <20231107061959.113213-1-rsingh@ventanamicro.com> References: <20231107061959.113213-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1699338011306100007 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh The function PciHotPlugRequestNotify has two if blocks towards the end of function both containing return. Due to the parameter checks ensured at the beginning of the function, one of the two if blocks is bound to come in execution flow. Hence, the return EFI_SUCCESS; at line 2112 is redundant/deadcode. To fix it, either of line 2109 or 2112 can be deleted. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Ray Ni Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c | 1 - 1 file changed, 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePkg/= Bus/Pci/PciBusDxe/PciEnumerator.c index 3f8c6e6da7dc..5b71e152f3ea 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c @@ -2106,7 +2106,6 @@ PciHotPlugRequestNotify ( // // End for // - return EFI_SUCCESS; } =20 return EFI_SUCCESS; --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110811): https://edk2.groups.io/g/devel/message/110811 Mute This Topic: https://groups.io/mt/102438298/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 20 23:46:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+110812+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110812+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699338012; cv=none; d=zohomail.com; s=zohoarc; b=Z53Hdo+zh+yhnNJ7ClSLjJTk9ezKJM+EF7RH6QJi9mFMx/t+gzXV6BzkdKFEtxCM6bFb+IyTYBQXzBBjhjmjTxAqkG5nhd6XKZcbg8J2VxoFmi7lXDR3C7R681xEokaOkJrFLVNcS50HDB9cCyJGUoIdgLnzxcw3+pzhDn4JStg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699338012; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=6HEIs9P+uD9fDKSP1ynqiFygDZej/hxFLq5H/Yczr+M=; b=ayTSTXcwXGqNleKMJys8xa19aKFenjkQ71IJ1cq1gEb9RRABswZWiahZC0xZfKzrnGUrQwOwBw0Y8BqHjbrMgQcrZ5N33+10k6t+v34Y9Bfu42+/YKrVCYV2e0qxRdIHE97M0mh9Zz9Yq123PrZiOfXPdTnA8K6dAdDBzVwivvc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110812+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699338012364664.6753987253791; Mon, 6 Nov 2023 22:20:12 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=VLvqt5okrQF/3h1GPL8yPQMBzfnYLbBDJWZEmyRJf+k=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1699338012; v=1; b=v8Zb63ZgqF2abqM803hkQqzpFecl/XOzdk8646SzWQracqm1366+jC4xeY3QLgdDj9fFJMyw NBHuyeZEgeJv6RGX/X9hnEniY/R9bc3zu/DqKOj2NFSp48fI7NDjU+bEd8u1QgFIdPypELX7/Vu jWVBaAKjK4W+uuFUoegIKdiQ= X-Received: by 127.0.0.2 with SMTP id hNMNYY1788612x4pO1r2jEkh; Mon, 06 Nov 2023 22:20:12 -0800 X-Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by mx.groups.io with SMTP id smtpd.web11.4651.1699338011522322292 for ; Mon, 06 Nov 2023 22:20:11 -0800 X-Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7a6acc8e222so200816639f.0 for ; Mon, 06 Nov 2023 22:20:11 -0800 (PST) X-Gm-Message-State: zOZTJ2AxshPKnIKykVFi8IU3x1787277AA= X-Google-Smtp-Source: AGHT+IFQ51vjpx22+f0xh21n40CKGGxZhTNWL4gA1FjLMmhw8TtreKOybf0S9ggo3QnKtsjPbMu7pA== X-Received: by 2002:a05:6602:2e96:b0:7ac:cb6b:6188 with SMTP id m22-20020a0566022e9600b007accb6b6188mr24272866iow.6.1699338010674; Mon, 06 Nov 2023 22:20:10 -0800 (PST) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1f24:775d:7335:84a5:7d11:9393]) by smtp.gmail.com with ESMTPSA id cb11-20020a0566381b0b00b00463ff175405sm1875508jab.80.2023.11.06.22.20.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 22:20:10 -0800 (PST) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Ray Ni , Veeresh Sangolli Subject: [edk2-devel] [PATCH v2 2/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix MISSING_BREAK Coverity issues Date: Tue, 7 Nov 2023 11:49:56 +0530 Message-Id: <20231107061959.113213-3-rsingh@ventanamicro.com> In-Reply-To: <20231107061959.113213-1-rsingh@ventanamicro.com> References: <20231107061959.113213-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1699338013326100010 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh The function UpdatePciInfo has switch-case code in which there are fall through from case 32: to case 64:. While this is seeemingly intentional, it is not evident to any general code reader why there is no break; in between. Adding // No break; here as this is an intentional fallthrough. as comment in between makes it explicit. Incidentally, the comment satisfies Coverity as well. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Ray Ni Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh Reviewed-by: Laszlo Ersek Reviewed-by: Ray Ni --- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeMod= ulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index 6594b8eae83f..eda97285ee18 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -1428,6 +1428,9 @@ UpdatePciInfo ( switch (Ptr->AddrSpaceGranularity) { case 32: PciIoDevice->PciBar[BarIndex].BarType =3D PciBarTypeMem3= 2; + // + // No break; here as this is an intentional fall through. + // case 64: PciIoDevice->PciBar[BarIndex].BarTypeFixed =3D TRUE; break; @@ -1440,6 +1443,9 @@ UpdatePciInfo ( switch (Ptr->AddrSpaceGranularity) { case 32: PciIoDevice->PciBar[BarIndex].BarType =3D PciBarTypePMem= 32; + // + // No break; here as this is an intentional fall through. + // case 64: PciIoDevice->PciBar[BarIndex].BarTypeFixed =3D TRUE; break; --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110812): https://edk2.groups.io/g/devel/message/110812 Mute This Topic: https://groups.io/mt/102438299/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 20 23:46:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+110813+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110813+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699338015; cv=none; d=zohomail.com; s=zohoarc; b=FWUVHLjtVuGOsnmX2j/kLufy3qaNf/G9iUDq/c8TYoncxYSO9BpO4GQPOsfFxqz/rtzs0PpFrT6CzPyA+K98X1jP1rVyYyEqSCBicaI0xB62PUDoHoZ1/2jGbeC1kDT2YOce8/i1udeTr/BmKkHWSNiKII61nN249aal/6QOgAU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699338015; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=wjcXS6w79hcjyXm8l7l5sBua+WEkwQF3yS6T+l820zA=; b=HOucSubTqeaLstoc4zdUtcw1VJZFB/x2T13hkc7xEdINg0Lsfp+u/Plcve8XSplm+2HIO/eOmbEDM3dcZf0tYvB+Sk/iAHHJcoGnSwjA/xUr/rFCOiQFC4v3paTkdmUliysvByoV1wAkROYjdZvomSvY3dWVaKiHk7XZ3yRlnos= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110813+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699338015270838.4740481932336; Mon, 6 Nov 2023 22:20:15 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=JTUK0IO/13wbb4d1b/SPj9ERR9w6ST0xyL+dZRhGd9Q=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1699338014; v=1; b=FwL7uQMFIsjlmuaofgROVN+TVNqQvjYI88JW1jddRRHYlGU7yStIGyySOaVDh0ZFAWl2up+G r7S/Q54bZP/avZUaiU8lmMtA2x6Y3os2ThFBB2tTcXmJMjzL/s0SMiMSSmopwSOayl6NHfyG6DF NfGFB3e3FLdD78RrVp2O82nw= X-Received: by 127.0.0.2 with SMTP id aYt9YY1788612xn8snBIkKHA; Mon, 06 Nov 2023 22:20:14 -0800 X-Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by mx.groups.io with SMTP id smtpd.web11.4654.1699338014223107631 for ; Mon, 06 Nov 2023 22:20:14 -0800 X-Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7a956887c20so218496439f.1 for ; Mon, 06 Nov 2023 22:20:14 -0800 (PST) X-Gm-Message-State: a4rNu5irqdSpGyNluyHuZSu2x1787277AA= X-Google-Smtp-Source: AGHT+IHaqUP48vHeLifAhavxCLFCJUJk11/HMtZHOW4eU2FfQ0rKl2RmCP+oG+UXKZpYdLXmB+JxGg== X-Received: by 2002:a05:6602:1693:b0:790:fcc2:6e9c with SMTP id s19-20020a056602169300b00790fcc26e9cmr39970182iow.12.1699338013224; Mon, 06 Nov 2023 22:20:13 -0800 (PST) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1f24:775d:7335:84a5:7d11:9393]) by smtp.gmail.com with ESMTPSA id cb11-20020a0566381b0b00b00463ff175405sm1875508jab.80.2023.11.06.22.20.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 22:20:13 -0800 (PST) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Ray Ni , Veeresh Sangolli Subject: [edk2-devel] [PATCH v2 3/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix ARRAY_VS_SINGLETON Coverity issues Date: Tue, 7 Nov 2023 11:49:57 +0530 Message-Id: <20231107061959.113213-4-rsingh@ventanamicro.com> In-Reply-To: <20231107061959.113213-1-rsingh@ventanamicro.com> References: <20231107061959.113213-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1699338017411100001 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh The function PciHostBridgeResourceAllocator is not making use of the generic approach as is used in one of the other function namely - DumpResourceMap. As a result, the following warnings can be seen as reported by Coverity e.g. (30) Event address_of: Taking address with "&IoBridge" yields a singleton pointer. (31) Event callee_ptr_arith: Passing "&IoBridge" to function "FindResourceNode" which uses it as an array. This might corrupt or misinterpret adjacent memory locations. Hence, adopt the generic approach to fix the issues at relevant points. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Ray Ni Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 37 ++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c b/MdeModulePkg/Bus/Pci= /PciBusDxe/PciLib.c index 84fc0161a19c..71767d3793d4 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c @@ -485,6 +485,8 @@ PciHostBridgeResourceAllocator ( UINT64 Mem64ResStatus; UINT64 PMem64ResStatus; UINT32 MaxOptionRomSize; + PCI_RESOURCE_NODE **ChildResources; + UINTN ChildResourceCount; PCI_RESOURCE_NODE *IoBridge; PCI_RESOURCE_NODE *Mem32Bridge; PCI_RESOURCE_NODE *PMem32Bridge; @@ -895,16 +897,39 @@ PciHostBridgeResourceAllocator ( // Create the entire system resource map from the information collecte= d by // enumerator. Several resource tree was created // - FindResourceNode (RootBridgeDev, &IoPool, &IoBridge); - FindResourceNode (RootBridgeDev, &Mem32Pool, &Mem32Bridge); - FindResourceNode (RootBridgeDev, &PMem32Pool, &PMem32Bridge); - FindResourceNode (RootBridgeDev, &Mem64Pool, &Mem64Bridge); - FindResourceNode (RootBridgeDev, &PMem64Pool, &PMem64Bridge); - + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &IoPool, NULL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &IoPool, &ChildResources[0]); + IoBridge =3D ChildResources[0]; ASSERT (IoBridge !=3D NULL); + + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &Mem32Pool, NU= LL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &Mem32Pool, &ChildResources[0]); + Mem32Bridge =3D ChildResources[0]; ASSERT (Mem32Bridge !=3D NULL); + + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &PMem32Pool, N= ULL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &PMem32Pool, &ChildResources[0]); + PMem32Bridge =3D ChildResources[0]; ASSERT (PMem32Bridge !=3D NULL); + + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &Mem64Pool, NU= LL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &Mem64Pool, &ChildResources[0]); + Mem64Bridge =3D ChildResources[0]; ASSERT (Mem64Bridge !=3D NULL); + + ChildResourceCount =3D FindResourceNode (RootBridgeDev, &PMem64Pool, N= ULL); + ChildResources =3D AllocatePool (sizeof (PCI_RESOURCE_NODE *) * ChildR= esourceCount); + ASSERT (ChildResources !=3D NULL); + FindResourceNode (RootBridgeDev, &PMem64Pool, &ChildResources[0]); + PMem64Bridge =3D ChildResources[0]; ASSERT (PMem64Bridge !=3D NULL); =20 // --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110813): https://edk2.groups.io/g/devel/message/110813 Mute This Topic: https://groups.io/mt/102438300/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 20 23:46:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+110814+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110814+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699338017; cv=none; d=zohomail.com; s=zohoarc; b=GxbqSagkWSjY9lLr6scfprRTi8t2lJpWR0PM3dMO/IFqytAC0tNEA8zbTDkO9gyQmq098YNzY2G+hZ+/MyROnu+8SDokUWcriFJGdd+64YyCwPOHX9GbJg+RRU7a5OuzAQ21ws7UAglhlkflqLbD70JGZOLPPnN11n3nznRp9+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699338017; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=G+hUcTEoqBIZJbH0nDQ2NSoI0oCUGdb1OT/5sTB0p78=; b=hYJx7BV9tznzV1m9/MP2se5l1MUXi64rVCP6W/zl5/6J5Sa6wqBG60qWhEOXhKaw/EPhLL3iM1Xkh+BKXOzZ6Zzq8U+9oogfZ5Wr6qtlExAQ2rwfvh3gRtvdAsvWBA7orNNSM6wx2kHIGxXfuxmoDlNVphVTJ0KwUgHcAJ6JSz0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110814+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699338017832489.763540831363; Mon, 6 Nov 2023 22:20:17 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Kx6eLZWosN9rrnCCf+zRRdsi21banw8hNB9nNTHsfUs=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1699338017; v=1; b=e6fpn6zt4ylQSvll8it6YbGiTd194yhQdChY0N5DSuQGjT1oSQPK6rx+c9kQPAhDtWkftH76 ++8kBm7fzRPQR+kFwkF8wpD69GwaoIazbRpAMkU4qJnu/Pfm9dtd04G00dvEwPtW9QEPyhbfnPE eD4MkGHs1ElfQcM6ne4g1gno= X-Received: by 127.0.0.2 with SMTP id DMFLYY1788612xM15wnkUPCl; Mon, 06 Nov 2023 22:20:17 -0800 X-Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by mx.groups.io with SMTP id smtpd.web10.5037.1699338016823354103 for ; Mon, 06 Nov 2023 22:20:16 -0800 X-Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7a67f447bf0so219729939f.2 for ; Mon, 06 Nov 2023 22:20:16 -0800 (PST) X-Gm-Message-State: mh4yCrf6Bg92gleIvCAha3pcx1787277AA= X-Google-Smtp-Source: AGHT+IGO7S25DIILRNtCyPIEjFGslFAX1tCsfns1PYHDhbn2R8VZU9N/2bgbN2VWSBaEFLQOCnGEzw== X-Received: by 2002:a05:6e02:16c6:b0:357:a14e:17cf with SMTP id 6-20020a056e0216c600b00357a14e17cfmr2592574ilx.19.1699338015821; Mon, 06 Nov 2023 22:20:15 -0800 (PST) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1f24:775d:7335:84a5:7d11:9393]) by smtp.gmail.com with ESMTPSA id cb11-20020a0566381b0b00b00463ff175405sm1875508jab.80.2023.11.06.22.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 22:20:15 -0800 (PST) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Ray Ni , Veeresh Sangolli Subject: [edk2-devel] [PATCH v2 4/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix NULL_RETURNS Coverity issue Date: Tue, 7 Nov 2023 11:49:58 +0530 Message-Id: <20231107061959.113213-5-rsingh@ventanamicro.com> In-Reply-To: <20231107061959.113213-1-rsingh@ventanamicro.com> References: <20231107061959.113213-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1699338019376100007 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh The function StartPciDevices has a check ASSERT (RootBridge !=3D NULL); but this comes into play only in DEBUG mode. In Release mode, there is no handling if the RootBridge value is NULL and the code proceeds to unconditionally dereference "RootBridge" which will lead to CRASH. Hence, for safety add NULL pointer checks always and return EFI_NOT_READY if RootBridge value is NULL which is one of the return values as mentioned in the function description header. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Ray Ni Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModuleP= kg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index 581e9075ad41..3de80d98370e 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -772,7 +772,10 @@ StartPciDevices ( LIST_ENTRY *CurrentLink; =20 RootBridge =3D GetRootBridgeByHandle (Controller); - ASSERT (RootBridge !=3D NULL); + if (RootBridge =3D=3D NULL) { + return EFI_NOT_READY; + } + ThisHostBridge =3D RootBridge->PciRootBridgeIo->ParentHandle; =20 CurrentLink =3D mPciDevicePool.ForwardLink; --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110814): https://edk2.groups.io/g/devel/message/110814 Mute This Topic: https://groups.io/mt/102438320/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon May 20 23:46:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+110815+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110815+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1699338020; cv=none; d=zohomail.com; s=zohoarc; b=JnjEj4xSKfquCD1LHwYK/HcwJDkdKYooHeBA6f+61gu/m5keQhFYUB1AioZ4pArLtX9mB2gbGjpwDuwHLp7ydf1bFh7VqO3iv55u4FiE/234LMO0D2mYH5gxU556RmHVuHOgi9toSI6BI9QdD7x82rqmsuNKGoRtVm9rBQ44x4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699338020; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=/e1xIKF4M0vJtvSiQ4E7LvUWLgUQxYM/RYaKz1OuHtM=; b=RMIAdEOQIowQ/BQJuAu6BiNjWfB8W64toKT0Pt1uipeCUDRxgAhrCqXc/g6QfoRle5s0N4mx408H/f3MQEECEBebihk/HjS9BvFWiVBWKWNMEXl32eg5aaFz6cNaKgA37/QewDqjrqair4w9FRb8zenb8nKsgiFsq4lHjsVhuyY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+110815+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1699338020112206.78180422100195; Mon, 6 Nov 2023 22:20:20 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Xed270C8F0XO0Xq4N6XYJPo3ivaNv56/0tgrPIXdkKc=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1699338019; v=1; b=CQ/KNhICe2Lsim7dFE9ugff+tyh+C8edb3latvunV+na+fEO/NGC3jT2GnIFevn5588mXkld Dl/gKjuDV3fwaPRc1qej+GCs90WC4c8gYhyE5EjmWa5M0S+LAjQEj4V8L0UkYYbrQavhRFnsyqv m9mxHiRBB7m5Ux3P4ZTtJ4Jc= X-Received: by 127.0.0.2 with SMTP id vG7FYY1788612xus8FzbgcFK; Mon, 06 Nov 2023 22:20:19 -0800 X-Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by mx.groups.io with SMTP id smtpd.web10.5039.1699338019153872234 for ; Mon, 06 Nov 2023 22:20:19 -0800 X-Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7ad1236c419so164293039f.0 for ; Mon, 06 Nov 2023 22:20:19 -0800 (PST) X-Gm-Message-State: 5mVQiFnLXJr2th8xviIB2RbRx1787277AA= X-Google-Smtp-Source: AGHT+IFoqNOlM1NEuJyw0ERGUB55QTaUd6a0okbZ1GaJTZAZUHAtlWTVnWo5EXOf+xWIrxMeDTBT3g== X-Received: by 2002:a05:6602:2a44:b0:792:989b:c621 with SMTP id k4-20020a0566022a4400b00792989bc621mr40901804iov.1.1699338018160; Mon, 06 Nov 2023 22:20:18 -0800 (PST) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1f24:775d:7335:84a5:7d11:9393]) by smtp.gmail.com with ESMTPSA id cb11-20020a0566381b0b00b00463ff175405sm1875508jab.80.2023.11.06.22.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 22:20:17 -0800 (PST) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Ray Ni Subject: [edk2-devel] [PATCH v2 5/5] MdeModulePkg/Bus/Pci/PciBusDxe: Fix UNUSED_VALUE Coverity issues Date: Tue, 7 Nov 2023 11:49:59 +0530 Message-Id: <20231107061959.113213-6-rsingh@ventanamicro.com> In-Reply-To: <20231107061959.113213-1-rsingh@ventanamicro.com> References: <20231107061959.113213-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1699338025811100001 Content-Type: text/plain; charset="utf-8" The return value after calls to functions gBS->UninstallMultipleProtocolInterfaces, StartPciDevicesOnBridge, PciPciDeviceInfoCollector, BarExisted, PciRootBridgeIo->Pci.Write, gPciHotPlugInit->InitializeRootHpc and PciRootBridgeP2CProcess is stored in Status, but it is not made of any use and later Status gets overridden. Remove the return value storage in Status or add Status check as seems appropriate at a particular point. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4239 Cc: Ray Ni Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 68 +++++++++++----= ----- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 42 ++++++++---- MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c | 8 +++ 3 files changed, 72 insertions(+), 46 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModuleP= kg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index 3de80d98370e..9b0587c94d05 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -544,12 +544,12 @@ DeRegisterPciDevice ( EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); if (!EFI_ERROR (Status)) { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - Handle, - &gEfiLoadFile2ProtocolGuid, - &PciIoDevice->LoadFile2, - NULL - ); + gBS->UninstallMultipleProtocolInterfaces ( + Handle, + &gEfiLoadFile2ProtocolGuid, + &PciIoDevice->LoadFile2, + NULL + ); } =20 // @@ -678,19 +678,21 @@ StartPciDevicesOnBridge ( ChildHandleBuffer ); =20 - PciIoDevice->PciIo.Attributes ( - &(PciIoDevice->PciIo), - EfiPciIoAttributeOperationSupported, - 0, - &Supports - ); - Supports &=3D (UINT64)EFI_PCI_DEVICE_ENABLE; - PciIoDevice->PciIo.Attributes ( - &(PciIoDevice->PciIo), - EfiPciIoAttributeOperationEnable, - Supports, - NULL - ); + if (!EFI_ERROR (Status)) { + PciIoDevice->PciIo.Attributes ( + &(PciIoDevice->PciIo), + EfiPciIoAttributeOperationSupported, + 0, + &Supports + ); + Supports &=3D (UINT64)EFI_PCI_DEVICE_ENABLE; + PciIoDevice->PciIo.Attributes ( + &(PciIoDevice->PciIo), + EfiPciIoAttributeOperationEnable, + Supports, + NULL + ); + } =20 return Status; } else { @@ -726,19 +728,21 @@ StartPciDevicesOnBridge ( ChildHandleBuffer ); =20 - PciIoDevice->PciIo.Attributes ( - &(PciIoDevice->PciIo), - EfiPciIoAttributeOperationSupported, - 0, - &Supports - ); - Supports &=3D (UINT64)EFI_PCI_DEVICE_ENABLE; - PciIoDevice->PciIo.Attributes ( - &(PciIoDevice->PciIo), - EfiPciIoAttributeOperationEnable, - Supports, - NULL - ); + if (!EFI_ERROR (Status)) { + PciIoDevice->PciIo.Attributes ( + &(PciIoDevice->PciIo), + EfiPciIoAttributeOperationSupported, + 0, + &Supports + ); + Supports &=3D (UINT64)EFI_PCI_DEVICE_ENABLE; + PciIoDevice->PciIo.Attributes ( + &(PciIoDevice->PciIo), + EfiPciIoAttributeOperationEnable, + Supports, + NULL + ); + } } =20 CurrentLink =3D CurrentLink->ForwardLink; diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeMod= ulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index eda97285ee18..636885dd189d 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -2796,6 +2796,20 @@ IsPciDeviceRejected ( // Test its high 32-Bit BAR // Status =3D BarExisted (PciIoDevice, BarOffset, &TestValue, &OldV= alue); + if (EFI_ERROR (Status)) { + // + // Not sure if it is correct to skip the below if (TestValue = =3D=3D OldValue) check in this special scenario. + // If correct, then remove these 11 comment lines eventually. + // If not correct, then replace "continue;" with blank "; // N= othing to do" and also remove these 11 comment lines eventually + // OR + // Remove the newly added if (EFI_ERROR (Status)) { ... } bl= ock completely and change + // Status =3D BarExisted (PciIoDevice, BarOffset, &TestValue= , &OldValue); + // =3D> + // BarExisted (PciIoDevice, BarOffset, &TestValue, &OldValue= ); + // i.e., no return value storage in Status + // + continue; + } if (TestValue =3D=3D OldValue) { return TRUE; } @@ -2861,13 +2875,13 @@ ResetAllPpbBusNumber ( if (!EFI_ERROR (Status) && (IS_PCI_BRIDGE (&Pci))) { Register =3D 0; Address =3D EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x18); - Status =3D PciRootBridgeIo->Pci.Read ( - PciRootBridgeIo, - EfiPciWidthUint32, - Address, - 1, - &Register - ); + PciRootBridgeIo->Pci.Read ( + PciRootBridgeIo, + EfiPciWidthUint32, + Address, + 1, + &Register + ); SecondaryBus =3D (UINT8)(Register >> 8); =20 if (SecondaryBus !=3D 0) { @@ -2878,13 +2892,13 @@ ResetAllPpbBusNumber ( // Reset register 18h, 19h, 1Ah on PCI Bridge // Register &=3D 0xFF000000; - Status =3D PciRootBridgeIo->Pci.Write ( - PciRootBridgeIo, - EfiPciWidthUint32, - Address, - 1, - &Register - ); + PciRootBridgeIo->Pci.Write ( + PciRootBridgeIo, + EfiPciWidthUint32, + Address, + 1, + &Register + ); } =20 if ((Func =3D=3D 0) && !IS_PCI_MULTI_FUNC (&Pci)) { diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c b/MdeModulePkg/Bus/Pci= /PciBusDxe/PciLib.c index 71767d3793d4..087fe563c0bc 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c @@ -1250,6 +1250,10 @@ PciScanBus ( &State ); =20 + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "Failed to initialize Hotplug PCI Cont= roller, Status %r\n", Status)); + } + PreprocessController ( PciDevice, PciDevice->BusNumber, @@ -1501,6 +1505,10 @@ PciRootBridgeP2CProcess ( =20 if (!IsListEmpty (&Temp->ChildList)) { Status =3D PciRootBridgeP2CProcess (Temp); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "Failed to process Option Rom on PCI root brid= ge %p, Status %r\n", Temp, Status)); + } } =20 CurrentLink =3D CurrentLink->ForwardLink; --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110815): https://edk2.groups.io/g/devel/message/110815 Mute This Topic: https://groups.io/mt/102438321/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-