From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail03.groups.io (mail03.groups.io [45.79.227.220]) by spool.mail.gandi.net (Postfix) with ESMTPS id 7B0F074003E for ; Thu, 11 Apr 2024 04:31:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=8IRPWSPT2HMptVVJHrm/mb8Tk9T91LK6WEM8h2ETNos=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels: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-Language:Content-Type; s=20240206; t=1712809915; v=1; b=LvvEJHVmaj1+doXb0y8wVHQkFjnO3DnJ5rRPWjRVtJ1kZQnt+rzcGSmxV/uczG4+eYcM0CcA ejaJUi/SGD/7eiC/Bv+jvgayc1Btwct0/RgIjK1mnqaZO9XJkUeYEdhWzJjCdPAry9vVQSGaQg1 1k9d1iGDNPJEV5/Pac8BNQN2+Wq7EEsROUWalBOJSHKsgV0VrmuGkrgNI+pQzstr9GkjA0hgIEO z53OmFHQ1Zli81PHdvtrOqZxHTQxAYdk3nSt0q+3ANZ8+bQJYyMFgDc/Z7W7kY2Y34AfQHfrhSI kdHiYBzxgqg/mjOHjEPQFZHK126ej0FUBNFH9ahxaKHEw== X-Received: by 127.0.0.2 with SMTP id ckQQYY7687511xM6yaRhK4P2; Wed, 10 Apr 2024 21:31:55 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mx.groups.io with SMTP id smtpd.web11.9846.1712809913912310277 for ; Wed, 10 Apr 2024 21:31:54 -0700 X-CSE-ConnectionGUID: JrjjMw83R1G7bYQlhhWfEg== X-CSE-MsgGUID: GUaJBiDpQ4SQWoJDqIvO3A== X-IronPort-AV: E=McAfee;i="6600,9927,11039"; a="8422883" X-IronPort-AV: E=Sophos;i="6.07,192,1708416000"; d="scan'208,217";a="8422883" X-Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2024 21:31:53 -0700 X-CSE-ConnectionGUID: qHbHo0EnQuyF8vFVRLnmug== X-CSE-MsgGUID: SuynS2wUTuGbLRKR5O8/Sg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,192,1708416000"; d="scan'208,217";a="25556308" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Apr 2024 21:31:53 -0700 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 10 Apr 2024 21:31:52 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 10 Apr 2024 21:31:52 -0700 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 10 Apr 2024 21:31:52 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) 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.2507.35; Wed, 10 Apr 2024 21:31:51 -0700 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by BL3PR11MB6457.namprd11.prod.outlook.com (2603:10b6:208:3bc::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.25; Thu, 11 Apr 2024 04:31:48 +0000 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::be1b:c524:662c:7941]) by MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::be1b:c524:662c:7941%7]) with mapi id 15.20.7452.019; Thu, 11 Apr 2024 04:31:48 +0000 From: "Wu, Jiaxin" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Zeng, Star" , Gerd Hoffmann , "Kumar, Rahul R" , "Dong, Guo" , "Rhodes, Sean" , "Lu, James" , "Guo, Gua" , Ard Biesheuvel , "Yao, Jiewen" Subject: Re: [edk2-devel] [PATCH v1 00/13] Add SmmRelocationLib Thread-Topic: [PATCH v1 00/13] Add SmmRelocationLib Thread-Index: AQHai75f55cbXHMN3kmg7WC3wlRBtrFiesQQ Date: Thu, 11 Apr 2024 04:31:48 +0000 Message-ID: References: <20240410135724.15344-1-jiaxin.wu@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN0PR11MB6158:EE_|BL3PR11MB6457:EE_ x-ms-office365-filtering-correlation-id: 9a0f6f1a-734b-430a-c7e0-08dc59e04d73 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: QNpMii8lzUfX7x2lSaWml3c6ALVTNIMoiPOHdM6PljPD8gLiyTX1YthLZNIZ3ekxXmpBAvmKKwOxchOvpU1KMngLFMInHwqrT1ZtfZmnQFJR+a8HMBAH3mSS0BfqLLgQOWVyoSB3/H+HCRYO5bPfH5mcSaIHUIyuclRwWYLlCwRdPRA25Ic3WwhIEHQeZamhd7wJ8iRPWGlWkugD9x0Do0V2e0s8a3ol42WCtAfELOE+M13zmf1ACRJ65ym1YdWm1UwWhpxFUQWPM8IscmNKvQeA5ojLvt6gRR7QVCS95jueQq+lgH9jB/qfwPfBD/MNnwsenDH+lY8pWRr18WfL8Nf/pf/Q6bKDczfu32e9lBZzSncAnpO3ylGYmN1ssnmNj7uumNtgRn+GV/CQJMzu1hqsKJbYtrDoeJhAxZpK/eqrLo51hkSwyMl/I6hp+BidS1zPekca7z6BR92drS0dz3Fl5QyZV8pQl2aAzJSXTUNYFMgPA1L08ipV0Op5SPQ7c7zEg5YO4pg4c4fA+DVkgMfbtE3LXHtuSbwpGx/J2nvAFF55Ic20MQYXgueUUcqcr/TuRuX8AokFCZbkOjf2lXx8cvxFxKO9U1uki10czrjNVoIhiQ7PPvqhWClPmbRHtvawHGr7MhfiM9mJEHfKQlRxjPoAoEynt+oSLCrPwT6ib873e2JOkYMzi+fEBDWK0bqS8IZOBtgSBNu8fLOPvJEoEiEijizsazceRdVPgW0= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xtUQdkq8XwkNcxLf3CPw30sRW1QWN9cfGTpnwgrkLXkddQxAkyjZimYoJfO4?= =?us-ascii?Q?OisdEApjN+tDZrVn2OWI5VhzPewOi+ULwT2n/gb0dO8xrjgmx0AGfkYlpVOi?= =?us-ascii?Q?FeTWgcBtXqStKBaMsIqVAFvE1AhYTDcBr8Xm1sYPD3AwYQOXlaS/Yr3opQwZ?= =?us-ascii?Q?4Ul57RLSw8cTyO5YviPD8cx4wtwWbgO/1hNO/cOgu1AznFFCj4xwA5KznXCo?= =?us-ascii?Q?q1PWOWFT+/FSkKeEM2Qs3SNJe3b67Rp6p44uqX4ChldsgHABW2qkkNywRq3J?= =?us-ascii?Q?lZ7z7oJjcmGFgdQkh9a8r537pcnkOt+IQ+iTgp1baBsMQH0t1ew+3GIMfAVD?= =?us-ascii?Q?PY9RW12s88Buf2WAIk7NPTQMgT61k58N8DpLeZNBNugP4k/+8vjerMQUVqt8?= =?us-ascii?Q?2SlUYYHPFq4Zx/1TaI7uLziayXsE9l4TgM4r5pDrhPabXV2SlrF+x0mb6bKU?= =?us-ascii?Q?ZnghPXVYRWyX0buFWmqWglS2oMEFZun56trD+FbExllRb/F+4qgdlJX5LNo0?= =?us-ascii?Q?PLWssYhMKGWkWNKH1iQ9+ZLgL2MHV1NeVoWFaAKvKb/VMpzpEnSzvnx9W908?= =?us-ascii?Q?bkYtkhKv9ysk4K42IVcJb+N3XaUFaEyytmUPMa/8BbWQUV11/DgkP/kssNNG?= =?us-ascii?Q?pDG7J/vC65fKDjOnaj/1i64BxO6B3p/2v/ajF8grX0efjLjA7gbQtTyt8H3Q?= =?us-ascii?Q?n7sqduJBHmv1tBJQIKQq4Yss83908xfB6pwMlpm9XQlBTew7Gk7laN8jw0H8?= =?us-ascii?Q?mkXLsKptp1cp/khOu0uUTRAIaSuv74mR8HUrdxt6c11svAWNX0mmzPlypgrR?= =?us-ascii?Q?Lx5bcpggsTffYoTr9WniaBduPfYnqM2+A3WMIqZy++N0Swp3fwHwyhHQCDkp?= =?us-ascii?Q?CpZtS/hdO7Xp6Hvj/FBCi4ZTIqfCf1AH2l/VbRef/GHoZQQ/2mW+GfbS9uyQ?= =?us-ascii?Q?U0fOSM+tL+zlQ9l/m13RiPR2sPNHe6UX5qjTH/hTT7JVwZzHQ3bX2XaRT2wo?= =?us-ascii?Q?Pg0gXXnGqTT7pdxfLRr0pBCopTg/pu52w2BWY6yoT0cXj22P1EJEyvLQiUQC?= =?us-ascii?Q?QHpPUahjnJariGR3fm9L037E/2IN1AgsMiejn2Q7KvaWRG17qkJoLZEU6vDl?= =?us-ascii?Q?+M5+HtQU3UOrVejwF9AYNbumJi5t6ebm+jJjWHo9kq6/65Cr5WHt9EGCQNl1?= =?us-ascii?Q?gvm2nuW5yfsrhfU1oa2jxROSsXx8w0BLSJcHk9v8ZeiMBHrp2GM+t9SG8USi?= =?us-ascii?Q?IHnjMHDvgyb65OgASK8dehZ1ub9uf8bBUib4k4gqLPCUiao74+NZxgdoQqVj?= =?us-ascii?Q?d5nGrGw0uKPrFPShUI34eT9mfbaXDE0iFuCxglW6mtGBuOZWeZ/xrw9D4BX3?= =?us-ascii?Q?gmBjJy5lVf1uEFC9Az3eQOMbWtr3Bq32yTZPFYTvVckKxscML6teDsen1el2?= =?us-ascii?Q?aJVIWcMPqgEd0HWTh05sSf+Cla6ZGKy5weetHJrSQXws6TFXsolS/iAHHWMn?= =?us-ascii?Q?i6clAU+VyeZWEsRx7mxK2dZyWG2E8wnQUnePU+5t+2YFL2n36OJ8nDnF/EVT?= =?us-ascii?Q?GIAnN8oLihWHrlKRd4FYp3iHNlE/qeGY5OYe6Icq?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6158.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a0f6f1a-734b-430a-c7e0-08dc59e04d73 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2024 04:31:48.6419 (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: li/LkXq0PiRsR/0NSx46ZrQ0So7QdUI6ZDFGB/wiVzznAnrRibiHD0oKoK9+PYkbF0k49tQLk0UA7cHykkwwWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB6457 X-OriginatorOrg: intel.com 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: Wed, 10 Apr 2024 21:31:54 -0700 Resent-From: jiaxin.wu@intel.com Reply-To: devel@edk2.groups.io,jiaxin.wu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NyofM5YcDey9zRrsUqjx7TvMx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN0PR11MB6158DFAF853D6D0084C49254FE052MN0PR11MB6158namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=LvvEJHVm; 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.227.220 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_MN0PR11MB6158DFAF853D6D0084C49254FE052MN0PR11MB6158namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Share the PR here: https://github.com/tianocore/edk2/pull/5546 From: Ni, Ray Sent: Thursday, April 11, 2024 11:15 AM To: Wu, Jiaxin ; devel@edk2.groups.io Cc: Zeng, Star ; Gerd Hoffmann ; Ku= mar, Rahul R ; Dong, Guo ; Rho= des, Sean ; Lu, James ; Guo, Gua= ; Ard Biesheuvel ; Yao, Jiew= en Subject: Re: [PATCH v1 00/13] Add SmmRelocationLib Jiaxin, can you kindly share a PR in GitHub so that it will be easier to re= view? Thanks, Ray ________________________________ From: Wu, Jiaxin > Sent: Wednesday, April 10, 2024 21:57 To: devel@edk2.groups.io > Cc: Ni, Ray >; Zeng, Star >; Gerd Hoffmann >; Kumar, Rahul R >; Dong, Guo >; Rhodes, Sean >; Lu, James >; Guo, Gua <= gua.guo@intel.com>; Ard Biesheuvel >; Yao, Jiewen > Subject: [PATCH v1 00/13] Add SmmRelocationLib Intel plans to separate the smbase relocation logic from PiSmmCpuDxeSmm driver, and the related behavior will be moved to the new interface defined by the SmmRelocationLib class. The SmmRelocationLib class provides the SmmRelocationInit() interface for platform to do the smbase relocation, which shall provide below 2 functionalities: 1. Relocate smbases for each processor. 2. Create the gSmmBaseHobGuid HOB. With SmmRelocationLib, PiSmmCpuDxeSmm driver (which runs at a later phase) can be simplfied as below for SMM init: 1. Consume the gSmmBaseHobGuid HOB for the relocated smbases for each Processor. 2. Execute the early SMM Init. Cc: Ray Ni > Cc: Zeng Star > Cc: Gerd Hoffmann > Cc: Rahul Kumar > Cc: Guo Dong > Cc: Sean Rhodes > Cc: James Lu > Cc: Gua Guo > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Signed-off-by: Jiaxin Wu > Jiaxin Wu (13): UefiCpuPkg: Add SmmRelocationLib class UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance UefiCpuPkg/SmmRelocationLib: Add library instance for OVMF UefiCpuPkg/SmmRelocationLib: Add library instance for AMD UefiCpuPkg/UefiCpuPkg.dsc: Include SmmRelocationLib in UefiCpuPkg UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib OvmfPkg: Include SmmRelocationLib in OvmfPkg OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid OvmfPkg/SmmAccess: Consume gEfiSmmSmramMemoryGuid OvmfPkg/PlatformInitLib: Create gEfiAcpiVariableGuid OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is done or not OvmfPkg/PlatformPei: Relocate SmBases in PEI phase UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic OvmfPkg/AmdSev/AmdSevX64.dsc | 1 + OvmfPkg/CloudHv/CloudHvX64.dsc | 1 + OvmfPkg/Library/PlatformInitLib/MemDetect.c | 104 ++-- .../Library/PlatformInitLib/PlatformInitLib.inf | 6 +- .../Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 33 +- OvmfPkg/Microvm/MicrovmX64.dsc | 1 + OvmfPkg/OvmfPkgIa32.dsc | 1 + OvmfPkg/OvmfPkgIa32X64.dsc | 1 + OvmfPkg/OvmfPkgX64.dsc | 1 + OvmfPkg/PlatformPei/Platform.c | 1 + OvmfPkg/PlatformPei/Platform.h | 5 + OvmfPkg/PlatformPei/PlatformPei.inf | 5 +- OvmfPkg/PlatformPei/SmmRelocation.c | 80 +++ OvmfPkg/SmmAccess/SmmAccess2Dxe.c | 4 +- OvmfPkg/SmmAccess/SmmAccess2Dxe.inf | 5 + OvmfPkg/SmmAccess/SmmAccessPei.c | 88 +-- OvmfPkg/SmmAccess/SmmAccessPei.inf | 7 +- OvmfPkg/SmmAccess/SmramInternal.c | 73 +-- OvmfPkg/SmmAccess/SmramInternal.h | 18 +- UefiCpuPkg/Include/Library/SmmRelocationLib.h | 42 ++ .../SmmRelocationLib/AmdSmmRelocationLib.inf | 61 ++ .../SmmRelocationLib/AmdSmramSaveStateConfig.c | 109 ++++ .../SmmRelocationLib}/Ia32/Semaphore.c | 13 +- .../Library/SmmRelocationLib/Ia32/SmmInit.nasm | 157 +++++ .../SmmRelocationLib/InternalSmmRelocationLib.h | 141 +++++ .../SmmRelocationLib/OvmfSmmRelocationLib.inf | 61 ++ .../SmmRelocationLib/OvmfSmramSaveStateConfig.c | 107 ++++ .../Library/SmmRelocationLib/SmmRelocationLib.c | 659 +++++++++++++++++= ++++ .../Library/SmmRelocationLib/SmmRelocationLib.inf | 61 ++ .../SmmRelocationLib/SmramSaveStateConfig.c | 91 +++ .../SmmRelocationLib}/X64/Semaphore.c | 13 +- .../SmmRelocationLib}/X64/SmmInit.nasm | 93 ++- UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 21 +- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm | 96 --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 6 +- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 322 +--------- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 98 --- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 4 - UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c | 69 --- UefiCpuPkg/UefiCpuPkg.dec | 3 + UefiCpuPkg/UefiCpuPkg.dsc | 3 + UefiPayloadPkg/UefiPayloadPkg.dsc | 2 + 42 files changed, 1850 insertions(+), 817 deletions(-) create mode 100644 OvmfPkg/PlatformPei/SmmRelocation.c create mode 100644 UefiCpuPkg/Include/Library/SmmRelocationLib.h create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/AmdSmmRelocationLib= .inf create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/AmdSmramSaveStateCo= nfig.c rename UefiCpuPkg/{PiSmmCpuDxeSmm =3D> Library/SmmRelocationLib}/Ia32/Sema= phore.c (72%) create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/Ia32/SmmInit.nasm create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocati= onLib.h create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/OvmfSmmRelocationLi= b.inf create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/OvmfSmramSaveStateC= onfig.c create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.c create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.in= f create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/SmramSaveStateConfi= g.c rename UefiCpuPkg/{PiSmmCpuDxeSmm =3D> Library/SmmRelocationLib}/X64/Semap= hore.c (78%) rename UefiCpuPkg/{PiSmmCpuDxeSmm =3D> Library/SmmRelocationLib}/X64/SmmIn= it.nasm (57%) delete mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm -- 2.16.2.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 (#117614): https://edk2.groups.io/g/devel/message/117614 Mute This Topic: https://groups.io/mt/105441987/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_MN0PR11MB6158DFAF853D6D0084C49254FE052MN0PR11MB6158namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Share the PR here: https://github.com/tianocore/edk2/pull/5546

 

From: Ni, Ray <ray.ni@intel.com>
Sent: Thursday, April 11, 2024 11:15 AM
To: Wu, Jiaxin <jiaxin.wu@intel.com>; devel@edk2.groups.io
Cc: Zeng, Star <star.zeng@intel.com>; Gerd Hoffmann <kraxel= @redhat.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Dong, Guo = <guo.dong@intel.com>; Rhodes, Sean <sean@starlabs.systems>; Lu,= James <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Yao, Jiewen <jiewen.yao@i= ntel.com>
Subject: Re: [PATCH v1 00/13] Add SmmRelocationLib

 

Jiaxin, can you kindly share a PR in GitHub so that it wil= l be easier to review?

 

Thanks,

Ray


From: Wu, Jiaxin <jiaxin.wu@intel.com>
Sent: Wednesday, April 10, 2024 21:57
To: devel@edk2.groups.io= <devel@edk2.groups.io> Cc: Ni, Ray <ray.ni@intel.com= >; Zeng, Star <star.zeng@i= ntel.com>; Gerd Hoffmann <kr= axel@redhat.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Dong, Guo <guo.dong@intel.com= >; Rhodes, Sean <sean@starla= bs.systems>; Lu, James <jam= es.lu@intel.com>; Guo, Gua <= gua.guo@intel.com>; Ard Biesheuvel <ardb+tiano= core@kernel.org>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: [PATCH v1 00/13] Add SmmRelocationLib

 

Intel plans to separa= te the smbase relocation logic from
PiSmmCpuDxeSmm driver, and the related behavior will be
moved to the new interface defined by the SmmRelocationLib
class.

The SmmRelocationLib class provides the SmmRelocationInit()
interface for platform to do the smbase relocation, which
shall provide below 2 functionalities:
1. Relocate smbases for each processor.
2. Create the gSmmBaseHobGuid HOB.

With SmmRelocationLib, PiSmmCpuDxeSmm driver (which runs at
a later phase) can be simplfied as below for SMM init:
1. Consume the gSmmBaseHobGuid HOB for the relocated smbases
for each Processor.
2. Execute the early SMM Init.

Cc: Ray Ni <ray.ni@intel.com>=
Cc: Zeng Star <star.zeng@intel.co= m>
Cc: Gerd Hoffmann <kraxel@redhat.co= m>
Cc: Rahul Kumar <rahul1.kumar@= intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <
sean@starlabs.= systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <
gua.guo@intel.com&= gt;
Cc: Ard Biesheuvel <ardb+ti= anocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel= .com>
Signed-off-by: Jiaxin Wu <jiaxin.= wu@intel.com>

Jiaxin Wu (13):
  UefiCpuPkg: Add SmmRelocationLib class
  UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance   UefiCpuPkg/SmmRelocationLib: Add library instance for OVMF
  UefiCpuPkg/SmmRelocationLib: Add library instance for AMD
  UefiCpuPkg/UefiCpuPkg.dsc: Include SmmRelocationLib in UefiCpuPkg   UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib
  OvmfPkg: Include SmmRelocationLib in OvmfPkg
  OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid
  OvmfPkg/SmmAccess: Consume gEfiSmmSmramMemoryGuid
  OvmfPkg/PlatformInitLib: Create gEfiAcpiVariableGuid
  OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is done or not   OvmfPkg/PlatformPei: Relocate SmBases in PEI phase
  UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic

 OvmfPkg/AmdSev/AmdSevX64.dsc       = ;            &n= bsp;   |   1 +
 OvmfPkg/CloudHv/CloudHvX64.dsc      &nb= sp;            =   |   1 +
 OvmfPkg/Library/PlatformInitLib/MemDetect.c    &n= bsp;   | 104 ++--
 .../Library/PlatformInitLib/PlatformInitLib.inf    |&n= bsp;  6 +-
 .../Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c  |  33 +-=
 OvmfPkg/Microvm/MicrovmX64.dsc      &nb= sp;            =   |   1 +
 OvmfPkg/OvmfPkgIa32.dsc       &nbs= p;            &= nbsp;       |   1 +
 OvmfPkg/OvmfPkgIa32X64.dsc       &= nbsp;           &nbs= p;     |   1 +
 OvmfPkg/OvmfPkgX64.dsc        = ;            &n= bsp;        |   1 +
 OvmfPkg/PlatformPei/Platform.c      &nb= sp;            =   |   1 +
 OvmfPkg/PlatformPei/Platform.h      &nb= sp;            =   |   5 +
 OvmfPkg/PlatformPei/PlatformPei.inf     &nbs= p;          |   5 +-=
 OvmfPkg/PlatformPei/SmmRelocation.c     &nbs= p;          |  80 +++
 OvmfPkg/SmmAccess/SmmAccess2Dxe.c      =             | &= nbsp; 4 +-
 OvmfPkg/SmmAccess/SmmAccess2Dxe.inf     &nbs= p;          |   5 +<= br>  OvmfPkg/SmmAccess/SmmAccessPei.c      &= nbsp;            |&n= bsp; 88 +--
 OvmfPkg/SmmAccess/SmmAccessPei.inf      = ;           |  = 7 +-
 OvmfPkg/SmmAccess/SmramInternal.c      =             |  = 73 +--
 OvmfPkg/SmmAccess/SmramInternal.h      =             |  = 18 +-
 UefiCpuPkg/Include/Library/SmmRelocationLib.h    =   |  42 ++
 .../SmmRelocationLib/AmdSmmRelocationLib.inf    &= nbsp;  |  61 ++
 .../SmmRelocationLib/AmdSmramSaveStateConfig.c    = ; | 109 ++++
 .../SmmRelocationLib}/Ia32/Semaphore.c     &= nbsp;       |  13 +-
 .../Library/SmmRelocationLib/Ia32/SmmInit.nasm    = ; | 157 +++++
 .../SmmRelocationLib/InternalSmmRelocationLib.h    | 1= 41 +++++
 .../SmmRelocationLib/OvmfSmmRelocationLib.inf    =   |  61 ++
 .../SmmRelocationLib/OvmfSmramSaveStateConfig.c    | 1= 07 ++++
 .../Library/SmmRelocationLib/SmmRelocationLib.c    | 6= 59 +++++++++++++++++++++
 .../Library/SmmRelocationLib/SmmRelocationLib.inf  |  61 ++=
 .../SmmRelocationLib/SmramSaveStateConfig.c    &n= bsp;   |  91 +++
 .../SmmRelocationLib}/X64/Semaphore.c     &n= bsp;        |  13 +-
 .../SmmRelocationLib}/X64/SmmInit.nasm     &= nbsp;       |  93 ++-
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c      =             |  = 21 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm    &n= bsp;   |  96 ---
 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c     &n= bsp;        |   6 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c    &nb= sp;    | 322 +---------
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h    &nb= sp;    |  98 ---
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf    &= nbsp;  |   4 -
 UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c    &nb= sp;    |  69 ---
 UefiCpuPkg/UefiCpuPkg.dec       &n= bsp;            = ;      |   3 +
 UefiCpuPkg/UefiCpuPkg.dsc       &n= bsp;            = ;      |   3 +
 UefiPayloadPkg/UefiPayloadPkg.dsc      =             | &= nbsp; 2 +
 42 files changed, 1850 insertions(+), 817 deletions(-)
 create mode 100644 OvmfPkg/PlatformPei/SmmRelocation.c
 create mode 100644 UefiCpuPkg/Include/Library/SmmRelocationLib.h
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/AmdSmmRelocati= onLib.inf
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/AmdSmramSaveSt= ateConfig.c
 rename UefiCpuPkg/{PiSmmCpuDxeSmm =3D> Library/SmmRelocationLib}/I= a32/Semaphore.c (72%)
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/Ia32/SmmInit.n= asm
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRel= ocationLib.h
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/OvmfSmmRelocat= ionLib.inf
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/OvmfSmramSaveS= tateConfig.c
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationL= ib.c
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationL= ib.inf
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/SmramSaveState= Config.c
 rename UefiCpuPkg/{PiSmmCpuDxeSmm =3D> Library/SmmRelocationLib}/X= 64/Semaphore.c (78%)
 rename UefiCpuPkg/{PiSmmCpuDxeSmm =3D> Library/SmmRelocationLib}/X= 64/SmmInit.nasm (57%)
 delete mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm

--
2.16.2.windows.1

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#117614) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN0PR11MB6158DFAF853D6D0084C49254FE052MN0PR11MB6158namp_--