UefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler
Once the #PF handler has set the page to be 'present', there should be a way to reset it to 'not-present'. 'TF' bit in EFLAGS can be used for this purpose. 'TF' bit will be set in interrupted function context so that it can be triggered once the cpu control returns back to the instruction causing #PF and re-execute it. This is an necessary step to implement non-stop mode for Heap Guard and NULL Pointer Detection feature. Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
@@ -355,10 +355,8 @@ o16 mov [ecx + IA32_TSS._SS], ax
|
||||
movzx ebx, word [ecx + IA32_TSS._CS]
|
||||
mov [eax - 0x8], ebx ; create CS in old stack
|
||||
mov ebx, dword [ecx + IA32_TSS.EFLAGS]
|
||||
bts ebx, 8
|
||||
bts ebx, 8 ; Set TF
|
||||
mov [eax - 0x4], ebx ; create eflags in old stack
|
||||
mov dword [ecx + IA32_TSS.EFLAGS], ebx ; update eflags in old TSS
|
||||
mov eax, dword [ecx + IA32_TSS._ESP] ; Get old stack pointer
|
||||
sub eax, 0xc ; minus 12 byte
|
||||
mov dword [ecx + IA32_TSS._ESP], eax ; Set new stack pointer
|
||||
|
||||
|
Reference in New Issue
Block a user