Re: [edk2-devel] [PATCH] UefiCpuPkg:fix issue when splitting paging entry

2024-05-23 Thread Wu, Jiaxin
Reviewed-by: Jiaxin Wu > -Original Message- > From: Tan, Dun > Sent: Friday, May 17, 2024 5:45 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Kumar, Rahul R ; > Gerd Hoffmann ; Wu, Jiaxin ; > Zhou, Jianfeng > Subject: [PATCH] UefiCpuPkg:fix issue when splittin

Re: [edk2-devel] [Patch V2 00/18] Remove some S3 related code in CpuS3.c of smm cpu driver

2024-05-23 Thread Wu, Jiaxin
Series Reviewed-by: Jiaxin Wu The series patches are good to me now. Thanks Dun. Thanks, Jiaxin > -Original Message- > From: Tan, Dun > Sent: Friday, May 17, 2024 5:46 PM > To: devel@edk2.groups.io > Cc: Liming Gao ; Wu, Jiaxin > ; Ni, Ray ; Ard Biesheuvel >

Re: [edk2-devel] [PATCH 04/18] UefiCpuPkg: Save MTRR by lockbox in CpuS3DataDxe

2024-05-12 Thread Wu, Jiaxin
> Sent: Friday, May 10, 2024 6:08 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Kumar, Rahul R ; > Gerd Hoffmann ; Wu, Jiaxin > Subject: [PATCH 04/18] UefiCpuPkg: Save MTRR by lockbox in CpuS3DataDxe > > Save MTRR by lockbox in CpuS3DataDxe. In S3 boot, > The MTRR setting will

Re: [edk2-devel] [PATCH 00/19] Remove some S3 related code in CpuS3.c of smm cpu driver

2024-05-12 Thread Wu, Jiaxin
My comments as below: 1. I stronger recommend re-ordering the patches as below so as to combine all related sub-patches together, then we can more easy understand what we are target to resolving: 1) S3 MTRRs operation 2) AP page table unavailiable issue fix. 3) S3 ApHltLoopCode Operation 3) Reg

Re: [edk2-devel] [PATCH 1/3] StandaloneMmPkg: Add LockBox Dependency DXE Driver

2024-05-08 Thread Wu, Jiaxin
Reviewed-by: Jiaxin Wu mailto:jiaxin...@intel.com>> after resolve Ray's concern. From: Ni, Ray Sent: Wednesday, May 8, 2024 10:46 AM To: Xie, Yuanhao ; devel@edk2.groups.io Cc: Liming Gao ; Wu, Jiaxin Subject: Re: [PATCH 1/3] StandaloneMmPkg: Add LockBox Dependency DXE Driver

Re: [edk2-devel] [PATCH 3/3] MdeModulePkg: Add Standalone MM Lockbox Driver.

2024-05-08 Thread Wu, Jiaxin
Reviewed-by: Jiaxin Wu > -Original Message- > From: Xie, Yuanhao > Sent: Tuesday, May 7, 2024 2:09 PM > To: devel@edk2.groups.io > Cc: Liming Gao ; Wu, Jiaxin > ; Ni, Ray ; Xie, Yuanhao > > Subject: [PATCH 3/3] MdeModulePkg: Add Standalone MM Lockbox Driver.

Re: [edk2-devel] [PATCH 2/3] MdeModulePkg: Refactors SmmLockBox.c.

2024-05-08 Thread Wu, Jiaxin
Reviewed-by: Jiaxin Wu > -Original Message- > From: Xie, Yuanhao > Sent: Tuesday, May 7, 2024 2:09 PM > To: devel@edk2.groups.io > Cc: Liming Gao ; Wu, Jiaxin > ; Ni, Ray ; Xie, Yuanhao > > Subject: [PATCH 2/3] MdeModulePkg: Refactors SmmLockBox.c. >

Re: [edk2-devel] [PATCH v4 00/14] Add SmmRelocationLib

2024-05-06 Thread Wu, Jiaxin
Thanks Jiewen. From: Yao, Jiewen Sent: Tuesday, May 7, 2024 12:59 PM To: Wu, Jiaxin ; Ni, Ray ; devel@edk2.groups.io; Ard Biesheuvel Cc: Zeng, Star ; Gerd Hoffmann ; Kumar, Rahul R ; Dong, Guo ; Rhodes, Sean ; Lu, James ; Guo, Gua ; Abdul Lateef Attar ; Abner Chang ; Tom Lendacky

Re: [edk2-devel] [PATCH v2] MdePkg: Add MmUnblockMemoryLib to MdeLibs.dsc

2024-05-06 Thread Wu, Jiaxin
Reviewed-by: Jiaxin Wu > -Original Message- > From: Zhang, Hongbin1 > Sent: Monday, April 29, 2024 2:25 PM > To: devel@edk2.groups.io > Cc: Zhang, Hongbin1 ; Kinney, Michael D > ; Ni, Ray ; Liming Gao > ; Liu, Zhiguang ; Wu, > Jiaxin ; Xie, Yuanhao > Subj

Re: [edk2-devel] [PATCH v4 00/14] Add SmmRelocationLib

2024-05-06 Thread Wu, Jiaxin
[PATCH v4 12/14] OvmfPkg/PlatformPei: Relocate SmBases in PEI phase Thanks, Jiaxin From: Wu, Jiaxin Sent: Tuesday, April 30, 2024 6:14 PM 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 ;

