Re: [edk2-devel] [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib

2024-05-14 Thread Gerd Hoffmann
On Tue, May 14, 2024 at 05:17:51AM GMT, Ni, Ray wrote: > Gerd, > I agree that the logic might be duplicated in multi places. > > But even CPU supports 1G paging, caller can decide whether to use 1G paging > or 2M paging, or 4K paging. > Using a single API to encapsulate the entire logic may not

Re: [edk2-devel] [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib

2024-05-13 Thread Ni, Ray
Gerd, I agree that the logic might be duplicated in multi places. But even CPU supports 1G paging, caller can decide whether to use 1G paging or 2M paging, or 4K paging. Using a single API to encapsulate the entire logic may not seem flexible. Maybe, a lib API to detect 1G paging capability can

Re: [edk2-devel] [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib

2024-05-13 Thread Gerd Hoffmann
Hi, > + if (sizeof (UINTN) == sizeof (UINT64)) { > +// > +// Check Page5Level Support or not. > +// > +Cr4.UintN = AsmReadCr4 (); > +Page5LevelSupport = (Cr4.Bits.LA57 ? TRUE : FALSE); > + > +// > +// Check Page1G Support or not. > +// > +

Re: [edk2-devel] [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib

2024-05-12 Thread Ni, Ray
Reviewed-by: Ray Ni Thanks, Ray From: Tan, Dun Sent: Friday, May 10, 2024 18:08 To: devel@edk2.groups.io Cc: Ni, Ray ; Laszlo Ersek ; Kumar, Rahul R ; Gerd Hoffmann ; Wu, Jiaxin Subject: [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib In

[edk2-devel] [PATCH 10/18] UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib

2024-05-10 Thread duntan
In this commit, change PeiMpLib to install callback of gEdkiiEndOfS3ResumeGuid to relocate AP to new safe buffer. The gEdkiiEndOfS3ResumeGuid is installed in S3Resume.c before jmping to OS waking vector. Previously, code in CpuS3.c of PiSmmCpuDxe driver will prepare the new safe buffer for AP and