From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.18773.1642996022962160743 for ; Sun, 23 Jan 2022 19:47:03 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=ozrdWLtO; 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.143.35, mailfrom: prvs=00231bd929=abner.chang@hpe.com) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20O2CAWE006734; Mon, 24 Jan 2022 03:46:56 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=UL9Pd6oYxHlGIKMQWD90oUQTIiaJ/AnKq7UDBDI8mQc=; b=ozrdWLtOjlxtjkyAI+3O9hiYKHw/DVOXb/I15ogLd7npDH3v552/JaS2ulOvcyqgq4n7 LhyYkLbRpZji4CJSz1v8p7RiqcFcYP694J/PpZwcrCyhKVVcjqnvMP7pc4G9o1P6WUyR wuq0xXOHnPQbEk8X9TFj3iyE5qTtkXki5IDKGTSMvmb4rx4hkGf99ZkS/LE0hQpcXAFH vFhESOntVd3BWqbFSBPd/51a9/OcHQfiP2i/mpSssBvRfclDPA4gasbtPzLRBJnhpIwo bBEHUmIKPWJtqqgCcz8Jirs7dSm34aFMTZV1lCIaOmnE1odF9sANZw6iGBYTs5e00PXW Xg== Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3dsf5n9gp3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Jan 2022 03:46:56 +0000 Received: from G4W9119.americas.hpqcorp.net (g4w9119.houston.hp.com [16.210.20.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3427.houston.hpe.com (Postfix) with ESMTPS id 2FBAF57; Mon, 24 Jan 2022 03:46:55 +0000 (UTC) Received: from G9W8454.americas.hpqcorp.net (2002:10d8:a104::10d8:a104) by G4W9119.americas.hpqcorp.net (2002:10d2:14d6::10d2:14d6) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 24 Jan 2022 03:46:54 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (15.241.52.10) by G9W8454.americas.hpqcorp.net (16.216.161.4) with Microsoft SMTP Server (TLS) id 15.0.1497.23 via Frontend Transport; Mon, 24 Jan 2022 03:46:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ehw5oDCXghxtFvkhoUrVC4WQSW+tgLN/Md1dACJYROp1Mc073KfCUa/O0QC1KS0ZWPj2vvgyoDHB0bkquqUfHG37jQi/r8GGz0Tk8wb8nHx/AklLSM/H0ClZED0zFsBUabQpL3gZODh1h3uQOGnMAN+JC7AP/Hya73f7sH1M/OVs4h8xHNA8kkpna4gCHR1G7pDuQ/ZljmN6r6UnMin0kng5Ou+wpYO0Rq7E7ClmDweC/6dR+tqIJb1yte/0dIgxr8Q12RPMSdk+rBIdhaih+VfWw5UzHJQEz/2dc/kNQHoPw1D/RtxtgAZv/xDB8M0O/d3Xm8OmvdzSzoWMVMkCrQ== 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=UL9Pd6oYxHlGIKMQWD90oUQTIiaJ/AnKq7UDBDI8mQc=; b=JO7orZA8FmAVLTSzGHSH7dhMcTWEzC6ZSfTI1RD1/HRaxrI2mNRQWwX3h+tfCog5Za0hxTnIt2VZV6hhliT9SBZff5EFo0th0/pc6RkG5Xh6ra3G5PsOGoxxtdTKPPxP+uoNfsJOYZpp7M8EInz+b+IefqMZXLRRGrAo/h+mZ+MbfQlYcxXw1JxDsSxgcKWBu6c1rMo3xkqC/dIVkyfBhAxEc1Dj7i4hElb3Q3rMIfj46NFKMVEddrbOvAJD+CxGqREH6x5QJwvXnZ5/y2KrQFQD3XGvCe+8rlhnUKAN4MeaP6KyO0zQQIBr4omGn9f79qdyhiI8VesimFZWjegT0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:154::18) by PH7PR84MB2029.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:154::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.17; Mon, 24 Jan 2022 03:46:53 +0000 Received: from PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM ([fe80::29fe:6cc2:38e0:4b55]) by PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM ([fe80::29fe:6cc2:38e0:4b55%7]) with mapi id 15.20.4867.011; Mon, 24 Jan 2022 03:46:53 +0000 From: "Abner Chang" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Ray Ni , Liming Gao , "Jiewen Yao" , Jordan Justen , "Leif Lindholm" , Ard Biesheuvel , Jian J Wang , Pawel Polawski , Hao A Wu Subject: Re: [PATCH v2 2/6] FdtPciHostBridgeLib: io range is not mandatory Thread-Topic: [PATCH v2 2/6] FdtPciHostBridgeLib: io range is not mandatory Thread-Index: AQHYC4lKJTvf9h4kQUOc9jtGv/BmaKxxkmoA Date: Mon, 24 Jan 2022 03:46:53 +0000 Message-ID: References: <20220117100146.1965662-1-kraxel@redhat.com> <20220117100146.1965662-3-kraxel@redhat.com> In-Reply-To: <20220117100146.1965662-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: 5552f4c5-3d8f-4e59-0a25-08d9deec2908 x-ms-traffictypediagnostic: PH7PR84MB2029:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UUApDKhBv4t9RF76TtfAZvUs0H5J8Nyq0lv1yURHaPoIRTKVCZTQO3Au0Tu8S9IVJb1YsCCbgBHxWovsjPsXr9DK4m9enhoqQHGoD8+x5eYJ8BiYbEKq4b9K+55BrZl3OoSyqRtK3WvFxZ1HOoDDk6d8WZIN8VIc4yqmi4CXBMfj+z8mwadscXAlo0D3OI9NhQ7TZAQ8v4l/0KXdEXeBFy56aP13uTPv4imz2FyY+BQxSx0mMs4125BpB8uwlMdRHToP5FEWkOinp1+gjD2Nv7+uVotimjYTQd00ArhY2wrAxg0ZR8dkb+rIZ3YFpwOwO9HvKwVhL+Nn00soVHwT/t++iU5bX0J+7/UmWFOJDrP6UwyP0IOBq3E4a5vE9mlDZdY874r7tbY0W4HhF0wIXxoYAGsIQBfPzlol0pPenBHs6ei+DjcC/0U4We0mg2fqgE7qaYItwrPqLD5YS/SXp+i4b9ilkSy8pzBHAMv3tFrV3lecRRFvn5FJi2o1UhSzE96cLzEDot7DPdFbLr7D4unyhwGNHBINU/LWt2Y45vlKxVFYfnOCV1r/KaEU63szjgtwfjU0deQCt+sTlSsuEmqWg3OXJlgmVba7GMVF+kjgE1QrbfL977ndlW8U5rtuBt3MlsgRT3x0+032F/Ya21wKCKNCvbkBzHjW1HvzkouLqUzMogvvhuhMgo/jUv/+LocjKh+Qbksa3e5WNFkOgxBJ606eR4lGd7vRZQ409m4= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(66946007)(66556008)(64756008)(66476007)(66446008)(53546011)(26005)(6506007)(38100700002)(52536014)(5660300002)(508600001)(122000001)(71200400001)(82960400001)(9686003)(76116006)(186003)(7696005)(8936002)(86362001)(110136005)(55016003)(7416002)(38070700005)(54906003)(8676002)(83380400001)(33656002)(2906002)(4326008)(316002)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xI+lbOflpsRhVKB6Z5Z+eVEkd9droWpiMft+mpptQe5nN2ve6W9K2XCESGhh?= =?us-ascii?Q?MEerH9Mi8Ek2KM/Fg9l5SXeKf+FqigC0dx/DXqaqBpLx7UdApAVGN/UMFghX?= =?us-ascii?Q?URob8OvZmZpbn8jC5P8JqK7FpYT9Licn7AdIaMdcmIyIGAyMQHPYPcYjDFRR?= =?us-ascii?Q?nBDM/1x7Ghu3JKxUi92lmasK20JJ/PWWBTf/RaFwCk/IjTcOChqWFZfCvKGr?= =?us-ascii?Q?wxvYyb1YW4G2j+IJ96j2N2Xxt45W2g/pXVdnHCbL4YroOsA9irSfoHHBbM09?= =?us-ascii?Q?B0/BXlkWGdABpFq/Fwp8z4hjFaZwirSB+2SeahclYMSIBGSHLEt50c8mkVsM?= =?us-ascii?Q?qxOxROfpgImhjWNgQteCCwgW3NZ9gHme1vCuBE3AayVfyQB8Kd0OPETc5Fx6?= =?us-ascii?Q?+fOJbZXKp1wP7vXxPV+6ZZ3hYbYWIiSBQOBcZmEmx061bwUOtW2KHYaT2ivD?= =?us-ascii?Q?r7lGLOggxkUD29/o0HX3obodwhL51pLcXROG10w5MmwqY2n3XOXi2iaj6+tE?= =?us-ascii?Q?T0DN+TCUIH7AZK5jMOzGn/BWLcF4V1wyhSJaH61H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ZYx/XiV3OhQ4F1VW757CAztBYB7Tll8n0550rZQdIwIgZNGvk1Ri?= =?us-ascii?Q?1vQfM9tf1VB2qeOujCn5VZCWUGtclgcs91EJhrjroUiyruxupnbmbsxlULsP?= =?us-ascii?Q?BlY0Jqt0ZvlbY4w3WyFdYCAfPGB3g+JLZSWKs0YfowPHkkp4uzisSeJoqOn4?= =?us-ascii?Q?cGhJD0dV63cw1pTq1umhafE=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR84MB1885.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 5552f4c5-3d8f-4e59-0a25-08d9deec2908 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2022 03:46:53.0739 (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: hEpMMTe48jHAR5L3RIKIRBnbGKm/l1jzqC7UiXZ7vSQQsKJrj7I6PuKZKmASHoYuc1Kbadn3NlBBbiRz6u8Dqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR84MB2029 X-OriginatorOrg: hpe.com X-Proofpoint-GUID: jYVvCUrawnFQzh8nuY5ILQuff2CPDeit X-Proofpoint-ORIG-GUID: jYVvCUrawnFQzh8nuY5ILQuff2CPDeit X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-24_01,2022-01-21_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 mlxscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 adultscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201240023 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Gerd Hoffmann > Sent: Monday, January 17, 2022 6:02 PM > To: devel@edk2.groups.io > Cc: Gerd Hoffmann ; Ray Ni ; > Liming Gao ; Chang, Abner (HPS SW/FW > Technologist) ; Jiewen Yao > ; Jordan Justen ; Leif > Lindholm ; Ard Biesheuvel > ; Jian J Wang ; Pawel > Polawski ; Hao A Wu > Subject: [PATCH v2 2/6] 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..823ea47c80a3 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) { > + // > + // 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) { Compare IoSize with 0 to follow edk2 coding standard. Abner > + 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) { > + 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.34.1