From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.1223.1610698253152054923 for ; Fri, 15 Jan 2021 00:10:53 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Ir6yM7pf; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: zarcd.zhong@intel.com) IronPort-SDR: MQsy5eBUuBbBUlH/jCczSAy6Go3Eq6azoNmF59MiICnucxYHJ5cQN2b0T1T9Vo3u1elqQlRjWA gspduVOPjymg== X-IronPort-AV: E=McAfee;i="6000,8403,9864"; a="178602773" X-IronPort-AV: E=Sophos;i="5.79,348,1602572400"; d="scan'208,217,223";a="178602773" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2021 00:10:47 -0800 IronPort-SDR: oVMAI1ZqinODVY/5j5S2IzquEXNCf8gXrp3DVYx/7NQ0yQEi1wZ+LPtmdVXfOElq68Ep2M/UIy moIyuhWGXUxA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,348,1602572400"; d="scan'208,217,223";a="398308618" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga004.fm.intel.com with ESMTP; 15 Jan 2021 00:10:46 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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:10:45 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX608.amr.corp.intel.com (10.22.229.21) 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:10:45 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx602.amr.corp.intel.com (10.22.229.15) 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:10:45 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) by edgegateway.intel.com (134.134.137.100) 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:10:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hiez5nFxIFCnT+f6NbBueK2ArQrJdxDTBVTXqQhb2JrIhEopUoYZjRMy5P0oG8s+4Eogc/6x1nii9oxU5fi28H9yKyQk7LNcxBPU/kYNHb+jn40dVmdfeXqBWH0jf6YzX4jF/XwxHSuMeayGWo0xAlptOw99YqE02CvuQUtR7YkzvcfRsdiwwbvXtVqpUhnd+fKb5qxqcy242s9ghE/OYzEbssTnumw4FS5CoqIDwOklaZnchc+WiHCtDcfjGMpFHpvULsaZ58XmTWJcikKyHKPxa4/MIqIf2NmbE4L/R/IY05SOANgqxhcZj7QapfoEm3sSOEDJqfprTh7wxHqS3g== 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=9ya8/KOIkJqP8ESpnK6b3zmA/2gxar0MR5D2AgN8BGA=; b=gHZ55H5Q5B0l2yDB0OU/ibpFr20+CyEZaZoMHLeBMsjTE1AOIC2lP9yMqLUF4LUT8wXixuRT31amVn56qqgsDh9EBXD0EAEYPKhBDdvnERZ1f4kzXnuaeBpFkcADJe1xYUTm3V98bcrdUVAfTSLYzwRfNJCdfhv0Y95Fa2pYa/T2tbtpSRv96bSGr+W7ibkKCwS6BOucUUEoX2Dn6pYmk7rs5V80D2OhrtoLD29MlmPgRBipsKVC5JXao61y/1WwyU94f8rFtX580JyI9wyPn0106HimG1eRu/sk9lbptuUEbFY0HuydgGyxqoHfHIa/FeANH8C0y6Jz37r7XSQw/Q== 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=9ya8/KOIkJqP8ESpnK6b3zmA/2gxar0MR5D2AgN8BGA=; b=Ir6yM7pfqisNtIVfEVWY8LePJAlfJ83KgmP6ElpkvIB0bfhBF9DxHiHLxPCSyl7JAj5j1NVGEj+8K7n+RcCJXov7705F4HKhdxwg6uW6+7AF8PEd2Ug3vNxyWDbQl9NrW2enT+vyU/qpi695nhJopVEtPqjq5yjll044aTQRB8Y= Received: from MWHPR11MB1309.namprd11.prod.outlook.com (2603:10b6:300:20::20) by MWHPR11MB1535.namprd11.prod.outlook.com (2603:10b6:301:d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9; Fri, 15 Jan 2021 08:10:44 +0000 Received: from MWHPR11MB1309.namprd11.prod.outlook.com ([fe80::a084:4090:7dee:dfb9]) by MWHPR11MB1309.namprd11.prod.outlook.com ([fe80::a084:4090:7dee:dfb9%10]) with mapi id 15.20.3763.011; Fri, 15 Jan 2021 08:10:44 +0000 From: "Zhong, Zarcd" To: "Ni, Ray" CC: "Wu, Hao A" , "Kinney, Michael D" , "devel@edk2.groups.io" , "Kim, Andrew" 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+ZBhAACnK61AABqDE4AABJCGQABb6sdAAAZOskAAcnoNwAACjh0A= Date: Fri, 15 Jan 2021 08:10:44 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: yes 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.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 55773577-fdab-49a3-34e5-08d8b92d0e95 x-ms-traffictypediagnostic: MWHPR11MB1535: 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: QkNwjQXCbZ/bYpleJA6upgo78s1E+WNIhV1XSHqSoVvNJQpZL72zER3bHJ6rSSQ3gfvdAlnc5z88GpFbObQYLTYtSITiztPln++vjR5CpPuj6lpDGeShPrYr/cCsYjKV5NLF2tUI3iTrx0rVNKg9c0zs2o8KvtqRC1OlcXDw0VINleP/lODg+D+TPLnZGJguKs1GJLgH0S3FrJKWneib4CUBew4VNopfgNq7ooBa3aOXVPJyWGvO2bxyAGV4QT0ryNpgq/XUQEOs7EPZQ9qIV/9K3NDDXrcVVT6G2IqY/Jm3GXmH4iyXnZEJm+wIzculdZ6K9CTuMXSxFJTVZf3uNaIHp9BK9STTWm2BpIa2wCLQWI3J5Lme9PtKbWtkRBERhG5guUs4tZeVfLfh18EuA1G5QzoJGrsWW6cIlHfAyB/7fzI4VkUHJ2Akt3y1TXbsIAKeHhx/+D2hMHfDSjym1A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1309.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(396003)(376002)(346002)(136003)(366004)(33656002)(2906002)(66476007)(9326002)(71200400001)(76116006)(99936003)(86362001)(107886003)(166002)(6862004)(8936002)(4326008)(64756008)(66556008)(478600001)(66946007)(5660300002)(55016002)(186003)(8676002)(9686003)(6506007)(54906003)(83380400001)(26005)(6636002)(53546011)(7696005)(52536014)(966005)(316002)(66616009)(66446008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?0awZnAJKnZK/qV6FveO35ZAJLfxqVrlEC0kjJd5KwUAq+Nd8oM5RugtJqFoX?= =?us-ascii?Q?gQwT1FRCKIAq57IYCxi7L0tIqFDxuVeeOb+7d1vkcZxbJaL55xyX/X9PH0MX?= =?us-ascii?Q?kJbfQJwS5RxS1FR/KiVEXnTYhZg2cNWaU6PaAFL6DpVO2ri8bjQvcJWSOyZh?= =?us-ascii?Q?kXIl1SrqeULrZpMlV/i9C+sgQ4qfLq1JZ/u0LFzyATNGwQ88w5WTb3ooZxBF?= =?us-ascii?Q?/Zey59YY/cFhVS6EeNro/MRvvjXIKnCMjixrdw2qzcilwpnSIfZYLXOxQagT?= =?us-ascii?Q?zzLeZzu1fcClHevbZUmkpx2W0mJBd1DW2R6E4QKv2idYlBZUONfCeQQQme+Z?= =?us-ascii?Q?DcfGroDC7sxLNfPoj93KwcS/viTcA+BrXfAsLTCqA6/eGL/HY3BTOD9Gvbxs?= =?us-ascii?Q?tALiOVW45HomSyEg+8GVzL+UMcHpsq1aikJaSSyh87D43QoTDq/oQLumCMJE?= =?us-ascii?Q?8xel3vnza6IHzb/T2zcmjmYW67z6Kmrg6iJhgPcIfyUdWTaVcLk5sTQHQkue?= =?us-ascii?Q?TY+KAwaN1+x6DlQ52XlEqnYZbyXhua2MmuO+nyWwi3P6Xd/HtqD3dg08OprE?= =?us-ascii?Q?54hmoNu9aPMcIhMAESkSSdFoADpvudQEtDKDf1Vv+J7ITaekpnNs82sdnArH?= =?us-ascii?Q?FIZazxGlYjLkbI1PVN6mGMGPB/IxuqaWAachb4KaTneCXKe6dJpJ7QLf1U+h?= =?us-ascii?Q?uUQZNaH5VVy6oMlXUwCO+mz2RDW1vmQI/q7aEs1IL6r077Z1XqNyzBFdG8rG?= =?us-ascii?Q?BwTNLND15jZBlD0j6A0HSmAdU1BeYRkU+0zJyOnEqSwQFRjTu4A1oUHHZ6iV?= =?us-ascii?Q?5TLLmJfYFIUTr9azJHv4jfZyf/Cda8o0OQqwSCvcXK+QZTv9yvEyGWsmUxv2?= =?us-ascii?Q?rzPohn19p0DkxXgVrVlXUWfVuRaXYaTXe2VQxb7KvGJ8rCLCbbgbbr02FQJa?= =?us-ascii?Q?YFdo+tC4FIOL9aHpSycZW4oJzZqwJfXcXmlgaKCO6Q0=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55773577-fdab-49a3-34e5-08d8b92d0e95 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2021 08:10:44.1102 (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: iYUrlRC9sGSRs9B0GN58Kd36fahYlRM5DL2DF/g1YoN3Lqe3mSWQjYHh15zEss72V+m+5LiMiuuoB7p/WI2ELQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1535 Return-Path: zarcd.zhong@intel.com X-OriginatorOrg: intel.com X-Groupsio-MsgNum: 70408 Content-Language: en-US Content-Type: multipart/mixed; boundary="_004_MWHPR11MB1309CCC6E52C532CCB454138FBA70MWHPR11MB1309namp_" --_004_MWHPR11MB1309CCC6E52C532CCB454138FBA70MWHPR11MB1309namp_ Content-Type: multipart/alternative; boundary="_000_MWHPR11MB1309CCC6E52C532CCB454138FBA70MWHPR11MB1309namp_" --_000_MWHPR11MB1309CCC6E52C532CCB454138FBA70MWHPR11MB1309namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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, Michael D ; devel@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_MWHPR11MB1309CCC6E52C532CCB454138FBA70MWHPR11MB1309namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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@intel.com>; Kinney, Michael D <mich= ael.d.kinney@intel.com>; devel@edk2.groups.io; Ni, Ray <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_MWHPR11MB1309CCC6E52C532CCB454138FBA70MWHPR11MB1309namp_-- --_004_MWHPR11MB1309CCC6E52C532CCB454138FBA70MWHPR11MB1309namp_ Content-Type: application/octet-stream; name="0001-MdeModulePkg-Bus-Pci-PciBusDxe-Handle-BAR-sizing-fai.patch" Content-Description: 0001-MdeModulePkg-Bus-Pci-PciBusDxe-Handle-BAR-sizing-fai.patch Content-Disposition: attachment; filename="0001-MdeModulePkg-Bus-Pci-PciBusDxe-Handle-BAR-sizing-fai.patch"; size=1062; creation-date="Fri, 15 Jan 2021 08:09:00 GMT"; modification-date="Fri, 15 Jan 2021 08:09:00 GMT" Content-Transfer-Encoding: base64 RnJvbSBkODBmZDY5MGU2N2QwODk5MTAzN2I3MTdjZDc2NmFlYmQxOTk2NTAyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBaYXJjZCBaaG9uZyA8emFyY2QuemhvbmdAaW50ZWwuY29tPgpE YXRlOiBNb24sIDQgSmFuIDIwMjEgMTc6MzI6NTQgKzA4MDAKU3ViamVjdDogW1BBVENIXSBNZGVN b2R1bGVQa2cvQnVzL1BjaS9QY2lCdXNEeGU6IEhhbmRsZSBCQVIgc2l6aW5nIGZhaWwgaW4KIGhp Z2ggMzJiaXQgb2YgTUVNNjQuCgogICAgUkVGOiBodHRwczovL2J1Z3ppbGxhLnRpYW5vY29yZS5v cmcvc2hvd19idWcuY2dpP2lkPTMxNDkKCiAgICBBZGRyZXNzIE1FTTY0IEJBUiBpbiB0eXBlIHVu a25vd24gaWYgc2l6aW5nIGZhaWwgaW4gaGlnaCAzMmJpdC4KCiAgICBDYzogUmF5IE5pIDxyYXku bmlAaW50ZWwuY29tPgogICAgQ2M6IEhhbyBBIFd1IDxoYW8uYS53dUBpbnRlbC5jb20+Ci0tLQog TWRlTW9kdWxlUGtnL0J1cy9QY2kvUGNpQnVzRHhlL1BjaUVudW1lcmF0b3JTdXBwb3J0LmMgfCAx ICsKIDEgZmlsZSBjaGFuZ2VkLCAxIGluc2VydGlvbigrKQoKZGlmZiAtLWdpdCBhL01kZU1vZHVs ZVBrZy9CdXMvUGNpL1BjaUJ1c0R4ZS9QY2lFbnVtZXJhdG9yU3VwcG9ydC5jIGIvTWRlTW9kdWxl UGtnL0J1cy9QY2kvUGNpQnVzRHhlL1BjaUVudW1lcmF0b3JTdXBwb3J0LmMKaW5kZXggMWI2NDky NGI3Yi4uYTI0MDY1ZThiYSAxMDA2NDQKLS0tIGEvTWRlTW9kdWxlUGtnL0J1cy9QY2kvUGNpQnVz RHhlL1BjaUVudW1lcmF0b3JTdXBwb3J0LmMKKysrIGIvTWRlTW9kdWxlUGtnL0J1cy9QY2kvUGNp QnVzRHhlL1BjaUVudW1lcmF0b3JTdXBwb3J0LmMKQEAgLTE2ODYsNiArMTY4Niw3IEBAIFBjaUlv dlBhcnNlVmZCYXIgKAogICAgICAgICAgICAgICAgICk7DQogDQogICAgICAgaWYgKEVGSV9FUlJP UiAoU3RhdHVzKSkgew0KKyAgICAgICAgUGNpSW9EZXZpY2UtPlZmUGNpQmFyW0JhckluZGV4XS5C YXJUeXBlID0gUGNpQmFyVHlwZVVua25vd247DQogICAgICAgICByZXR1cm4gT2Zmc2V0ICsgNDsN CiAgICAgICB9DQogDQotLSAKMi4xNi4yLndpbmRvd3MuMQoK --_004_MWHPR11MB1309CCC6E52C532CCB454138FBA70MWHPR11MB1309namp_--