From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.2875.1687160811414090506 for ; Mon, 19 Jun 2023 00:47:07 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=RmBoKSAC; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: hongbin1.zhang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687160827; x=1718696827; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+UP7YhGBvw7oS4p0m/i1fpVuOzd/g6ZRhPkeqr6/Tlg=; b=RmBoKSACkz5mI10L6aJno6S8vn6VfvOvbv9N8UVlR084DTiIt9ef2/eV pyeG7eWRt9JCVWz9EEoVfjajT4u43Jeev7UTeO0wUjAXj4A1V4QvTIrVp OhFvsZBQWvTBjAcYZWgPZmsYWJrt8zjkAUTBy7KiNnPBF5ex8xCynKzFI IKubXNdrXjzhwBoYwKEJ3WeNPx7gvp3q5xK7SuNw/03x/HDyBnbX7vvMS G953tbIPewxZiaNgBwikTVgMPKtDFnfvZZd86Vb9DkwhCh9oOCsXiMNJ7 qvrUszw0f0xqsfAWVBf54ZAL21l6YHTCNmwOsjrRdGS3tZ5w8e/5ameQv g==; X-IronPort-AV: E=McAfee;i="6600,9927,10745"; a="339904910" X-IronPort-AV: E=Sophos;i="6.00,254,1681196400"; d="scan'208";a="339904910" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2023 00:47:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10745"; a="960346555" X-IronPort-AV: E=Sophos;i="6.00,254,1681196400"; d="scan'208";a="960346555" Received: from hongbin1-mobl1.ccr.corp.intel.com ([10.238.0.232]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2023 00:47:05 -0700 From: "Zhang, Hongbin1" To: devel@edk2.groups.io Cc: "Zhang, Hongbin1" , Jiewen Yao , Ray Ni , Star Zeng , Jiaxin Wu , Sami Mujawar , Ard Biesheuvel , Supreeth Venkatesh Subject: [PATCH v4 5/5] StandaloneMmPkg: Add StandaloneMmIplPei driver. Date: Mon, 19 Jun 2023 15:46:39 +0800 Message-Id: <20230619074639.1569-5-hongbin1.zhang@intel.com> X-Mailer: git-send-email 2.37.0.windows.1 In-Reply-To: <20230619074639.1569-1-hongbin1.zhang@intel.com> References: <20230619074639.1569-1-hongbin1.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add StandaloneMmIplPei IA32/X64 driver at PEI stage. FSP will use this driver to load Standalone MM code to dispatch other Standalone MM drivers. Signed-off-by: Hongbin1 Zhang Cc: Jiewen Yao Cc: Ray Ni Cc: Star Zeng Cc: Jiaxin Wu Cc: Sami Mujawar Cc: Ard Biesheuvel Cc: Supreeth Venkatesh --- StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c index 0d0c678f90..78939faeea 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c @@ -626,5 +626,16 @@ StandaloneMmIplPeiEntry ( DEBUG ((DEBUG_ERROR, "SMM IPL could not find a large enough SMRAM region to load SMM Core\n")); } + // + // Close and lock all SMRAM ranges. + // + for (Index = 0; Index < mSmramRangeCount; Index++) { + Status = mSmmAccess->Close ((EFI_PEI_SERVICES **)PeiServices, mSmmAccess, Index); + ASSERT_EFI_ERROR (Status); + + Status = mSmmAccess->Lock ((EFI_PEI_SERVICES **)PeiServices, mSmmAccess, Index); + ASSERT_EFI_ERROR (Status); + } + return EFI_SUCCESS; } -- 2.37.0.windows.1