From nobody Fri Apr 19 10:50:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+69685+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+69685+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1609838130; cv=none; d=zohomail.com; s=zohoarc; b=BPZ5fARouK14nMA51dHvQFhaxm/3IgVfQM8tNK/QP5ngEfOWoAAe9NsJYJI8lnw0Mu/XK0jz2I1c9fqaHbq0drF2MspjEGSud2yqtZXcz4pIqEoJH1ecmKT5DKA7cTsPL4dTUKClEsGgFVM77BbqwuPcFlYb8saZSXb41EZNctA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609838130; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=VGnj7N4x1ZbaATLzn4PTxcntupaCpC8NmhK3+6hUYEk=; b=GAfxwTYULxod3tVgenlynmtPhH51qp7K8fnj5bvvXdscmHDiiJansaDHufUp97LKEOwTPug+Xf/leemkxE9z6o5DDf1/Phw0leeaCz5hlP90Mo6eVDSBBDkjytPkBl4IDaCeK79pO439Mqd5ulsqOBLH82l0GG4d+B6PHC22OlY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+69685+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1609838130028440.63311336147524; Tue, 5 Jan 2021 01:15:30 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id VqdwYY1788612xPCr4DcUX8p; Tue, 05 Jan 2021 01:15:28 -0800 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.2860.1609838128014957818 for ; Tue, 05 Jan 2021 01:15:28 -0800 IronPort-SDR: l5ldiYipWf+wwQ+AC1J2Kdw8kf3YaaO8ZROoZF+L47Y/W2MGAykkF3ffZR78l43F61otKB9uTL M0J9SeBWDhRg== X-IronPort-AV: E=McAfee;i="6000,8403,9854"; a="241160979" X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="241160979" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 01:15:26 -0800 IronPort-SDR: hPOZImphZbWVZgWTG+QACdf+UEEocXBmHRh/gVIOfLqPbFH0oq6tFO4WWBErtSToDboDvzKyEZ p82Ts2nQodWQ== X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="346210704" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.252.189.178]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 01:15:25 -0800 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Maurice Ma , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH] IntelFsp2Pkg: Support FSP private temporary memory. Date: Tue, 5 Jan 2021 17:15:18 +0800 Message-Id: <20210105091518.1750-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: erfoCABdUwXeX4BNrvs42f1lx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1609838128; bh=FnPy9ZWAf8qprgGiCxihKfIgRWr3bry0R7umPQHArws=; h=Cc:Date:From:Reply-To:Subject:To; b=uGbK/HQcne1+c23dTbKEBFHYwuLfEcqlUws+ynamvfpPFyQrad5fub8Pgx1IQFI3Guj 8WfpZmbyBYQevW1kx9xtKMd3ymI92kwLapaQQxg8APlzVY6PRQM20LO4HAo5PymWPSHii 9XXFNtXBX587YgcoAPMi0B/DmuQI6DU/MqM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3153 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. 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 Reviewed-by: Nate DeSimone Reviewed-by: Star Zeng --- 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 =20 - 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 =20 **/ @@ -150,15 +150,18 @@ SecStartup ( SecCoreData.BootFirmwareVolumeBase =3D BootFirmwareVolume; SecCoreData.BootFirmwareVolumeSize =3D (UINT32)((EFI_FIRMWARE_VOLUME_HEA= DER *)BootFirmwareVolume)->FvLength; =20 - 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 + P= cdGet32 (PcdFspPrivateTemporaryRamSize); + SecCoreData.TemporaryRamSize =3D SizeOfRam - PcdGet32 (PcdFspPriva= teTemporaryRamSize); if (PcdGet8 (PcdFspHeapSizePercentage) =3D=3D 0) { - SecCoreData.TemporaryRamSize =3D SizeOfRam; // stack size that i= s going to be copied to the permanent memory SecCoreData.PeiTemporaryRamBase =3D SecCoreData.TemporaryRamBase; SecCoreData.PeiTemporaryRamSize =3D SecCoreData.TemporaryRamSize; SecCoreData.StackBase =3D (VOID *)GetFspEntryStack(); // = Share 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)SecCoreDa= ta.TemporaryRamBase + SecCoreData.PeiTemporaryRamSize); diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf b/IntelFsp2Pkg/FspSecC= ore/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 Corporation. 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 =20 [Ppis] gEfiTemporaryRamSupportPpiGuid ## PRODUCES diff --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| UIN= T8|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|UI= NT32|0x10000006 =20 [PcdsFixedAtBuild,PcdsDynamic,PcdsDynamicEx] gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedMemoryLength |0x00100000|UINT3= 2|0x46530000 --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#69685): https://edk2.groups.io/g/devel/message/69685 Mute This Topic: https://groups.io/mt/79446867/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-