From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.27611.1650883176397685556 for ; Mon, 25 Apr 2022 03:39:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=MBkjTrO2; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0114dc4f73=abner.chang@hpe.com) Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23P6pcoJ023831; Mon, 25 Apr 2022 10:39:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=UPTo0w3ZXh0oTBJ5SEEyVlH1J+x3zuFWDc9Zeqo/Xz0=; b=MBkjTrO2lZ0kPmC4/r/q9fsqdxKdxojzMYaGYuqSwdSDcNB0b1g2yuZ2OLIjge9zHreP f/VHKBUzc0VNFPi1SZA8c/wOf00qpqdr8oLApvnSNS3vCy1P6Tj2Ddi8Kcj6Aa3fGvGM bNN+NzDYvNSb3pfJWyxXVkxRZppXK8nZFJKY8ZpuXTk3uVDdVmNhw0SPsTkweNDzsI+p XTaPtWV1n941P0lqe4Iq1mAsoh+m9cLqURnwm7PjgYFyJR3vOTq3kXRGYUV/eGobApmd 5Wxs2D7RoLXxnyVRPRHJaDbDbPWfYvefEefBjFgK9c3EbxMD3I2kA+LBR7Pmg7yxEdUt 7A== Received: from p1lg14878.it.hpe.com (p1lg14878.it.hpe.com [16.230.97.204]) by mx0a-002e3701.pphosted.com (PPS) with ESMTPS id 3fmu69abdx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Apr 2022 10:39:27 +0000 Received: from p1wg14926.americas.hpqcorp.net (unknown [10.119.18.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id 6B3D013172; Mon, 25 Apr 2022 10:39:26 +0000 (UTC) Received: from p1wg14927.americas.hpqcorp.net (10.119.18.117) by p1wg14926.americas.hpqcorp.net (10.119.18.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Sun, 24 Apr 2022 22:39:26 -1200 Received: from p1wg14923.americas.hpqcorp.net (10.119.18.111) by p1wg14927.americas.hpqcorp.net (10.119.18.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Sun, 24 Apr 2022 22:39:25 -1200 Received: from p1wg14920.americas.hpqcorp.net (16.230.19.123) by p1wg14923.americas.hpqcorp.net (10.119.18.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15 via Frontend Transport; Sun, 24 Apr 2022 22:39:25 -1200 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (192.58.206.38) by edge.it.hpe.com (16.230.19.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Sun, 24 Apr 2022 22:39:25 -1200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PeCesVWQNKPAObd+78+7GW4LPoHb2fg5NzySMNfaYNjKjSY+zeCeSwuUVHwbLVZI/Nq2uptREfWV5vAsJMdy7CDum5FhpYaS+KcbtB/17rMFmjsE1W8XICkBGz/dnJMg1Ehf+5dvQYVcrt2ogRjakwpnz15nITF/QIpH9JfbAF/G1QALgwsESyMNW0pRoIjHmyhLsNTrU6TEA7xg047pCqBCMGXYAU+htA7qFhB78aD62SbnrpYue34dkMb77AlMBbaumSvJn3ij9LcMRtZS2T4uxVEt6GRu1vp3S6Ye75EA5JxyKa4nG7v0Vogy/Ay7XFCyXeAUbwgTzhm+ynO6Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UPTo0w3ZXh0oTBJ5SEEyVlH1J+x3zuFWDc9Zeqo/Xz0=; b=hSzVH2k9h9f8dddEOBzgyEr4SyMv+XbzoK5F1zGRBOgxQLYplDUBeH2hDBVLYz8ja2+BsTdFR50WGLF9FaSdOcimBpmEnQrvgza07WjPMnVG+PAjLDbnVPTP3wOBjNtLkqXytIkqWeFJRQuDoqwgGOy9DJDdjJLogAog01jCCE8yY17EAo3UmHRdt8xQMSOu4ZzQj7FuzCbQE2X4gfLdWZz5Dfba1PTkcMQllAcQszVgG3Hj5nzyqulcO+cCV3RrwXuBfXCMoprijMF/CaIa/L4SDxSubFVp3isgSvU95Ohnh1gotcjaITNOweGF4usB/ZfaYCOzCRaQSNUwqf43cA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:173::6) by DS7PR84MB3064.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:8:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.19; Mon, 25 Apr 2022 10:39:23 +0000 Received: from PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM ([fe80::1180:9469:31d2:6933]) by PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM ([fe80::1180:9469:31d2:6933%7]) with mapi id 15.20.5186.015; Mon, 25 Apr 2022 10:39:23 +0000 From: "Abner Chang" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Jiewen Yao , Oliver Steffen , Leif Lindholm , Pawel Polawski , Hao A Wu , Liming Gao , Ray Ni , Jordan Justen , Jian J Wang , "Ard Biesheuvel" Subject: Re: [PATCH v6 2/6] OvmfPkg/FdtPciHostBridgeLib: io range is not mandatory Thread-Topic: [PATCH v6 2/6] OvmfPkg/FdtPciHostBridgeLib: io range is not mandatory Thread-Index: AQHYWJAwKcIBZj9HvUKnKt96NnLgqa0Ab6vg Date: Mon, 25 Apr 2022 10:39:23 +0000 Message-ID: References: <20220425103446.496763-1-kraxel@redhat.com> <20220425103446.496763-3-kraxel@redhat.com> In-Reply-To: <20220425103446.496763-3-kraxel@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 418a1081-443b-4b03-3d9b-08da26a7dce3 x-ms-traffictypediagnostic: DS7PR84MB3064:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BvZ21gzd9zIbmdPkI3M6BzLpp86JtwpaOyZwry2x/5Ih0qAeBMinqU40HElaxX2lu3LQkIcXZAwPzWI6wUMYpLPOzVloVJDtsCbQCkumyP9ssi0pCK9rA6+C7LGMoI30vjEWlnu0IXAQL/X4f33NRGpniom7Nf36qysq7hT4/B/J1QBSQmsiQWULoo7QXzk6202bra3Iph+eaUVJuWmtviW94Ig7I+ZGGgQgQhK9DSd1TevCijc5XoD5D9KANVXLqVz8lzrw6Nv07rcdH+vVIWvdsLjrNd5JW9Ls92+UMMsGpM2IkUcxj1HMWIeyaLTT92+4gQt8KZipa00seOoV5bzYs4LwD6pLrnig6Xcac4xYABb0UJrRxWC1fwkjnblYETjsmmUSRQKQvf1XJPQ5tC7BjfucFMRm8ackVRB+STpLUiPhz0lsf+24rdtdJxzPYSMuAU7l3sb1uQT7qwvn58IR/3nvpzdFPZP27HduwZU5TAiUarzcfvtqAjGP39caGmT5DPytrNJl9ZB/wgsRFvmhtWRY9VcbdeVpU02xU66W0nJ42FcZZx+cfr1JfUEUjwejhUj6PIhCGQrrAaW8RKC3QCtTtKujyqKkmkncurdQI4w9xBglvnlKyoVgID3sWo4xo/ABiKvyYrToLPGM1UdbN4Vff29hroUZF0K2AzZay62hxru02m0Mmce2kDu/lUqU8cVO9e9f4bUOoUj/2RNRyPV8NItNvo3gEvXXdlo= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230001)(366004)(7696005)(76116006)(64756008)(6506007)(66556008)(66446008)(8676002)(508600001)(53546011)(110136005)(186003)(54906003)(33656002)(86362001)(2906002)(316002)(83380400001)(66946007)(66476007)(4326008)(52536014)(9686003)(38070700005)(122000001)(26005)(71200400001)(7416002)(82960400001)(8936002)(5660300002)(38100700002)(55016003)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?mSoqvKNW3u2rD6YAWYH+JmPzRG8vaHBMfxVDCIRXPgLLvOnLr7kBLrD/e5JO?= =?us-ascii?Q?XrRp/0hmhD53sz3VNIbc6k/qaFkn2B++dGCe1bU6+GbVE36g6bvl0Tp3AnSL?= =?us-ascii?Q?OUNNOtf3EHqUPzfxt9EHvIqLHO6BNgoR1h1JbWqzJAeo7GZlXE8CidxMe2Ys?= =?us-ascii?Q?RjE7Brei2frNj2yxVXYyR1R5vZQmB64Ykp/GHo+025t+cY9ovs9sHJoekNEI?= =?us-ascii?Q?TJxsTzBhqN83wGq/CGd05tM5Thsja2oN9t3a3aamtl/fDCKGTMw6JWCfjSTc?= =?us-ascii?Q?hpWCILeJN1me8Fd5sHO0jWkkXfiHkKiRxLAUfPkmrS5gCZxUlSSIe+kihHQg?= =?us-ascii?Q?WEbpHPDEuqxBF3Jh567anul8Q3O1KYW3OA3lNHzZtlaXyKlQiwpD1opqc32+?= =?us-ascii?Q?oSAeunGiYGwPGeuAcUyKNk/V1GPjfV684jgBJuvnroMbceZdUnS4wxAfcIyI?= =?us-ascii?Q?sWDeSc9jztLIG80VQF+yihopsBRWYhyjtLalSUdITra0RkxP48+gQKJeZxRE?= =?us-ascii?Q?/EINvWPRG42SzBlFzu6ieloG1qi6r7tFFTodx2cxp//Vo6FdJ627pg2YCKbA?= =?us-ascii?Q?KNylC8Rrg638zyyG43+Q8WpmUCNZ1C/bS5/6DD2XB9BWMxS35Q6l/oL6pLGQ?= =?us-ascii?Q?wUZpzN8sRK6CaKp78gOZb96SL1Xh4SHHhJpt+dUypd8QvX6BuBPRFrQx32kf?= =?us-ascii?Q?6g+8mvxR0cUSl1eGBfqYyVQLKcCm3xkxwdn3gjsE2uue1dj70n7PkWeYOefc?= =?us-ascii?Q?bHtl5K92MOYkSHLo31QcRHOkVLouRjOO2XdfZDcraC9HleVYM91MDZfsiKLM?= =?us-ascii?Q?Pu81sB+7NryxaESqibMCnBmVO0uAgKNysT5UGum/LLzWwSXmngCBBBniXy73?= =?us-ascii?Q?rdnyLVDdDiHhZVYCbWkQwyw7e0wd/it9HKqgmxzHrUp9QDzKnX6ihtW8LbSk?= =?us-ascii?Q?9SKxKkYtEir274aLOYmjct4aJksFcSn/hSESLEDxNeCpkfuxLsq59BPW4e6u?= =?us-ascii?Q?674YHuyeXOaHahtw7ikpa91Vg2u/G7q5mPPqFuAZkl4Pwku3f0Pmx8yozPZX?= =?us-ascii?Q?8H6h2cRDdilxjc2mUIO963PoAiWXEKkH6HN7vbzU89RGWbZRaB70nDbtR0QI?= =?us-ascii?Q?BJtUIPtMrj9xRA+8uVIGcp73pcKvNNeA7T5EuOsFHMn7cgXcA4bkNJPSeaO1?= =?us-ascii?Q?ePlf/0Dx9aWKqolNnu6hHiCqswrdogZEQIS0qjnlFl4j7NKKwVWU6rvggSJN?= =?us-ascii?Q?yHZWRDxw6V+gsfLyQa1vDogQxSBKOBjt9jIcRGaJaQxRMwKCU25HDACWPyMp?= =?us-ascii?Q?3AmX1GtY0Pn+/6sc3vO2wBIajwJSM1+A0UQw3z3EAB7kLHxdIwoYnA9DiHjt?= =?us-ascii?Q?u2qWmFPomTcIIUAEdVROpPyayZFKxewOwfqW+qZMI4J/BnKhws95rHC0RJAF?= =?us-ascii?Q?PkvbkKJRj9w39loAuZYDvie4GPSfVKv7LXP7gKJM2VcnMv3oSA2SDjXkSE+r?= =?us-ascii?Q?R3YzQvbTc6cIa2xVT6iW2OajLVOrBsM1Q5zII/XoS5UfkjjgOA6up8TIqO6S?= =?us-ascii?Q?OFnaDsJ6sHTFBFvL8nuX3BvhfpI//BDDyDyrcZLfIBZpAp1ISdkpnasIlUJf?= =?us-ascii?Q?GqjFt+cVWrulFt3KKMbz8z/+cjrIsjeX5v8BFxbVM9+35KhgDXM6EoFD/+5O?= =?us-ascii?Q?DykXZl5pHWpZHl7a4h+ZHANR2rGJyn3g38PK6suiIOn+uR2vucgQQTjE7B79?= =?us-ascii?Q?umuRM9J5jg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 418a1081-443b-4b03-3d9b-08da26a7dce3 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2022 10:39:23.2995 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LcQlBGeV3HB6Kxg0/FxWMCHu4xk0JKLATnmM0xTtR1rhA6lBKmqbzIRH0SY/JZj2uP66+7vwOWImXQLzH1gIew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR84MB3064 X-OriginatorOrg: hpe.com X-Proofpoint-ORIG-GUID: t4t-eHw2mF_qfY9gKgSbIAx8YFt_EVSB X-Proofpoint-GUID: t4t-eHw2mF_qfY9gKgSbIAx8YFt_EVSB X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-25_06,2022-04-25_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 spamscore=0 phishscore=0 mlxlogscore=999 clxscore=1015 suspectscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204250046 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks. Reviewed-by: Abner Chang > -----Original Message----- > From: Gerd Hoffmann > Sent: Monday, April 25, 2022 6:35 PM > To: devel@edk2.groups.io > Cc: Jiewen Yao ; Oliver Steffen > ; Leif Lindholm ; Pawel > Polawski ; Hao A Wu ; > Chang, Abner (HPS SW/FW Technologist) ; Liming > Gao ; Ray Ni ; Jordan Justen > ; Jian J Wang ; Ard > Biesheuvel ; Gerd Hoffmann > > Subject: [PATCH v6 2/6] OvmfPkg/FdtPciHostBridgeLib: io range is not > mandatory >=20 > io range is not mandatory according to pcie spec, > so allow host bridges without io address space. >=20 > Signed-off-by: Gerd Hoffmann > --- > .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 45 ++++++++++--------- > 1 file changed, 23 insertions(+), 22 deletions(-) >=20 > diff --git a/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c > b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c > index 98828e0b262b..14b41a533e96 100644 > --- a/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c > +++ b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c > @@ -292,13 +292,8 @@ ProcessPciHost ( > } > } >=20 > - if ((*IoSize =3D=3D 0) || (*Mmio32Size =3D=3D 0)) { > - DEBUG (( > - DEBUG_ERROR, > - "%a: %a space empty\n", > - __FUNCTION__, > - (*IoSize =3D=3D 0) ? "IO" : "MMIO32" > - )); > + if (*Mmio32Size =3D=3D 0) { > + DEBUG ((DEBUG_ERROR, "%a: MMIO32 space empty\n", > __FUNCTION__)); > return EFI_PROTOCOL_ERROR; > } >=20 > @@ -333,13 +328,15 @@ ProcessPciHost ( > return Status; > } >=20 > - // > - // Map the MMIO window that provides I/O access - the PCI host bridge > code > - // is not aware of this translation and so it will only map the I/O vi= ew > - // in the GCD I/O map. > - // > - Status =3D MapGcdMmioSpace (*IoBase + IoTranslation, *IoSize); > - ASSERT_EFI_ERROR (Status); > + if (*IoSize !=3D 0) { > + // > + // Map the MMIO window that provides I/O access - the PCI host bridg= e > code > + // is not aware of this translation and so it will only map the I/O = view > + // in the GCD I/O map. > + // > + Status =3D MapGcdMmioSpace (*IoBase + IoTranslation, *IoSize); > + ASSERT_EFI_ERROR (Status); > + } >=20 > return Status; > } > @@ -413,17 +410,21 @@ PciHostBridgeGetRootBridges ( >=20 > AllocationAttributes =3D EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM; >=20 > - Io.Base =3D IoBase; > - Io.Limit =3D IoBase + IoSize - 1; > + if (IoSize !=3D 0) { > + Io.Base =3D IoBase; > + Io.Limit =3D IoBase + IoSize - 1; > + } else { > + Io.Base =3D MAX_UINT64; > + Io.Limit =3D 0; > + } > + > Mem.Base =3D Mmio32Base; > Mem.Limit =3D Mmio32Base + Mmio32Size - 1; >=20 > - if (sizeof (UINTN) =3D=3D sizeof (UINT64)) { > - MemAbove4G.Base =3D Mmio64Base; > - MemAbove4G.Limit =3D Mmio64Base + Mmio64Size - 1; > - if (Mmio64Size > 0) { > - AllocationAttributes |=3D EFI_PCI_HOST_BRIDGE_MEM64_DECODE; > - } > + if ((sizeof (UINTN) =3D=3D sizeof (UINT64)) && (Mmio64Size !=3D 0)) { > + MemAbove4G.Base =3D Mmio64Base; > + MemAbove4G.Limit =3D Mmio64Base + Mmio64Size - 1; > + AllocationAttributes |=3D EFI_PCI_HOST_BRIDGE_MEM64_DECODE; > } else { > // > // UEFI mandates a 1:1 virtual-to-physical mapping, so on a 32-bit > -- > 2.35.1