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 5FB32D80078 for ; Thu, 11 Apr 2024 03:14:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=oyfTszl6xOneCab+V0UjuQfhgKR6vs83dzVjF2uHJBk=; 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=1712805278; v=1; b=C3VNyZ9Ds9r9bMX4DOHrrOtwE9PxVPozHHvcuCVNkzX+TSe/3RKg99zU8Y+oQlrQAYnhNPkz wVSRTofioPWx7nRnB5pbL+W2PkbjZ6toQdcrWYaNY0HybdtOFghA8KmEagHtmXk0N01VjD93ZmM rbwVJ8ZIECfM2RbkW3iP6FlFfv27SWVkSPiJrXyhxbUNbs09N/y0mzTN9s39q1oSPzCNIkMPYNh 182pe5e4s3Bzg2AluE7S/X1m476CMsVqiT8lONbb3q98gCm7mMBYsQ0PNY7af2/X5YLuIdiEoxH u2ApJRBt8Xo59SYIHEEl8S+aZwtYz7ZBniBaOH+2+KC9Q== X-Received: by 127.0.0.2 with SMTP id UlXHYY7687511xdaMBeW3ljX; Wed, 10 Apr 2024 20:14:38 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by mx.groups.io with SMTP id smtpd.web11.8892.1712805277457473133 for ; Wed, 10 Apr 2024 20:14:37 -0700 X-CSE-ConnectionGUID: 6VClkamHQZ28uRSMyIOCEg== X-CSE-MsgGUID: ZyWPlfMnSWaDaIEg5e02kQ== X-IronPort-AV: E=McAfee;i="6600,9927,11039"; a="12050940" X-IronPort-AV: E=Sophos;i="6.07,192,1708416000"; d="scan'208,217";a="12050940" X-Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2024 20:14:37 -0700 X-CSE-ConnectionGUID: vGqj8H6eRM2poRBhzEEz/A== X-CSE-MsgGUID: iFyZ3RM3SEiCf92muuqARA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,192,1708416000"; d="scan'208,217";a="25286422" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Apr 2024 20:14:37 -0700 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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 20:14:36 -0700 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) 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 20:14:36 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (134.134.137.100) 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 20:14:35 -0700 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by IA1PR11MB6444.namprd11.prod.outlook.com (2603:10b6:208:3a7::11) 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 03:14:32 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817%5]) with mapi id 15.20.7430.045; Thu, 11 Apr 2024 03:14:32 +0000 From: "Ni, Ray" To: "Wu, Jiaxin" , "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: AQHai08Owpp3hCTDYEGwbdCRVd1/obFiZfY+ Date: Thu, 11 Apr 2024 03:14:32 +0000 Message-ID: References: <20240410135724.15344-1-jiaxin.wu@intel.com> In-Reply-To: <20240410135724.15344-1-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|IA1PR11MB6444:EE_ 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: r0G6zAV72fOLFpMMxEuvigIG0sI1z/tGPbvE3s7CgFHy57Aftkc1MDMOelwYAbNz8HDsRQ1vLABrQjdKwv5Oe72xPKeT2jzN08YV2KgUhZH5AnCBV8mu4S0rINyViKdXQuynLyPTteVfuVwb3vY3wvRB7JbDbKY9nxq8nMYImKZIkYyy3uoIDvAJrLf/UjaOpextAxH5qm7CX6Ns+1NLIfBp88iTQwFc7XrSJLKLXcY0cfaAqjSqXEZr/xj6uK745hLgee4bNT0/WO2+ZgBDeniC0ZOT+/BzH8uB5cPo/ajM6LrE4KnLxLuOfWMUKOa/RaJRRt/0r/6Yy+whACzQO10nin4suW7s0gpUYi8OlfRejFbS4HCDifANLMbukKT554e8rEJWXO4qtW5zR1muf3BV616Fw5RwNdZk2MR/7KKPb2LD4tlZErZNFywwgyG+wi/8GH3QnRbhJ6F4IA9bGNqOdMevzhxY5LriIOxmQ8Qs7fFY0HbYw4lkAm8B98c0nUsbaYEuvzT7rNFlTwlsOw+kYcAP8QQJpg6T7s9xdCkAPADJdEXenRVjw/mvGrkSaHmSq4RXM/xae+L/gkfRX1nzAWvPFB9xwDZS7sfiFgCJxBYM36df8uwg3gzdtPBR8MZYoyqQf47tYy9GpMYu686wWldzTauwdoxPvJX1cP8= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?NQefn0O3yI30L/ydmWwr5ZypfIBZwPNf1Y87i5dATZSHCUxsPWkUo+QQMCaj?= =?us-ascii?Q?tPsGReaf8u2k3+j++HeD15qCJ76apeqOkUuNJHAxBv9EbAMBpGEUeJ1fCHcs?= =?us-ascii?Q?JCRWGPnkxnneJtFsZpXIQbKcCfZxfuFoKyFnsANm3pi+pkqOegMZSCuS3KXh?= =?us-ascii?Q?Rttulcg76Rb8AuEkL3nv64tP0gcwknotpQUtfkG74Ltc+JO3VKXJpH0aBISx?= =?us-ascii?Q?6UK3CJVARvyr5xCy7kEMRd5qPSOz7ldgj+v/y4P053lr9uuYXc2E2SvR3Dy6?= =?us-ascii?Q?RjDyQmQDz26gNcRm7lfNg0Y0cVBC252VOSLr7B5n8DT2nBJ3xWOQlwuLzZvG?= =?us-ascii?Q?7xiUZHEGTWS/fq/Fio8gnbSPFeTwGe/+N/ii/QXM8wMkwqy6qMJe2+aEVwt+?= =?us-ascii?Q?bhGk7xCloQN5aRhUuJufxUMBl7PFhI7Bnft3UWfTH3WSPP3WGgWGHZedN7P7?= =?us-ascii?Q?ozHYqI43iIqMhIlMGbRKSqZmZ1bcZit9FIe8HL2oLOUfEgSsyAkj84tfVTiH?= =?us-ascii?Q?wEAQCCqjRDe161FZ9goCq+hSPLU6VpYpwDjppZayI8gV6F5pKEjHGXkPxGnz?= =?us-ascii?Q?l8xdvFK/BJYMPrXPPBc0sBwqcoVPD+gWXhKdWMzMMNKVBaamWqR+Xg6g8nc4?= =?us-ascii?Q?iMwxeQe/5WQxNZyzjicrAija6ZrNEZl+PtSvJJBhAm2golAB21gINg03K42R?= =?us-ascii?Q?BsWKz7gBQhFjKswoBvyS2Qjm6EB1Hn34hNUeWj0xHUN7HkTHEkKG4Pw0tbrq?= =?us-ascii?Q?RoEt2q5o9A0xfSoUD/3iXn60M8rSmc7ectsda3gRRp+FcfLSsC9lDqTpF5O7?= =?us-ascii?Q?4/DuzCD5bxRZK9nzeTeQQuMbzvN2npX1EK9eYn/p05zhanHzkBdq4hjnnbft?= =?us-ascii?Q?N2xH66ZmfQvC49EtaPQw0czuuLej99/Jy6VwLU0qO5ouy9WZSSrbTYaBfXbT?= =?us-ascii?Q?BTdCrUBG5tHdaeb7reMtkRHMQZmMmZmoqHH1WD2EJj9WJX+6ctmMyLg7q4to?= =?us-ascii?Q?U1sQcInWIJNw/aNssP2ZKdMfFZG0feWXoLWlYVs0MoE3GG/3nlXY2MNdqXLR?= =?us-ascii?Q?ccDD2+RBgfMVlGJbljoK4GB9l91jDKL6HZqXAi7FVLP5A5HwITSFNk5TjYVm?= =?us-ascii?Q?SWWgmlpgfXz06J4cqXY22sh6lHZGKG4gvql09zVh0mzHpDEZqbWRApPKmaKC?= =?us-ascii?Q?DwveVIKOSbFOXD+1Tgh8CdxNQb9D2yiGd5Y/g+wf6khMC0RHt/WFqR0pGyRy?= =?us-ascii?Q?+PrKHvYFPeZ8QiWiPFDNxGuuVVmLZpU7vjsSj+GPZDM1DnMFq6Etr+bhiIvx?= =?us-ascii?Q?pFWbZB4VNnjwplrl1BTDNzRzwk3q+WOEQn+ldIGHNR2YFd22Ia5aQeM1ThBW?= =?us-ascii?Q?xiWrAIYh1fX77rkzjP/H4qgxZ+Ip8nnGqGLOFPlAXT8n2DVC1doBGrJ6CeZ3?= =?us-ascii?Q?jtqxt1OioqDqD+npiVJwkJXDbQbXtY5FUkGO+gWUwoN8fcQ58odWtoT2fH50?= =?us-ascii?Q?Xs01Ni8SSfwEv8k1q3WB2NB3vOKPyPxGa3okv4qFsxnsR9BuD6Y7WOq2dg26?= =?us-ascii?Q?+LFWN9ddGQDzaE3OQbk=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27d81dd2-2f10-4818-6d20-08dc59d5821e X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Apr 2024 03:14:32.5363 (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: JoiDfrOCG1AwB0P+6Z3El9uavfWqjK57StNyh1G/yvSZR+M7N9sBAfQjdnt8GGTki5xamCyu1uRn3B2jN1W+ZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6444 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 20:14:37 -0700 Resent-From: ray.ni@intel.com Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: CQokhOE0tVYcdkNIzWlZWyrAx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN6PR11MB8244D4C7E05776B16C8A18888C052MN6PR11MB8244namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=C3VNyZ9D; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.227.220 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) --_000_MN6PR11MB8244D4C7E05776B16C8A18888C052MN6PR11MB8244namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 Hoff= mann ; Kumar, Rahul R ; Dong, G= uo ; Rhodes, Sean ; Lu, James ; Guo, Gua ; 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 (#117609): https://edk2.groups.io/g/devel/message/117609 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_MN6PR11MB8244D4C7E05776B16C8A18888C052MN6PR11MB8244namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Jiaxin, can you kindly share a PR in GitHub so that it will be easier to re= view?

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@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.or= g>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: [PATCH v1 00/13] Add SmmRelocationLib
 
Intel plans to separate the smbase relocation logi= c 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.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
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>
Cc: Ard Biesheuvel <ardb+tianocore@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 (#117609) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN6PR11MB8244D4C7E05776B16C8A18888C052MN6PR11MB8244namp_--