From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.1961.1609981201678230676 for ; Wed, 06 Jan 2021 17:00:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=JIAV1BMQ; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: ExB1tgA53NEIJXv/t9I5GiOBhy3euTsF8fEsC2j70XZZKyFjPVqggxBeTOWmdDvOgBcQ0H15Xu vMYB+58xsiUw== X-IronPort-AV: E=McAfee;i="6000,8403,9856"; a="165054197" X-IronPort-AV: E=Sophos;i="5.79,328,1602572400"; d="scan'208";a="165054197" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2021 17:00:00 -0800 IronPort-SDR: oBDePzKu2NV2aX5UgZV3Gxn9gvCN5e2E0qNQJRpkVkpfyP/hYehvzKz4gSrZENp/n/zWeo6fv9 jwyE2gjSiImA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,328,1602572400"; d="scan'208";a="361779022" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga002.jf.intel.com with ESMTP; 06 Jan 2021 16:59:56 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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, 6 Jan 2021 16:59:54 -0800 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 6 Jan 2021 16:59:53 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx604.amr.corp.intel.com (10.18.126.84) 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, 6 Jan 2021 16:59:53 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.48) 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, 6 Jan 2021 16:59:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OZHDr9DNWhAPiM0UtHxzavT29ylasOPiyepTuU7elLddYTSi0S8ANhSxiDN8umgToCPnTssVH8X99ZrFOTLazBaBSFqmPU3uwR8GllGTsszxKSwiZJQuSHV2Hy2tRoanq5qeqiIINHEw5dARZLkviQe6oJcXUeyatyA5SbB+Kr49BjVt1uA9i6dgeturdMPNE4MoK9pCQbuZX22KiSWPzs949t38t1Lr06P7xrf8MRXT+7mUjwgXYAAa96SL5uaAJbyyV11ACVzbc0u8+sXv00VSWQlcEMUeAPZWDL8T+fRkboDa4D4sUnNKf963Tk51/cDjE7q9JvPvJv2g5Z5Jow== 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=y13mQoj9tMEMjljgNzXLHy5B+SjntBtMVuP4SDq8l2w=; b=YBJUvG47171cOtS57Lh5HuJNeSEGF/JDS+fXRWh2mbLi2mjG2qnoKUda6VhAmbzjnFXjjbkcAHZZV9NxGhynArTYIrlZWJuPlf72bK5JIyhRYT70D54aWTziZnlOLchkFtxrYmoB2P0FQUc4EiwMCr6PMUrHtA4gY3xmLtew90EMzTC/g2D/rKBxAq0jC3i9wPcYr6icYgJvWa4Qmcb7JyktHDMtr+yU8tu6j0nDa/e+ua8jwf58f7eWGl4zot4M9bBbPRfRMGbjm5D932Na5uRPMUfsMGLqDDQSzJQDprsWwQ7I7PdY7i2JBWYw3arDP9Ir3QTdfI0DTw82s18ZWw== 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=y13mQoj9tMEMjljgNzXLHy5B+SjntBtMVuP4SDq8l2w=; b=JIAV1BMQrO7vuzZnIzstARjmo3CZpfvM7qe4eMNHsXGgK3VAKiTZ+FcOV3cl7FLRktS7Hvh7ftbiJjvIqYraK9pzHVrt+U4IWYMiL5hwuKlYreAdlEk9uLw+NKL41K27xGJspRe1LNBaDoPUU+ZOLRKM2OThuu2279nLSuYOenA= Received: from BN6PR1101MB2147.namprd11.prod.outlook.com (2603:10b6:405:57::23) by BN8PR11MB3843.namprd11.prod.outlook.com (2603:10b6:408:88::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Thu, 7 Jan 2021 00:59:47 +0000 Received: from BN6PR1101MB2147.namprd11.prod.outlook.com ([fe80::9b9:f28:c6e0:d0e3]) by BN6PR1101MB2147.namprd11.prod.outlook.com ([fe80::9b9:f28:c6e0:d0e3%7]) with mapi id 15.20.3721.024; Thu, 7 Jan 2021 00:59:47 +0000 From: "Nate DeSimone" To: "Chiu, Chasel" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Ma, Maurice" , "Zeng, Star" Subject: Re: [PATCH] IntelFsp2Pkg: Support FSP private temporary memory. Thread-Topic: [PATCH] IntelFsp2Pkg: Support FSP private temporary memory. Thread-Index: AQHW40NYwtEJNa6akk2XHn40b6kONqobWinA Date: Thu, 7 Jan 2021 00:59:47 +0000 Message-ID: References: <20210105091518.1750-1-chasel.chiu@intel.com> In-Reply-To: <20210105091518.1750-1-chasel.chiu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows 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: [50.53.190.176] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 02d34a76-e13a-40fb-c161-08d8b2a7876f x-ms-traffictypediagnostic: BN8PR11MB3843: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:935; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: U199bMBMxB0zl3Y63HnOEWQXrNUFiLnpdyPfhwH65olHL1b5GA1bg+Mk9JtzRL1H5Vc7K6hQx8LO3nwK8J3JvWoZSsLpUKH9SeyeMZcXyO5Cl0rAQUFv7wU0BLj1+0Y4wwMMRYazyHSDAl6OnTATDqS2TgNdNPZcvH3Wguc+hmSkFOxzr/nJLdv7gleLsrWnCnCeWSwrZrKB21o3oGmPErYN1R+PPA1kNAOHak2WvScSGu5w19TB5YOTcAcHtAtYd1a9jzxPjnG0ITvHVNAXCbny8UBXDRrE6KXcYpMghVmZMgqgUeh893GopEbZBlvU0dgP3b3nWXcB1RUcQdZSIGUSdGc82CZjy6IYdM7eg8ddCt/Vx5jHwESQIO1RG5aKC/KCOeKD7VCmqTvOXgDylhNHyPI4nS1urgAl45THsHm+jIx35HDEaixaGW6xnHIQS3ybmro9kKRpNPR2CBR3yw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR1101MB2147.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(39860400002)(136003)(366004)(396003)(52536014)(7696005)(83380400001)(54906003)(110136005)(316002)(19627235002)(5660300002)(8676002)(66476007)(66946007)(76116006)(64756008)(66446008)(66556008)(33656002)(2906002)(8936002)(478600001)(4326008)(71200400001)(6506007)(186003)(107886003)(26005)(55016002)(53546011)(9686003)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?XEKl9uvnSXdgH99o7wXZn6LVeKnUs8zMR4d4TndszP+O1ybvoft00rX7BmyQ?= =?us-ascii?Q?u5DdVgbiJS9uNKIOPmKWgkjyVQcG7VbwjOP72q30QbLf66+LHx84uCRdrtu/?= =?us-ascii?Q?Gkqd+jn491oqyBiOU57O4AUsfIHBUMM1mcrBpD1ThRwj2yrjEQWLPw9I8fgs?= =?us-ascii?Q?nOObCAnNUYSEWbdx9LWA+u2dYf4vfxc1RFBlaZqJ0TWD1mJAo1Rk6esVnhst?= =?us-ascii?Q?/NO4Ocy7ot5cH25/B862+GpBEH9RcUQfUb21JtcCIko8GwY9nO7+y1Urs7wu?= =?us-ascii?Q?vUQqvHN7F6MjU/v3n7ttwCisHvPAd8ndwUkRerCCBW9Vxbt+jQlyrMhf8M14?= =?us-ascii?Q?qdaK9ISUGKkyZXwpl/Wcc5x7yOBoSHNb1hzzTpgTWHQX4OGOFQJsa5utx53N?= =?us-ascii?Q?j83dpC5pKEGIXfhZgBOBVzAarWX846AMZzE0c0oaB4lAemUbMxC2Xp2FmnFo?= =?us-ascii?Q?IOb7q32mvm6TXBRsr8K5OknmUn6wqV7XAa27zCnhlLtrIHG4h9V70atS6p8x?= =?us-ascii?Q?ufFXtyVAM1bFBc8EBbnMZYBs35meYfLgjbT2+71Ul/FnPHzTIJv+/Ujj3a16?= =?us-ascii?Q?Aldth2xROQdYHgUfKHwpO+Bi2wovMXVSYnHSYDkinoy5kV2u/DIMfBl/dzS5?= =?us-ascii?Q?uxu4I6AtiEvCNeZJaIlCMtbH0bVD7wrp/0xV+IuLKyh6se2eIkVEV39y5KjC?= =?us-ascii?Q?MywftAtFnc8CCAuAUMIowdXYTSj1HG2KqP9c+WLSOFzvdk5yiTaotGxMJB/n?= =?us-ascii?Q?22renSGQ2QHDe9iUxI9T9z+vTGZ0ksBC8B3GarpdHHxUfzwyeBOCTSu9i/RJ?= =?us-ascii?Q?nx5Nsl6+zu3xlo5o0+ZBAl/s+wMNEEnt47EX5unVgKN1/BlmOHs4HUWl9OtD?= =?us-ascii?Q?I/WFrgR+Qv5+xqEYbbo1JWkuFknoXGRwgzFW19tkAmFySTj0GBb9JwZ97P2q?= =?us-ascii?Q?mv/Fm/FhV9z4frQDTzGSvaZ3IV3lIFf61GlYUqrpumc=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR1101MB2147.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02d34a76-e13a-40fb-c161-08d8b2a7876f X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jan 2021 00:59:47.3206 (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: kX4uWNhyE4kMlMKTmH23lM9owmgUkhs89LrWxFzMoMKpv03yh4qb9s7KTMDZczAaMp2OY+L+WS1Cm/SksIqXZNwWgxp3C7/PR0QDi/ofoJA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3843 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone > -----Original Message----- > From: Chasel Chiu > Sent: Tuesday, January 5, 2021 1:15 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Ma, Maurice > ; Desimone, Nathaniel L > ; Zeng, Star > Subject: [PATCH] IntelFsp2Pkg: Support FSP private temporary memory. >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3153 >=20 > When FSP sharing same bootloader stack, the bootloader provided > temporary memory for FSP will be totally given to PeiCore as Heap, but in > some cases FSP may have to reserve some more temporary memory for > private usage. >=20 > This commit adds this flexibility for FSP to reserve some temporary memor= y > before giving them to PeiCore. >=20 > 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(-) >=20 > diff --git a/IntelFsp2Pkg/FspSecCore/SecMain.c > b/IntelFsp2Pkg/FspSecCore/SecMain.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 > reserved.
+ Copyright (c) 2014 - 2021, Intel Corporation. All rights > reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/@@ - > 150,15 +150,18 @@ SecStartup ( > SecCoreData.BootFirmwareVolumeBase =3D BootFirmwareVolume; > SecCoreData.BootFirmwareVolumeSize =3D > (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)BootFirmwareVolume)- > >FvLength; - SecCoreData.TemporaryRamBase =3D (VOID*)(UINTN) > 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 (PcdFspPrivateTemporaryRamSize);+ > SecCoreData.TemporaryRamSize =3D SizeOfRam - PcdGet32 > (PcdFspPrivateTemporaryRamSize); if (PcdGet8 > (PcdFspHeapSizePercentage) =3D=3D 0) {- SecCoreData.TemporaryRamSize = =3D > SizeOfRam; // stack size that is going to be copied to the permanent memo= ry > SecCoreData.PeiTemporaryRamBase =3D SecCoreData.TemporaryRamBase; > SecCoreData.PeiTemporaryRamSize =3D SecCoreData.TemporaryRamSize; > SecCoreData.StackBase =3D (VOID *)GetFspEntryStack(); // Sha= re the > same boot loader stack 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)SecCoreData.TemporaryRamBase + > SecCoreData.PeiTemporaryRamSize);diff --git > a/IntelFsp2Pkg/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 Corpo= ration. > All rights reserved.
+# Copyright (c) 2016 - 2021, Intel Corporation.= All > rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent > #@@ -59,6 +59,7 @@ > gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize ## > CONSUMES gIntelFsp2PkgTokenSpaceGuid.PcdFspHeapSizePercentage > ## CONSUMES > gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxInterruptSupported ## > CONSUMES+ > gIntelFsp2PkgTokenSpaceGuid.PcdFspPrivateTemporaryRamSize ## > CONSUMES [Ppis] gEfiTemporaryRamSupportPpiGuid = ## > PRODUCESdiff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dec > b/IntelFsp2Pkg/IntelFsp2Pkg.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.
+# > Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
# = SPDX- > License-Identifier: BSD-2-Clause-Patent # ##@@ -98,6 +98,11 @@ > # Maximal Interrupt supported in IDT table. # > gIntelFsp2PkgTokenSpaceGuid.PcdFspMaxInterruptSupported | 34| > UINT8|0x10000005+ #+ # Allows 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|UINT32|0x10000006 > [PcdsFixedAtBuild,PcdsDynamic,PcdsDynamicEx] > gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedMemoryLength > |0x00100000|UINT32|0x46530000-- > 2.28.0.windows.1