public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] UefiCpuPkg PiSmmCpuDxeSmm: Update SmiEntry function run the same position
@ 2018-09-12  5:13 Liming Gao
  2018-09-12  6:31 ` Yao, Jiewen
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Liming Gao @ 2018-09-12  5:13 UTC (permalink / raw)
  To: edk2-devel; +Cc: Laszlo Ersek, Eric Dong, Jiewen Yao

1. Remove jmp _SmiHandler, and run the code at the same position.
2. Fix up the function call address as the absolute address.
Verify OVMF SMM boot to shell with VS2017, GCC5 and XCODE5 tool chain.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 34 +++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
index 315d0f8..d8259de 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
@@ -173,9 +173,6 @@ SmiHandlerIdtrAbsAddr:
     mov     gs, eax
     mov     ax, [rbx + DSC_SS]
     mov     ss, eax
-    mov     rax, strict qword 0         ;   mov     rax, _SmiHandler
-_SmiHandlerAbsAddr:
-    jmp     rax
 
 _SmiHandler:
     mov     rbx, [rsp + 0x8]             ; rcx <- CpuIndex
@@ -189,13 +186,19 @@ _SmiHandler:
     add     rsp, -0x20
 
     mov     rcx, rbx
-    call    ASM_PFX(CpuSmmDebugEntry)
+    mov     rax, strict qword 0         ;   call    ASM_PFX(CpuSmmDebugEntry)
+CpuSmmDebugEntryAbsAddr:
+    call    rax
 
     mov     rcx, rbx
-    call    ASM_PFX(SmiRendezvous)
+    mov     rax, strict qword 0         ;   call    ASM_PFX(SmiRendezvous)
+SmiRendezvousAbsAddr:
+    call    rax
 
     mov     rcx, rbx
-    call    ASM_PFX(CpuSmmDebugExit)
+    mov     rax, strict qword 0         ;   call    ASM_PFX(CpuSmmDebugExit)
+CpuSmmDebugExitAbsAddr:
+    call    rax
 
     add     rsp, 0x20
 
@@ -206,7 +209,8 @@ _SmiHandler:
 
     add     rsp, 0x200
 
-    lea     rax, [ASM_PFX(mXdSupported)]
+    mov     rax, strict qword 0         ;       lea     rax, [ASM_PFX(mXdSupported)]
+mXdSupportedAbsAddr:
     mov     al, [rax]
     cmp     al, 0
     jz      .1
@@ -230,7 +234,19 @@ ASM_PFX(PiSmmCpuSmiEntryFixupAddress):
     lea    rcx, [SmiHandlerIdtrAbsAddr]
     mov    qword [rcx - 8], rax
 
-    lea    rax, [_SmiHandler]
-    lea    rcx, [_SmiHandlerAbsAddr]
+    lea    rax, [ASM_PFX(CpuSmmDebugEntry)]
+    lea    rcx, [CpuSmmDebugEntryAbsAddr]
+    mov    qword [rcx - 8], rax
+
+    lea    rax, [ASM_PFX(SmiRendezvous)]
+    lea    rcx, [SmiRendezvousAbsAddr]
+    mov    qword [rcx - 8], rax
+
+    lea    rax, [ASM_PFX(CpuSmmDebugExit)]
+    lea    rcx, [CpuSmmDebugExitAbsAddr]
+    mov    qword [rcx - 8], rax
+
+    lea    rax, [ASM_PFX(mXdSupported)]
+    lea    rcx, [mXdSupportedAbsAddr]
     mov    qword [rcx - 8], rax
     ret
-- 
2.10.0.windows.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-09-25  0:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-12  5:13 [Patch] UefiCpuPkg PiSmmCpuDxeSmm: Update SmiEntry function run the same position Liming Gao
2018-09-12  6:31 ` Yao, Jiewen
2018-09-12 13:23 ` Laszlo Ersek
2018-09-12 15:42   ` Gao, Liming
2018-09-12 19:49     ` Laszlo Ersek
2018-09-19 15:28       ` Gao, Liming
     [not found] ` <1537491361-3172-1-git-send-email-liming.gao@intel.com>
2018-09-21  5:35   ` [PATCH v2] " Yao, Jiewen
2018-09-21 10:48   ` Laszlo Ersek
2018-09-25  0:26     ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox