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 7EA1CD80CAA for ; Tue, 30 Apr 2024 10:14:48 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=kll3XackKS1vybo85vc1FYo9/bGhiuNdggG/OpMwCL4=; 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=1714472087; v=1; b=HCPblS11wdfq0cm6wjgwVx0tXp1jT98pDHrWa13RMAL1i8X0aEXP4UUNIzIhZLV0UB30A3n1 MfgwtkGo2Pb1MGs6zESzTkzecheK1WQGo3pIu9YQn72Y9d8FrZy3P/+KxcdmP64dxNZYNh0f2/W 7Z0xUjtOBdrgCMrcvjJ020qIUDYDDcTLaWl2Dje0ABQPIelNaz9jgfEZRF6051wUIZ0dJQh4oZj Y6ln3VBtuY0f4kHit9Lzt1sEh8tkZR5ViG8TpYVCLN0o6kVfOm78tuyz+xn6eA94I/xJA1c+6aJ BW22ZdsEy8U9xLVnQWF68Wt/8L6g4WQONx5ztqZDqpucA== X-Received: by 127.0.0.2 with SMTP id vbcXYY7687511xolUzff7Iih; Tue, 30 Apr 2024 03:14:47 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by mx.groups.io with SMTP id smtpd.web10.11942.1714472086257956663 for ; Tue, 30 Apr 2024 03:14:46 -0700 X-CSE-ConnectionGUID: rbDiFfczRwub5V7zD/cGOw== X-CSE-MsgGUID: 5YS35jFuQeSKc7Op2fPoBQ== X-IronPort-AV: E=McAfee;i="6600,9927,11059"; a="20855916" X-IronPort-AV: E=Sophos;i="6.07,241,1708416000"; d="scan'208,217";a="20855916" X-Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2024 03:14:45 -0700 X-CSE-ConnectionGUID: NOkffqfkSrCn2Bs8VWN7vA== X-CSE-MsgGUID: W/nm7cEHRKOCJAb0dgQ5nQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,241,1708416000"; d="scan'208,217";a="57304997" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 Apr 2024 03:14:45 -0700 X-Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 30 Apr 2024 03:14:44 -0700 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 30 Apr 2024 03:14:44 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 30 Apr 2024 03:14:44 -0700 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by PH7PR11MB6675.namprd11.prod.outlook.com (2603:10b6:510:1ad::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Tue, 30 Apr 2024 10:14:35 +0000 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::b0c8:dcaf:59ea:9e99]) by MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::b0c8:dcaf:59ea:9e99%6]) with mapi id 15.20.7519.031; Tue, 30 Apr 2024 10:14:35 +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" , Abdul Lateef Attar , Abner Chang , Tom Lendacky Subject: Re: [edk2-devel] [PATCH v4 00/14] Add SmmRelocationLib Thread-Topic: [PATCH v4 00/14] Add SmmRelocationLib Thread-Index: AQHal9PA9IGV4Fma0kKigj4l3IqtTrGAVyLRgABAhnA= Date: Tue, 30 Apr 2024 10:14:35 +0000 Message-ID: References: <20240426121720.54308-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_|PH7PR11MB6675:EE_ x-ms-office365-filtering-correlation-id: 819f2978-4846-48ed-514b-08dc68fe5647 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: =?us-ascii?Q?uXgPSOYRduxtcofygEo5vMOvJL50ZO/HRcudDYqVrLebP90k4j/yCMMm/Jf2?= =?us-ascii?Q?odAETS5nEM3Xyswxw1G5mKbdBxHRaklQOABfCEWXMK6NKB6SQ4PHdwO3h4Js?= =?us-ascii?Q?qzwhF5Y1ckQBGUhQJtLwuGP2vvgBawNshTtCwTM+SN7+G0SjTmlbRMl/3d3l?= =?us-ascii?Q?ReK+T0GseBlTTkbB0Ag5mueJv+FXXt+b7n1Liyz+u7Ssc3BKBF2T7xxJpFYU?= =?us-ascii?Q?fwGKAUars4/1XY1OUXNvJpn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vPr0UcHei2ix3jZ8hl5GsFKGSj5maiq6StzGN/1/y73Po/IxbKod4CveC?= =?us-ascii?Q?ptLlx0U0eVP08ffEY79Ia+f5JUdJKWoRhvlACgT8PNpsmVY7VeJeH68pePR4?= =?us-ascii?Q?0rXVMDD8KQb9hJ9vkDZay5IBTqKr15BCeSbush3yxc+XLK33VdtGHDRVWSHc?= =?us-ascii?Q?BrxQrYqM9nXNdbWmHcTIursWFc63cERSzgx8Ft7mH4jz2Q=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6e2S02J4aIlGW1vNworoGgy3IgJtJMIkE9rNp2baE8IsnoNnEz5GzEvM8Y0/?= =?us-ascii?Q?2KdbU24PdR0BIJps0fGAlhvjsJBFeYo0LGhCPsdG9oTMrH3nzavxMzTu3tKP?= =?us-ascii?Q?l4CvQX9drhXCg/RO2Lwt7HsriZba2IRh5kmCSuDf5NOurHiDw9+NoZoEcmTx?= =?us-ascii?Q?k8sbwhf+cBqizpnHndbYwvtemIJEgl0WA68R8iZ3TnR3E5aB8zGZ0JeagMsd?= =?us-ascii?Q?NlMFUxuENouGSCIgPw2oeSrWTpKuaSrtjikWgSzzIQy1gJVoiE+juZ0n5JOA?= =?us-ascii?Q?QHzkDFi83KKEuTJqaj4wV3hkDxgD4jONBV7il62+gfn9rA3u8e8DMcmtimGX?= =?us-ascii?Q?1Z5OncYdZZHQeRmVrnNTGSubxfJJ6Rb8Qa5R9GBzTbLUaM7A95rZdGT/6S1n?= =?us-ascii?Q?/I70PDDdA/GksmdNXD7ovIYqbYWQqhuC2NP4K4OaaRakeZcoyZqQeBYWi9v3?= =?us-ascii?Q?VWtPvV+6Takwlh4GTbQRL1L69cMqCTtcj9WD6C/YS+sR7jsIZfjwNXkBDybw?= =?us-ascii?Q?xNAn52Wdz43DgcK7JLTjqCdzLYsEHCEwfQpuHsg4BE7QPaXThPrMZlXhRftG?= =?us-ascii?Q?a4CjH67PeX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?us-ascii?Q?jdL+o/2iXboydU7EW9CPHw8nVJCkhri7TAEoMCmkJ+6WW/F69jTjlV4Sg96n?= =?us-ascii?Q?fhKHVZR/Q1rfqSLIfccm8FUvMqdIhatrrt/4uyxX?= 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: 819f2978-4846-48ed-514b-08dc68fe5647 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2024 10:14:35.7692 (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: Jc9IyFiW7yk/vL93sBTzdFAJbovOg+hmY85yrf+8fWqmkCxNbdBeH7wVfTQlJDasbNvmeuNAKo5HCBcJx44yUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6675 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: Tue, 30 Apr 2024 03:14:46 -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: Dhno30d671TuHcbYdz3yWAJmx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN0PR11MB61585B4BD97DDB8323D5F5C7FE1A2MN0PR11MB6158namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=HCPblS11; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 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_MN0PR11MB61585B4BD97DDB8323D5F5C7FE1A2MN0PR11MB6158namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Ray, I missed to add some already reviewed-by tag in v4. All V4 patc= hes are tested & acted by Gerd: Tested-by: Gerd Hoffmann > Acked-by: Gerd Hoffmann > For each one: listed as below, *so need Ray "reviewed-by" tag on the patch:= 05/06/14, need Gerd "reviewed-by" tag on the patch: 08/09/10/11/12* [PATCH v4 01/14] UefiCpuPkg: Add SmmRelocationLib class Reviewed-by: Ray Ni > --> no cha= nge compared to V3 [PATCH v4 02/14] UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib librar= y instance Reviewed-by: Ray Ni > --> no chan= ge compared to V3 [PATCH v4 03/14] UefiCpuPkg/SmmRelocationLib: Rename global variables Reviewed-by: Ray Ni > --> no chan= ge compared to V3 [PATCH v4 04/14] UefiCpuPkg/SmmRelocationLib: Avoid unnecessary memory al= location Reviewed-by: Ray Ni > --> no chan= ge compared to V3 [PATCH v4 05/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary global v= ariable [PATCH v4 06/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary CpuIndex * Change Based on Ray's comment on V3: split the removal of CpuIndex parame= ter in a new patch, so add the 06 patch in V4.* [PATCH v4 07/14] UefiCpuPkg/SmmRelocationLib: Add library instance for AM= D Reviewed-by: Abdul Lateef Attar --> no change c= ompared to V3 [PATCH v4 08/14] OvmfPkg/SmmRelocationLib: Add library instance for OVMF [PATCH v4 09/14] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid [PATCH v4 10/14] OvmfPkg: Refine SmmAccess implementation [PATCH v4 11/14] OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is do= ne or not [PATCH v4 12/14] OvmfPkg/PlatformPei: Relocate SmBases in PEI phase *Change Based on Gerd's comment on V3: 1. Creating the EFI_SMM_SMRAM_MEMOR= Y_GUID HOB should be moved to its own function. 2) refine the comment in S= mmAccess 3) refine the commit log.* [PATCH v4 13/14] UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocation= Lib Reviewed-by: Gua Guo Reviewed-by: Guo Dong [PATCH v4 14/14] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation log= ic *Change Based on Ray's comment on V3: move the "TileSize" check just below = the original TileSize calculation logic* Thanks, Jiaxin From: Ni, Ray Sent: Tuesday, April 30, 2024 2:01 PM 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 ; Abdul Lateef Attar ; = Abner Chang ; Tom Lendacky Subject: Re: [PATCH v4 00/14] Add SmmRelocationLib Jiaxin, You need to add the missing Reviewed-by for each patch if the patch doesn't= change in V4. Can you reply to this mail to list what patches have already got Reviewed-b= y from whom? Thanks, Ray ________________________________ From: Wu, Jiaxin > Sent: Friday, April 26, 2024 20:17 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 >; Abdul Lateef Attar >; Abner Chang >; Tom Lendacky > Subject: [PATCH v4 00/14] Add SmmRelocationLib PR: https://github.com/tianocore/edk2/pull/5546 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 > Cc: Abdul Lateef Attar > Cc: Abner Chang > Cc: Tom Lendacky > Signed-off-by: Jiaxin Wu > Jiaxin Wu (14): UefiCpuPkg: Add SmmRelocationLib class UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance UefiCpuPkg/SmmRelocationLib: Rename global variables UefiCpuPkg/SmmRelocationLib: Avoid unnecessary memory allocation UefiCpuPkg/SmmRelocationLib: Remove unnecessary global variable UefiCpuPkg/SmmRelocationLib: Remove unnecessary CpuIndex UefiCpuPkg/SmmRelocationLib: Add library instance for AMD OvmfPkg/SmmRelocationLib: Add library instance for OVMF OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid OvmfPkg: Refine SmmAccess implementation OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is done or not OvmfPkg/PlatformPei: Relocate SmBases in PEI phase UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic OvmfPkg/AmdSev/AmdSevX64.dsc | 1 + OvmfPkg/CloudHv/CloudHvX64.dsc | 1 + OvmfPkg/Library/PlatformInitLib/MemDetect.c | 135 +++-- .../Library/PlatformInitLib/PlatformInitLib.inf | 6 +- .../Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 33 +- .../Library/SmmRelocationLib}/Ia32/Semaphore.c | 13 +- .../Library/SmmRelocationLib}/Ia32/SmmInit.nasm | 83 +++- .../SmmRelocationLib/InternalSmmRelocationLib.h | 127 +++++ .../Library/SmmRelocationLib/SmmRelocationLib.c | 549 +++++++++++++++++= ++++ .../Library/SmmRelocationLib/SmmRelocationLib.inf | 60 +++ .../SmmRelocationLib/SmramSaveStateConfig.c | 100 ++++ .../Library/SmmRelocationLib}/X64/Semaphore.c | 13 +- .../Library/SmmRelocationLib}/X64/SmmInit.nasm | 85 +++- OvmfPkg/Microvm/MicrovmX64.dsc | 1 + OvmfPkg/OvmfPkgIa32.dsc | 1 + OvmfPkg/OvmfPkgIa32X64.dsc | 1 + OvmfPkg/OvmfPkgX64.dsc | 1 + OvmfPkg/PlatformPei/Platform.c | 3 + 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 | 116 ++--- OvmfPkg/SmmAccess/SmmAccessPei.inf | 11 +- OvmfPkg/SmmAccess/SmramInternal.c | 72 +-- OvmfPkg/SmmAccess/SmramInternal.h | 19 +- UefiCpuPkg/Include/Library/SmmRelocationLib.h | 42 ++ .../SmmRelocationLib/AmdSmmRelocationLib.inf | 60 +++ .../SmmRelocationLib/AmdSmramSaveStateConfig.c | 125 +++++ .../SmmRelocationLib}/Ia32/Semaphore.c | 13 +- .../SmmRelocationLib}/Ia32/SmmInit.nasm | 83 +++- .../SmmRelocationLib/InternalSmmRelocationLib.h | 127 +++++ .../Library/SmmRelocationLib/SmmRelocationLib.c | 549 +++++++++++++++++= ++++ .../Library/SmmRelocationLib/SmmRelocationLib.inf | 61 +++ .../SmmRelocationLib/SmramSaveStateConfig.c | 136 +++++ .../SmmRelocationLib}/X64/Semaphore.c | 13 +- .../SmmRelocationLib}/X64/SmmInit.nasm | 85 +++- UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 21 +- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 10 +- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 334 ++----------- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 103 +--- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 4 - UefiCpuPkg/PiSmmCpuDxeSmm/SmmMpPerf.h | 2 +- UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c | 69 --- UefiCpuPkg/UefiCpuPkg.dec | 3 + UefiCpuPkg/UefiCpuPkg.dsc | 2 + UefiPayloadPkg/UefiPayloadPkg.dsc | 2 + 48 files changed, 2578 insertions(+), 796 deletions(-) copy {UefiCpuPkg/PiSmmCpuDxeSmm =3D> OvmfPkg/Library/SmmRelocationLib}/Ia3= 2/Semaphore.c (71%) copy {UefiCpuPkg/PiSmmCpuDxeSmm =3D> OvmfPkg/Library/SmmRelocationLib}/Ia3= 2/SmmInit.nasm (47%) create mode 100644 OvmfPkg/Library/SmmRelocationLib/InternalSmmRelocationL= ib.h create mode 100644 OvmfPkg/Library/SmmRelocationLib/SmmRelocationLib.c create mode 100644 OvmfPkg/Library/SmmRelocationLib/SmmRelocationLib.inf create mode 100644 OvmfPkg/Library/SmmRelocationLib/SmramSaveStateConfig.c copy {UefiCpuPkg/PiSmmCpuDxeSmm =3D> OvmfPkg/Library/SmmRelocationLib}/X64= /Semaphore.c (78%) copy {UefiCpuPkg/PiSmmCpuDxeSmm =3D> OvmfPkg/Library/SmmRelocationLib}/X64= /SmmInit.nasm (59%) 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 (71%) rename UefiCpuPkg/{PiSmmCpuDxeSmm =3D> Library/SmmRelocationLib}/Ia32/SmmI= nit.nasm (47%) create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRelocati= onLib.h 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 (59%) -- 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 (#118434): https://edk2.groups.io/g/devel/message/118434 Mute This Topic: https://groups.io/mt/105748911/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_MN0PR11MB61585B4BD97DDB8323D5F5C7FE1A2MN0PR11MB6158namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thanks Ray, I missed to add some already reviewed-by= tag in v4. All V4 patches are tested & acted by Gerd:

