From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.1337.1610699805909113561 for ; Fri, 15 Jan 2021 00:36:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=RcqjebRR; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: hao.a.wu@intel.com) IronPort-SDR: gHirSYgHllzZapN/1VmuODPC97YuhckaHjJ7MtzzfNl5EUYBdni6NST6ttQ2Hn5v+8buzDOqXc SPdMYzJobfBw== X-IronPort-AV: E=McAfee;i="6000,8403,9864"; a="240063606" X-IronPort-AV: E=Sophos;i="5.79,349,1602572400"; d="scan'208,217";a="240063606" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2021 00:36:40 -0800 IronPort-SDR: GXacjATUgg3trQ/7vJsxJ/2ffhJSd+OtHLYTSLDeuiO2TygJBhJEbQis0BuiuMYT/azx1vpi42 Shmrv1SmQESg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,349,1602572400"; d="scan'208,217";a="364514629" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga002.jf.intel.com with ESMTP; 15 Jan 2021 00:36:40 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 15 Jan 2021 00:36:40 -0800 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 15 Jan 2021 00:36:39 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 15 Jan 2021 00:36:39 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Fri, 15 Jan 2021 00:36:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hZR/ePmR9XcQvh4O729DWy/LxOyduT/HbNvuMZnK6Oi/+szD2ycqd0YsJyNft1t5q2UPWRLSxKaok5V52aaZa9i8S0gwhjRzBJgVoq8EZFTf8c+ls7HHv59lZZy4pxHxkDdhhajoboFKwmqELOi9l+UJbPrzIfasVcSGc57HZSO6KX++K1YvEwhrNxDFz7J3lQNKiJFeqSqC0d8YZln4ZQ2qmtlukwWFO8k5x2tiY6tDOMvm8S9GTfr5fQ625I17O7bbDOe8LVKQb98k4St/2ymIXtrnlWMFwkcpD0+2PJlo7yl6k+Vd56XHb7MfxeoNuo+4RZwOXaaCsPzYhghBlw== 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=83sR2OuPwvGICjFH/JjTWm8UaMWODL55bWm1vcB/49Y=; b=GSelrHNiIGZiwZSTVOIPBogQgBgAeruv9KS2Ah/z9G0Rk5n+c/aTqu1YSP+COuL9tJRrsuHlsqAmmA3c6vYQd/7SAcQl8aFSOXpv9gXmEx9Xl/h0tsW6Gzh70NWMjdFQtb3og/AKEka+dxkUlWt6VZZCOWX7X/DWGyy3ITp4Q7juZtzOabzjlCkOQeZBKHmNYKrT4TUv2IGXoLdO4hqqrbuVuSebYNsYAkOTfLZsZWzhHv5zVayMkNsSqpmJWaHY8WsPNk1NfHPDwCutexAP1v4JCUx6BGntACHrOpznWfJpjq1V4JJ7YsRrw26Ep21sAAXFas2eM5wTJkBMOznalQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=83sR2OuPwvGICjFH/JjTWm8UaMWODL55bWm1vcB/49Y=; b=RcqjebRR84j/FkGxTabpZqX3MMBY9kilSuFCeEKsoJbH4HKopDzhhSKqz+xvnfrNk6uGkXHeopzMGT0gQNtd4qsLdkNMKjnEl4KW2g92W91MH6MqN0n1Jl53LNTpOrIek6AaKbKdkNvne7E6kuEakUIxMKWCBa95tC3M5NQI0hM= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR11MB3907.namprd11.prod.outlook.com (2603:10b6:405:83::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10; Fri, 15 Jan 2021 08:36:36 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::d11e:3b2:e34f:7f0f]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::d11e:3b2:e34f:7f0f%5]) with mapi id 15.20.3763.011; Fri, 15 Jan 2021 08:36:36 +0000 From: "Wu, Hao A" To: "Zhong, Zarcd" , "devel@edk2.groups.io" , Laszlo Ersek CC: "Kinney, Michael D" , "devel@edk2.groups.io" , "Kim, Andrew" , "Ni, Ray" Subject: Re: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64. Thread-Topic: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64. Thread-Index: AdbifqrbMhe/1KwPTxui//AvwMCRQAG+ZBhAACnK61AABqDE4AABJCGQABb6sdAAAZOskAAcnoNwAACjh0AAABL98AAAkRcwAAA7tGA= Date: Fri, 15 Jan 2021 08:36:36 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a9ba7d2e-e7a0-4fce-9a53-08d8b930abd4 x-ms-traffictypediagnostic: BN6PR11MB3907: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KiegVpDozLeJR9JsiwJ8zlppnMPsk+8JpUAByZaBnEJF+6sRLHoFpldCcS2ZvQa6jv4DYRhjtS3f/TbrnfUr22KkWoPiCSFTPBAGMKmwYF4Lol9phGrKlSSlBIn/Vt6yDYG9fI6HRKTH+e7REvRDGJ6eLpoi4utzrA15hhMhmUOQNT7Loz/7qRYZcWn/1Ii9h9pHGNwzPtfrlPXuDT4kxNpieWDu3khKWnHUZK+JroKnQX4jb3/KsRcC0tDZ8Kai2n13TzKwDJioDvIwz+IXaSXqxeFO/+I4+KsCtC0YjYIJqsSq6DHHp6YLkypm+vXYDVQDUSETWZbnFaY4qP4XCcmTBDsZdHQBdmGbmAI3k38eUXiTG7hLVwWpwt00OoQnATdb0Fv/PIdq2bdEozh+BIJC/ZhRQNLPO7FEqIokPtuewQnZimpG6qbV4e1aw/uKulLN2pxjkYa8hyMuH0osDA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(39860400002)(346002)(376002)(136003)(396003)(66556008)(66476007)(66446008)(64756008)(76116006)(66946007)(316002)(52536014)(54906003)(26005)(8936002)(86362001)(6506007)(53546011)(5660300002)(83380400001)(478600001)(186003)(8676002)(110136005)(166002)(71200400001)(33656002)(9686003)(7696005)(4326008)(107886003)(55016002)(2906002)(9326002)(966005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?0tfubyu7cV9+jakUDCdQ/+fM7HC9d8GM6Or8qVa4zmwBnUfFXv0VXCsAz26i?= =?us-ascii?Q?XbzJrvFTT3dnU5KDKIcwtErFc0j8I2B0x5iN7PypdYmyRyMfBVPv04gbX3NO?= =?us-ascii?Q?u3Xm14dpopXHcCj1Hsp81u7VxkcOQBsV0Xt7lPr5a6KDYjKT9LBZCoGf+kWG?= =?us-ascii?Q?6AG/JW8sQiAYuPRHt1vWEKTj21LS+gMFwc17Pxb/WSC+xs7tyXARKkV6mggI?= =?us-ascii?Q?u6Ej1YWfxVAtWWBh7oovYsW73RnuXul6KTkf0MqPE+W5V84nE+QW8O0CjHRB?= =?us-ascii?Q?1OPnkFRQcUm88ITwCim+fx7iAq23TtNaTjhfsr2Y82BMm4+bogsGWyDvcREV?= =?us-ascii?Q?F8DxBUd9/BVLIFrLQalxxzYmXN3vDTGS9gWLhCFWCenKFTdvmJZdgNRWwNpU?= =?us-ascii?Q?FC0vYm7q+hDh7Y3RnhvsNsZzgaO/u7vUhlmwbp8wCzfOWRttiFz7ALcnhK2f?= =?us-ascii?Q?jSZ3zYMrzH2NPt8/qSYn6xU9HF3pemKuEB8Ub/eFfWVf2oHztipSzfZQEqIj?= =?us-ascii?Q?EBTKt/t6CbS+IeX13jjZnQSFU2A50J30Ack+dCBt6NqcH5DW9IHjpNyQ89ue?= =?us-ascii?Q?Zmm8H8wOodozlzhZMSY4U2RVdQnIQkGvgonDBnz+3cjVchlyViPWdq+aFnTz?= =?us-ascii?Q?rwzo+QDsgxqr5Rfuvrnmuy57XWSZ6n3AfLsnfXKCN+gK3veCtxQwDP+kCNaB?= =?us-ascii?Q?UsePk2TweVeRTEqQcPWQqDIAp+dzF3I7UijQbapA3YMn2jUjDu1vjKfEojST?= =?us-ascii?Q?0q7zZYE7Dbu8TibkPhQQ3H0DuAa7huIjsKoqfF7nmdnqdaPMyBPrmaqG0O0X?= =?us-ascii?Q?toIkv15JdvH8aaQCrsuOUNzliFnuE6u+N1DnY8j3aF0oR1D2V7cWVsLg0NOn?= =?us-ascii?Q?HW8Mgq45JFhwoQ2WGJEUKkY5zIN93y/OWBfKGtGOILHRKjCIX3Po0db+Lstt?= =?us-ascii?Q?HKofHP54C8kakK2pOerO1I50igA6cKghmxApJzeZIcI=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9ba7d2e-e7a0-4fce-9a53-08d8b930abd4 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2021 08:36:36.3362 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yQ70PFGfks9h/OXYVAlu91Jwv9A1tmIQFyhbRVFQPI7rSfCFyCgxt17XQ6fqK8LeXwoOcjTmwEF8CRcvijJ5LQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3907 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN8PR11MB36665D1DA6A6B3141139AFCFCAA70BN8PR11MB3666namp_" --_000_BN8PR11MB36665D1DA6A6B3141139AFCFCAA70BN8PR11MB3666namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Could you help to follow the suggestion by Laszlo and use the 'git-send-ema= il' command rather than attaching the patch file: https://edk2.groups.io/g/devel/message/69828 You can keep the "Reviewed-by" tag by Ray when sending out the patch. Thanks in advance. Best Regards, Hao Wu From: Zhong, Zarcd Sent: Friday, January 15, 2021 4:30 PM To: Wu, Hao A Cc: Kinney, Michael D ; devel@edk2.groups.io; K= im, Andrew ; Ni, Ray Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. Hi Hao, Please help to review this patch and push it to open source EDKii. Thanks From: Ni, Ray > Sent: Friday, January 15, 2021 4:12 PM To: Zhong, Zarcd > Cc: Wu, Hao A >; Kinney, Mich= ael D >; deve= l@edk2.groups.io; Kim, Andrew > Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. Reviewed-by: Ray Ni > From: Zhong, Zarcd > Sent: Friday, January 15, 2021 4:11 PM To: Ni, Ray > Cc: Wu, Hao A >; Kinney, Mich= ael D >; deve= l@edk2.groups.io; Kim, Andrew > Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. Hi Ray, Your suggestion for one line patch test PASS. Attached file is the patch. Please help to review. From: Kim, Andrew > Sent: Friday, January 15, 2021 3:53 PM To: Zhong, Zarcd > Cc: Wu, Hao A >; Kinney, Mich= ael D >; deve= l@edk2.groups.io; Ni, Ray > Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. Hi Zarcd, It works fine with this Ray's solution. Customer confirmed it. -Andrew From: Kim, Andrew Sent: Thursday, January 14, 2021 10:14 AM To: Zhong, Zarcd > Cc: Wu, Hao A >; Kinney, Mich= ael D >; deve= l@edk2.groups.io; Ni, Ray > Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. BTW, to be clear for this to try. Could you confirm if this is right update with your suggestion? if (EFI_ERROR (Status)) { PciIoDevice->VfPciBar[BarIndex].BarType =3D PciBarTypeUnknown; return Offset + 4; } -Andrew From: Kim, Andrew Sent: Thursday, January 14, 2021 9:38 AM To: Zhong, Zarcd > Cc: Wu, Hao A >; Kinney, Mich= ael D >; deve= l@edk2.groups.io; Ni, Ray > Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. Hi Zarcd, Thanks for this update. Sure, I will let you know once it has been verified. -Andrew From: Zhong, Zarcd > Sent: Wednesday, January 13, 2021 10:32 PM To: Kim, Andrew > Cc: Wu, Hao A >; Kinney, Mich= ael D >; deve= l@edk2.groups.io; Ni, Ray > Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. Hi Kim, Ray suggests a one line patch instead of google's solution. + PciIoDevice->VfPciBar[BarIndex].BarType =3D PciBarTypeUnknown; Could you help to verify Ray's solution on that card? From: Ni, Ray > Sent: Thursday, January 14, 2021 1:59 PM To: Zhong, Zarcd >; dev= el@edk2.groups.io Cc: Wu, Hao A >; Kinney, Mich= ael D > Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. Zarcd, I may not say very clearly. I prefer to just keep below line. Can you check= whether that can work? + PciIoDevice->VfPciBar[BarIndex].BarType =3D PciBarTypeUnknown; Thanks, Ray From: Zhong, Zarcd > Sent: Thursday, January 14, 2021 10:48 AM To: Ni, Ray >; devel@edk2.groups.= io Cc: Wu, Hao A >; Kinney, Mich= ael D > Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. Hi Ray, Attached patch is updated with below add. Thanks for your remind. PciIoDevice->VfPciBar[BarIndex].BarType =3D PciBarTypeUnknown; From: Ni, Ray > Sent: Wednesday, January 13, 2021 3:01 PM To: Zhong, Zarcd >; dev= el@edk2.groups.io Cc: Wu, Hao A >; Kinney, Mich= ael D > Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail= in high 32bit of MEM64. Zarcd, I can understand that this patch is needed for some buggy pci devices whose VF bar behaves strangely. Incompatible PCI protocol can only deal with norm= al PCI bar. And this patch is just to enhance the error handling logic. Can you please use below code for error handling? + PciIoDevice->VfPciBar[BarIndex].BarType =3D PciBarTypeUnknown I understand that your change is aligned to existing error handling in the = beginning of PciIovParseVfBar(). But that logic runs before PciIoDevice->VfPciBar[BarIndex].BarType is assig= ned. The key is to reset the BarType to PciBarTypeUnknown so that the resource s= ummary code doesn't count this bar. Thanks, Ray From: Zhong, Zarcd > Sent: Monday, January 4, 2021 5:48 PM To: devel@edk2.groups.io Cc: Ni, Ray >; Wu, Hao A > Subject: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in = high 32bit of MEM64. >>From 7518212a85269e486d06dcea927a3d34e23372c2 Mon Sep 17 00:00:00 2001 From: Zarcd Zhong > Date: Mon, 4 Jan 2021 17:32:54 +0800 Subject: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in = high 32bit of MEM64. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3149 Clear length and alignment for low 32bit of MEM64 BAR if sizing fail in= high 32bit. Cc: Ray Ni > Cc: Hao A Wu > --_000_BN8PR11MB36665D1DA6A6B3141139AFCFCAA70BN8PR11MB3666namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

 

