mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-01 10:54:27 +02:00
UefiCpuPkg: Using the "movabsq" instruction to read global variable mDoFarReturnFlag and mErrorCodeFlag to avoid page fault with big RAM sizes (> 2GB).
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14920 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
8b7d84ca53
commit
eac8082e1d
@ -273,7 +273,10 @@ ASM_PFX(HookAfterStubHeaderEnd):
|
|||||||
andl $0x0fffffff0, %esp
|
andl $0x0fffffff0, %esp
|
||||||
pushq %rcx
|
pushq %rcx
|
||||||
movq 8(%rax), %rcx
|
movq 8(%rax), %rcx
|
||||||
bt %ecx, ASM_PFX(mErrorCodeFlag)
|
pushq %rax
|
||||||
|
movabsl ASM_PFX(mErrorCodeFlag), %eax
|
||||||
|
bt %ecx, %eax
|
||||||
|
popq %rax
|
||||||
jc NoErrorData
|
jc NoErrorData
|
||||||
pushq (%rsp) # push additional rcx to make stack alignment
|
pushq (%rsp) # push additional rcx to make stack alignment
|
||||||
NoErrorData:
|
NoErrorData:
|
||||||
@ -301,8 +304,8 @@ ASM_PFX(CommonInterruptEntry):
|
|||||||
cmp $32, %ecx # Intel reserved vector for exceptions?
|
cmp $32, %ecx # Intel reserved vector for exceptions?
|
||||||
jae NoErrorCode
|
jae NoErrorCode
|
||||||
pushq %rax
|
pushq %rax
|
||||||
leaq ASM_PFX(mErrorCodeFlag)(%rip), %rax
|
movabsl ASM_PFX(mErrorCodeFlag), %eax
|
||||||
bt %ecx, (%rax)
|
bt %ecx, %eax
|
||||||
popq %rax
|
popq %rax
|
||||||
jc CommonInterruptEntry_al_0000
|
jc CommonInterruptEntry_al_0000
|
||||||
|
|
||||||
@ -549,7 +552,10 @@ ErrorCode:
|
|||||||
jmp *-24(%rsp)
|
jmp *-24(%rsp)
|
||||||
|
|
||||||
DoReturn:
|
DoReturn:
|
||||||
cmpq $0, ASM_PFX(mDoFarReturnFlag) # Check if need to do far return instead of IRET
|
pushq %rax
|
||||||
|
movabsq ASM_PFX(mDoFarReturnFlag), %rax
|
||||||
|
cmpq $0, %rax # Check if need to do far return instead of IRET
|
||||||
|
popq %rax
|
||||||
jz DoIret
|
jz DoIret
|
||||||
pushq %rax
|
pushq %rax
|
||||||
movq %rsp, %rax # save old RSP to rax
|
movq %rsp, %rax # save old RSP to rax
|
||||||
|
Loading…
x
Reference in New Issue
Block a user