Tested-by: Gerd Hoffmann <kraxel@redhat.com>

Acked-by: Gerd Hoffmann <kraxel@redhat.com>

 

For each one: listed as below, *so need Ray ̶= 0;reviewed-by” tag on the patch: 05/06/14, need Gerd “reviewed-= by” tag on the patch:  08/09/10/11/12*

 

  [PATCH v4 01/14] UefiCpuPkg: Add SmmRelocatio= nLib class

Reviewed-by: Ray Ni <ray.ni@intel.com>  --> no change compared to V3=


  [PATCH v4 02/14] UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib l= ibrary instance

Reviewed-by: Ray Ni <ray.ni@intel.com> --> no change compared to V3


  [PATCH v4 03/14] UefiCpuPkg/SmmRelocationLib: Rename global variable= s

Reviewed-by: Ray Ni <ray.ni@intel.com> --> no change compared to V3


 [PATCH v4 04/14]  UefiCpuPkg/SmmRelocationLib: Avoid unnecessary= memory allocation

Reviewed-by: Ray Ni <ray.ni@intel.com> --> no change compared to V3


  [PATCH v4 05/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary glo= bal variable
  [PATCH v4 06/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary Cpu= Index

* Change Based on Ray’s comment on V3: = spl= it the removal of CpuIndex parameter in a new patch, so add the 06 patch in= V4.*


  [PATCH v4 07/14] UefiCpuPkg/SmmRelocationLib: Add library instance f= or AMD

Reviewed-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com> --> no change compared to V3


  [PATCH v4 08/14] OvmfPkg/SmmRelocationLib: Add library instance for = OVMF
  [PATCH v4 09/14] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryG= uid
  [PATCH v4 10/14]  OvmfPkg: Refine SmmAccess implementation
  [PATCH v4 11/14] OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation = is done or not
  [PATCH v4 12/14] OvmfPkg/PlatformPei: Relocate SmBases in PEI phase<= o:p>

*Change Based on Gerd’s  comment on V3= : 1. Creating the EFI_SMM_SMRAM_MEMORY_GUID HOB should be moved to its own = function.  2) refine the comment in SmmAccess 3) refine the commit log= .*


  [PATCH v4 13/14] UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmReloc= ationLib