Could you help to follow the suggestion by Laszlo an= d use the ‘git-send-email’ command rather than attaching the pa= tch file:

https://edk2.groups.io/g/devel/message/69828

 

You can keep the "Reviewed-by" tag by Ray = when sending out the patch.

Thanks in advance.

 

Best Regards,

Hao Wu

 

From: Zhong, Zarcd <zarcd.zhong@intel.com&= gt;
Sent: Friday, January 15, 2021 4:30 PM
To: Wu, Hao A <hao.a.wu@intel.com>
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2= .groups.io; Kim, Andrew <andrew.kim@intel.com>; Ni, Ray <ray.ni@in= tel.com>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

Hi Hao,

 

Please help to review this patch and push it to open= source EDKii. Thanks

 

From: Ni, Ray <ray.ni@intel.com>
Sent: Friday, January 15, 2021 4:12 PM
To: Zhong, Zarcd <zarcd.= zhong@intel.com>
Cc: Wu, Hao A <hao.a.wu@int= el.com>; Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io; Kim, Andr= ew <andrew.kim@intel.com>=
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

Reviewed-by: Ray Ni <ray.ni@intel.com>

 

From: Zhong, Zarcd <zarcd.zhong@intel.com>
Sent: Friday, January 15, 2021 4:11 PM
To: Ni, Ray <ray.ni@intel.com= >
Cc: Wu, Hao A <hao.a.wu@int= el.com>; Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io; Kim, Andr= ew <andrew.kim@intel.com>=
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

