From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.4724.1610521297387060035 for ; Tue, 12 Jan 2021 23:01:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=k0Eiv33m; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: ray.ni@intel.com) IronPort-SDR: 04N9TIOKpdPcbMtP0KRDnL3k2WOXvsKPQNzOsSarXfAU2YoG2FpPC7DsrqHB/BEF+JWsyndN85 ejOZe3OPvEow== X-IronPort-AV: E=McAfee;i="6000,8403,9862"; a="178308840" X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208,217";a="178308840" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 23:01:25 -0800 IronPort-SDR: /c0TpQmGlbiLDahtFvmhfhTw52N8U6gwJVUgTER0iAv8/SZZ5xd4FhLimi1PxUFdFhGYYK9roI 4r3BwY0gKqug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208,217";a="363786458" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP; 12 Jan 2021 23:01:25 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 12 Jan 2021 23:01:24 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 12 Jan 2021 23:01:24 -0800 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.54) 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; Tue, 12 Jan 2021 23:01:24 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EmIFd7oqCpRgI6nQTpVPza0i/rGeA2UFakYpiFCqncuf3S/84///DTqOfNKyL2a3TrskMc2UajeqfZojvdqdcPpjZIH2HPLihCWWjKCuVlum+6cO98BLv50qn2qmTMiCSbY8e79rBGdZ/hOmOg35HTdiuTtRtmqjIUbYbo04FAuc4Uap+w36Gb6DAdpm9hoIabi3/OKQFJNH1nvnTPjJ1rD6oSN0PZ0nFCMzrQa95oVZSDxU8GpUD/+bniN9heCayKjB/OhFJ/98Lqp5xVd1ooPm8T8p7sOQ9ANyz7ZXgg4zNQS+gXO4KUDCDph/ueqbOV/OLc6/Oa8jVoZ9mbUwGA== 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=iw4Av0QcxwGP+MlQerX2f39Li/g7mbkSNyLNhJ4EBDU=; b=JtcxOBbG+DECIOSVBhvGiUHYzWpnBMCWOxcE0uw8cjE8tvuMtn8Q5mZUv5uPL71LSZIa/g4rh2BqMv1FOzbqRGlF/Wbe6dUAe8GNqFpDnFwMB/loru3FFq1L+29Wyi/4kidjJZm4mUTeL9HzeezIjXCjufpDpa3106A6RZJHSyWFUsZjZfru+/U8/ZLSiBK1pFBswHOLuleAXDCFpHDiEy5/NRJmAoxUFnba25LwPKBuLB2N45FssyRyHAr7cA3s1YbxZnqkbLHcr+7/t3egOzlJKJgGyJSQdYP4rN8eN2JACM1pLFxtvYV18buiiXfYgPe1KLgEHQ+JM8tEZEdkRw== 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=iw4Av0QcxwGP+MlQerX2f39Li/g7mbkSNyLNhJ4EBDU=; b=k0Eiv33mr+CB1mMSJ39HrBc98iN3hLn8kxqK/b9Rsah3xwAhxQgWre0kF7orkFaB43/MJCmxagGVcRGi5VsCdK2552wp2G3rUpU6aCvE+ES6qVXqk1Bwz14JnqAdz8LLkDIIynJgW3AGbhzjFi0EVs6yxBrzPpZ7wZqp0kmKBi4= Received: from CO1PR11MB4930.namprd11.prod.outlook.com (2603:10b6:303:9b::11) by CO1PR11MB5044.namprd11.prod.outlook.com (2603:10b6:303:92::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10; Wed, 13 Jan 2021 07:01:23 +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; Wed, 13 Jan 2021 07:01:23 +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+ZBhA Date: Wed, 13 Jan 2021 07:01:23 +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: dd4cae48-8f87-4950-9f9b-08d8b7910a09 x-ms-traffictypediagnostic: CO1PR11MB5044: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2SAW16QJdVcgeTzl76w8BDgbDuZBYxSO73esTFHdKgq4a9g0V7LbqUBtq1BpvdFodQ+ejQlwmVM5juXufO1upisGmbAYTT/SDLpC0Z2puCDj2KkB10gmbue/uJ7vP+fI7WJ/KsCasSr0k6LtgXme2Hcp/SVa0YlnLTzFYwy67UxmWhiK6nanvDFuQ9sfAb1QweJg0ZFZB+lrV4pNzynKzSy5BYCq3gEgz9u2W/jvSe5zm5yASsPQK1+H1xjXdRh26JfhQG2OSyQJHu71ZcM4i495W2JqACZ/+2wVdEJCSeFiGGqzW4XLnORrgBAWSoGB55dXu3R3gK+bDu7TXgekyaitffwnL9yawqy+fyBArzZ4wSDplIr2kC++DhyI1N0Z5jFMhWMuDS2YCkIdauOW5vhtzAu2iGCdoVj42UrPKE3TbantJtUc9PvDgXg5XBhAiEHFF3ZaT8FIoXdEGS9udQ== 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)(376002)(366004)(396003)(39860400002)(136003)(346002)(6506007)(8676002)(166002)(4326008)(53546011)(26005)(2906002)(86362001)(186003)(7696005)(52536014)(5660300002)(54906003)(110136005)(33656002)(71200400001)(316002)(107886003)(9686003)(55016002)(66946007)(66556008)(66446008)(64756008)(76116006)(66476007)(966005)(478600001)(8936002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?2whyuJsYF86M9xdB5x1UGLzYeT/guvThopamnGB/G/JzOzUL+l9jZibEG9Ek?= =?us-ascii?Q?T3QPaOEHCUydqkFgDHj6f0G4KWokQYnRJJm90kvNSFI9hT7mnFBudmU43UIO?= =?us-ascii?Q?74Obtiob3hJ97X1kWinm9xOzvAsZ/EBPqlpZBAi/TuRTvaErTIQUHi4PqfBh?= =?us-ascii?Q?6hvqufTafJLede2Ucai46zjyPDV1JjfmZ00gUx5DJ33GGAeB0lFPVVQcKmUU?= =?us-ascii?Q?nyBgx3ucKheK6+fxCxBhlW/SGY+zSfAm8Yz3ZCiOFYK2z+Obja5ypKKLrClN?= =?us-ascii?Q?tDwE4CtAll4opEcRF5nIllHmH/6lRiP5TQNZX5GiUTI/S7LK3SNmldA5TLlI?= =?us-ascii?Q?AD4/hqeGATRLWuTF+2c5oA6UC3ojED0lFoKwEhHW7rSDTTGFXV0skRmtA+DJ?= =?us-ascii?Q?ucDcwJhZH91kivTwpddglY0BPsprpCPsHaSy14Dz8PjWuGosthG6HLIE2kJG?= =?us-ascii?Q?/9jEornsngFxwoJ3hhQKdXgG10qBnR0+G96yOfdopDExpFmyQ2lOG/kngyeR?= =?us-ascii?Q?7aDvGbDMPeOsGllUidA4Fv4/9aMPO/d3AC6GHqEBXvpnFrLsWTKhUSkriSRg?= =?us-ascii?Q?iqj85mMIrTDcBi40keFQ3kX99K6lULHT/GZF/nUuCJpV5eONALMw9SSOwvU3?= =?us-ascii?Q?+irzSivt8daHSL3gTbhdg8KY/IqzleHV1BJoy2dgisLYCTkdAk6nKENt5AWa?= =?us-ascii?Q?PeUr0FZTuXt8S4i4g+CIkDdCgAcZ8Bph5q73Fj94Yb7HlM4csUJR227sOI5w?= =?us-ascii?Q?UtuVYh6U20kT8Y/MUiLh55JZgs9xNRYBNPmwwzTZEYnXXarneiQtvHSclfs2?= =?us-ascii?Q?3YR2sR0H583db5yBzBfXshj05EOycdjlpj+p8AacMs1ywy8kYpQGD9ErNZml?= =?us-ascii?Q?9iT0mzFDKPuZunQLl1wpWCaA2Axhv8Jc3XCeUiXzG7Q2X2nNJ7akLs0EUYwm?= =?us-ascii?Q?CH/gQVUY5OMELU5BAn+XF2SxEMtfehWikCFt6QMLh5n00xkrHk+Ry4EG1sqd?= =?us-ascii?Q?9cRk?= 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: dd4cae48-8f87-4950-9f9b-08d8b7910a09 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2021 07:01:23.8602 (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: OPOj+u5wHgt5M2ZrI3+IgYYwiBNpW6pSRfHlp8s0U+stjOukDTvcTJqKdlEdOp7e/Ltzuuj21JU9Co1v7c3U+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5044 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CO1PR11MB49303AE73A74B7AF6FFB90098CA90CO1PR11MB4930namp_" --_000_CO1PR11MB49303AE73A74B7AF6FFB90098CA90CO1PR11MB4930namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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_CO1PR11MB49303AE73A74B7AF6FFB90098CA90CO1PR11MB4930namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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&= gt;
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@intel.c= om>
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_CO1PR11MB49303AE73A74B7AF6FFB90098CA90CO1PR11MB4930namp_--