Reviewed-by: Gua Guo <gua.guo@intel.com>

Reviewed-by: Guo Dong <guo.dong@intel.com>


  [PATCH v4 14/14] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocatio= n logic

*Change Based on Ray’s comment on V3: <= b>move= the "TileSize" check just below the original TileSize calculatio= n logic*

 

Thanks,

Jiaxin

 

From: Ni, Ray <ray.ni@intel.com>
Sent: Tuesday, April 30, 2024 2:01 PM
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>; Abdul Lateef Attar <AbdulLateef.Attar@amd.com>; Abner C= hang <abner.chang@amd.com>; Tom Lendacky <thomas.lendacky@amd.com&= gt;
Subject: Re: [PATCH v4 00/14] Add SmmRelocationLib

 

Jiaxin,

You need to add the missing Reviewed-by for each patch if = the patch doesn't change in V4.

 

Can you reply to this mail to list what patches have alrea= dy got Reviewed-by from whom?

 

 

 

Thanks,

Ray


From: Wu, Jiaxin <jiaxin.wu@intel.com>
Sent: Friday, April 26, 2024 20:17
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>; Abdul Lateef Attar <AbdulLateef.Attar@amd.com>; Abner Chang <abner.chang@amd.com= >; Tom Lendacky <thoma= s.lendacky@amd.com>
Subject: [PATCH v4 00/14] Add SmmRelocationLib

 