Re: [edk2-devel] [PATCH v4 00/14] Add SmmRelocationLib

2024-04-30 Thread Wu, Jiaxin
lude SmmRelocationLib Reviewed-by: Gua Guo Reviewed-by: Guo Dong [PATCH v4 14/14] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic *Change Based on Ray's comment on V3: move the "TileSize" check just below the original TileSize calculation logic* Thanks, Jiaxin From:

Re: [edk2-devel] [PATCH v1] Maintainers.txt: Update StandaloneMmPkg and UefiCpuPkg Reviewer

2024-04-29 Thread Wu, Jiaxin
Thanks Ray, please help add the push label for the PR: https://github.com/tianocore/edk2/pull/5611 From: Ni, Ray Sent: Tuesday, April 30, 2024 1:34 PM To: Wu, Jiaxin ; devel@edk2.groups.io Cc: Ard Biesheuvel ; Sami Mujawar ; Kumar, Rahul R ; Gerd Hoffmann Subject: Re: [PATCH v1

Re: [edk2-devel] [PATCH v1] UefiCpuPkg/Library: Cleanup debug message in LmceSupport

2024-04-29 Thread Wu, Jiaxin
Thanks Ray, please help add the push label for the PR: https://github.com/tianocore/edk2/pull/5610 From: Ni, Ray Sent: Tuesday, April 30, 2024 1:33 PM To: Wu, Jiaxin ; devel@edk2.groups.io Cc: Zeng, Star ; Gerd Hoffmann ; Kumar, Rahul R Subject: Re: [PATCH v1] UefiCpuPkg/Library: Cleanup

Re: [edk2-devel] [PATCH v1] UefiCpuPkg/Library: Support to get processor extended info

2024-04-29 Thread Wu, Jiaxin
Thanks Ray, please help add the push label for the PR: https://github.com/tianocore/edk2/pull/5608 From: Ni, Ray Sent: Tuesday, April 30, 2024 1:33 PM To: Wu, Jiaxin ; devel@edk2.groups.io Cc: Zeng, Star ; Gerd Hoffmann ; Kumar, Rahul R Subject: Re: [PATCH v1] UefiCpuPkg/Library: Support to

[edk2-devel] [PATCH v1] UefiCpuPkg/Library: Support to get processor extended info

2024-04-29 Thread Wu, Jiaxin
Intel has some features need to use processor extended information under CPU feature InitializeFunc(), so add code to support it: This patch is to add CPU_V2_EXTENDED_TOPOLOGY to get processor extended info. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu -

Re: [edk2-devel] [PATCH v4 00/14] Add SmmRelocationLib

2024-04-29 Thread Wu, Jiaxin
not OvmfPkg/PlatformPei: Relocate SmBases in PEI phase Thanks, Jiaxin > -Original Message- > From: devel@edk2.groups.io On Behalf Of Wu, > Jiaxin > Sent: Friday, April 26, 2024 8:17 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Zeng, Star ; Gerd > Hoffmann ; Kum

[edk2-devel] [PATCH v1] Maintainers.txt: Update StandaloneMmPkg and UefiCpuPkg Reviewer

2024-04-28 Thread Wu, Jiaxin
This is to update StandaloneMmPkg and UefiCpuPkg Reviewer. Cc: Ray Ni Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Rahul Kumar Cc: Gerd Hoffmann Signed-off-by: Jiaxin Wu --- Maintainers.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Maintainers.txt b/Maintainers.txt index 7d9cdca611..

[edk2-devel] [PATCH v1] UefiCpuPkg/Library: Cleanup debug message in LmceSupport

2024-04-28 Thread Wu, Jiaxin
ProcessorNumber 0 is not always BSP. Debug message based on 0 of ProcessorNumber is incorrect. This patch is to clean the debug message in LmceSupport directly. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- UefiCpuPkg/Library/CpuCommonFeaturesLib/Ma

[edk2-devel] [PATCH v1] UefiCpuPkg/Library: Cleanup debug message in LmceSupport

2024-04-28 Thread Wu, Jiaxin
ProcessorNumber 0 is not always BSP. Debug message based on 0 of ProcessorNumber is incorrect. This patch is to clean the debug message in LmceSupport directly. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- UefiCpuPkg/Library/CpuCommonFeaturesLib/Ma

Re: [edk2-devel] [PATCH v1] Add MmUnblockMemoryLib to MdeLibs.dsc

2024-04-28 Thread Wu, Jiaxin
Reviewed-by: Jiaxin Wu > -Original Message- > From: Zhang, Hongbin1 > Sent: Monday, April 29, 2024 11:08 AM > To: devel@edk2.groups.io > Cc: Zhang, Hongbin1 ; Kinney, Michael D > ; Ni, Ray ; Liming Gao > ; Liu, Zhiguang ; Wu, > Jiaxin ; Xie, Yuanhao &

[edk2-devel] [PATCH v4 14/14] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic

2024-04-26 Thread Wu, Jiaxin
This patch is to remove legacy SmBase relocation in PiSmmCpuDxeSmm Driver. The responsibility for SmBase relocation has been transferred to the SmmRelocationInit interface, which now handles the following tasks: 1. Relocates the SmBase for each processor. 2. Generates the gSmmBaseHobGuid HOB. As a

[edk2-devel] [PATCH v4 13/14] UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib

