Changeset 47690 in vbox
- Timestamp:
- Aug 13, 2013 12:53:48 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlersA.asm
r42771 r47690 297 297 mov ebx, IMP(g_trpmGuestCtxCore) ; Assume GC as the most common. 298 298 test byte [%$STK_CS], 3h ; check RPL of the cs selector 299 ;; @todo check this for conforming segments. 300 jnz .save_state 299 jnz .save_guest_state 301 300 test dword [%$STK_EFLAGS], X86_EFL_VM; If in V86, then guest. 302 jnz .save_ state301 jnz .save_guest_state 303 302 mov ebx, IMP(g_trpmHyperCtxCore) ; It's raw-mode context, actually. 304 303 … … 306 305 ; Save the state. 307 306 ; 308 ; ASSUMPTION: If trap in hypervisor, we assume that we can read two dword 309 ; under the bottom of the stack. This is atm safe. 310 ; 311 .save_state: 307 .save_hyper_state: 308 mov [ebx + CPUMCTXCORE.ecx], ecx 309 lea eax, [%$STK_ESP] 310 mov [ebx + CPUMCTXCORE.esp], eax 311 mov cx, ss 312 mov [ebx + CPUMCTXCORE.ss.Sel], cx 313 jmp .save_state_common 314 315 .save_guest_state: 316 mov [ebx + CPUMCTXCORE.ecx], ecx 317 mov eax, [%$STK_ESP] 318 mov [ebx + CPUMCTXCORE.esp], eax 319 mov cx, [%$STK_SS] 320 mov [ebx + CPUMCTXCORE.ss.Sel], cx 321 322 .save_state_common: 312 323 mov eax, [%$STK_SAVED_EAX] 313 324 mov [ebx + CPUMCTXCORE.eax], eax 314 mov [ebx + CPUMCTXCORE.ecx], ecx315 325 mov [ebx + CPUMCTXCORE.edx], edx 316 326 mov eax, [%$STK_SAVED_EBX] … … 319 329 mov [ebx + CPUMCTXCORE.edi], edi 320 330 mov [ebx + CPUMCTXCORE.ebp], ebp 321 322 mov eax, [%$STK_ESP]323 mov [ebx + CPUMCTXCORE.esp], eax324 mov cx, [%$STK_SS]325 mov [ebx + CPUMCTXCORE.ss.Sel], cx326 331 327 332 mov cx, [%$STK_CS] … … 792 797 793 798 mov ebx, IMP(g_trpmGuestCtxCore) ; Assume GC as the most common. 794 test byte [%$STK_CS], 3h ; check RPL of the cs selector 795 ;; @todo check this for conforming segments. 796 jnz .save_state 797 test dword [%$STK_EFLAGS], X86_EFL_VM ; If in V86, then guest. 798 jnz .save_state 799 test byte [%$STK_CS], 3h ; check RPL of the cs selector 800 jnz .save_guest_state 801 test dword [%$STK_EFLAGS], X86_EFL_VM ; If in V86, then guest. 802 jnz .save_guest_state 799 803 mov ebx, IMP(g_trpmHyperCtxCore) ; It's raw-mode context, actually. 800 804 … … 802 806 ; Save the state. 803 807 ; 804 ; ASSUMPTION: If trap in hypervisor, we assume that we can read two dword 805 ; under the bottom of the stack. This is atm safe. 806 ; 807 .save_state: 808 .save_hyper_state: 809 mov [ebx + CPUMCTXCORE.ecx], ecx 810 lea eax, [%$STK_ESP] 811 mov [ebx + CPUMCTXCORE.esp], eax 812 mov cx, ss 813 mov [ebx + CPUMCTXCORE.ss.Sel], cx 814 jmp .save_state_common 815 816 .save_guest_state: 817 mov [ebx + CPUMCTXCORE.ecx], ecx 818 mov eax, [%$STK_ESP] 819 mov [ebx + CPUMCTXCORE.esp], eax 820 mov cx, [%$STK_SS] 821 mov [ebx + CPUMCTXCORE.ss.Sel], cx 822 823 .save_state_common: 808 824 mov eax, [%$STK_SAVED_EAX] 809 825 mov [ebx + CPUMCTXCORE.eax], eax 810 mov [ebx + CPUMCTXCORE.ecx], ecx811 826 mov [ebx + CPUMCTXCORE.edx], edx 812 827 mov eax, [%$STK_SAVED_EBX] … … 815 830 mov [ebx + CPUMCTXCORE.edi], edi 816 831 mov [ebx + CPUMCTXCORE.ebp], ebp 817 818 mov eax, [%$STK_ESP]819 mov [ebx + CPUMCTXCORE.esp], eax820 mov cx, [%$STK_SS]821 mov [ebx + CPUMCTXCORE.ss.Sel], cx822 832 823 833 mov cx, [%$STK_CS]
Note:
See TracChangeset
for help on using the changeset viewer.