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
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
>
> 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
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
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
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.
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.
>
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
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
[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 ;
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:
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
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
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
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
-
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
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..
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
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
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
&
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
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
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
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
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
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->
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
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
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
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
---
.
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
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.
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
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
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
>
> 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
>
> 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
>
> > 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
> >
> > 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
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
> ;
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:
1000
7F00 1A--> ---> for the S3 Resume in
gEfiAcpiVariableGuid
PlatformQemuInitializeRam: 7F001000 FFF000
7F001000A
Thanks,
Jiaxin
> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday,
>
> > +SmramHobDescriptorBlock =
> (EFI_SMRAM_HOB_DESCRIPTOR_BLOCK *)(Hob.Raw);
>
> > +SmramHobDescriptorBlock->Descriptor[0].PhysicalStart =
> PlatformInfoHob->LowMemory - TsegSize;
> > +SmramHobDescriptorBlock->Descriptor[0].CpuStart =
> PlatformInfo
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,
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
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
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
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
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
>
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
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
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
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
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
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
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
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,
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
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
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
---
.
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
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.
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
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
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
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
>
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
>
> 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
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
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
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
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
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 ++
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
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
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,
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
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
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
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
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
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
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
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
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 ++-
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
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
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
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
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|
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
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
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
-
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
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
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
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
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
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
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 - 100 of 416 matches
Mail list logo