From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 78693D80220 for ; Thu, 24 Aug 2023 01:15:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=JiK7/RW+F8avvvKUXXikWz8TW5pU20sTzH0Ye3CwhU4=; c=relaxed/simple; d=groups.io; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20140610; t=1692839706; v=1; b=RF4ObaeEd6WzedDwOY5x8gYOAKuqkT5i0VhM4aQhr/yt2iFiTiSNgzGQbApObd0xXOVnOyw4 /3DBdoSTuDN9tpKcKpZ1ubkL9DjvhZYMwH2GZKBeZeSivgA3OMMF+mQubcgVOzWTgB+kSOOn+Ih q1iIx0mXdiuBBHXnzTILjsqI= X-Received: by 127.0.0.2 with SMTP id fgC1YY7687511xNQPY1J97qb; Wed, 23 Aug 2023 18:15:06 -0700 X-Received: from cxsh.intel-email.com (cxsh.intel-email.com [121.46.250.151]) by mx.groups.io with SMTP id smtpd.web11.1103.1692839703192234140 for ; Wed, 23 Aug 2023 18:15:04 -0700 X-Received: from cxsh.intel-email.com (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id 8578CDDA7EF for ; Thu, 24 Aug 2023 09:15:00 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id 80251DDA7ED for ; Thu, 24 Aug 2023 09:15:00 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by cxsh.intel-email.com (Postfix) with SMTP id C6E24DDA7E6 for ; Thu, 24 Aug 2023 09:14:57 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 24 Aug 2023 09:14:53 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: , Cc: "'Jian J Wang'" , "'Hao A Wu'" References: <20230821034048.38632-1-nhi@os.amperecomputing.com> In-Reply-To: <20230821034048.38632-1-nhi@os.amperecomputing.com> Subject: =?UTF-8?B?5Zue5aSNOiBbICoqIFNQQU1NQUlMICoqIF1bZWRrMi1kZXZlbF0gW1BBVENIIDEvMV0gTWRlTW9kdWxlUGtnL1BjaUJ1c0R4ZTogRml4IGJvb3QgaGFuZyB3aXRoIGZhdWx0eSBQQ0kgT3B0aW9uIFJPTQ==?= Date: Thu, 24 Aug 2023 09:14:56 +0800 Message-ID: <002d01d9d628$64e75b60$2eb61220$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQHSzjswDWnz1tKjp/3dyU8m2qoW97AGtExA 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,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: udQZaGFyyRbVHe4ixi8D9okLx7686176AA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=RF4ObaeE; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none Reviewed-by: Liming Gao > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Nhi Pham via > groups.io > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B48=E6=9C=8821=E6=97=A5 = 11:41 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > =E6=8A=84=E9=80=81: Nhi Pham ; Jian J Wang > ; Liming Gao ; Hao A > Wu > =E4=B8=BB=E9=A2=98: [ ** SPAMMAIL ** ][edk2-devel] [PATCH 1/1] > MdeModulePkg/PciBusDxe: Fix boot hang with faulty PCI Option ROM >=20 > A faulty PCI device has the Option ROM image size set to 0. UEFI reads > two headers PCI_EXPANSION_ROM_HEADER and PCI_DATA_STRUCTURE to > get the > Option ROM information. Because the image size is 0, the Option ROM > header address never changes. As a result, UEFI keeps reading the same > two headers definitely. This patch is intended to fix it. >=20 > Cc: Jian J Wang > Cc: Liming Gao > Cc: Hao A Wu > Signed-off-by: Nhi Pham > --- > MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c > index 89f5f64101a5..bd5ace18f6e4 100644 > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.c > @@ -506,13 +506,13 @@ LoadOpRomImage ( > Indicator =3D RomPcir->Indicator; >=20 > RomImageSize =3D RomImageSize + RomPcir->ImageLength * 512; >=20 > RomBarOffset =3D RomBarOffset + RomPcir->ImageLength * 512; >=20 > - } while (((Indicator & 0x80) =3D=3D 0x00) && ((RomBarOffset - RomBar) = < > RomSize)); >=20 > + } while (((Indicator & 0x80) =3D=3D 0x00) && ((RomBarOffset - RomBar) = < > RomSize) && (RomImageSize > 0)); >=20 >=20 >=20 > // >=20 > // Some Legacy Cards do not report the correct ImageLength so used the > maximum >=20 > // of the legacy length and the PCIR Image Length >=20 > // >=20 > - if (CodeType =3D=3D PCI_CODE_TYPE_PCAT_IMAGE) { >=20 > + if ((RomImageSize > 0) && (CodeType =3D=3D PCI_CODE_TYPE_PCAT_IMAGE)) > { >=20 > RomImageSize =3D MAX (RomImageSize, LegacyImageLength); >=20 > } >=20 >=20 >=20 > -- > 2.25.1 >=20 >=20 >=20 >=20 >=20 -=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 (#107991): https://edk2.groups.io/g/devel/message/107991 Mute This Topic: https://groups.io/mt/100927966/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-