From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web08.4658.1609915891962773556 for ; Tue, 05 Jan 2021 22:51:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=JXltpObG; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: star.zeng@intel.com) IronPort-SDR: 9QMxM/Nd9X4BtVRRNhuCT6SKwrVJwn1Grh+x4IX1JWtpS8tvvy4jC9JSGZ5ODkmSPu0gKIDPWe ZGLW/8Tcq1sA== X-IronPort-AV: E=McAfee;i="6000,8403,9855"; a="241317111" X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="241317111" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 22:51:30 -0800 IronPort-SDR: EOo/oFbTqiDlQYDyMI61/MPgIzzr/WsghsWw8Tlr8X/4oyLfjDm0X1aK87pjsUJDlo5kppN2U2 0e59IMc+tyQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,479,1599548400"; d="scan'208";a="398116709" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga002.fm.intel.com with ESMTP; 05 Jan 2021 22:51:30 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 5 Jan 2021 22:51:29 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) 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, 5 Jan 2021 22:51:29 -0800 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.54) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 5 Jan 2021 22:51:29 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hmAG8Q3/XgqTvoroP1MUd6cZbfgJKDtOMkijCtj4gT1wrKhsLBNgRWqcXKGIz7SOfG3pkh+I+dWS5qYE3EnvH4x6j0HGrFmt5hDGMgkaa1yhPeqA5QgPZTI/BZTh7GIqc8u1BX0OWN83U8hTxbku6I9qED5yq/1nYdIRwPe7N8V2n1qi+wQshtitl4lrrA9CGWw0WAvC1m87koXTNqwwVCYd2zQpGRf7mePZNjBL4mwlJrbFN4Xi9CL8AVWAzRCDXSoeoqmg/MVzvL3NwIHe1KxE04Ta8yjqsb2+ARlhB5pFBJXOj4qEzy9W1vnOZ/wSj+CHWJeT8Otx7Wz5gcZbjg== 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=M1x/NBGsw33a2rAjLA7iIAHUavoLRVkn5DePoQI5Has=; b=Yxj3yJCx2gTXVxkvfFFqe4Ddwsw56YTB4Q21MJtuVCUI2Tm1ePmR4URM+23164h4q5kfBOeYCdUtgYR1GfTkktoAHMtudmtESJwJbrDXvwEO/tI7vfZRoUWHGTaNAQ5sWr7KuxZu7E7yHBs2ffCZRFsEaKK4wjBTb3ckXyQGpAaFo6UzVA/YvAm2+2VhkWR8t0T9HhL9KZ70gF5nAB0TsEhcSbrAafLUT3D2vwhR53RBoP4m2fkwPj0uId8BbE+/NdoVbN7fbGeuGuXL2qJOvoHsu5K3OtjT3pQcn+GtRp5ZKu8c1i5KfJi1lMkkjX/pa2C+nQGsqzW/HP8dFiyBMw== 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=M1x/NBGsw33a2rAjLA7iIAHUavoLRVkn5DePoQI5Has=; b=JXltpObGkSa++USaokXpGfDUyeifOm2qP2NAKgo71DmVI+jYjbX2Dqv/+63JmHhYWNDsf7CZZg8EuEpippdnzLtoXS9LcYfUAe+sTks4nJNSoqmPYhiz+Eu8zZhx+u+9Ck9a17zfTDp7xG0Zis2OMYmc/tiifvuPF1vk5R0hk6U= Received: from DM6PR11MB4058.namprd11.prod.outlook.com (2603:10b6:5:193::13) by DM6PR11MB3932.namprd11.prod.outlook.com (2603:10b6:5:194::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Wed, 6 Jan 2021 06:51:28 +0000 Received: from DM6PR11MB4058.namprd11.prod.outlook.com ([fe80::880f:c15b:574a:a9eb]) by DM6PR11MB4058.namprd11.prod.outlook.com ([fe80::880f:c15b:574a:a9eb%6]) with mapi id 15.20.3721.024; Wed, 6 Jan 2021 06:51:28 +0000 From: "Zeng, Star" To: "Chiu, Chasel" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Ma, Maurice" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [PATCH] IntelFsp2Pkg: Support FSP private temporary memory. Thread-Topic: [PATCH] IntelFsp2Pkg: Support FSP private temporary memory. Thread-Index: AQHW40NYkYyGoleL70CTfeo4wDtrvKoaKhlg Date: Wed, 6 Jan 2021 06:51:28 +0000 Message-ID: References: <20210105091518.1750-1-chasel.chiu@intel.com> In-Reply-To: <20210105091518.1750-1-chasel.chiu@intel.com> Accept-Language: zh-CN, 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.202] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 338a0f1c-a835-4d5e-3094-08d8b20f7e71 x-ms-traffictypediagnostic: DM6PR11MB3932: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ok6T6GzsxNgBrnc6j2O35SKKDpEtmh7bmoCjAH6U5Q599+9exC4K3+szg1C0vCfokJDOyFCYTTcrBNVXLvIQI9XYJVYw0JHYioN9zMIotkUKlLIbdIyvSYMpFA4DQ4KuKonPsgAsGLa9Qm7J+4I9/Y4I4oWlhlQFqpweQcCamV4DlJbnfQeSVw9hbu24Jbn+JXSkbOshFJfLtmQrr1/IN1l5xDxYNAkw3OlVdKwFMA3G1LKDnV2cwbFTXaZkRLvoAPTnyjbirVR3hDdV2+wST5FqeU+Go8gWzES9nFL6yktX4XtY56qKiBf64dAikB3u/P5f7XWH0wMiV1paEOoo/kZiAVRgmIDfGPc93sM5F5cv+UekfDzprEPwf6c+ZImwQNe/AqY36p661gD3+7zqzdBnh/cRZHSldcIbh8gn2NgfRhdjlLCbw9V0M23WRTHlqXEb/xDVHydff66BHyg04A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4058.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(136003)(396003)(346002)(39860400002)(376002)(8676002)(8936002)(66446008)(5660300002)(71200400001)(55016002)(66946007)(9686003)(6506007)(83380400001)(107886003)(186003)(53546011)(26005)(86362001)(316002)(19627235002)(2906002)(33656002)(7696005)(478600001)(76116006)(110136005)(54906003)(52536014)(4326008)(66556008)(66476007)(64756008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?YVRmLIxQjWN/Zk/a3D6LIQ4E57biABUiizrAc5WH+JWMLFRvhuSM/QP4TMNW?= =?us-ascii?Q?BRnUmWI9yvC40ZubyM2Ij0zuWZTfNcuSRvgrGcRNDCp+MhMTIQ6Z0tUd7OeL?= =?us-ascii?Q?lyaHUlGmsC3I/2o+UWr3LjxrQghWyDEIDeBLk46v9k9Smni16tw0GvKWKxpB?= =?us-ascii?Q?vjWUmgGquMtsTKT7FlzM1ETEUeBr4cOenbpl1yMBbpsWF66aCJzYrvLoUw43?= =?us-ascii?Q?2IwYs1t8RskC1jiRDmTuWhbYhS9Wmrl3l90+A+He059AcXIjel6BR3rtTdu3?= =?us-ascii?Q?exGFIIzHbGxbdKnTfSBlO+uPUMKMXwwvSmDdupRRhhwgD9fPgrJEAyfNTaW7?= =?us-ascii?Q?AL+qxUHkwagx+RREAo1mXOnQ5UwrWT67yLW+Co1y7Tg0fwcGDTuqyodQckgD?= =?us-ascii?Q?+XRYxLBNFYdXtWrXgXjWDVe2U649dcMMd5lNsCxUo0k14fB6m/288+F0Bono?= =?us-ascii?Q?0sjXI2rOxdQBlaKbK6HCiv4FFULQGVYGPu7KVHfy0KF6QaZbxN8wdGneDEPu?= =?us-ascii?Q?QMtEoeHbuHDYPUzHilzTdRBPn1zEsq7kCk9Z0JIQ/LwTWPyHGHj076RivqaO?= =?us-ascii?Q?ACFwjfICl4bdwMIFAigd7zBSSKmyt6pRmOtNOsW6adVO388eyVI/wxUMlkRD?= =?us-ascii?Q?1oVVOZ2Yj+vJ/gZloEZ+cyfxa5Wshtbf9C+pyngEEd23yXDR+2EwFzHueN/x?= =?us-ascii?Q?A1nvITo5K5/pl+nqtL4ePZzkDiBs2mozsk3PpXUD7Xf1Q7Wa2K8kHkop3ZJ1?= =?us-ascii?Q?VH73maaWQYsdG4DG/1T60UYjtRPMaegznqlmqD/3tsOXxc5IDQYvc7WbfuH1?= =?us-ascii?Q?23J0SH5EYnKeiojxNeIwO2b/UZ6fS4hU8E6Dv01phZlGxp6uvwKIApfX0/Ds?= =?us-ascii?Q?qY1SF17Nn0BjR2Yd6zqYdM+An0BRrOXKSkivwzEjXkp3XPhn1ea7lTlNkrAf?= =?us-ascii?Q?LEiMgtq/D6MoLorsxJQFsMgiPb3Cx9Pkf13Jb3X75JU=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4058.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 338a0f1c-a835-4d5e-3094-08d8b20f7e71 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2021 06:51:28.7846 (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: 64ePBz+4nu0I1u+Fs9J44wMyX7LAQBUTPut+BKQy1v94kqS3+KFgLrHbJjYA5b0/dv/ZI2cEiRDj4+P/xNaX1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3932 Return-Path: star.zeng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Chasel Chiu =20 Sent: Tuesday, January 5, 2021 5:15 PM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Ma, Maurice ; Desimone, Nathaniel L ; Zeng, Star Subject: [PATCH] IntelFsp2Pkg: Support FSP private temporary memory. REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3153 When FSP sharing same bootloader stack, the bootloader provided temporary m= emory for FSP will be totally given to PeiCore as Heap, but in some cases F= SP may have to reserve some more temporary memory for private usage. This commit adds this flexibility for FSP to reserve some temporary memory = before giving them to PeiCore. Cc: Maurice Ma Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu --- IntelFsp2Pkg/FspSecCore/SecMain.c | 11 +++++++---- IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf | 3 ++- IntelFsp2Pkg/IntelFsp2Pkg.dec | 7 ++++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/IntelFsp2Pkg/FspSecCore/SecMain.c b/IntelFsp2Pkg/FspSecCore/Se= cMain.c index c8de52e1d5..540571187a 100644 --- a/IntelFsp2Pkg/FspSecCore/SecMain.c +++ b/IntelFsp2Pkg/FspSecCore/SecMain.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2014 - 2020, Intel Corporation. All rights rese= rved.
+ Copyright (c) 2014 - 2021, Intel Corporation. All rights reserv= ed.
SPDX-License-Identifier: BSD-2-Clause-Patent **/@@ -150,15 +150,= 18 @@ SecStartup ( SecCoreData.BootFirmwareVolumeBase =3D BootFirmwareVolume; SecCoreData= .BootFirmwareVolumeSize =3D (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)BootFirm= wareVolume)->FvLength; - SecCoreData.TemporaryRamBase =3D (VOID*)(UI= NTN) TempRamBase;+ //+ // Support FSP reserved temporary memory from the = whole temporary memory provided by bootloader.+ // FSP reserved temporary = memory will not be given to PeiCore.+ //+ SecCoreData.TemporaryRamBase = =3D (UINT8 *)(UINTN) TempRamBase + PcdGet32 (PcdFspPrivateTemporaryRam= Size);+ SecCoreData.TemporaryRamSize =3D SizeOfRam - PcdGet32 (PcdFs= pPrivateTemporaryRamSize); if (PcdGet8 (PcdFspHeapSizePercentage) =3D=3D = 0) {- SecCoreData.TemporaryRamSize =3D SizeOfRam; // stack size th= at is going to be copied to the permanent memory SecCoreData.PeiTempora= ryRamBase =3D SecCoreData.TemporaryRamBase; SecCoreData.PeiTemporary= RamSize =3D SecCoreData.TemporaryRamSize; SecCoreData.StackBase = =3D (VOID *)GetFspEntryStack(); // Share the same boot loader stac= k SecCoreData.StackSize =3D 0; } else {- SecCoreData.= TemporaryRamSize =3D SizeOfRam; SecCoreData.PeiTemporaryRamBase = =3D SecCoreData.TemporaryRamBase; SecCoreData.PeiTemporaryRamSize = =3D SecCoreData.TemporaryRamSize * PcdGet8 (PcdFspHeapSizePercentage) / 100= ; SecCoreData.StackBase =3D (VOID*)(UINTN)((UINTN)SecCoreD= ata.TemporaryRamBase + SecCoreData.PeiTemporaryRamSize);diff --git a/IntelF= sp2Pkg/FspSecCore/FspSecCoreM.inf b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf index 61b7ddca4c..7b05cae641 100644 --- a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf +++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf @@ -1,7 +1,7 @@ ## @file # Sec Core for FSP #-# Copyright (c) 2016 - 2019, Intel Corpora= tion. All rights reserved.
+# Copyright (c) 2016 - 2021, Intel Corporat= ion. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Pa= tent #@@ -59,6 +59,7 @@ gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize ## CONSUMES= gIntelFsp2PkgTokenSpaceGuid.PcdFspHeapSizePercentage ## CONSUMES= gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxInterruptSupported ## CONSUMES= + gIntelFsp2PkgTokenSpaceGuid.PcdFspPrivateTemporaryRamSize ## CONSUMES= [Ppis] gEfiTemporaryRamSupportPpiGuid ## P= RODUCESdiff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dec b/IntelFsp2Pkg/IntelFsp2P= kg.dec index 60d40ab6b9..ec7b9a7702 100644 --- a/IntelFsp2Pkg/IntelFsp2Pkg.dec +++ b/IntelFsp2Pkg/IntelFsp2Pkg.dec @@ -1,7 +1,7 @@ ## @file # Provides driver and definitions to build fsp in EDKII bios. #-#= Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
+# C= opyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
# SPD= X-License-Identifier: BSD-2-Clause-Patent # ##@@ -98,6 +98,11 @@ # Maximal Interrupt supported in IDT table. # gIntelFsp2PkgTokenSpac= eGuid.PcdFspMaxInterruptSupported | 34| UINT8|0x10000005+ #+ # All= ows FSP-M to reserve a section of Temporary RAM for implementation specific= use.+ # Reduces the amount of memory available for the PeiCore heap.+ #+= gIntelFsp2PkgTokenSpaceGuid.PcdFspPrivateTemporaryRamSize |0x00000000|UIN= T32|0x10000006 [PcdsFixedAtBuild,PcdsDynamic,PcdsDynamicEx] gIntelFsp2Pk= gTokenSpaceGuid.PcdFspReservedMemoryLength |0x00100000|UINT32|0x46530000--= =20 2.28.0.windows.1