Hi Ray,

 

  Your suggestion for one line patch test PASS.=   

 

Attached file is the patch. Please help to review. <= o:p>

 

From: Kim, Andrew <andrew.kim@intel.com>
Sent: Friday, January 15, 2021 3:53 PM
To: Zhong, Zarcd <zarcd.= zhong@intel.com>
Cc: Wu, Hao A <hao.a.wu@int= el.com>; Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io; Ni, Ray &= lt;ray.ni@intel.com>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

Hi Zarcd,

 

It works fine with this Ray’s solution. Custom= er confirmed it.

 

-Andrew

 

From: Kim, Andrew
Sent: Thursday, January 14, 2021 10:14 AM
To: Zhong, Zarcd <zarcd.= zhong@intel.com>
Cc: Wu, Hao A <hao.a.wu@int= el.com>; Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io; Ni, Ray &= lt;ray.ni@intel.com>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

BTW, to be clear for this to try.

Could you confirm if this is right update with your = suggestion?

 

 

      if (EFI_ERROR (Status= )) {

        PciIoDevice->VfPciBar[BarIndex].BarType =3D PciBarTypeU= nknown;

 

        return Of= fset + 4;

      }

 

 

-Andrew

 

From: Kim, Andrew
Sent: Thursday, January 14, 2021 9:38 AM
To: Zhong, Zarcd <zarcd.= zhong@intel.com>
Cc: Wu, Hao A <hao.a.wu@int= el.com>; Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io; Ni, Ray &= lt;ray.ni@intel.com>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

