Exception handler function does not take 16byte alignment into account #5452
gongtianle123
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can someone please come and help with this bug.
The test scenario is that the shell triggers a DF exception using the INT instruction and finds that instead of going to the DF exception handler function normally, it goes to the GP exception handler function.
I checked the assembly code and found the following path file
Edk2\UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\Xcode5ExceptionHandlerAsm.nasm
There is a piece of Code like this
;; FX_SAVE_STATE_X64 FxSaveState.
sub rsp, 512
mov rdi, rsp
db 0xf, 0xae, 0x7 ;fxsave [rdi]//exception happen this line
Forcing 16B alignment is not considered here. In some scenarios, less or more push of a parameter results in an alignment relationship that cannot be satisfied, which can lead to GP exceptions being thrown?
Translated with DeepL.com (free version)
Beta Was this translation helpful? Give feedback.
All reactions