From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.5758.1655519865303752969 for ; Fri, 17 Jun 2022 19:37:45 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Shwqez04; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: lee.m.hamel@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655519865; x=1687055865; h=from:to:cc:subject:date:message-id:mime-version; bh=7VDsrM7j1qIPRAdd9Ks2k+5Y5QZ5EWi6nwXdp9L/f5Q=; b=Shwqez04+c6PQtGOPfpjJ/p+EX8fu1CqSrpFtP4o5QO++c63DOYRGvhj z7P8leER2gAqWSjShcwgAtMpcdCTzQbjx4dWz1PX22ZPKb2SVz1IDuX/Q H7rwpcs3x+QCR07UC7kQhrGOD6mmjOWrBCiAvW8GJu813CcZt6ZRnoITm eHWkHU9viFu1bG/uAH59oT8YDrwJJJpQlvAmCotslxx03W9FIkhYozOxB d98q1VbEM+qp1GXclIdT+EMS4RCU6mwGWdfTN7Hi6j9q1bQoVuinzUO9g lBtxTSv9Y6u0UQQsNKYRnyrD87el3Yq724VwQZH3hA4pKfrK5tego77Z+ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="268338594" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208,217";a="268338594" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2022 19:37:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208,217";a="912840177" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga005.fm.intel.com with ESMTP; 17 Jun 2022 19:37:44 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 17 Jun 2022 19:37:44 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2308.27 via Frontend Transport; Fri, 17 Jun 2022 19:37:44 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 17 Jun 2022 19:37:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cTUNluiOZjVHDeH2NuElf3SqoIJZHHfudfm5YaVCqg3m6TDXtdhv2XE1TQD0zzL3iKbesmGYZ/bydU6CDkLftaO1p98Ha3WshL5bF7zOZQ1CnEUVesaRqO8sIKJDxNwqf7qiryuFuXnFPh38OtKE74oP4WIfM0j+Hm8HE1toFT8BOrz6wLMtBvogPfak341uKJpgA6+uvoY3ldchMMm3ND+Bg6Bj23m56FwVskUiT4DNUhslb8MvGxJ7RCWj5Uim/KHvfvFGRQgjkYf/tdbA6aBdOw+7P9H3em9jzxIObVoj/wM4TWQC6UUpQ9GQE56vA5vvzoXRaT/d17+nIjCbfQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oiR3O/hk/YAYkhJsP/BDdwMnHOJqBC0KWFtB8Uluvl8=; b=Jt0YoAA0RBUAgwN4hj7+3CyuDoNz8OcnLpCZFguCZDfBdw9LfSeaFHmHq77q3WvccNkcsU1a5d/i6OeS+zJ72HRFn2mcZEV05mvxD7Tq/ZXVY1Ux8mddzT+s05h6HM+mQozoch4clvjZPyzEBjaiKBSmgyCUdxtl5XOXa8R1nTUENyh7ejAcqL9ozJxEpenFSZ2kOW8FY5Z1eiJPliOmUrLcUh5Jaomsw7hXIMEfQpAmOByE83DpJCrL2c7hk2qRWooqIw41HT4yL2QLLhdXAwhv9okNmdF3fzciZi+a1mJhSJMfkvVCVibG+9CizqMnbJY8IbAOtRVuEDiYCuknDg== 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 Received: from MW3PR11MB4716.namprd11.prod.outlook.com (2603:10b6:303:53::17) by MN2PR11MB4367.namprd11.prod.outlook.com (2603:10b6:208:18b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.13; Sat, 18 Jun 2022 02:37:41 +0000 Received: from MW3PR11MB4716.namprd11.prod.outlook.com ([fe80::7d38:b5fb:ce27:4e87]) by MW3PR11MB4716.namprd11.prod.outlook.com ([fe80::7d38:b5fb:ce27:4e87%2]) with mapi id 15.20.5353.018; Sat, 18 Jun 2022 02:37:41 +0000 From: lee.m.hamel@intel.com To: "devel@edk2.groups.io" CC: "Wu, Hao A" , "Ni, Ray" Subject: [PATCH] Edk2/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c:XhcCreateUsbHc: check return value of XHC_PAGESIZE_OFFSET Thread-Topic: [PATCH] Edk2/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c:XhcCreateUsbHc: check return value of XHC_PAGESIZE_OFFSET Thread-Index: AdiCufEmK6jldJKbTWixYRB5oTl5nA== Date: Sat, 18 Jun 2022 02:37:41 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 715fad62-fdc0-4de0-6d3c-08da50d38426 x-ms-traffictypediagnostic: MN2PR11MB4367:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sycTVEv++gsLnYx2GPB1dhZp7GiHXmItXQK3sUgogjT/LKNiIo7tcdjGFZB0DQ1Wpg1XbTcpNv1AEABFsgfST4Ccwi5gZyVGHTel0ZCoj8MDkEm2yJHH7RqPcTQ8ENJreElJXgeIjfbbSvyi1z2SD+o+6n01yoF6C3PNomHXfvXVOoxDe9m+X8i7NBw7ahSBsQTBym1Tyivl8X/YKAldMkdm2ov2YOgWX17Mh5KQ2T5qZfoTFYNyWcWL8251FZFeOHreieMCJ1jr8ZrB/U+rT6vao4/XawbvxH0HtkRZQGKjMkZAywzNfcuouEdrvkqUacUMp4Cyc4HLEbNTnmmdRuLW7b4yUk0/DFm7CLxNdjYzQU6B7OZurf21HG0clapDRKCGQqIWN9C1PyTW3Is2Y/moVjLee9a0cTHK2o7yE5ooWAn1X3214yjm6aYxOEJ9c6BGGI29nWj5RCubczCnYQCk42VxUGV4TCGqFGKsp7CnY5I8CfT1rT8UQpRCES/WaYNPpWv9LO2ADMiGbttBGDc2GzZgnj7UaQWHICGZeD82VscqRswfFeY6jqBUkWPblefxLFjxxPiuWwxm1JEZYs5nogsHiFIOaNRi7sq7LRM1p3AXysplgYBSvYMZFQ6QgyxEeF9WQUw9sKirvbYdwFps3paZo8GGlQQltglmsCAEeD90WfkiNc29+H1zQkndtbFOewek+/9tYyyhw7TEKPktGKnlj2nVhKvmxQWuKyL4ivbsStN5yKUJ1dpzemQkCspp4xSZMdcm5REh/f5rwnuccUlRnRPcOxNoo3MtXt0= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4716.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(498600001)(107886003)(55016003)(9686003)(71200400001)(122000001)(166002)(5660300002)(966005)(8936002)(186003)(33656002)(66946007)(6506007)(82960400001)(4326008)(38070700005)(64756008)(2906002)(52536014)(66556008)(86362001)(66476007)(66446008)(38100700002)(54906003)(8676002)(76116006)(6916009)(316002)(26005)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1Qsy94sikcPWJAVhlzdwaL3wQ8HiifgG9FAyaDoQyA/xNl2G4kGF+WfgI6WC?= =?us-ascii?Q?kl79YV4lNvx4t0/Ty6nga4rBac6MQn1rbHXXlCsxJizmwxvF8AgIEqejMF3/?= =?us-ascii?Q?HleBFBhDC1WCKU5hv5tOi49k3ZSwBZ2adg/iwm0A1eX3VT537x4giq1VOdQM?= =?us-ascii?Q?ySpymzLzjnLWcBfeZ7xc3bpZxnlXmZMwj/rVW2E6Eg/Ya1xacp9FN/28qIhI?= =?us-ascii?Q?rNvor5Qc3wZx7B9XQwRCtux/UK6qpLnLEPXj9cxsmoaiHqw+ENW+nUvZvszV?= =?us-ascii?Q?c1y64euyipzQAfDoIbCm+fP2CDhN7iTLHqhJlewpZV5FOujT2i8PZNyq4Qe2?= =?us-ascii?Q?1KRFXdXaJ6jS6WzFlHqyN+ICsE7W22XEKYWW+Tu9wM+ZsGgu7zjKhumfEoVC?= =?us-ascii?Q?cjmxAxjJPBsyoa4mIepZFOGydPew+iEW9ReWCFOsAAF45hCFmXFRNj7hfg+3?= =?us-ascii?Q?psqYgddx/1grdAfkFE/dB3MM4fclG6yfzp0wT0l1LlyQ1nom4NPI9mxGrIJJ?= =?us-ascii?Q?QNb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+O1c5fuA3ZkLJfpD?= =?us-ascii?Q?0dGcRXEsxeg+jhkQTuEj9dffQ5UHk39LTfQQsEYvSe4Y4L2ecVCYax6K1NPz?= =?us-ascii?Q?vqMwE7BCUm5PCWdUowG7mnWgwz1+uhApp4s6+t/KRnNB8nWG8rC37ez0GTw4?= =?us-ascii?Q?TpXWBwU9jtNY2vbuRFk4wR1GYfvYrx+OMCPDiBKAV7LZO5sHwWGLF9EoysBt?= =?us-ascii?Q?mu8/8iMr31Ar2sjCZFRNzSjrqukTdn3depFh9/KCvcsNUcE0391QTwsKPbbC?= =?us-ascii?Q?paVA/Puj0uGRI3/61kifkFI0Aej2ec9llWy1t8uE7sqdcPyK5kjSpmQRT0DQ?= =?us-ascii?Q?mC20H2k8DQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4716.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 715fad62-fdc0-4de0-6d3c-08da50d38426 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jun 2022 02:37:41.1622 (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: 0qUCS0OyWLthNjgFNpRDf+tIBNWNFBTDkWjmM5GyjuIYwFZYiQFpDoOged63tEysTYP0pPz/Kxve+HM1GMDgZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4367 Return-Path: lee.m.hamel@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MW3PR11MB471652395BE0113E3A5876D7A3AE9MW3PR11MB4716namp_" --_000_MW3PR11MB471652395BE0113E3A5876D7A3AE9MW3PR11MB4716namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3954 --- C:\Edk2\MdeModulePkg\Bus\Pci\XhciDxe\Xhci.c Tue Jun 14 21:29:21= 2022 UTC +++ C:\myEdk2\MdeModulePkg\Bus\Pci\XhciDxe\Xhci.c Tue Jun 14 21:26:57 2022 = UTC @@ -1,7 +1,7 @@ /** @file The XHCI controller driver. -Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -1813,7 +1813,12 @@ // This xHC supports a page size of 2^(n+12) if bit n is Set. For exampl= e, // if bit 0 is Set, the xHC supports 4k byte page sizes. // - PageSize =3D XhcReadOpReg (Xhc, XHC_PAGESIZE_OFFSET) & XHC_PAGESIZE= _MASK; + PageSize =3D XhcReadOpReg (Xhc, XHC_PAGESIZE_OFFSET); + if(PageSize =3D=3D 0xFFFFFFFF) { + DEBUG ((DEBUG_INFO, "XhcCreateUsb3Hc: error reading XHC_PAGESIZE_OFFSET\= n")); + goto ON_ERROR; + } + PageSize &=3D XHC_PAGESIZE_MASK; Xhc->PageSize =3D 1 << (HighBitSet32 (PageSize) + 12); ExtCapReg =3D (UINT16)(Xhc->HcCParams.Data.ExtCapReg); --_000_MW3PR11MB471652395BE0113E3A5876D7A3AE9MW3PR11MB4716namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3954

 

--- C:\Edk2\MdeModulePkg\Bus\Pci\XhciDxe\Xhci.c = ;        Tue Jun 14 21:29:21 2022 UTC

+++ C:\myEdk2\MdeModulePkg\Bus\Pci\XhciDxe\Xhci.c Tu= e Jun 14 21:26:57 2022 UTC

@@ -1,7 +1,7 @@

/** @file

   The XHCI controller driver.<= /p>

-Copyright (c) 2011 - 2018, Intel Corporation. All r= ights reserved.<BR>

+Copyright (c) 2011 - 2022, Intel Corporation. All r= ights reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent

 **/

@@ -1813,7 +1813,12 @@

   // This xHC supports a page size of 2^(= n+12) if bit n is Set. For example,

   // if bit 0 is Set, the xHC supports 4k= byte page sizes.

   //

-  PageSize      =3D X= hcReadOpReg (Xhc, XHC_PAGESIZE_OFFSET) & XHC_PAGESIZE_MASK;<= /p>

+  PageSize      =3D X= hcReadOpReg (Xhc, XHC_PAGESIZE_OFFSET);

+  if(PageSize =3D=3D 0xFFFFFFFF) {<= /p>

+  DEBUG ((DEBUG_INFO, "XhcCreateUsb3Hc: e= rror reading XHC_PAGESIZE_OFFSET\n"));

+    goto ON_ERROR;

+  }

+  PageSize      &= =3D XHC_PAGESIZE_MASK;

   Xhc->PageSize =3D 1 << (HighBi= tSet32 (PageSize) + 12);

   ExtCapReg    &= nbsp;         =3D (UINT16)(Xhc->= HcCParams.Data.ExtCapReg);

 

--_000_MW3PR11MB471652395BE0113E3A5876D7A3AE9MW3PR11MB4716namp_--