PR: https://github.com/tianocore/edk2/pull/5546

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 <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>
Cc: Abdul Lateef Attar <Abd= ulLateef.Attar@amd.com>
Cc: Abner Chang <abner.chang@amd.= com>
Cc: Tom Lendacky <thomas.lend= acky@amd.com>
Signed-off-by: Jiaxin Wu <jiaxin.= wu@intel.com>

Jiaxin Wu (14):
  UefiCpuPkg: Add SmmRelocationLib class
  UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance   UefiCpuPkg/SmmRelocationLib: Rename global variables
  UefiCpuPkg/SmmRelocationLib: Avoid unnecessary memory allocation
  UefiCpuPkg/SmmRelocationLib: Remove unnecessary global variable
  UefiCpuPkg/SmmRelocationLib: Remove unnecessary CpuIndex
  UefiCpuPkg/SmmRelocationLib: Add library instance for AMD
  OvmfPkg/SmmRelocationLib: Add library instance for OVMF
  OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid
  OvmfPkg: Refine SmmAccess implementation
  OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is done or not   OvmfPkg/PlatformPei: Relocate SmBases in PEI phase
  UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib
  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;   | 135 +++--
 .../Library/PlatformInitLib/PlatformInitLib.inf    |&n= bsp;  6 +-
 .../Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c  |  33 +-=
 .../Library/SmmRelocationLib}/Ia32/Semaphore.c    = ; |  13 +-
 .../Library/SmmRelocationLib}/Ia32/SmmInit.nasm    |&n= bsp; 83 +++-
 .../SmmRelocationLib/InternalSmmRelocationLib.h    | 1= 27 +++++
 .../Library/SmmRelocationLib/SmmRelocationLib.c    | 5= 49 +++++++++++++++++++++
 .../Library/SmmRelocationLib/SmmRelocationLib.inf  |  60 ++= +
 .../SmmRelocationLib/SmramSaveStateConfig.c    &n= bsp;   | 100 ++++
 .../Library/SmmRelocationLib}/X64/Semaphore.c    =   |  13 +-
 .../Library/SmmRelocationLib}/X64/SmmInit.nasm    = ; |  85 +++-
 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;            =   |   3 +
 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;            | 1= 16 ++---
 OvmfPkg/SmmAccess/SmmAccessPei.inf      = ;           |  11 +-=
 OvmfPkg/SmmAccess/SmramInternal.c      =             |  = 72 +--
 OvmfPkg/SmmAccess/SmramInternal.h      =             |  = 19 +-
 UefiCpuPkg/Include/Library/SmmRelocationLib.h    =   |  42 ++
 .../SmmRelocationLib/AmdSmmRelocationLib.inf    &= nbsp;  |  60 +++
 .../SmmRelocationLib/AmdSmramSaveStateConfig.c    = ; | 125 +++++
 .../SmmRelocationLib}/Ia32/Semaphore.c     &= nbsp;       |  13 +-
 .../SmmRelocationLib}/Ia32/SmmInit.nasm     =        |  83 +++-
 .../SmmRelocationLib/InternalSmmRelocationLib.h    | 1= 27 +++++
 .../Library/SmmRelocationLib/SmmRelocationLib.c    | 5= 49 +++++++++++++++++++++
 .../Library/SmmRelocationLib/SmmRelocationLib.inf  |  61 ++= +
 .../SmmRelocationLib/SmramSaveStateConfig.c    &n= bsp;   | 136 +++++
 .../SmmRelocationLib}/X64/Semaphore.c     &n= bsp;        |  13 +-
 .../SmmRelocationLib}/X64/SmmInit.nasm     &= nbsp;       |  85 +++-
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c      =             |  = 21 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c     &n= bsp;        |  10 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c    &nb= sp;    | 334 ++-----------
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h    &nb= sp;    | 103 +---
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf    &= nbsp;  |   4 -
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmMpPerf.h     &n= bsp;        |   2 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c    &nb= sp;    |  69 ---
 UefiCpuPkg/UefiCpuPkg.dec       &n= bsp;            = ;      |   3 +
 UefiCpuPkg/UefiCpuPkg.dsc       &n= bsp;            = ;      |   2 +
 UefiPayloadPkg/UefiPayloadPkg.dsc      =             | &= nbsp; 2 +
 48 files changed, 2578 insertions(+), 796 deletions(-)
 copy {UefiCpuPkg/PiSmmCpuDxeSmm =3D> OvmfPkg/Library/SmmRelocation= Lib}/Ia32/Semaphore.c (71%)
 copy {UefiCpuPkg/PiSmmCpuDxeSmm =3D> OvmfPkg/Library/SmmRelocation= Lib}/Ia32/SmmInit.nasm (47%)
 create mode 100644 OvmfPkg/Library/SmmRelocationLib/InternalSmmReloca= tionLib.h
 create mode 100644 OvmfPkg/Library/SmmRelocationLib/SmmRelocationLib.= c
 create mode 100644 OvmfPkg/Library/SmmRelocationLib/SmmRelocationLib.= inf
 create mode 100644 OvmfPkg/Library/SmmRelocationLib/SmramSaveStateCon= fig.c
 copy {UefiCpuPkg/PiSmmCpuDxeSmm =3D> OvmfPkg/Library/SmmRelocation= Lib}/X64/Semaphore.c (78%)
 copy {UefiCpuPkg/PiSmmCpuDxeSmm =3D> OvmfPkg/Library/SmmRelocation= Lib}/X64/SmmInit.nasm (59%)
 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 (71%)
 rename UefiCpuPkg/{PiSmmCpuDxeSmm =3D> Library/SmmRelocationLib}/I= a32/SmmInit.nasm (47%)
 create mode 100644 UefiCpuPkg/Library/SmmRelocationLib/InternalSmmRel= ocationLib.h
 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 (59%)

--
2.16.2.windows.1

_._,_._,_

Groups.io Links:

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

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

_._,_._,_
--_000_MN0PR11MB61585B4BD97DDB8323D5F5C7FE1A2MN0PR11MB6158namp_--