Hi Zarcd,

 

Thanks for this update.

 

Sure, I will let you know once it has been verified.=

 

-Andrew

 

From: Zhong, Zarcd <zarcd.zhong@intel.com>
Sent: Wednesday, January 13, 2021 10:32 PM
To: Kim, Andrew <andrew.k= im@intel.com>
Cc: Wu, Hao A <hao.a.wu@int= el.com>; Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io; Ni, Ray &= lt;ray.ni@intel.com>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

Hi Kim,

 

Ray suggests  a one line patch instead of googl= e’s solution.

+        PciIoDev= ice->VfPciBar[BarIndex].BarType =3D PciBarTypeUnknown;

 

Could you help to verify Ray’s solution on tha= t card?

 

 

 

 

From: Ni, Ray <ray.ni@intel.com>
Sent: Thursday, January 14, 2021 1:59 PM
To: Zhong, Zarcd <zarcd.= zhong@intel.com>; devel@edk2.groups.io
Cc: Wu, Hao A <hao.a.wu@int= el.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

Zarcd,

I may not say very clearly. I prefer to just keep be= low line. Can you check whether that can work?

+        PciIoDev= ice->VfPciBar[BarIndex].BarType =3D PciBarTypeUnknown;

 

Thanks,
Ray

 

From: Zhong, Zarcd <zarcd.zhong@intel.com>
Sent: Thursday, January 14, 2021 10:48 AM
To: Ni, Ray <ray.ni@intel.com= >; devel@edk2.groups.io
Cc: Wu, Hao A <hao.a.wu@int= el.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

