From nobody Mon Feb 9 17:25:24 2026 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+103520+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+103520+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1682404816; cv=none; d=zohomail.com; s=zohoarc; b=GEatE7qrUdrUNvuazGSX/Zx9RWcAodJGrIU/SMVaqcJ0QyXXoWe4k3AA2Ezs2eGFMejODEpcvGDNG9y/kVSNcQHqNyc/OjZM9P+rA5gYCNCpSyaKeevvvdMQQcxTggVQJNelsfmg5cm+HmOmWUiKb7ja5hJZdqTv9z2rFo/CHGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682404816; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=18egvG3u6nc90iqFaWMMmhrP9YPImiIugrha/3Ksblo=; b=iunN3iowWOSu3upr+C0MPLWsxIQJnMotOpWSLQu7MsX4+NOLPRLAcuBOBZQPv4OInE2OwMqziaoGoFXMuDkL8XD+9OxRnbnLswMBg3ThjxQOqsX5x8aqhY7FBhc+28V1CzKYDsh/RWol54YTY0/XUbdrWD5CGp2diXkbvTyKH3c= 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+103520+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1682404816233430.257935079205; Mon, 24 Apr 2023 23:40:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id XgQsYY1788612xJGYXUG5zfS; Mon, 24 Apr 2023 23:40:15 -0700 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.73019.1682404812454075052 for ; Mon, 24 Apr 2023 23:40:15 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="326982892" X-IronPort-AV: E=Sophos;i="5.99,224,1677571200"; d="scan'208";a="326982892" X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2023 23:40:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="817558208" X-IronPort-AV: E=Sophos;i="5.99,224,1677571200"; d="scan'208";a="817558208" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2023 23:40:13 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Ray Ni , Nate DeSimone Subject: [edk2-devel] [PATCH 2/3] SimicsOpenBoardPkg: Initialize temporary memory with PcdInitValueInTempStack Date: Tue, 25 Apr 2023 14:40:02 +0800 Message-Id: <20230425064003.2037-3-zhiguang.liu@intel.com> In-Reply-To: <20230425064003.2037-1-zhiguang.liu@intel.com> References: <20230425064003.2037-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,zhiguang.liu@intel.com X-Gm-Message-State: a07PZogQNvpkrXUxteG5kQOXx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1682404815; bh=4KZ37nCMHWBXbe3FGOGN6anyAgTrqjjoAk8iP2cglEc=; h=Cc:Date:From:Reply-To:Subject:To; b=ZSh1ZsEjOIRrQITb+vAMmrO7ecnrdfRX+0XchUBKEtolKTLG0zckjM2wZO5mkIA99jz WhL6TSBUEiymTIIt/Pbx6j0mVnzjLv8okKMFQ3LVCiYKf5fP7Rs1YEvKpSL9fHO5SWRtC Q9i2z/4cI691ZZNyoI46sQZjIIHEP0D4rfI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1682404816698100009 Content-Type: text/plain; charset="utf-8" From: Ray Ni PeiCore dumps how many bytes of stack is used by checking stack contents against PcdInitValueInTempStack. The assumption is when temporary memory is setup, its initial content is PcdInitValueInTempStack. The patch changes X64 version SecCore of QSP to fill the temporary memory as what PeiCore expects. This helps to detect if stack in temporary ram is enough. Cc: Nate DeSimone Signed-off-by: Ray Ni --- .../Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf | 1 + .../SimicsOpenBoardPkg/SecCore/X64/SecEntry.nasm | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf b/Platfo= rm/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf index 9dd492a2fb..1de3d012a7 100644 --- a/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf +++ b/Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf @@ -68,6 +68,7 @@ gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress gSimicsOpenBoardPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsDecompressionScratchEnd + gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack =20 [FeaturePcd] gSimicsX58PkgTokenSpaceGuid.PcdSmmSmramRequire diff --git a/Platform/Intel/SimicsOpenBoardPkg/SecCore/X64/SecEntry.nasm b/= Platform/Intel/SimicsOpenBoardPkg/SecCore/X64/SecEntry.nasm index 2e6d8f618c..306208a824 100644 --- a/Platform/Intel/SimicsOpenBoardPkg/SecCore/X64/SecEntry.nasm +++ b/Platform/Intel/SimicsOpenBoardPkg/SecCore/X64/SecEntry.nasm @@ -24,6 +24,19 @@ extern ASM_PFX(SecCoreStartupWithStack) ; global ASM_PFX(_ModuleEntryPoint) ASM_PFX(_ModuleEntryPoint): + ; + ; Fill the temporary RAM with the initial stack value. + ; The loop below will seed the heap as well, but that's harmless. + ; + mov rax, (FixedPcdGet32 (PcdInitValueInTempStack) << 32) | FixedPc= dGet32 (PcdInitValueInTempStack) + ; qword to= store + mov rdi, FixedPcdGet32 (PcdSimicsSecPeiTempRamBase) ; base add= ress, + ; relati= ve to + ; ES + mov rcx, FixedPcdGet32 (PcdSimicsSecPeiTempRamSize) / 8 ; qword co= unt + cld ; store fr= om base + ; up + rep stosq =20 ; ; Load temporary RAM stack based on PCDs --=20 2.31.1.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 (#103520): https://edk2.groups.io/g/devel/message/103520 Mute This Topic: https://groups.io/mt/98488022/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-