From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web09.4293.1610603941913759331 for ; Wed, 13 Jan 2021 21:59:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=OUsnpPiY; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: ray.ni@intel.com) IronPort-SDR: QBPM2DKJHz0Hzdrll4YosoPvbTxBd00Me/r1ombg9yN9SV0tw4ZcO+ypEhs4TTWKHrgeIoB7Bj y7wUgIN9vIIA== X-IronPort-AV: E=McAfee;i="6000,8403,9863"; a="175733884" X-IronPort-AV: E=Sophos;i="5.79,346,1602572400"; d="scan'208,217";a="175733884" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2021 21:59:00 -0800 IronPort-SDR: g6+pHPA+HffyOS/UhR03MOD7wq7dKmuDdHWlR7TB9lRxM/YxDezAnuyYlNlO0Q1MgN+BZzdxNu D49wnV6iryPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,346,1602572400"; d="scan'208,217";a="465152126" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga001.fm.intel.com with ESMTP; 13 Jan 2021 21:59:00 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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; Wed, 13 Jan 2021 21:59:00 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 13 Jan 2021 21:59:00 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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; Wed, 13 Jan 2021 21:59:00 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 13 Jan 2021 21:58:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QaPhRMQQ4LKpCDPmwT1hKnTVyOAEB+zMqofdRnUf5WiYyE8F9ThscuNM0xXQZAflG8CiX4H7861rQcay+sEAeEwCkAzjqquLOpi8SFKKC3Pmc39OhRim7Qte1+9G8EtDrwVDb4W/kerGrHFCSn26BS8+Mzsu5WXh8Ig2UAN9omQrDoQbfs5qBJ5cYss0tMqLReT4HP+FVPCOhrqLQsupzMrKXOYMSW3QFIDOkKtVS4zmIkoPlRUxk9dE0V9VB+q0EKvd/vuxGx/t0fRHVIrbjLKw17tQt9P30PCLaAHymPP5uulTbSEaaZohijTzL6KX5mgbXnwM5zQOQmLypeKPQQ== 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=mCR8PFvj9CpDKEEg5mXXGbxpYIgo//mniV4rSf3NDhM=; b=OwmLojKu2pQqGP4KxohURqpAImqBgVsxcQ/vGu+D+LfZGGc3M15uhHdtg9LIz0C7WyOKDGTL/oHeO5vbaOnNxVi7sKMhh4HGy1Ilou5B4fMH3zN2c/iA1+TEaNtDOhjTAkfczffTKVu0LF5wwsasgTozcijVaJDHeumya+7mLSDBeBlxQM5Pu5bi8a/D9govlP4jbRoZ6/y5h48FSzWIjWxIaAZ0GQV1CvVkWTzPJw/zmys2FXT9g4QpZrwOs6uh7l8CwItDOLwdcDXfvqBqn0QaWk8qpYVPEK5bqFB8+JdvyGsxDYoBykXykQd8eak6hV3XxkSadV9Gh/mv0iIJvA== 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=mCR8PFvj9CpDKEEg5mXXGbxpYIgo//mniV4rSf3NDhM=; b=OUsnpPiYb4WbXNXbrB/JBfZS7ySOiPq8TcCLG20F/pBG5+PaTSJ23245Rkl8mOy1f1sELFE0b4SMfPo76ePMzlQEu3K/r/bah3wSiIWPZE6dG7EgkfZA1d7ACiqB4CzDEvVaiVRsVTluiq/bXvtXE/EuW/508oREav6CISsAl9Q= Received: from CO1PR11MB4930.namprd11.prod.outlook.com (2603:10b6:303:9b::11) by MW3PR11MB4745.namprd11.prod.outlook.com (2603:10b6:303:5e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9; Thu, 14 Jan 2021 05:58:55 +0000 Received: from CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::d18:1234:c1d6:5936]) by CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::d18:1234:c1d6:5936%7]) with mapi id 15.20.3763.010; Thu, 14 Jan 2021 05:58:55 +0000 From: "Ni, Ray" To: "Zhong, Zarcd" , "devel@edk2.groups.io" CC: "Wu, Hao A" , "Kinney, Michael D" 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+ZBhAACnK61AABqDE4A== Date: Thu, 14 Jan 2021 05:58:55 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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.194] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6b3c116e-2b77-4ce8-9686-08d8b8517a45 x-ms-traffictypediagnostic: MW3PR11MB4745: 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: +IUg4ZFUNqOqFYGTyJFVXbpzaoHgDO0ai15AkF7gSBBE+ALzVlfrwzJXxumF54QHtxI4n6K4UjPUsoSJA3JoeB2Ube89+LvxZ3ZE5yOSkvZvK2V1tIY90P5fk7lxQR6nTLq7qNl4tQ1eSlhtReHYqbf/13FcF7ZS6dfT8MrtvK4Fzr0+t8IbI2gXaxD51E2Rd7sEmQu6t+qiW6/C2jmo2rV42+AjSMjgVAi7lNzfZJhK6rITvACb4DKKGpo4s69BJCKcnBAm5otNOmpvi8/Fwn8woUW0oc8BfvtCbYU4izEB1Ww4BUoHfdR8geFYwbW2XPcYkAG6uNcL/70Bgow+hzGUYq+bTNL9dwS9Z7BgBlRSbMHNoRPYq8sD8ZM5qeveq/Sc2E2xmh+oTbILCX36JQoGr+BUdvUXAHAZ3mW1fgHGGdlFBtyBpTVfhZzLNRBLPo2x2C1kQ1VLP2FoklQ7Eg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4930.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(346002)(396003)(366004)(39860400002)(376002)(54906003)(478600001)(110136005)(7696005)(8676002)(9686003)(8936002)(55016002)(52536014)(86362001)(166002)(316002)(966005)(71200400001)(76116006)(66946007)(186003)(66556008)(33656002)(2906002)(5660300002)(83380400001)(64756008)(6506007)(66446008)(53546011)(66476007)(4326008)(26005)(107886003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?6v01A3ODuHNWVwjOBMdfdbwNIuB9OO9Oo/hlMYmLbtd5fe04wti0s0cSLo9d?= =?us-ascii?Q?a+anoyhRPSYdBHukR2UeKLj3VnqCF5rVzOUDklYGqN3wE+pygLanYTxRCZ73?= =?us-ascii?Q?Hsw3GgPQ3eQS+F3Au8jCmp1pVs3bhjQ+4pXlNjTePsLxk37IVnoInbE0iUFl?= =?us-ascii?Q?HEWOFsq9dBH4ECbGoyhlBanV1V8X3Gus/WtwlzuuLxDJQ9JfinVLcZ0WWv1h?= =?us-ascii?Q?FU/pCG9xZDat2UuVB7YHqiJJLaP9mNIJ3vvl7Jb4k4V7aGbc8mn2lsZT8rac?= =?us-ascii?Q?F2r9OwSzJqcwRCLf1K6il+uPZuPV3tQHnro9TmbPyTzoyprb7GqWWptV6nYN?= =?us-ascii?Q?VxMMU5bq0fvBqXVCKk1k/bT1BWDX5WGwZbQWgyPWHYV+Au4dePEztBLbpUpK?= =?us-ascii?Q?tGo1SpGaHRM9L6Cv9+qy2rAvdw+v4h4w/4HsdZvhv+TGdUf2onZ3kLeEOQFq?= =?us-ascii?Q?jNLfczJit1AAsPHYT7Z1phMxxJOwP6tpby2w0qgLiZ/6uMO2fhihUkPdvbnK?= =?us-ascii?Q?0aoP3GUvXA629osVly06yPATC1DTFc3Wovfh4PLBZ5LsfenjxAqDqWY8M1gO?= =?us-ascii?Q?t/ae79q3ONFUI/HZoSo+E0F9AKe4RWtq+liQzY+WFYx+OuBb571UgBHoECm4?= =?us-ascii?Q?hw6dQLAMDp0W+gDcemE1qfB7zAYLq6sHqPQDbYq/9wKtWD+5qCxsZ/8neFKA?= =?us-ascii?Q?cqOMJ5Q/PEt3574CB/kKut3QRfqRxQhxAr3fBdKf8UFsO48/GEWkef/KZ/r5?= =?us-ascii?Q?Z7/Y5yANVdHVs16LoTmgikEGftCEsoOnvteKCmnvCUIeXXZJwxiVRCnMUPwY?= =?us-ascii?Q?VNRHY/CHN9aHpaw/j5NlApbTCgIvhleiD9SfBASL9A6rMVBW/UMzu1J7H++p?= =?us-ascii?Q?Dzbdbdya+HPnPc3eJyCH4FEIbhTISioGC0yKbMEhFrb+kQfQAWGv1xdGgvL7?= =?us-ascii?Q?nDuhrBXXasZM/YBBDmlUWWBaJAZZUF67Nt0x133GBdg=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4930.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b3c116e-2b77-4ce8-9686-08d8b8517a45 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2021 05:58:55.5530 (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: 03iSjT6A4Gdu4q7lr1AWu3WqhWV6AnzxqyT0E5T2kxNmFBmTe/web94KseAqSjnGKAvS4P+Z1qb2x/AE+Qoe9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4745 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CO1PR11MB4930FFB0480E23929C3ECB348CA80CO1PR11MB4930namp_" --_000_CO1PR11MB4930FFB0480E23929C3ECB348CA80CO1PR11MB4930namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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, Michael 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_CO1PR11MB4930FFB0480E23929C3ECB348CA80CO1PR11MB4930namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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&= gt;
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@intel.com>; Kinney, Michael D <mich= ael.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_CO1PR11MB4930FFB0480E23929C3ECB348CA80CO1PR11MB4930namp_--