diff options
author | Laszlo Ersek <lersek@redhat.com> | 2013-11-29 04:44:22 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-11-29 04:44:22 +0000 |
commit | eac8082e1dc528b748ece73ac4880bee7e4a15f3 (patch) | |
tree | 40d3402a0c09cec12d2c0c53d94f8ba682f6c39d /UefiCpuPkg/Library/CpuExceptionHandlerLib | |
parent | 8b7d84ca533ef7f3a794884dc738221bf1d1799e (diff) | |
download | edk2-platforms-eac8082e1dc528b748ece73ac4880bee7e4a15f3.tar.xz |
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
Diffstat (limited to 'UefiCpuPkg/Library/CpuExceptionHandlerLib')
-rw-r--r-- | UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S index 7d5672f892..6e80d848fe 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S @@ -273,7 +273,10 @@ ASM_PFX(HookAfterStubHeaderEnd): andl $0x0fffffff0, %esp
pushq %rcx
movq 8(%rax), %rcx
- bt %ecx, ASM_PFX(mErrorCodeFlag)
+ pushq %rax
+ movabsl ASM_PFX(mErrorCodeFlag), %eax
+ bt %ecx, %eax
+ popq %rax
jc NoErrorData
pushq (%rsp) # push additional rcx to make stack alignment
NoErrorData:
@@ -301,8 +304,8 @@ ASM_PFX(CommonInterruptEntry): cmp $32, %ecx # Intel reserved vector for exceptions?
jae NoErrorCode
pushq %rax
- leaq ASM_PFX(mErrorCodeFlag)(%rip), %rax
- bt %ecx, (%rax)
+ movabsl ASM_PFX(mErrorCodeFlag), %eax
+ bt %ecx, %eax
popq %rax
jc CommonInterruptEntry_al_0000
@@ -549,7 +552,10 @@ ErrorCode: jmp *-24(%rsp)
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
pushq %rax
movq %rsp, %rax # save old RSP to rax
|