2024-04-26 Thread Wu, Jiaxin
This patch just includes SmmRelocationLib in UefiPayloadPkg. Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ray Ni Signed-off-by: Jiaxin Wu Reviewed-by: Gua Guo Reviewed-by: Guo Dong --- UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Uef

[edk2-devel] [PATCH v4 12/14] OvmfPkg/PlatformPei: Relocate SmBases in PEI phase

2024-04-26 Thread Wu, Jiaxin
This patch is to consume SmmRelocationInit for SmBase Relocation. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Ray Ni Signed-off-by: Jiaxin Wu --- OvmfPkg/PlatformPei/Platform.c | 3 + OvmfPkg/PlatformPei/Platform.h | 5 ++ OvmfPkg/Platfor

[edk2-devel] [PATCH v4 11/14] OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is done or not

2024-04-26 Thread Wu, Jiaxin
Based on gSmmBaseHobGuid: If gSmmBaseHobGuid found, means SmBase info has been relocated and recorded in the SmBase array. So, this patch check smbase relocation is done or not in SmmCpuFeaturesInitializeProcessor(). With SmmRelocationLib, gSmmBaseHobGuid will be always created. Here this patch ju

[edk2-devel] [PATCH v4 10/14] OvmfPkg: Refine SmmAccess implementation

2024-04-26 Thread Wu, Jiaxin
This patch refines the SmmAccess implementation: 1. SmramMap will be retrieved from the gEfiSmmSmramMemoryGuid instead of original from the TSEG Memory Base register. 2. Remove the gEfiAcpiVariableGuid creation, thus the DESCRIPTOR_INDEX definition can be also cleaned. 3. The gEfiAcpiVariableGuid H

[edk2-devel] [PATCH v4 09/14] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-26 Thread Wu, Jiaxin
In the PiSmmCpuDxeSmm driver, SMRAM allocation for SMI handlers and processor Save State areas was traditionally performed using the Smst->AllocatePages() function during the DXE phase. The introduction of SmmRelocationLib changes this process by moving the allocation to the PEI phase, where Smst->

[edk2-devel] [PATCH v4 08/14] OvmfPkg/SmmRelocationLib: Add library instance for OVMF

2024-04-26 Thread Wu, Jiaxin
There are below 2 differences between AMD & OVMF according existing implementation: 1.The mode of the CPU check is different between the AMD & OVMF. OVMF: CpuSaveState->x86.SMMRevId & 0X AMD: LMAValue = (UINT32)AsmReadMsr64 (EFER_ADDRESS) & LMA 2.Existing SmBase configuration is different be

[edk2-devel] [PATCH v4 07/14] UefiCpuPkg/SmmRelocationLib: Add library instance for AMD

2024-04-26 Thread Wu, Jiaxin
Due to the definition difference of SMRAM Save State, SmmBase config in SMRAM Save State for AMD is also different. This patch provides the AmdSmmRelocationLib library instance to handle the SMRAM Save State difference. Cc: Abdul Lateef Attar Cc: Abner Chang Cc: Ray Ni Cc: Zeng Star Cc: Gerd

