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.4511.1610605911141081548 for ; Wed, 13 Jan 2021 22:31:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=PZxh9gQA; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: zarcd.zhong@intel.com) IronPort-SDR: /tL07ZTgFzCbzVlKPYJ+OwB1l8IsyGN1I1e8evd0u2id8Njubs1rtIQfqCSrf0VaffT8iKmAXz lGS374sJRG7g== X-IronPort-AV: E=McAfee;i="6000,8403,9863"; a="175736627" X-IronPort-AV: E=Sophos;i="5.79,346,1602572400"; d="scan'208,217";a="175736627" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2021 22:31:48 -0800 IronPort-SDR: 4UMrcW1AOpcEOeVkWw0KYzIU6D7F+5uYyRGyjwQoank6WNgMFiQJvnUGbDaCrha/rg/8CuSvrX m2oLMJdykFdQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,346,1602572400"; d="scan'208,217";a="389714349" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga007.jf.intel.com with ESMTP; 13 Jan 2021 22:31:48 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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; Wed, 13 Jan 2021 22:31:47 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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 22:31:47 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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 22:31:47 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) 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; Wed, 13 Jan 2021 22:31:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b1yXm42w5zQcLdDtHvd/7HeeUTZOt6anWqkKEiLoUnEdNx04VQgeWI2DMlwPVRAAPWIQJY6c/i8FXLVGs1zQhzVvaptZ3OuHfE3BGnM5KTIEA1JnQK9lOXnezBgtOPZX+gobjZlgveleiUJnYqSff9Iiso6hb+g+m/IDDpIu6dMH0CyqYkst2dLxTrKLzsmaUpW5nNZvt01gG3FSBh0c5pvwxkLX6+50F4cTTEwN9hHEhlJ+KCOST4vO/mPZMKIpMEG1Ht1GutLq0L/E/p54X1oM6KiKEhVeqEuYMEHkgDMdlAr8MD3axmIdezh3U1pkQdiRfehDexKpWyL89IlZUg== 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=Tg7jDDX3wiL2IkGXK5jMmsplzPS2p6PmhsGPza0Cmws=; b=Nk7Hgh51EiN/yur6P3LUsHI7T2gvUNHVCcgoh5DGMOdo8pyUCY9lXOqGXlSJM3Kz2oUAU7JcfzhFRushrUbtp/PQTAJy7Ww19to96NrOrCiDuu6M1mknFRclKP5zNru4NBOYJ8okcRcenF2ksNjK2RG5uNluxMReTVaZYjtCcK3A94gWdP2FiAHfFAjA76W/10yY/mToe29FIMWcDYCWNJU7j75EkVraRTD6YA7fYEAn7gJ6Um9nzlqe118Qa2+m96JFBdMR7UFy82fVl/uEsYHTfNO4h9VTGEtAo5sP2L8kCoaY2e2MsoJ5MtFBFhx2f29JLssrnKWXpEQpRxzKOw== 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=Tg7jDDX3wiL2IkGXK5jMmsplzPS2p6PmhsGPza0Cmws=; b=PZxh9gQAHfRs+FbPpf5KfOXdP/MSq3IOh8DKnFSPtcOo3g6LXNM+pLZf77qLQTGErqBAz7WLxiD62GVPAvgozBO0/vsrMwItyA8noDy8+ixyok9/b3yQPRs1jXFOgPRuhrq2ZY+0CmbBEcpK29+xTrRLUXGqlkerp4iQ2ury0qQ= Received: from MWHPR11MB1309.namprd11.prod.outlook.com (2603:10b6:300:20::20) by MW3PR11MB4762.namprd11.prod.outlook.com (2603:10b6:303:5d::21) 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 06:31:31 +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; Thu, 14 Jan 2021 06:31:30 +0000 From: "Zhong, Zarcd" 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. Thread-Topic: [PATCH] MdeModulePkg/Bus/Pci/PciBusDxe: Handle BAR sizing fail in high 32bit of MEM64. Thread-Index: AdbifqrbMhe/1KwPTxui//AvwMCRQAG+ZBhAACnK61AABqDE4AABJCGQ Date: Thu, 14 Jan 2021 06:31:30 +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: 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.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f895ab00-5c58-4716-5e96-08d8b85607bc x-ms-traffictypediagnostic: MW3PR11MB4762: 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: gDn34m9DqBngwc3kQQ44ZkoAnshMZJEwQHaqcxZagB3xxmxZc1oy+7oW3wJX+QOeFjsp36xMZn+IvgUXQYceSzm2lEJwyZqnaSKMgogUO2cGPWw5Slz63y9QhIyKWZqnClSCxsrJjaZXJwS8Vdz/uXOHLtoOixTME0NLK8o25hUzjLIwxIn9Dg4z10lKpM/H0fe4WVvLUib2CJkPfGsPFpbSXCXObyC1cBKExRZQqsYiujxd+lsnLeLjjg8jRXopkr0ivKS8nkNZ2KDOsgNee4fdpVGYXZ4VuPyibbUITA+uWGuWGL/krTsEYjFLFB99FKhsPSQFc5UDDGkd1yvues+qPI3sflQxNmCX3sP0sXcQ6OKoaV74u6w3Wcihu7J9n0eTUDl+7Q8vxr2NNt4/xNwWu+nK7SYxEizjU9fuKyBcixiHvZS3CXXM4fnPUpJAKpMFJiQKxTYeSjZu0WbAdw== 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)(396003)(39860400002)(376002)(366004)(346002)(136003)(9326002)(8676002)(52536014)(107886003)(83380400001)(8936002)(53546011)(64756008)(6862004)(6506007)(166002)(26005)(33656002)(66476007)(478600001)(9686003)(7696005)(2906002)(66556008)(54906003)(316002)(4326008)(966005)(5660300002)(86362001)(71200400001)(186003)(76116006)(55016002)(66446008)(66946007)(6636002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Ofa3RCMesqsjTNLzYaxjeUsQejO8L/gV+Q2ruqNrHmGD6o7jjkw8LM0LPBaY?= =?us-ascii?Q?FaM6Fujp98JnaQTJMiRe5p3+IusftbuGqUSzW98Ndx6/NvL4IhceNujBhyZI?= =?us-ascii?Q?xo/9p8ofKqWD0jc4XyG6xIjbzuM8snooMLAtDzKA5HeLnwdmg+HU8HImbTzC?= =?us-ascii?Q?xsMKRXL8gSVlVDslXJ5OmyJ9ZgSY0hD5Xv9lxsbOV2x2Be/XFgVQm7ec79Ou?= =?us-ascii?Q?ds0uUsveQQfQUDS2QYcJct3IIY1HFH8BOStOhORa+Dc8SC7DOaSsAUNPTFyx?= =?us-ascii?Q?C93NpCG2vq02hpp4oxrZgmlttmXBmEfR0k1JDAMn3pG7sNnjcBJjkYzUnvo+?= =?us-ascii?Q?IEo6RcZMB73XVQZvqYbHEsn8c9Qoltvu8Hu1Q1Q1fjwdc/VvsReFGPjca86Y?= =?us-ascii?Q?naDXeYR4YiACyz4YSjdSvdmdNw0v83352uyy+m01jbmw9t2EAEY2umML9v1j?= =?us-ascii?Q?Ntf2OMEQCbsjjQz1Knu360oTXb7/Him1YA/LC+ieq8NkPsBalcMBVxV/V2W3?= =?us-ascii?Q?zL+5jbGe4tj37BgKNa3tydWfWORckYlU4H6WeIXX5sdvaNcD0RhlsEb0St0D?= =?us-ascii?Q?JjfEaXMBJ5WbTItcxIKU0L4QzqOHfRNGZXphuPBuJ5KarJQ0qDar8R26LN9q?= =?us-ascii?Q?LG8PBBEGAhv4YgWT8RXOsp9BaPdittFGkjj9UPOOirwqHLlpx3K37UUHWwaY?= =?us-ascii?Q?Q1PNLdrKpz+GmV7V4OGkx2rvpQzveYhUA9lM7dssuMRXxdkCcMrem421tjWG?= =?us-ascii?Q?F/JvX9/WFtTrS5L6kGLu/8ShG2JMePaejxLADrgzaoYZ4sWIPy/iHfDVqbbd?= =?us-ascii?Q?I++ErNLSbjNOpIQ3af6/hmyrBZF/D2BEGBOuGXJeqCaDGSRLK5sv6Xxt66ql?= =?us-ascii?Q?J6zcl92a4oh5okQdGHZqFRm6L7L45I8jU2/TP8x7796g5lTDk10yv4oFtvSe?= =?us-ascii?Q?uYFwq8/c8TRMGopajntOga6GYo5LNBXB2s7LrXjK65w=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: f895ab00-5c58-4716-5e96-08d8b85607bc X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2021 06:31:30.7290 (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: L5aBrDQBskQRPPMwxXNFcL2eXCHytaOa6tQxwyTZ6O+B5w8wcKreGWoGMfptjirBkDKvKFHHyJd9cJDErYsTgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4762 Return-Path: zarcd.zhong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MWHPR11MB1309EAF1E71A1B0D780502C9FBA80MWHPR11MB1309namp_" --_000_MWHPR11MB1309EAF1E71A1B0D780502C9FBA80MWHPR11MB1309namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 ; 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. 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_MWHPR11MB1309EAF1E71A1B0D780502C9FBA80MWHPR11MB1309namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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@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.

 

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_MWHPR11MB1309EAF1E71A1B0D780502C9FBA80MWHPR11MB1309namp_--