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.5799.1650448213029083396 for ; Wed, 20 Apr 2022 02:50:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=L1tPVfR3; 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=01094f280f=abner.chang@hpe.com) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23K4mXjP000718; Wed, 20 Apr 2022 09:44:54 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=ifbS3q4G1psAMktKBmgt30btXj2bwjC+6hHUPA+dP10=; b=L1tPVfR3pk4ljcLcES9AEPHp02EABbqbqStFrvfgW5I7ifj34EAQTVeF+Zzoux2rkbB9 YEg9PyC2o48Yuiz5AGA6MhVICgkL5zrDwogvN7PXdtLAJot9MT8xzIm6jgU11jjAZHDC aEjTvSrVZ89p8iSaNkZtC4etMi0hKdiLz5gZOcO8AFQZIiiZOuHQt/l9O7NmM44Q9Dy7 ujGCWPM51pmRsITDq3QzaaWM25IDRxJGToAIXlp6gVNBexZ9Mqp9T0O8yWQq529hQaYJ x8FS+5N/vjKjIGVXT709tcRgVx//vunY/E5YsuwnilJNRVDdV7BpBvgHxiPsXQHeR45s MA== Received: from p1lg14879.it.hpe.com (p1lg14879.it.hpe.com [16.230.97.200]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3fjbfjjc9n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Apr 2022 09:44:54 +0000 Received: from p1wg14925.americas.hpqcorp.net (unknown [10.119.18.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by p1lg14879.it.hpe.com (Postfix) with ESMTPS id C66DA13083; Wed, 20 Apr 2022 09:44:53 +0000 (UTC) Received: from p1wg14926.americas.hpqcorp.net (10.119.18.115) by p1wg14925.americas.hpqcorp.net (10.119.18.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Tue, 19 Apr 2022 21:44:26 -1200 Received: from p1wg14920.americas.hpqcorp.net (16.230.19.123) 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 via Frontend Transport; Tue, 19 Apr 2022 21:44:26 -1200 Received: from NAM02-BN1-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; Tue, 19 Apr 2022 21:44:26 -1200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mdzVqs5NLEFP5ZFyHVRt8dxpifUKjSRC+XAvxBevP1cGY1iwTslyWLo7VxOFTaMcbF3YObcychIuM96MtEHuJj6wH3fuQYeximZ3jT4zCM7LkD+UX9aVAiR5Os8aRDO6gGG5aMEU3Tr46ec/cBbdE6CIaYonpo/VMml5gAUR+LRb+6k4rMYaiOZUZvczOnUu+C8e4PPw9KkLHVCL7fhtI3UCBP3te2e8BIZxddPGyVDH7Sa26GiacLLm2At7Q3fTO9hcQRErNCIOlgQG7gdCU9E90ttGTJtrkEuFf5BtGgdcACmuZzejoqIv8vV7p3F5T/MiatDtXDlIe26pI8VkqA== 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=ifbS3q4G1psAMktKBmgt30btXj2bwjC+6hHUPA+dP10=; b=Gj4mJUWx7iumbUQKKOjZTeNdhJ58Muet6dIZG6tZwQp+YcOycLlAcETTQbDMDVsxBiehteEVmdvylj6zTqzN+COtOqs4lZM+HJH0vhUmgGTOUcVBbKAhvEckVsXTAHd5SSy6heR0UuXHKbdXTTHuPBC8N1E66eXp5VVb/iOC7WSHuHA1IUMy1B+NGHNT7rxzl41AqLDVIz17/7/P/rsJ4xE/d3pDwo88pBHWgG2m6/QYtBjnleIxMZR2SvP2XRFMgmSHPG3h+1vkvSeXlH4i+2DNdEpF2sMNrdvLxR0UGzShg05BDseKFGWT1MLkWqbOsZyg3U5ANb02oxt/R9IIDQ== 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 MW4PR84MB1921.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1b0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Wed, 20 Apr 2022 09:44:23 +0000 Received: from PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM ([fe80::cc95:6a61:fb46:aed1]) by PH0PR84MB1647.NAMPRD84.PROD.OUTLOOK.COM ([fe80::cc95:6a61:fb46:aed1%9]) with mapi id 15.20.5164.025; Wed, 20 Apr 2022 09:44:23 +0000 From: "Abner Chang" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Leif Lindholm , Ard Biesheuvel , Jordan Justen , "Jian J Wang" , Ray Ni , Hao A Wu , Jiewen Yao , Liming Gao , Pawel Polawski , "Oliver Steffen" , Ard Biesheuvel Subject: Re: [edk2-devel] [PATCH v3 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory Thread-Topic: [edk2-devel] [PATCH v3 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory Thread-Index: AQHYSmKLbBt7zfC830SDabFgkVUBzaztV/HQgAAvqQCAAFuB4IAJZwKAgAFXZoA= Date: Wed, 20 Apr 2022 09:44:23 +0000 Message-ID: References: <20220407093304.1551182-1-kraxel@redhat.com> <20220407093304.1551182-2-kraxel@redhat.com> <20220413081216.l6j33a7emc3yy2qq@sirius.home.kraxel.org> <20220419131447.uglm3edvgawxfaky@sirius.home.kraxel.org> In-Reply-To: <20220419131447.uglm3edvgawxfaky@sirius.home.kraxel.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 26a5e2b2-d133-41a2-bd9f-08da22b25a30 x-ms-traffictypediagnostic: MW4PR84MB1921: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: 31fuRE+Lm7jd7R1h+uXKQgMyieHgqBBr2PK4cX/AoPdKuurUYlMbaYVXMZl6jbqxQjeQ5INXukDnIMLhIlSsk3GFXpYE7wndYkrJpgS0z0s5YbV8v5clnKT/VwW9WAU1ySIDG6mfZN/oxoVefXjRC3dhjrq0xkwZ9MWzinSFv+A79mlOgoH/V3h8Isp9X+PopqQOBnrbrHo9r//uR9bPjgKkTVlZTmArV7YvnjDcAYtNTp5f2yBOnMhJt0Hfxhw3r9rJL7q6KKiW52QPUmZOhkvLlYsUIS1yTMrxiVXIfC8KfNj8+pZYIJ+pF2uLbvziWfqYLdChxpgOJkPStCk1CtsbW0Ec1nerHeNGFByjCxhUAO4RyGKljKFH4lOLkn45cpfY4v5gBXStjTdHsHyZ5H+T3K1tnC4ZAnefVcCz7Y2p6BnKLx8Ao2ARm7DVDWkvWtqcJ4y2EdUvdcV2VWakDrRVtfk+GIt+rsq2Sxt9Vgll/6xvqaOlluWhhcEDeljC3B25kfZn9wkmzFJceovWl0jEpAvup1GG72u88sQUp+kmf9CEqleFWPQOKqJ9T7CwcT2hm5qGuXDMRfGfJ2dH0DmQDhQrkVMeWChZ0eb2amjcwGQkrPa8lBOq9VELdvTsBtt8VuCZE0wiI/Vltea2UJ8nAqM4VhoEULu2LEJjq186o0QBXdddu/o61JaP4WiKCWsxZvf1KvuH9Rdzcao0Pw== 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)(38100700002)(122000001)(38070700005)(82960400001)(316002)(66946007)(64756008)(7416002)(4326008)(55016003)(66446008)(8676002)(110136005)(54906003)(76116006)(71200400001)(66556008)(66476007)(7696005)(9686003)(2906002)(5660300002)(53546011)(6506007)(83380400001)(86362001)(508600001)(52536014)(186003)(26005)(33656002)(8936002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?175Mha69iwhelIzPXIDERb0Sj0s02govMJnSPEKYsqcEhiNW4LzWh/Lzc+2v?= =?us-ascii?Q?ZQt06jCQoOhEQkE4vEWMcKokQW3QvN7WWWlKBThHGbCufVx6808Yhjo8cB5v?= =?us-ascii?Q?8+M+GWfpQ+eK1BPGswuTNCB6Tvru4VLSskWXvtfeKhlnvrhjH9L8baYCGBfl?= =?us-ascii?Q?J7NOqZncPqKTYR5Y17TsKaX6REj9GLL3kt0vwn4A+/yL+glP3itUDetWq+yF?= =?us-ascii?Q?7kO4HtgqXF+o6KMsVRl6gWgdp3kEYfj6KG1vIm6tMreJEMBMdXCliR0MfQEw?= =?us-ascii?Q?UMznkydS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kNiFOfrGwd50LUf0ZBAx?= =?us-ascii?Q?rrhe+Obw4MFNVcw22CF3gVyl+ICKL2T7vIK70n4uEHX0lnlYHuMl0471WRxQ?= =?us-ascii?Q?FADqqzgqwBirGE7CM9waSZU27yRwObxZBHdAdGqXGItGEy8HcCO5rrZbvHvo?= =?us-ascii?Q?pQ+st0fuqolzrZXShabWGxFNSaNnYj9jdNtjqO+YB1oZR+ik6S+jr1kbKBz1?= =?us-ascii?Q?WXUlmf/UnjFUAiPAJWTDfwuVgFxq+88JkvMir3W0GIgw7plKcD48EzkvVTX8?= =?us-ascii?Q?62Za8roVTb+SRWiI/9XtFJxkaLiHeLv37UWVy/icrs0tVKqg4tRHqh4xcvZW?= =?us-ascii?Q?RizEWcCmVCgBvBVzE1bKJ71QDhHxQxFOGazOUs3GwgHLmuSKY0WRC4tbjeQ6?= =?us-ascii?Q?BSLzqFapjUr0AkJAYmGyOlIxyAuk0Hgc8urNZU372PmScvx9j99GPp1py/BI?= =?us-ascii?Q?Q2fDkH6KDAnf9r/9vifKg4eI6EPfiSAokaohhZmTjDTDCDwSm+kSPLXcWqrk?= =?us-ascii?Q?iopu4CfBgj4Ad2l1lyulfrAjJQrS+/GugghiQnY95otnjHZzj/ZB/75vRnRT?= =?us-ascii?Q?HPTCuj6gcA=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: 26a5e2b2-d133-41a2-bd9f-08da22b25a30 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2022 09:44:23.7451 (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: t+lHFb82W/qhTaty7apeeFMEs8JZApxpfY5jOaE8G28rWwI4wuItcVeP56S3OPNZLyC7izgZkzcBgDEbYfotSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR84MB1921 X-OriginatorOrg: hpe.com X-Proofpoint-GUID: QHyi6gFios0WvneUUZC4ayzOflNyJWGk X-Proofpoint-ORIG-GUID: QHyi6gFios0WvneUUZC4ayzOflNyJWGk 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-20_02,2022-04-15_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204200060 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Gerd Hoffmann > Sent: Tuesday, April 19, 2022 9:15 PM > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) > > Cc: Leif Lindholm ; Ard Biesheuvel > ; Jordan Justen ; > Jian J Wang ; Ray Ni ; Hao A Wu > ; Jiewen Yao ; Liming Gao > ; Pawel Polawski ; > Oliver Steffen ; Ard Biesheuvel > Subject: Re: [edk2-devel] [PATCH v3 1/6] MdeModulePkg/PciHostBridge: io > range is not mandatory >=20 > On Wed, Apr 13, 2022 at 01:44:55PM +0000, Abner Chang wrote: > > > > > > > -----Original Message----- > > > From: Gerd Hoffmann > > > Sent: Wednesday, April 13, 2022 4:12 PM > > > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) > > > > > > Cc: Leif Lindholm ; Ard Biesheuvel > > > ; Jordan Justen > ; > > > Jian J Wang ; Ray Ni ; Hao A > Wu > > > ; Jiewen Yao ; Liming > Gao > > > ; Pawel Polawski ; > > > Oliver Steffen ; Ard Biesheuvel > > > > Subject: Re: [edk2-devel] [PATCH v3 1/6] MdeModulePkg/PciHostBridge: > io > > > range is not mandatory > > > > > > Hi, > > > > > > > > diff --git > a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c > > > > > b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c > > > > > index b20bcd310ad5..51a3b987967f 100644 > > > > > --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c > > > > > +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c > > > > > @@ -1085,6 +1085,9 @@ NotifyPhase ( > > > > > RootBridge->ResAllocNode[Index].Base =3D BaseAdd= ress; > > > > > RootBridge->ResAllocNode[Index].Status =3D ResAllo= cated; > > > > > DEBUG ((DEBUG_INFO, "Success\n")); > > > > > + } else if (Index =3D=3D TypeIo) { > > > > How do we tell the BaseAddress is set to UINT64 because > "(BaseAddress < > > > Limit)" or "gDS->AllocateMemorySpace()" returns error in > AllocateResource() > > > for TypeIo ? > > > > > > Does the reason matter? > > > > > > io resources are optional, so if there is no io address space availab= le > > > it should not be a fatal error, no matter what the root cause is. > > If the device requires I/O resource however the io address space is not > available, shouldn't this an error? >=20 > How do you figure that? >=20 > The PCIe spec requires devices being fully functional without io address > space resources, so in theory this case should not exist. In practice > things are not that simple unfortunately. But the pure presence of an > io bar doesn't imply it is actually required. >=20 > I think we can't do much about that at this point. An actual driver for > the device which has more knowledge about the device would be in a > better position to figure whenever not having io resources is a fatal > error or not. Ok. >=20 > > > > Is "else if (Index =3D=3D TypeIo && RootBridge->Io.Base =3D=3D MAX= _UINT64)" > > > more reliable? Or I missed the code logic here? > > > > > > I think it is not needed, but if you think it is better that way I ca= n > > > change it. > > This is more clear to reader. That means that we don't have to treat it= as an > error on the TypeIo if the base address for it is MAX_UINT64. >=20 > Ok, I'll change it. Thanks Abner >=20 > take care, > Gerd