Hi Ray,

 

Attached patch is updated with below add. Thanks for= your remind.

 

PciIoDevice->VfPciBar[BarIndex].BarType =3D PciBa= rTypeUnknown;

 

 

From: Ni, Ray <ray.ni@intel.com>
Sent: Wednesday, January 13, 2021 3:01 PM
To: Zhong, Zarcd <zarcd.= zhong@intel.com>; devel@edk2.groups.io
Cc: Wu, Hao A <hao.a.wu@int= el.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizi= ng fail in high 32bit of MEM64.

 

Zarcd,

I can understand that this patch is needed for some = buggy pci devices whose
VF bar behaves strangely. Incompatible PCI protocol can only deal with norm= al
PCI bar. And this patch is just to enhance the error handling logic.

 

Can you please use below code for error handling?

+        PciIoDev= ice->VfPciBar[BarIndex].BarType     =3D PciBarTypeUn= known

 

I understand that your change is aligned to existing= error handling in the beginning
of PciIovParseVfBar().

But that logic runs before PciIoDevice->VfPciBar[= BarIndex].BarType is assigned.

The key is to reset the BarType to PciBarTypeUnknown= so that the resource summary
code doesn’t count this bar.

 

Thanks,

Ray

 

From: Zhong, Zarcd <zarcd.zhong@intel.com>
Sent: Monday, January 4, 2021 5:48 PM
To: devel@edk2.groups.io=
Cc: Ni, Ray <ray.ni@intel.com= >; Wu, Hao A <hao.a.wu@inte= l.com>
Subject: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing f= ail in high 32bit of MEM64.

 

From 7518212a85269e486d06dcea927a3d34e23372c2 Mon Se= p 17 00:00:00 2001

From: Zarcd Zhong <zarcd.zhong@intel.com>

Date: Mon, 4 Jan 2021 17:32:54 +0800

Subject: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Han= dle BAR sizing fail in high 32bit of MEM64.

 

    REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3149

 

    Clear length and alignment for lo= w 32bit of MEM64 BAR if sizing fail in high 32bit.

 

    Cc: Ray Ni <ray.ni@intel.com>

    Cc: Hao A Wu <hao.a.wu@intel.com>

--_000_BN8PR11MB36665D1DA6A6B3141139AFCFCAA70BN8PR11MB3666namp_--