diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S index f371fd350a..49ef7b1968 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S @@ -378,12 +378,7 @@ DoReturn: pushq 0x18(%rax) # save EFLAGS in new location movq (%rax), %rax # restore rax popfq # restore EFLAGS - .byte 0x48 # prefix to composite "retq" with next "retf" -#ifdef __APPLE__ - .byte 0xCB -#else - retf # far return -#endif + lretq # far return DoIret: iretq