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.web11.18460.1633033058873355071 for ; Thu, 30 Sep 2021 13:17:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=xBmXO3GX; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: guo.dong@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10123"; a="225320725" X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="225320725" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 13:17:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="477110582" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga007.jf.intel.com with ESMTP; 30 Sep 2021 13:17:37 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2242.12; Thu, 30 Sep 2021 13:17:37 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2242.12 via Frontend Transport; Thu, 30 Sep 2021 13:17:37 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.40) 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.2242.12; Thu, 30 Sep 2021 13:17:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XSRoDHbwvB4PYLc6dhZ0ABJBlOIfcEb3rm/QZ0XR2m4t+jC81pMU0qLGXcPG/IebLYsZTmat5qyNklvvb42VCY3cswdw0DxO1EW2wEw6XSUpg/q0yzAIBKTHg7KpuUSMGXu490Py/spHvnB5+BWyVuImOWrTd7GpcVyBSMFTS8HMWbfycMG232Sn1RJI7euPPRPJ3Qh0NRGbxMgWcLXYp3dq5M9fSehJLBRPkKNI4k9QTQVyVvNPXTSHQiUIxlNFL5VjPlP1G0bGh+r/xVgZdWELts8VJ7l0EKhlCZb8vN7ERaJokS5B/PWbD1G8pCYyD2mrgQ8pW6/OSdx+5NNohg== 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; bh=2C+67I4LAxdnPJmDP5tcDgAxsMZMicgAIEqbRGdpZ28=; b=aY0FoV0s+UQfgbe9NC//rgRN+g1XHFN9lXgjfQ45F2TXh/lNwOI59/9iaaErKepcYriyvaMo78iJbj+WWh8Aaj1hdn9D/SLuZrrklnvU/N7PFuSIcOVAAQ/p48X+1MRr2bqizD9+qNYCQl//WcpA4dAgeOl8/lmRj9fVU2p0Po02InANtqjXgPEltP+xjx80t5svOiFi8aLAbUDDoz2tOM1PH8sdmgVRcJILaBRjcpgFKw+TQ1LOidPGzZWD6LTaELx7VcTYnBEZ9uGP1vMfLIQ4I58v+izvsB/hvf77zrWLNc9u3sc69umPivt2gutK5+9apsjqG5++tx9BHeApMQ== 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=2C+67I4LAxdnPJmDP5tcDgAxsMZMicgAIEqbRGdpZ28=; b=xBmXO3GXaUsHWpIUBukKD4YnW4yjHAqD1i38GUcqfZ1W4jJSwR9l9M6z73r7BwueWokIvt3tUVwQkTcJQ/9ETaNrXhNtOliTnUID4YwBLV5IgCB9ToxihdEXdqXiYvtBGYwr3xZPfj32L0qK7cYbiKCCkwQ1OIjAWfyOdZYa4wA= Received: from BYAPR11MB3622.namprd11.prod.outlook.com (2603:10b6:a03:fe::30) by BYAPR11MB3255.namprd11.prod.outlook.com (2603:10b6:a03:1d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.20; Thu, 30 Sep 2021 20:17:36 +0000 Received: from BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::d40b:f4f3:3815:dd69]) by BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::d40b:f4f3:3815:dd69%7]) with mapi id 15.20.4566.015; Thu, 30 Sep 2021 20:17:36 +0000 From: "Guo Dong" To: "Ma, Maurice" , "devel@edk2.groups.io" CC: "Ni, Ray" , "You, Benjamin" Subject: Re: [edk2-devel] [PATCH 1/1] UefiPayloadPkg: Add PCI root bridge info hob support for SBL Thread-Topic: [edk2-devel] [PATCH 1/1] UefiPayloadPkg: Add PCI root bridge info hob support for SBL Thread-Index: AQHXthyTtdpj+yKRrkujXfIljHAv9au9BCdA Date: Thu, 30 Sep 2021 20:17:36 +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.6.200.16 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1aad45c1-ac8c-4d69-b36b-08d9844f57e3 x-ms-traffictypediagnostic: BYAPR11MB3255: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O4/i6tUK/IjZuJW6tyBQAq75dMG+xYsHcBAI4k6cxJiipi6xP7KD6vWPVz3J3oy5LnWhGN1KugqWX4pp16tCFJGAWLKZXdjW46pvXx3o5LBqVENLu1qlK8OqugECydW5eaVss9k5tYOFLPY/q7FsSggsFgc0sl22BijX1pv+RJMJJA6w162lSrvhbgYJ+0PfHFYz5vdpGYHUj3OXTepRtc4ZfEDjz8gUHcDfgcYmzLjbCGF1tqf8o2mV4yDECvuKbT1SaM0Mcah3hTEhAbCz4cPBHRTcImXoqkRepbhfz1+Fhhet+W2bYugbax2CXiQR8Y7m91yTdUiALTdQN36zrordCpOfT9nr2XIIxdjM5CZo74yo48581REy/5bAukEZLJP27oxBO35bkNcMkijDm1SB53fCr85KxxJiknl7vOv75HNC8EP6tAB/L7iY9hxY6+2/8/oMfmCqneC7FsGouzepLpNnLxCWdyced9To+KzQJi4IYNO5McwiQNhdFu2zcX2cLtG0WFOSD7Wqh57bDSXG8X1cXCVVFnoyUWl4WnwGBIKodtzcyHNWHhMRj9kVti+EJ/UD2IK563FpADWhT/7IgBOl8VPljeOaFcXraXAOdgvYAvXzPTYaufDiIMEqw1pG2twcz1zZdGF+asFP2UNmEgn7xTepw2TernJ6w6JRtM7RH3K8YSEwt/j711EL1d8dUos4rNVebuWOMU0PMQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3622.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(38100700002)(86362001)(8676002)(53546011)(76116006)(66946007)(52536014)(66476007)(66556008)(66446008)(6506007)(64756008)(186003)(8936002)(38070700005)(5660300002)(83380400001)(7696005)(316002)(107886003)(54906003)(4326008)(2906002)(55016002)(508600001)(9686003)(110136005)(33656002)(71200400001)(122000001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Xfc86OZsWPOt7QqqPsZpyKF2L9Tw12rjCOMAGd3tI3+RR2tb9OLtck4Pk0Tw?= =?us-ascii?Q?mcac1xyaqWeLcTx/HtnU5nvCh3wJ6mgr0aOnLPLlVTzKBK+P3vHl89KiYwMD?= =?us-ascii?Q?pgqChGseFYD0CF3ZiueCR9xxnox9FU86Ht+aAx8pkkCkzWYuaCsgcuDPF9p6?= =?us-ascii?Q?oFaAU6oho9VH9zrkKR0EaGNiCaCAhPX4xZd9hlslR7YeXBtAi9yQvaNknsNj?= =?us-ascii?Q?W4hEUYly/F4DGtxXtgLFnHDsb25UrpFb3NQNNPzJDyCZ3AekAT21YFGH/FQu?= =?us-ascii?Q?tquLywzYip9lXWjWNTi/U5EmmbmCluXXwnjzUITfkkhoq33n1ygPaWzkCS6N?= =?us-ascii?Q?j2HOfHsmrGuVwfY+4m88SiMHAHcGeFe8fHfBMVU9TlsHWTR3rhQtcK8ROc6m?= =?us-ascii?Q?tri2Fj5oAf8p4AlcmpyVkPxuBHjjIzHswBQP3uYPbqQvTS9ns1lxaKIUsQpm?= =?us-ascii?Q?RTkTUGgG7+YCJOzcAJ/w2vpKcywEVvIwByff/7WYpCgQoq6qPmp+54fgYTuD?= =?us-ascii?Q?Cu8qWKsHy/Ity5FnmwIkisW3W2FAzdwAO0JZoc9mz4I7rIhltfx0Ui+YR0ib?= =?us-ascii?Q?GyvP/yX/HNeyPnZZsUw1ji3fPnqFX3IPR67zfaiT7hIbolUDcI6PUoKhCEZL?= =?us-ascii?Q?vrQROOTncKHKuginiJSyAMmgHqhBVcXN/AAatCQ3O6+t/RJskpQWGXpCAnrc?= =?us-ascii?Q?s7vsvIIz5dqifBX6XjrONRYM//VlUG872CRnQZzZDF973Lr1dzbfo5493SSU?= =?us-ascii?Q?cwqQS+PNijDmYBcFtlFL/ZBV/xvV3oUl8DZlpsYzqq3EJWyKyctZbKcX/4N/?= =?us-ascii?Q?LWpy0FKl0bJN97u4ZfNWYmiea2+qb9RmaTM0toqdrUm9I516JJwzAC9FjLL+?= =?us-ascii?Q?5hakTZLrTaNy1NJphfqB2EZ4XfMYZvcr5XUphL34T9V1/l+EGz2yNjrOnWr6?= =?us-ascii?Q?W2MEPhJaKdKiZpgwD/Qw/vz+iYw9bIATbxPuicKiJI4tYoK2YTrw7GJU+j/F?= =?us-ascii?Q?V/XNOo9mpIoo823q9DQUbOZq1eIfWvBoI2UTcTyAEBd2DS+2U0h7/ZCNq3UP?= =?us-ascii?Q?NEAmC5IDqP2HnAFpoPkuQmqP2gE8I8gcQUvRwxrcCzdZQQbnPiVIfiiRhdU0?= =?us-ascii?Q?lBv2yzoZRA/W8LnC7E/Nhy7OlV3tge1ozji7uJB+7Hdn91XpTwEiTMB+Kce8?= =?us-ascii?Q?K/oRMY0Gm7kCmtHDM2ORQBEHCLxGbcD5ogLaqEhuaffaTDoJI7sDpUHZl26j?= =?us-ascii?Q?PaMdzGLGX3N2WIIN+baLZbZqf38uJ1M6J20XwY7IQxx6cABXayZGOpEHDbIT?= =?us-ascii?Q?xuZm+tdXKmWjvPHKPtvQ01q5YYpzR5p1reAFcsKOzVQMmPV6BQJ4QAl65lUw?= =?us-ascii?Q?eTG4vWckHODWuzEMJvkAxuFdcBog?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3622.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1aad45c1-ac8c-4d69-b36b-08d9844f57e3 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2021 20:17:36.0459 (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: fDUvIalfvFWrCdA1thpD7klAsM2KGLpgGjJ3Wi3qKFUFqH/p2pQP3R3j8H81Yi++FvBx2QyY6lBIYHtMzuUvKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3255 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Guo Dong -----Original Message----- From: Ma, Maurice =20 Sent: Thursday, September 30, 2021 9:59 AM To: devel@edk2.groups.io Cc: Ma, Maurice ; Ni, Ray ; Dong, G= uo ; You, Benjamin Subject: [edk2-devel] [PATCH 1/1] UefiPayloadPkg: Add PCI root bridge info = hob support for SBL Current UefiPayloadPkg can suport PCI root bridge info HOB provided by boot= loader. For UniversalPayload, bootloader can directly provide this HOB for = payload consumption. However, for legacy UEFI payload, it is required to mi= grate the HOB information from bootloader HOB space to UEFI payload HOB spa= ce. This patch added the missing part for the bootloader ParseLib in order = to support both legacy and universal UEFI payload. This patch was tested on Slim Bootloader with latest UEFI payload, and it w= orked as expected. Cc: Ray Ni Cc: Guo Dong Cc: Benjamin You Signed-off-by: Maurice Ma --- UefiPayloadPkg/Include/Library/BlParseLib.h | 14 ++++++ .../Library/CbParseLib/CbParseLib.c | 16 +++++++ .../Library/SblParseLib/SblParseLib.c | 47 ++++++++++++++++++- .../Library/SblParseLib/SblParseLib.inf | 1 + .../UefiPayloadEntry/UefiPayloadEntry.c | 8 ++++ 5 files changed, 84 insertions(+), 2 deletions(-) diff --git a/UefiPayloadPkg/Include/Library/BlParseLib.h b/UefiPayloadPkg/I= nclude/Library/BlParseLib.h index 1244190d4e87..49eac3124818 100644 --- a/UefiPayloadPkg/Include/Library/BlParseLib.h +++ b/UefiPayloadPkg/Include/Library/BlParseLib.h @@ -116,4 +116,18 @@ ParseGfxDeviceInfo ( OUT EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *GfxDeviceInfo ); +/**+ Pa= rse and handle the misc info provided by bootloader++ @retval RETURN_SUCCE= SS The misc information was parsed successfully.+ @retval RETURN= _NOT_FOUND Could not find required misc info.+ @retval RETURN_OUT_= OF_RESOURCES Insufficant memory space.++**/+RETURN_STATUS+EFIAPI+ParseMisc= Info (+ VOID+ );+ #endifdiff --git a/UefiPayloadPkg/Library/CbParseLib/Cb= ParseLib.c b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c index 4f90687e407e..f81aa0f301d8 100644 --- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c +++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c @@ -560,3 +560,19 @@ ParseGfxDeviceInfo ( return RETURN_NOT_FOUND; } +/**+ Parse and handle the misc info provide= d by bootloader++ @retval RETURN_SUCCESS The misc information wa= s parsed successfully.+ @retval RETURN_NOT_FOUND Could not find re= quired misc info.+ @retval RETURN_OUT_OF_RESOURCES Insufficant memory spa= ce.++**/+RETURN_STATUS+EFIAPI+ParseMiscInfo (+ VOID+ )+{+ return RETURN_= SUCCESS;+}diff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c b/U= efiPayloadPkg/Library/SblParseLib/SblParseLib.c index 7214fd87d20c..ccdcbfc07db9 100644 --- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c +++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c @@ -1,7 +1,7 @@ /** @file This library will parse the Slim Bootloader to get required in= formation. - Copyright (c) 2014 - 2019, Intel Corporation. All rights rese= rved.
+ Copyright (c) 2014 - 2021, Intel Corporation. All rights reserv= ed.
SPDX-License-Identifier: BSD-2-Clause-Patent **/@@ -15,7 +15,7 @= @ #include #include #include -+#include /** T= his function retrieves the parameter base address from boot loader.@@ -221,= 3 +221,46 @@ ParseGfxDeviceInfo ( return RETURN_SUCCESS; } +/**+ Parse and handle the misc info provided = by bootloader++ @retval RETURN_SUCCESS The misc information was = parsed successfully.+ @retval RETURN_NOT_FOUND Could not find requ= ired misc info.+ @retval RETURN_OUT_OF_RESOURCES Insufficant memory space= .++**/+RETURN_STATUS+EFIAPI+ParseMiscInfo (+ VOID+ )+{+ RETURN_STATUS = Status;+ UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *Bl= RootBridgesHob;+ UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *PldRootBridgesHob= ;++ Status =3D RETURN_NOT_FOUND;+ BlRootBridgesHob =3D (UNIVERSAL_PAYLOAD= _PCI_ROOT_BRIDGES *) GetGuidHobDataFromSbl (+ &gUnive= rsalPayloadPciRootBridgeInfoGuid+ );+ if (BlRootBridge= sHob !=3D NULL) {+ //+ // Migrate bootloader root bridge info hob fro= m bootloader to payload.+ //+ PldRootBridgesHob =3D BuildGuidHob (+ = &gUniversalPayloadPciRootBridgeInfoGuid= ,+ BlRootBridgesHob->Header.Length+ = );+ ASSERT (PldRootBridgesHob !=3D NUL= L);+ if (PldRootBridgesHob !=3D NULL) {+ CopyMem (PldRootBridgesHob= , BlRootBridgesHob, BlRootBridgesHob->Header.Length);+ DEBUG ((DEBUG_I= NFO, "Create PCI root bridge info guid hob\n"));+ Status =3D RETURN_SU= CCESS;+ } else {+ Status =3D RETURN_OUT_OF_RESOURCES;+ }+ }++ = return Status;+}+diff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLi= b.inf b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf index 665a5a8adcef..535cca58a63c 100644 --- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf +++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf @@ -41,6 +41,7 @@ gLoaderMemoryMapInfoGuid gEfiGraphicsInfoHobGuid gEfiGraphicsDeviceI= nfoHobGuid+ gUniversalPayloadPciRootBridgeInfoGuid [Pcd] gUefiPayloadPk= gTokenSpaceGuid.PcdBootloaderParameterdiff --git a/UefiPayloadPkg/UefiPaylo= adEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEnt= ry.c index f2ac3d2c6925..5a1e5786687a 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c @@ -321,6 +321,14 @@ BuildHobFromBl ( return Status; } + //+ // Parse the misc info provided by bootload= er+ //+ Status =3D ParseMiscInfo ();+ if (EFI_ERROR (Status)) {+ DEBU= G ((DEBUG_WARN, "Error when parsing misc info, Status =3D %r\n", Status));+= }+ // // Parse platform specific information. //--=20 2.29.2.windows.2