mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 00:54:06 +02:00
UefiCpuPkg/CpuExceptionHandler: Revert CpuExceptionHandler binary patching
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2340 Now that an XCODE5 specific CpuExceptionHandlerLib library is in place, revert the changes made to the ExceptionHandlerAsm.nasm in commit 2db0ccc2d7fe ("UefiCpuPkg: Update CpuExceptionHandlerLib pass XCODE5 tool chain") so that binary patching of flash code is not performed. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Acked-by: Bret Barkelew <bret.barkelew@microsoft.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Message-Id: <810f67d8604c054c09d17a22f0bcfaeb41ee8e3b.1588856809.git.thomas.lendacky@amd.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
parent
b304d2807b
commit
9378310dd8
@ -34,7 +34,7 @@ AsmIdtVectorBegin:
|
|||||||
db 0x6a ; push #VectorNum
|
db 0x6a ; push #VectorNum
|
||||||
db ($ - AsmIdtVectorBegin) / ((AsmIdtVectorEnd - AsmIdtVectorBegin) / 32) ; VectorNum
|
db ($ - AsmIdtVectorBegin) / ((AsmIdtVectorEnd - AsmIdtVectorBegin) / 32) ; VectorNum
|
||||||
push rax
|
push rax
|
||||||
mov rax, strict qword 0 ; mov rax, ASM_PFX(CommonInterruptEntry)
|
mov rax, ASM_PFX(CommonInterruptEntry)
|
||||||
jmp rax
|
jmp rax
|
||||||
%endrep
|
%endrep
|
||||||
AsmIdtVectorEnd:
|
AsmIdtVectorEnd:
|
||||||
@ -44,8 +44,7 @@ HookAfterStubHeaderBegin:
|
|||||||
@VectorNum:
|
@VectorNum:
|
||||||
db 0 ; 0 will be fixed
|
db 0 ; 0 will be fixed
|
||||||
push rax
|
push rax
|
||||||
mov rax, strict qword 0 ; mov rax, HookAfterStubHeaderEnd
|
mov rax, HookAfterStubHeaderEnd
|
||||||
JmpAbsoluteAddress:
|
|
||||||
jmp rax
|
jmp rax
|
||||||
HookAfterStubHeaderEnd:
|
HookAfterStubHeaderEnd:
|
||||||
mov rax, rsp
|
mov rax, rsp
|
||||||
@ -257,7 +256,8 @@ HasErrorCode:
|
|||||||
; and make sure RSP is 16-byte aligned
|
; and make sure RSP is 16-byte aligned
|
||||||
;
|
;
|
||||||
sub rsp, 4 * 8 + 8
|
sub rsp, 4 * 8 + 8
|
||||||
call ASM_PFX(CommonExceptionHandler)
|
mov rax, ASM_PFX(CommonExceptionHandler)
|
||||||
|
call rax
|
||||||
add rsp, 4 * 8 + 8
|
add rsp, 4 * 8 + 8
|
||||||
|
|
||||||
cli
|
cli
|
||||||
@ -365,24 +365,11 @@ DoIret:
|
|||||||
; comments here for definition of address map
|
; comments here for definition of address map
|
||||||
global ASM_PFX(AsmGetTemplateAddressMap)
|
global ASM_PFX(AsmGetTemplateAddressMap)
|
||||||
ASM_PFX(AsmGetTemplateAddressMap):
|
ASM_PFX(AsmGetTemplateAddressMap):
|
||||||
lea rax, [AsmIdtVectorBegin]
|
mov rax, AsmIdtVectorBegin
|
||||||
mov qword [rcx], rax
|
mov qword [rcx], rax
|
||||||
mov qword [rcx + 0x8], (AsmIdtVectorEnd - AsmIdtVectorBegin) / 32
|
mov qword [rcx + 0x8], (AsmIdtVectorEnd - AsmIdtVectorBegin) / 32
|
||||||
lea rax, [HookAfterStubHeaderBegin]
|
mov rax, HookAfterStubHeaderBegin
|
||||||
mov qword [rcx + 0x10], rax
|
mov qword [rcx + 0x10], rax
|
||||||
|
|
||||||
; Fix up CommonInterruptEntry address
|
|
||||||
lea rax, [ASM_PFX(CommonInterruptEntry)]
|
|
||||||
lea rcx, [AsmIdtVectorBegin]
|
|
||||||
%rep 32
|
|
||||||
mov qword [rcx + (JmpAbsoluteAddress - 8 - HookAfterStubHeaderBegin)], rax
|
|
||||||
add rcx, (AsmIdtVectorEnd - AsmIdtVectorBegin) / 32
|
|
||||||
%endrep
|
|
||||||
; Fix up HookAfterStubHeaderEnd
|
|
||||||
lea rax, [HookAfterStubHeaderEnd]
|
|
||||||
lea rcx, [JmpAbsoluteAddress]
|
|
||||||
mov qword [rcx - 8], rax
|
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user