Re: [edk2-devel] [PATCH] UefiCpuPkg/MpInitLib: Simplify logic in SwitchBsp

2022-08-25 Thread Ni, Ray
> > ;Store EFLAGS, GDTR and IDTR register to stack > pushfd Can you update the comments? > -moveax, cr4 > -push eax ; push cr4 firstly > -moveax, cr0 > -push eax > - > -sgdt [esi + CPU_EXCHANGE_ROLE_INFO.Gdtr] > -sidt

[edk2-devel] [PATCH] UefiCpuPkg/MpInitLib: Simplify logic in SwitchBsp

2022-08-24 Thread Zhiguang Liu
When switch bsp, old bsp and new bsp put CR0/CR4 into stack, and put IDT and GDT register into a structure. After they exchange their stack, they restore these registers. This logic is now implemented by assembly code. This patch aims to reuse (Save/Restore)VolatileRegisters function to replace suc