From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id E2747AC1103 for ; Fri, 10 May 2024 10:08:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ljPqIYT5zlGeDkBLP4mrpZDvCxgv38Mzyvgqyem5mK0=; c=relaxed/simple; d=groups.io; h=From:To:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1715335728; v=1; b=t6ch0g0CH6QIcwcNoIBYNSwTsZlwXRh4jWj9RF71UcdapP4Sajw5riMyy16HRZJUo2do6Vb7 +3DUlEVKT2bnXqTDbHj4fOrfYXdmlypgF/yN5GCWhRCuwKSC12nPNuhL7HGlv4zpaxeZS1HtY6R m/ob14jivRRPiKhp1Ls9yjJ5jf86YWriFsQc62wrHNd9Fn+yoN6ogycki9Yn53AKe+DJDkifZpc 3A60mgSS56SfCcjiMJbaZJujncgohnAFBvrArrLESE94HHovRIz/Hg/aSXHH1IJ9HuXQOl8M+tV hQi4zrm7W984fvh0FEZB80MroQctfRh0bT+mqXoxhOuTA== X-Received: by 127.0.0.2 with SMTP id XZ0oYY7687511xKefX62QCqo; Fri, 10 May 2024 03:08:48 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mx.groups.io with SMTP id smtpd.web10.9485.1715335727366928454 for ; Fri, 10 May 2024 03:08:47 -0700 X-CSE-ConnectionGUID: HH38tn8STYaybJnFvZFyGg== X-CSE-MsgGUID: 7Xse1EpbSJuqLoHrRuU4jA== X-IronPort-AV: E=McAfee;i="6600,9927,11068"; a="28819104" X-IronPort-AV: E=Sophos;i="6.08,150,1712646000"; d="scan'208";a="28819104" X-Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2024 03:08:47 -0700 X-CSE-ConnectionGUID: iBYXS+DkQEC4FW+z8UgvVw== X-CSE-MsgGUID: CmjRCzF7Q5S1nadFVjSKMw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,150,1712646000"; d="scan'208";a="60424189" X-Received: from unknown (HELO shwdeopenlab702.ccr.corp.intel.com) ([10.239.55.43]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2024 03:08:46 -0700 From: "duntan" To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH 00/19] Remove some S3 related code in CpuS3.c of smm cpu driver Date: Fri, 10 May 2024 18:08:09 +0800 Message-Id: <20240510100827.1903-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 10 May 2024 03:08:47 -0700 Resent-From: dun.tan@intel.com Reply-To: devel@edk2.groups.io,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: gebfUZkcsiyb5V1j7S3NJJZXx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=t6ch0g0C; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io This patch set is to remove some S3 related code in CpuS3.c of smm cpu driver. It contain commits to: 1.Save MTRR setting by lockbox in PEI phase 2.Load MTRR in S3Resume.c before transferring to CpuS3.c in smm cpu driver. 3.Add callback of gEdkiiEndOfS3ResumeGuid in PeiMpLib to relocate Ap to new safe buffer. 4.Install gEdkiiEndOfS3ResumeGuid in S3Resume.c before booting OS to relocate APs 4.Change PcdCpuFeaturesInitOnS3Resume to TRUE to set register table in CpuFeaturesPei 5.Remove code to set register table/load mtrr/wakeup AP and relocate ap in CpuS3.c. With this patch set, CpuS3.c in smm CPU driver can be simplified. Dun Tan (18): MdeModulePkg: Add gEdkiiS3MtrrSettingGuid OvmfPkg: Save MTRR by lockbox in CpuS3DataDxe UefiCpuPkg: Add locbox lib instance in DSC UefiCpuPkg: Save MTRR by lockbox in CpuS3DataDxe UefiCpuPkg: LoadMtrrData for all cpu in S3Resume UefiCpuPkg: Remove the duplicated mpservice locate UefiCpuPkg: Install gEdkiiEndOfS3ResumeGuid in S3Resume UefiCpuPkg:Abstract some DxeMpLib code to function UefiCpuPkg:Move some code in DxeMpLib to common place UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib UefiCpuPkg: Disable PG in IA32 ApLoopCode UefiCpuPkg: Remove code to load mtrr setting UefiCpuPkg:Set PcdCpuFeaturesInitOnS3Resume to TRUE UefiCpuPkg: Remove code to set register table UefiCpuPkg:Remove code to handle APIC setting and Interrupt UefiCpuPkg:Rremove code to wakeup AP and relocate ap UefiCpuPkg: Remove GetAcpiCpuData() in CpuS3.c MdeModulePkg: remove MpService2Ppi field in SMM_S3_RESUME_STATE Ray Ni (1): MdePkg: Add MmUnblockMemoryLib to MdeLibs.dsc MdeModulePkg/Include/Guid/AcpiS3Context.h | 1 - MdeModulePkg/MdeModulePkg.dec | 3 +++ MdePkg/MdeLibs.dsc.inc | 3 ++- OvmfPkg/CpuS3DataDxe/CpuS3Data.c | 11 +++++++++++ OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf | 2 ++ UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c | 11 +++++++++++ UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf | 2 ++ UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 181 +++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------- UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm | 4 ++++ UefiCpuPkg/Library/MpInitLib/MpLib.c | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/Library/MpInitLib/MpLib.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 4 ++++ UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 991 ++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/MpFuncs.nasm | 153 ------------------------------------------------------------------------------------------------------------------------------------------------- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmFuncsArch.c | 27 -------------------------- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 6 ++---- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 24 ----------------------- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 3 --- UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm | 189 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c | 28 --------------------------- UefiCpuPkg/UefiCpuPkg.dec | 2 +- UefiCpuPkg/UefiCpuPkg.dsc | 1 + UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf | 2 ++ 25 files changed, 511 insertions(+), 1561 deletions(-) delete mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/MpFuncs.nasm delete mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/X64/MpFuncs.nasm -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118792): https://edk2.groups.io/g/devel/message/118792 Mute This Topic: https://groups.io/mt/106018119/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-