[edk2-devel] [PATCH v4 06/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary CpuIndex

2024-04-26 Thread Wu, Jiaxin
This patch is to remove unnecessary CpuIndex. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- UefiCpuPkg/Library/SmmRelocationLib/Ia32/Semaphore.c | 3 --- .../Library/SmmRelocationLib/InternalSmmRelocationLib.h | 5 - UefiCpuPkg/Lib

[edk2-devel] [PATCH v4 05/14] UefiCpuPkg/SmmRelocationLib: Remove unnecessary global variable

2024-04-26 Thread Wu, Jiaxin
This patch aims on mProcessorInfo global variable, which can be defined as local variable in SmmRelocateBases(). With this patch, no need to allocate the memory for all CPUs to store the Processor Info. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- .

[edk2-devel] [PATCH v4 04/14] UefiCpuPkg/SmmRelocationLib: Avoid unnecessary memory allocation

2024-04-26 Thread Wu, Jiaxin
Since SMM relocation is performed serially for each CPU, there is no need to allocate buffers for all CPUs to store the SmBase address in mSmBase and the Rebased flag in mRebased. A defined global variable is sufficient. This patch focuses on the mSmBase and mRebased global variables to prevent un

[edk2-devel] [PATCH v4 03/14] UefiCpuPkg/SmmRelocationLib: Rename global variables

2024-04-26 Thread Wu, Jiaxin
This patch aims to rename global variables for clearer association with Smm Init, ensuring their names are distinct from those used in the PiSmmCpuDxeSmm Driver. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- .../Library/SmmRelocationLib/Ia32/SmmInit.

[edk2-devel] [PATCH v4 02/14] UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance

2024-04-26 Thread Wu, Jiaxin
This patch just separates the smbase relocation logic from PiSmmCpuDxeSmm driver, and moves to the SmmRelocationInit interface. It maintains the original implementation of most functions and leaves the definitions of global variables intact. Further refinements to the code are planned for subsequen

[edk2-devel] [PATCH v4 01/14] UefiCpuPkg: Add SmmRelocationLib class

2024-04-26 Thread Wu, Jiaxin
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 s

[edk2-devel] [PATCH v4 00/14] Add SmmRelocationLib

2024-04-26 Thread Wu, Jiaxin
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

Re: [edk2-devel] [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-25 Thread Wu, Jiaxin
> > Creating the EFI_SMM_SMRAM_MEMORY_GUID HOB should be moved to its > own > function. Also move over the comments from SmmAccess describing the > regions please. > > Adding a reference to the PI spec section describing this would be good > too. > Got it, I will refine the patch to V4 based o

Re: [edk2-devel] [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-24 Thread Wu, Jiaxin
> > SmramInternal.c handles that. It creates two regions, one is a page at > the start of SMRAM where S3 state is stored (and marked as allocated), > one is all the rest. > Yes, the same logic is moved to the OvmfPkg/Library/PlatformInitLib/MemDetect.c: // // Create first SMRAM descrip

Re: [edk2-devel] [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-24 Thread Wu, Jiaxin
> > > Transfer to 16bit OS waking vector - 991F0 > hang here!!! > > That is the last ovmf message of a successful S3 resume, after that the > OS should have back control. Looks fine to me. > Great, got it. Thanks, Jiaxin -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages

Re: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

2024-04-24 Thread Wu, Jiaxin
> > > > AMD version is not work for IA32X64 ovmf. > > > > I checked the detailed: CpuSaveState->x64 is always used for OVMF no > matter IA32 or X64, while AMD is not, which is decided by the MSR > EFER_ADDRESS LMA bit check. > > Hmm, probably because only PEI runs in 32-bit mode whereas DXE and SM

Re: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

2024-04-23 Thread Wu, Jiaxin
for IA32. Before this open resolved, I still prefer to keep use the ovmf specific lib instance. Thanks, Jiaxin > -Original Message- > From: Wu, Jiaxin > Sent: Tuesday, April 23, 2024 8:16 PM > To: Gerd Hoffmann > Cc: devel@edk2.groups.io; Ni, Ray ; Zeng, Star > ;

Re: [edk2-devel] [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-23 Thread Wu, Jiaxin
d)! Transfer to 16bit OS waking vector - 991F0 > hang here!!! Thanks, Jiaxin > -Original Message- > From: Wu, Jiaxin > Sent: Tuesday, April 23, 2024 9:20 PM > To: Gerd Hoffmann > Cc: devel@edk2.groups.io; Ard Biesheuvel ; Yao, > Jiewen ; Ni, Ray > Subject:

Re: [edk2-devel] [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-23 Thread Wu, Jiaxin
1000 7F00 1A--> ---> for the S3 Resume in gEfiAcpiVariableGuid PlatformQemuInitializeRam: 7F001000 FFF000 7F001000A Thanks, Jiaxin > -Original Message- > From: Wu, Jiaxin > Sent: Tuesday,

Re: [edk2-devel] [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-23 Thread Wu, Jiaxin
> > > +SmramHobDescriptorBlock = > (EFI_SMRAM_HOB_DESCRIPTOR_BLOCK *)(Hob.Raw); > > > +SmramHobDescriptorBlock->Descriptor[0].PhysicalStart = > PlatformInfoHob->LowMemory - TsegSize; > > +SmramHobDescriptorBlock->Descriptor[0].CpuStart = > PlatformInfo

Re: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

2024-04-23 Thread Wu, Jiaxin
n use the ADM version for OVMF. Thanks, Jiaxin > -Original Message- > From: Gerd Hoffmann > Sent: Tuesday, April 23, 2024 4:43 PM > To: Wu, Jiaxin > Cc: devel@edk2.groups.io; Ni, Ray ; Zeng, Star > ; Kumar, Rahul R ; Dong, > Guo ; Rhodes, Sean ; Lu, > James ; Guo,

Re: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

2024-04-23 Thread Wu, Jiaxin
on you. Thanks, Jiaxin > -Original Message- > From: Gerd Hoffmann > Sent: Monday, April 22, 2024 3:58 PM > To: Wu, Jiaxin > Cc: devel@edk2.groups.io; Ni, Ray ; Zeng, Star > ; Kumar, Rahul R ; Dong, > Guo ; Rhodes, Sean ; Lu, > James ; Guo, Gua ; Ard Biesheuvel

Re: [edk2-devel] [PATCH 1/1] UefiCpuPkg/SmmCpuSyncLib: Add MM_STANDALONE tag.

2024-04-22 Thread Wu, Jiaxin
Reviewed-by: Jiaxin Wu > -Original Message- > From: Xie, Yuanhao > Sent: Tuesday, April 23, 2024 1:57 PM > To: devel@edk2.groups.io > Cc: Xie, Yuanhao ; Dong, Eric > ; Ni, Ray ; Kumar, Rahul R > ; Gerd Hoffmann ; Wu, Jiaxin > > Subject: [PATCH 1/1] Ue

Re: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

2024-04-18 Thread Wu, Jiaxin
Oh, sorry, I missed the that email. If so, that's great! Thanks Ray & Abner & Abdul. From: Chang, Abner Sent: Friday, April 19, 2024 11:47 AM To: Ni, Ray ; Wu, Jiaxin ; devel@edk2.groups.io Cc: Zeng, Star ; Gerd Hoffmann ; Kumar, Rahul R ; Dong, Guo ; Rhodes, Sean ; Lu, Jam

Re: [edk2-devel] [PATCH v3 13/13] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic

2024-04-18 Thread Wu, Jiaxin
Ok, thanks Ray, I will follow the change in next version. From: Ni, Ray Sent: Thursday, April 18, 2024 4:15 PM To: Wu, Jiaxin ; devel@edk2.groups.io Cc: Zeng, Star ; Gerd Hoffmann ; Kumar, Rahul R Subject: Re: [PATCH v3 13/13] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic

Re: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

2024-04-18 Thread Wu, Jiaxin
Hi Tom & Abner, Could you help check & review AMD related patch? > UefiCpuPkg/SmmRelocationLib: Add library instance for AMD Thanks, Jiaxin > -Original Message- > From: devel@edk2.groups.io On Behalf Of Wu, > Jiaxin > Sent: Thursday, April 18, 2024 2:56 PM >

Re: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

2024-04-18 Thread Wu, Jiaxin
ation is done or not > OvmfPkg/PlatformPei: Relocate SmBases in PEI phase Thanks, Jiaxin > -Original Message- > From: devel@edk2.groups.io On Behalf Of Wu, > Jiaxin > Sent: Thursday, April 18, 2024 2:56 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Zeng, St

Re: [edk2-devel] [PATCH v3 05/13] UefiCpuPkg/SmmRelocationLib: Remove unnecessary global variable

2024-04-18 Thread Wu, Jiaxin
Sure, I will you split the removal of CpuIndex parameter in a new patch. Thanks, Jiaxin From: Ni, Ray Sent: Thursday, April 18, 2024 3:48 PM To: Wu, Jiaxin ; devel@edk2.groups.io Cc: Zeng, Star ; Gerd Hoffmann ; Kumar, Rahul R Subject: Re: [PATCH v3 05/13] UefiCpuPkg/SmmRelocationLib: Remove

[edk2-devel] [PATCH v3 13/13] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic

2024-04-17 Thread Wu, Jiaxin
This patch is to remove legacy SmBase relocation in PiSmmCpuDxeSmm Driver. The responsibility for SmBase relocation has been transferred to the SmmRelocationInit interface, which now handles the following tasks: 1. Relocates the SmBase for each processor. 2. Generates the gSmmBaseHobGuid HOB. As a

[edk2-devel] [PATCH v3 11/13] OvmfPkg/PlatformPei: Relocate SmBases in PEI phase

2024-04-17 Thread Wu, Jiaxin
This patch is to consume SmmRelocationInit for SmBase Relocation. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Ray Ni Signed-off-by: Jiaxin Wu --- OvmfPkg/PlatformPei/Platform.c | 3 + OvmfPkg/PlatformPei/Platform.h | 5 ++ OvmfPkg/Platfor

[edk2-devel] [PATCH v3 12/13] UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib

2024-04-17 Thread Wu, Jiaxin
This patch just includes SmmRelocationLib in UefiPayloadPkg. Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ray Ni Signed-off-by: Jiaxin Wu Reviewed-by: Gua Guo Reviewed-by: Guo Dong --- UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Uef

[edk2-devel] [PATCH v3 10/13] OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is done or not

2024-04-17 Thread Wu, Jiaxin
Based on gSmmBaseHobGuid: If gSmmBaseHobGuid found, means SmBase info has been relocated and recorded in the SmBase array. So, this patch check smbase relocation is done or not in SmmCpuFeaturesInitializeProcessor(). With SmmRelocationLib, gSmmBaseHobGuid will be always created. Here this patch ju

[edk2-devel] [PATCH v3 09/13] OvmfPkg: Refine SmmAccess implementation

2024-04-17 Thread Wu, Jiaxin
This patch refines the SmmAccess implementation: 1. SmramMap will be retrieved from the gEfiSmmSmramMemoryGuid instead of original from the TSEG Memory Base register. 2. Remove the gEfiAcpiVariableGuid creation, thus the DESCRIPTOR_INDEX definition can be also cleaned. 3. The gEfiAcpiVariableGuid H

[edk2-devel] [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-17 Thread Wu, Jiaxin
Background: In the PiSmmCpuDxeSmm driver, SMRAM allocation for SMI handlers and processor Save State areas was traditionally performed using the Smst->AllocatePages() function during the DXE phase. The introduction of SmmRelocationLib changes this process by moving the allocation to the PEI phase,

[edk2-devel] [PATCH v3 07/13] OvmfPkg/SmmRelocationLib: Add library instance for OVMF

2024-04-17 Thread Wu, Jiaxin
There are below 2 differences between AMD & OVMF according existing implementation: 1.The mode of the CPU check is different between the AMD & OVMF. OVMF: CpuSaveState->x86.SMMRevId & 0X AMD: LMAValue = (UINT32)AsmReadMsr64 (EFER_ADDRESS) & LMA 2.Existing SmBase configuration is different be

[edk2-devel] [PATCH v3 06/13] UefiCpuPkg/SmmRelocationLib: Add library instance for AMD

2024-04-17 Thread Wu, Jiaxin
Due to the definition difference of SMRAM Save State, SmmBase config in SMRAM Save State for AMD is also different. This patch provides the AmdSmmRelocationLib library instance to handle the SMRAM Save State difference. Cc: Abdul Lateef Attar Cc: Abner Chang Cc: Ray Ni Cc: Zeng Star Cc: Gerd

[edk2-devel] [PATCH v3 05/13] UefiCpuPkg/SmmRelocationLib: Remove unnecessary global variable

2024-04-17 Thread Wu, Jiaxin
This patch aims on mProcessorInfo global variable, which can be defined as local variable in SmmRelocateBases(). With this patch, no need to allocate the memory for all CPUs to store the Processor Info. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- .

[edk2-devel] [PATCH v3 04/13] UefiCpuPkg/SmmRelocationLib: Avoid unnecessary memory allocation

2024-04-17 Thread Wu, Jiaxin
Since SMM relocation is performed serially for each CPU, there is no need to allocate buffers for all CPUs to store the SmBase address in mSmBase and the Rebased flag in mRebased. A defined global variable is sufficient. This patch focuses on the mSmBase and mRebased global variables to prevent un

[edk2-devel] [PATCH v3 03/13] UefiCpuPkg/SmmRelocationLib: Rename global variables

2024-04-17 Thread Wu, Jiaxin
This patch aims to rename global variables for clearer association with Smm Init, ensuring their names are distinct from those used in the PiSmmCpuDxeSmm Driver. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- .../Library/SmmRelocationLib/Ia32/SmmInit.

[edk2-devel] [PATCH v3 02/13] UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance

2024-04-17 Thread Wu, Jiaxin
This patch just separates the smbase relocation logic from PiSmmCpuDxeSmm driver, and moves to the SmmRelocationInit interface. It maintains the original implementation of most functions and leaves the definitions of global variables intact. Further refinements to the code are planned for subsequen

[edk2-devel] [PATCH v3 01/13] UefiCpuPkg: Add SmmRelocationLib class

2024-04-17 Thread Wu, Jiaxin
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 s

[edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

2024-04-17 Thread Wu, Jiaxin
Lendacky Signed-off-by: Jiaxin Wu Jiaxin Wu (13): UefiCpuPkg: Add SmmRelocationLib class UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance UefiCpuPkg/SmmRelocationLib: Rename global variables UefiCpuPkg/SmmRelocationLib: Avoid unnecessary memory allocation UefiCpuPkg

Re: [edk2-devel] [PATCH v1 03/13] UefiCpuPkg/SmmRelocationLib: Add library instance for OVMF

2024-04-17 Thread Wu, Jiaxin
I'm using the OVMF library, haven't try the AMD library:). > -Original Message- > From: Gerd Hoffmann > Sent: Wednesday, April 17, 2024 3:04 PM > To: Wu, Jiaxin > Cc: thomas.lenda...@amd.com; devel@edk2.groups.io; Ni, Ray > ; Zeng, Star ; Ard Biesheuvel >

Re: [edk2-devel] [PATCH v1 03/13] UefiCpuPkg/SmmRelocationLib: Add library instance for OVMF

2024-04-16 Thread Wu, Jiaxin
Hi Gerd, > > I don't the background why AMD and OVMF has such difference. Maybe > OVFM doesn't not support the MSR "EFER_ADDRESS". > > It surely does, it's a rather essential MSR for x64 CPUs. > > > > The SmBase configuration for OVMF looks suspicious to me. I'm > wondering > > > whenever the O

Re: [edk2-devel] [PATCH v1 03/13] UefiCpuPkg/SmmRelocationLib: Add library instance for OVMF

2024-04-16 Thread Wu, Jiaxin
> > On Mon, Apr 15, 2024 at 01:04:58PM +0000, Wu, Jiaxin wrote: > > Hi Gred, > > > > Because: > > 1) The mode of the CPU check is different between the AMD & OVMF. > > OVMF: > > CpuSaveState->x86.SMMRevId & 0X > > > > AMD: &g

Re: [edk2-devel] [PATCH v2 00/10] Add SmmRelocationLib

2024-04-16 Thread Wu, Jiaxin
RUE build. Thanks, Jiaxin > -Original Message- > From: Gerd Hoffmann > Sent: Tuesday, April 16, 2024 3:31 PM > To: devel@edk2.groups.io; Wu, Jiaxin > Cc: Ni, Ray ; Zeng, Star ; Kumar, > Rahul R ; Dong, Guo ; > Rhodes, Sean ; Lu, James ; > Guo, Gua ; Ard Biesheuvel

[edk2-devel] [PATCH v2 09/10] UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib

2024-04-15 Thread Wu, Jiaxin
This patch just includes SmmRelocationLib in UefiPayloadPkg. Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ray Ni Signed-off-by: Jiaxin Wu Reviewed-by: Gua Guo --- UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UefiPayloadPkg/UefiPayload

[edk2-devel] [PATCH v2 07/10] OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is done or not

2024-04-15 Thread Wu, Jiaxin
Based on gSmmBaseHobGuid: If gSmmBaseHobGuid found, means SmBase info has been relocated and recorded in the SmBase array. So, this patch check smbase relocation is done or not in SmmCpuFeaturesInitializeProcessor(). With SmmRelocationLib, gSmmBaseHobGuid will be always created. Here this patch ju

[edk2-devel] [PATCH v2 10/10] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic

2024-04-15 Thread Wu, Jiaxin
This patch is to remove legacy SmBase relocation in PiSmmCpuDxeSmm Driver. The responsibility for SmBase relocation has been transferred to the SmmRelocationInit interface, which now handles the following tasks: 1. Relocates the SmBase for each processor. 2. Generates the gSmmBaseHobGuid HOB. As a

[edk2-devel] [PATCH v2 08/10] OvmfPkg/PlatformPei: Relocate SmBases in PEI phase

2024-04-15 Thread Wu, Jiaxin
This patch is to consume SmmRelocationInit for SmBase Relocation. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Ray Ni Signed-off-by: Jiaxin Wu --- OvmfPkg/PlatformPei/Platform.c | 3 ++ OvmfPkg/PlatformPei/Platform.h | 5 +++ OvmfPkg/PlatformPei/PlatformPei.inf | 5 ++

[edk2-devel] [PATCH v2 06/10] OvmfPkg: Refine SmmAccess implementation

2024-04-15 Thread Wu, Jiaxin
This patch refines the SmmAccess implementation: 1. SmramMap will be retrieved from the gEfiSmmSmramMemoryGuid instead of original from the TSEG Memory Base register. 2. Remove the gEfiAcpiVariableGuid creation, thus the DESCRIPTOR_INDEX definition can be also cleaned. 3. The gEfiAcpiVariableGuid H

[edk2-devel] [PATCH v2 02/10] UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance

2024-04-15 Thread Wu, Jiaxin
This patch separates the smbase relocation logic from PiSmmCpuDxeSmm driver, and moves to the SmmRelocationInit interface. Platform shall consume the interface for the smbase relocation if need SMM support. Note: Before using SmmRelocationLib, the PiSmmCpuDxeSmm driver allocates the SMRAM to be u

[edk2-devel] [PATCH v2 05/10] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-15 Thread Wu, Jiaxin
Background: In the PiSmmCpuDxeSmm driver, SMRAM allocation for SMI handlers and processor Save State areas was traditionally performed using the Smst->AllocatePages() function during the DXE phase. The introduction of SmmRelocationLib changes this process by moving the allocation to the PEI phase,

[edk2-devel] [PATCH v2 04/10] OvmfPkg/SmmRelocationLib: Add library instance for OVMF

2024-04-15 Thread Wu, Jiaxin
There are below 2 differences between AMD & OVMF according existing implementation: 1.The mode of the CPU check is different between the AMD & OVMF. OVMF: CpuSaveState->x86.SMMRevId & 0X AMD: LMAValue = (UINT32)AsmReadMsr64 (EFER_ADDRESS) & LMA 2.Existing SmBase configuration is different be

[edk2-devel] [PATCH v2 01/10] UefiCpuPkg: Add SmmRelocationLib class

2024-04-15 Thread Wu, Jiaxin
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 s

[edk2-devel] [PATCH v2 03/10] UefiCpuPkg/SmmRelocationLib: Add library instance for AMD

2024-04-15 Thread Wu, Jiaxin
Due to the definition difference of SMRAM Save State, SmmBase config in SMRAM Save State for AMD is also different. This patch provides the AmdSmmRelocationLib library instance to handle the SMRAM Save State difference. Cc: Abdul Lateef Attar Cc: Abner Chang Cc: Tom Lendacky Cc: Ray Ni Cc: Ze

[edk2-devel] [PATCH v2 00/10] Add SmmRelocationLib

2024-04-15 Thread Wu, Jiaxin
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 (10

Re: [edk2-devel] [PATCH v1 03/13] UefiCpuPkg/SmmRelocationLib: Add library instance for OVMF

2024-04-15 Thread Wu, Jiaxin
ies patch won't change the existing implementation code logic, so, we need override one version for OVMF. +AMD feature owner Thanks, Jiaxin > -Original Message- > From: Gerd Hoffmann > Sent: Thursday, April 11, 2024 3:11 PM > To: Wu, Jiaxin > Cc: devel@edk2.groups.io; Ni, Ray

Re: [edk2-devel] [PATCH v1 00/13] Add SmmRelocationLib

2024-04-10 Thread Wu, Jiaxin
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 ; 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

2024-04-10 Thread Wu, Jiaxin
QSP platform. Thanks, Jiaxin > -Original Message- > From: Yao, Jiewen > Sent: Wednesday, April 10, 2024 10:02 PM > To: Wu, Jiaxin ; devel@edk2.groups.io > Cc: Ni, Ray ; Zeng, Star ; Gerd > Hoffmann ; Kumar, Rahul R ; > Dong, Guo ; Rhodes, Sean ; > Lu, James ; Guo

[edk2-devel] [PATCH v1 13/13] UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic

2024-04-10 Thread Wu, Jiaxin
This patch is to remove legacy SmBase relocation in PiSmmCpuDxeSmm Driver, and the SmBase relocation behavior will be in the SmmRelocationInit interface: 1. Relocate smbases for each processor. 2. Create the gSmmBaseHobGuid HOB. Then, PiSmmCpuDxeSmm driver can be simplified to: 1. Consume the gSmm

[edk2-devel] [PATCH v1 12/13] OvmfPkg/PlatformPei: Relocate SmBases in PEI phase

2024-04-10 Thread Wu, Jiaxin
This patch is to consume SmmRelocationInit for SmBase Relocation. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Ray Ni Signed-off-by: Jiaxin Wu --- OvmfPkg/PlatformPei/Platform.c | 1 + OvmfPkg/PlatformPei/Platform.h | 5 +++ OvmfPkg/PlatformPei/PlatformPei.inf | 5 ++-

[edk2-devel] [PATCH v1 11/13] OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is done or not

2024-04-10 Thread Wu, Jiaxin
Based on gSmmBaseHobGuid: If gSmmBaseHobGuid found, means SmBase info has been relocated and recorded in the SmBase array. So, this patch check smbase relocation is done or not in SmmCpuFeaturesInitializeProcessor(). With SmmRelocationLib, gSmmBaseHobGuid will be always created. Here this patch ju

[edk2-devel] [PATCH v1 09/13] OvmfPkg/SmmAccess: Consume gEfiSmmSmramMemoryGuid

2024-04-10 Thread Wu, Jiaxin
This patch refines the SmmAccess implementation: 1. SmramMap will be retrieved from the gEfiSmmSmramMemoryGuid instead of original from the TSEG Memory Base register. 2. Remove the gEfiAcpiVariableGuid creation, thus the DESCRIPTOR_INDEX definition can be also cleaned. The gEfiAcpiVariableGuid HOB

[edk2-devel] [PATCH v1 10/13] OvmfPkg/PlatformInitLib: Create gEfiAcpiVariableGuid

2024-04-10 Thread Wu, Jiaxin
This patch is for OVMF to create the gEfiAcpiVariableGuid since it has been removed from the SmmAccess driver. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Ray Ni Signed-off-by: Jiaxin Wu --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 9 + OvmfPkg/Library/Platfo

[edk2-devel] [PATCH v1 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid

2024-04-10 Thread Wu, Jiaxin
SmmRelocationLib instance will reserve the memory from gEfiSmmSmramMemoryGuid for the smbase relocation. So, system must produce the gEfiSmmSmramMemoryGuid. This patch is for the OVMF to produce the gEfiSmmSmramMemoryGuid HOB. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Ray Ni Si

[edk2-devel] [PATCH v1 07/13] OvmfPkg: Include SmmRelocationLib in OvmfPkg

2024-04-10 Thread Wu, Jiaxin
This patch just includes SmmRelocationLib in OvmfPkg. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Ray Ni Signed-off-by: Jiaxin Wu --- OvmfPkg/AmdSev/AmdSevX64.dsc | 1 + OvmfPkg/CloudHv/CloudHvX64.dsc | 1 + OvmfPkg/Microvm/MicrovmX64.dsc | 1 + OvmfPkg/OvmfPkgIa32.dsc|

[edk2-devel] [PATCH v1 06/13] UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib

2024-04-10 Thread Wu, Jiaxin
This patch just includes SmmRelocationLib in UefiPayloadPkg. Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Ray Ni Signed-off-by: Jiaxin Wu --- UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayload

[edk2-devel] [PATCH v1 05/13] UefiCpuPkg/UefiCpuPkg.dsc: Include SmmRelocationLib in UefiCpuPkg

2024-04-10 Thread Wu, Jiaxin
This patch just includes SmmRelocationLib in UefiCpuPkg. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu --- UefiCpuPkg/UefiCpuPkg.dsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc index 10b335

[edk2-devel] [PATCH v1 02/13] UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance

2024-04-10 Thread Wu, Jiaxin
This patch separates the smbase relocation logic from PiSmmCpuDxeSmm driver, and moves to the SmmRelocationInit interface. Platform shall consume the interface for the smbase relocation if need SMM support. Cc: Ray Ni Cc: Zeng Star Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu -

[edk2-devel] [PATCH v1 04/13] UefiCpuPkg/SmmRelocationLib: Add library instance for AMD

2024-04-10 Thread Wu, Jiaxin
Due to the definition difference of SMRAM Save State, SmmBase config in SMRAM Save State for AMD is also different. This patch provides the AmdSmmRelocationLib library instance to handle the SMRAM Save State difference. Cc: Abdul Lateef Attar Cc: Abner Chang Cc: Ray Ni Cc: Zeng Star Cc: Gerd

[edk2-devel] [PATCH v1 03/13] UefiCpuPkg/SmmRelocationLib: Add library instance for OVMF

2024-04-10 Thread Wu, Jiaxin
Due to the definition difference of SMRAM Save State, SmmBase config in SMRAM Save State for OVMF is also different. This patch provides the OvmfSmmRelocationLib library instance to handle the SMRAM Save State difference. Cc: Ray Ni Cc: Zeng Star Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hof

[edk2-devel] [PATCH v1 01/13] UefiCpuPkg: Add SmmRelocationLib class

2024-04-10 Thread Wu, Jiaxin
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 s

[edk2-devel] [PATCH v1 00/13] Add SmmRelocationLib

2024-04-10 Thread Wu, Jiaxin
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

Re: [edk2-devel] OVMF SMM Support

2024-04-08 Thread Wu, Jiaxin
Thank you Michael & Gerd, it does the problem of https://gitlab.com/qemu-project/qemu/-/issues/2064. The issue is gone with latest QEMU version. Thanks, Jiaxin > -Original Message- > From: Michael Kubacki > Sent: Tuesday, April 9, 2024 8:55 AM > To: devel@edk2.group

[edk2-devel] OVMF SMM Support

2024-04-08 Thread Wu, Jiaxin
Hi Gerd, With below OVMF build and QEMU command, OVMF hangs after SendSmiIpi (mBspApicId) during SmmRelocateBases(), is there any issues with latest code to support SMM on OVMF or my local command/configuration issue? Build (latest edk2 code): build -p OvmfPkg\OvmfPkgIa32X64.dsc -a IA32 -a X64

[edk2-devel] [PATCH v1 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Make RunningApCount on exclusive cacheline

2024-03-06 Thread Wu, Jiaxin
For non blocking mode during SmmMpBroadcastProcedure, multiple APs might contended access the RunningApCount in the PROCEDURE_TOKEN: Step1: RunningApCount is initialized to the mMaxNumberOfCpus (See GetFreeToken). Step2: Decrease RunningApCount if the AP is not present (See InterlockedDecrement in

  1   2   3   4   5   >