From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.54]) by mx.groups.io with SMTP id smtpd.web10.4275.1582198433614389637 for ; Thu, 20 Feb 2020 03:33:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nxp.com header.s=selector2 header.b=qs8mMQZY; spf=pass (domain: nxp.com, ip: 40.107.6.54, mailfrom: gaurav.jain@nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OFmUzCt6u2HvmGbspJ4iNBQvMa4GdzYNiQXNkYr4in4J0U+2HKj2V6NlVx4PUMw+hi35jsNxLtRKXxrWu686QU0HNqwKNGLREY5w5TWAxq1w3uQhypSEWAFOb7+bj9n3o9iuAakLUowaz4yBzWm0nhi4idOs7F85FDSKIOJweFjb7vR9t5v8EVz7zEVJoo6WoBLhOEneWegMq575qtvS/D7AGh2Qs/316McEYbnyamZXu+PbFNTMNyG/DaPIslDuWYsc3Y77yWPDpv3g4N1L6paGNDgERKCk8ZvrQQOOGPrCFAFWE+6tiCnjUjyGz1Gsnm5Ab0PptquqQWovyMdLlA== 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-SenderADCheck; bh=aON8KalopaH5TFN/uKPI4E+Qh0aHuZKxY/lVc9iGH7M=; b=QtXOv4yVWsFOk8cirgnkvWi2IEnKCs73PuSXIyksxd/+EdgW1EGqmGakkRqJtTKrkR7XazwRA58CSy9OVtMLvJQdJhx2GVcCk1EJ47Ef0A+ObVORpNxUg5RKrKj3mu+egfmE4MJnxbpWwpDiZrP4lgLLTI0u+JJmSzp6/6X48YtJDBhH+y9gE3ccRykGQZWYeGePHEc/H/tYiPU6cDaf7BNiz1xztyN0MU5EK2OROF/wPigbac641gMwiIJgtJzAomHX5zMkKEaydB12lhhufo/d6Xm2JzKu19G6JXCfbLDQ5CsiMN3GyGOx6AUKsAI8fA4bWrxQZZ4Sn11uhhtzWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aON8KalopaH5TFN/uKPI4E+Qh0aHuZKxY/lVc9iGH7M=; b=qs8mMQZYZLcEe1sTNjcKS4JN3eUcha5jEWFB0gXC/1l/7sXNdoVf5yXlBa6OAwYoHjP9D1gzsQi/4oKx3Kyb5Qapx7D4NyU6K+z21K++D0undmnCpMoasQSvP/qiKvypQ5i5zdra0gpSYhewoL8zkkwhcW3dgljoEiH1bPmlf0E= Received: from DB7PR04MB4091.eurprd04.prod.outlook.com (52.134.110.144) by DB7PR04MB4970.eurprd04.prod.outlook.com (20.176.232.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.22; Thu, 20 Feb 2020 11:33:51 +0000 Received: from DB7PR04MB4091.eurprd04.prod.outlook.com ([fe80::183:969:2508:3c92]) by DB7PR04MB4091.eurprd04.prod.outlook.com ([fe80::183:969:2508:3c92%6]) with mapi id 15.20.2729.033; Thu, 20 Feb 2020 11:33:51 +0000 From: "Gaurav Jain" To: "Wu, Hao A" , "devel@edk2.groups.io" , Ard Biesheuvel CC: "Wang, Jian J" , "Ni, Ray" , Pankaj Bansal Subject: Re: [EXT] RE: [PATCH 1/1] MdeModulePkg/Pci: Fixed Asserts in SCT PCIIO Protocol Test. Thread-Topic: [EXT] RE: [PATCH 1/1] MdeModulePkg/Pci: Fixed Asserts in SCT PCIIO Protocol Test. Thread-Index: AQHV10XR5XjIzUYbAkmv942vGaqAFKgiJYBwgAHu3wA= Date: Thu, 20 Feb 2020 11:33:51 +0000 Message-ID: References: <20200130133804.32261-1-gaurav.jain@nxp.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=gaurav.jain@nxp.com; x-originating-ip: [92.121.36.197] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: e21121af-1c1a-4d25-77d9-08d7b5f8c276 x-ms-traffictypediagnostic: DB7PR04MB4970:|DB7PR04MB4970: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 031996B7EF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(396003)(136003)(366004)(346002)(376002)(199004)(189003)(53546011)(6506007)(186003)(478600001)(26005)(54906003)(4326008)(110136005)(71200400001)(316002)(7696005)(86362001)(8936002)(9686003)(55016002)(66946007)(2906002)(66476007)(66556008)(64756008)(66446008)(76116006)(52536014)(5660300002)(33656002)(81166006)(8676002)(81156014)(44832011);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4970;H:DB7PR04MB4091.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bwtDJuvZsrzK50GMdJuehUDW8vpEYjGyy9avgUmvvbsTZkcdm2L3/aCksUNdN5L7Z0OkM2P3/lDROctoddkAMXw6US8hElN9jZN8d6JnkyN38kjdTxDMzvS43Ks74xxVoATwsu7SQwlRn2A8RNLgPqfN4Cj+qy1TAHl7avDhys5k9qF+Wik9IrGHL4hvjrsinJ+2lbTNceSUKoVlflt3b5NTfs0bIZDYrYsNpBaRq5kajI3qlbTldsdJFt3dv/sZpQI+kIa1fm80Llv+5w2Pld76dgfP0XTn6w8/Xt3PzsipXeV7tMo07vj9v6s/6vR1gj+rhAOz5UZUUBFvQ6DTx3momAUfb0ts4jW2Jp7eLJStLRtcEHWnPKKn+ovmWTzesk91BbNVOV05M5JeZM5ncJnHJJ+3Vc5p/Bka7Gfe6426DYmkAN+iM/s27wgvUHz6 x-ms-exchange-antispam-messagedata: v6oxNAUPW++pIWGm8AVCkY+rk/A3LTBpgaiGl6ypQB62wLZbLcjzsUMLsUjFk/tmCIANOkxbfKyySliTzfkFlXlao03LP6rtuEVnIw/1YiRFUtMf61Kvp+H3h1l5GwEcdAvkkui7D22YMO0g6sLtLA== MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e21121af-1c1a-4d25-77d9-08d7b5f8c276 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Feb 2020 11:33:51.4305 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yq/EU0mrZS1STkR4+NCM1m/DhRykJKDlWMKdzB47BlxnFXyFHAvad9cQKLyi3XxBoPmjnCzBh4fi3rjfQhuCew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4970 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Wu, Hao A > Sent: Wednesday, February 19, 2020 12:04 PM > To: Gaurav Jain ; devel@edk2.groups.io; Ard Biesheuv= el > > Cc: Wang, Jian J ; Ni, Ray ; Pan= kaj > Bansal > Subject: [EXT] RE: [PATCH 1/1] MdeModulePkg/Pci: Fixed Asserts in SCT PCI= IO > Protocol Test. >=20 > Caution: EXT Email >=20 > > -----Original Message----- > > From: Gaurav Jain [mailto:gaurav.jain@nxp.com] > > Sent: Thursday, January 30, 2020 4:18 PM > > To: devel@edk2.groups.io > > Cc: Wang, Jian J; Wu, Hao A; Ni, Ray; Pankaj Bansal; Gaurav Jain > > Subject: [PATCH 1/1] MdeModulePkg/Pci: Fixed Asserts in SCT PCIIO > > Protocol Test. > > > > ASSERT in CopyMem_Conf, PollMem_Conf, SetBarAttributes_Conf > > Conformance Test. > > SCT Test expect return as Invalid Parameter. > > So removed ASSERT(). >=20 >=20 > Include Ard (as the driver contributor) to see if he has additional comme= nts. >=20 > A couple of general level comments: > 1. I think the ASSERT can still be added after the checks you add. The AS= SERT > may serve as a notification in the DEBUG image that the service is not > implemented. >=20 > 2. I found that for functions: > PciIoPollIo() > PciIoIoRead() > PciIoIoWrite() > They also do not have checks that perfectly match with the UEFI spec. = Even > though they are not exposed by the SCT tests, could you help to addres= s them > as well? >=20 > Some other inline comments below. Done the suggested changes and sent v2. Please review. >=20 >=20 > > > > Signed-off-by: Gaurav Jain > > --- > > .../NonDiscoverablePciDeviceIo.c | 20 ++++++++++++++++--- > > 1 file changed, 17 insertions(+), 3 deletions(-) > > > > diff --git > > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverableP > > ciDeviceIo.c > > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverableP > > ciDeviceIo.c > > index 2d55c9699322..76cb000602fc 100644 > > --- > > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverableP > > ciDeviceIo.c > > +++ > > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverableP > > ciDeviceIo.c > > @@ -93,7 +93,15 @@ PciIoPollMem ( > > OUT UINT64 *Result > > ) > > { > > - ASSERT (FALSE); > > + if ((UINT32)Width >=3D EfiPciIoWidthMaximum || >=20 >=20 > Looks to me that the 1st part of the 'if' check is redundant. > Could you help to double confirm? >=20 >=20 > > + Width > EfiPciIoWidthUint64) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + if (Result =3D=3D NULL) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > return EFI_UNSUPPORTED; > > } > > > > @@ -556,7 +564,10 @@ PciIoCopyMem ( > > IN UINTN Count > > ) > > { > > - ASSERT (FALSE); > > + if ((UINT32)Width >=3D EfiPciIoWidthMaximum || >=20 >=20 > Looks to me that the 1st part of the 'if' check is redundant. > Could you help to double confirm? >=20 > Best Regards, > Hao Wu >=20 >=20 > > + Width > EfiPciIoWidthUint64) { > > + return EFI_INVALID_PARAMETER; > > + } > > return EFI_UNSUPPORTED; > > } > > > > @@ -1414,7 +1425,10 @@ PciIoSetBarAttributes ( > > IN OUT UINT64 *Length > > ) > > { > > - ASSERT (FALSE); > > + if (Offset =3D=3D NULL || Length =3D=3D NULL) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > return EFI_UNSUPPORTED; > > } > > > > -- > > 2.17.1