From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.5111.1610645883322977852 for ; Thu, 14 Jan 2021 09:38:03 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=R/IFb102; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: andrew.kim@intel.com) IronPort-SDR: vOcJfhD9796yU8kbgJWccF4I2Oh80FS9gzzsyMghYhqchFhWPVCyTEnlkwa+xMfAFNophT6gDY PAmV3CTx0EzQ== X-IronPort-AV: E=McAfee;i="6000,8403,9864"; a="177631135" X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208,217";a="177631135" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2021 09:37:58 -0800 IronPort-SDR: pk2JyP+zcXOHAUAMexESqWsTR9BZ6BnHOSrz18P70SVYmeUwC5Yc3X/H009EoZsRDl8tiC0Eq5 sD0xAgmICDLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,347,1602572400"; d="scan'208,217";a="400982060" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 14 Jan 2021 09:37:57 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 14 Jan 2021 09:37:57 -0800 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 14 Jan 2021 09:37:56 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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; Thu, 14 Jan 2021 09:37:56 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.49) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 14 Jan 2021 09:37:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SHGUEVvs8RY5T9tqWEb0bjObfbN+p2FqvX6wQGDr9ZDZVYgnMbNukT4oTHaYBrmZiFwmdPDinZvgFNbo70AlE2yVQHg3p5cREb10q1EiOKiYcE3LNzZAfWoTCfQ3ztX7IF1O0uiMFELE3c6ddd4BiKuFhgW0UU2wUYr5SZq8WUxnq+oGwF3+qxpC4L+o81CZG7v93lJt+sPXky8FB54acTUozmoTY7Ei37uAQBfqkfexjZxEBZ3iXZBF2+DsAxYO6Y8FzbrluVh5v1MW5WpuBaFu+wuy1NxKoFaP7Ll+sepA+dmWYahbr8G+zJbwR0lHfoIkmCB1JiSLJlGGWoavrA== 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=ktNhelEyoVzdJl5h5H5od3WXRSZtgoWyPvH0p5Mmn4Q=; b=L5Bf69FuV3Xpk0Zw4qVYqb+zrd9+8bRGpMtZB9TDl/yNg7lwUjtzAwOEBw3kzm++asw7BEU0mV/g0ZVSDM6DKCdJN5QSC2BoYZzOARmqC6zcerJ830P8wyufVhnETMaw9z7URC98bQ+3j2pl3TB2Ochy7vtiWQocsO1he2zXs99ej6JWcafQW1i9RazA5RwNFgb+B1zF5NNTyzqgldXh646qKB37UL/Xs//K3MSZqc16m3H9SIr5WU3g4Fn3tDqcPRpPlibLhIGmOOc+gpsBHXxLmTeJuD5+tbqTFTDHazJniCr8w5lByzee4YlEb+4bTOWew3vH8wGQLOkL/6eUIw== 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=ktNhelEyoVzdJl5h5H5od3WXRSZtgoWyPvH0p5Mmn4Q=; b=R/IFb1022S08L/2wlupVJSFB8aP1AKxUbPW4GJVMuiynMAJ+zL5eMd1kuFZT9bRhnBEDqr/2+o4whK5hFJlNef1mRdAZt1f8sFUDnegj/Sa61ZBRpNThdgWjLolAbqsbLqAdVg3X70gLHH1F3GupC/+7EB7QmW1kvyFICBpcLlQ= Received: from DM6PR11MB2764.namprd11.prod.outlook.com (2603:10b6:5:bf::12) by DM6PR11MB4108.namprd11.prod.outlook.com (2603:10b6:5:197::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.9; Thu, 14 Jan 2021 17:37:55 +0000 Received: from DM6PR11MB2764.namprd11.prod.outlook.com ([fe80::88f4:fba0:3381:d4e5]) by DM6PR11MB2764.namprd11.prod.outlook.com ([fe80::88f4:fba0:3381:d4e5%7]) with mapi id 15.20.3763.010; Thu, 14 Jan 2021 17:37:55 +0000 From: "Kim, Andrew" 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. Thread-Topic: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64. Thread-Index: AdbifqrbMhe/1KwPTxui//AvwMCRQAG+ZBhAACnK61AABqDE4AABJCGQABb6sdA= Date: Thu, 14 Jan 2021 17:37:55 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: request-justification,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: [104.153.200.4] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fa95af62-60b5-4a6a-edf1-08d8b8b32030 x-ms-traffictypediagnostic: DM6PR11MB4108: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: G5ULAG+esUWqPL7iwW5wT+4kKCXTKsLhYq90Y4jpFvpGtmCgx21v0n9taJPqq/muwoQXQd3TCbM05dMgDqt9IpFRzyzj/tYKbJhKHpM8dKTaxemjgfNQLk1fDCMkw9FPGRMmqneGY5wONiHYvDVwuPZj9r9gna33csSB8pvwMqDMy/aqYv8VfUhBp26B/1Cqj0FVp0UtM0BRMLoTrcAPGX2o+rL9htEEuoua/bPjIWNREwzfvv1H8XdqD09WxrYOeUEuIPzqVixUhc/MLDF5R/0AoRbU0RtLWADwZTWCe2fO01fMXEwr+FuKrNCdqVW3kefOzBNDv6wJp90NkPsCdm9+JowpVbujlr7QLbqFr7iGVny+JALIazbW9IyeI0o6WbuW2PSMSmCsf6vby7fy7GAAt5x+Y4g+Ryh68c6MJo0+lHpZpp4nSeM+ssWkIsQA9+nEETq8yDxlCPG7g1VlvA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB2764.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(366004)(136003)(39860400002)(396003)(6862004)(6636002)(7696005)(66946007)(8936002)(76116006)(8676002)(2906002)(66446008)(33656002)(6506007)(4326008)(9326002)(107886003)(53546011)(26005)(64756008)(478600001)(55016002)(83380400001)(71200400001)(9686003)(966005)(316002)(54906003)(66556008)(52536014)(166002)(5660300002)(66476007)(186003)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?qtdL5juLEu+vGEE2FIwbvdkIZhcGmGPLYv30FIszmiKEdhxFCY3pMcyX+Urf?= =?us-ascii?Q?IyQls1/3aG4fz6aKUZFDJgqNsjqTROZ0IdpSTnwnMW4dzge0B0OCP+uImh7Q?= =?us-ascii?Q?i+uDRIIS5aUat8/f2soYHcVa9t8W1jqyTmByD69fGP8+zxhbgWkJUaH/T+Au?= =?us-ascii?Q?4sFaZKvrxh4as4aaJIUj5EXuy6+t304/2K2e1cAeqEyxQUNKximwXx5kxRmt?= =?us-ascii?Q?k9tzGtY0Xo1JVg28BnsvQqOnghvLKISijTMo5dwFtFRkognBUe+U1oWDVbCg?= =?us-ascii?Q?fl1cyptqFSCGCXdFkQskwpgQhAVxyFoZFdQFCWP5PCBGjZ0wweeAptbwLCAZ?= =?us-ascii?Q?2D26o19pF7TuYrZwTv70a3khco5/QA6meZSTevDiSjB4/Oi9Y9GFRxP5Fghv?= =?us-ascii?Q?FkoCmSxFWI50vf6V0eoO0gRmHh6LKg8grd+J3wCRswvz2kWBLOifM5uvKKZI?= =?us-ascii?Q?2mBqYA2HflhOLylf6MYuvORzZ2G+yj4wCAJoXFtVPnZyoWH0o5I5oEJe3Mtm?= =?us-ascii?Q?vmc+dQLit1ma/5eJiJQ/tPAwcOM8FE3v3TNz08n0TsXj24QOVTB6GzHq2GyY?= =?us-ascii?Q?ASIdgPCISwtAyDwP7uI5KlfV5hUa2/lH7Ah2o1pqTCDtwfDduq698EEoLOTS?= =?us-ascii?Q?jQUqkJpSscohRf8KtEFod4NrkXBg+j1LCBPBeBsYFr09Dc8ToJmHfo3xlqSo?= =?us-ascii?Q?s7JQ5qbyNz4yvna9uYJ8uI7rXsz+ighmrNdVH/gBW0jTRg6cjra8UobIc2Z/?= =?us-ascii?Q?1tHESavxLskTl8I2TqKxpt5laPqZkgyYD3ys+EVMRCTaSyzCD5hV4a1LGyxx?= =?us-ascii?Q?hn7ZrJ88AjpmOAZeICyYy38H6yAe2kuOFXzc8GWd9WlTDjvFt46pXRY4VZ96?= =?us-ascii?Q?b7YhyAo6wtoET5UTRzEwQXzid2Cu9Pw2y1ULSXl1HHmRktkHhtGq4C6d5WeJ?= =?us-ascii?Q?+O6S8EN0DfJD2/hKl27BSr5DB5oFL+P/xFDx1KB1Om8=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB2764.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa95af62-60b5-4a6a-edf1-08d8b8b32030 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2021 17:37:55.0550 (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: TfPjGvEJfZfpOSGDRCOe8a5f6SXlmiIyVfSYL0yIZSJsc4CWldkInN2S1jXPIhq8RkxJZLDyur1JDiXuA4kTkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4108 Return-Path: andrew.kim@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DM6PR11MB276441C7AC573E584B3E1D1685A80DM6PR11MB2764namp_" --_000_DM6PR11MB276441C7AC573E584B3E1D1685A80DM6PR11MB2764namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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, 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 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_DM6PR11MB276441C7AC573E584B3E1D1685A80DM6PR11MB2764namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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&= gt;
Sent: Wednesday, January 13, 2021 10:32 PM
To: Kim, Andrew <andrew.kim@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 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_DM6PR11MB276441C7AC573E584B3E1D1685A80DM6PR11MB2764namp_--