Changeset 14993 in vbox for trunk/src/VBox/VMM/VMMSwitcher
- Timestamp:
- Dec 4, 2008 3:39:41 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40364
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMSwitcher/LegacyandAMD64.mac
r14988 r14993 136 136 pop dword [edx + CPUMCPU.Host.eflags] 137 137 138 ;; handle use flags.139 mov esi, [edx + CPUMCPU.fUseFlags] ; esi == use flags.140 and esi, ~CPUM_USED_FPU ; Clear CPUM_USED_* flags. ;;@todo FPU check can be optimized to use cr0 flags!141 mov [edx + CPUMCPU.fUseFlags], esi142 143 138 ; control registers. 144 139 mov eax, cr0 … … 240 235 mov ds, rax 241 236 mov es, rax 242 237 243 238 ; Setup stack; use the lss_esp, ss pair for lss 244 239 DEBUG_CHAR('7') … … 248 243 lss esp, [rdx + CPUM.Hyper.lss_esp] 249 244 250 ; call the hypervisor function with rdx=pCpumCpu 251 mov eax, [rdx + CPUM.Hyper.eip] 245 ; load the hypervisor function address 246 mov r9, [rdx + CPUM.Hyper.eip] 247 252 248 CPUMCPU_FROM_CPUM(edx) 249 250 ; Check if we need to restore the guest FPU state 251 mov esi, [rdx + CPUMCPU.fUseFlags] ; esi == use flags. 252 test esi, CPUM_SYNC_FPU_STATE 253 jz near gth_fpu_no 254 255 mov rax, cr0 256 mov rcx, rax ; save old CR0 257 and rax, ~(X86_CR0_TS | X86_CR0_EM) 258 mov cr0, rax 259 fxrstor [rdx + CPUMCPU.Guest.fpu] 260 mov cr0, rcx ; and restore old CR0 again 261 262 gth_fpu_no: 263 ; Check if we need to restore the guest debug state 264 test esi, CPUM_SYNC_DEBUG_STATE 265 jz near gth_debug_no 266 267 mov rax, qword [rdx + CPUMCPU.Guest.dr + 0*8] 268 mov dr0, rax 269 mov rax, qword [rdx + CPUMCPU.Guest.dr + 1*8] 270 mov dr1, rax 271 mov rax, qword [rdx + CPUMCPU.Guest.dr + 2*8] 272 mov dr2, rax 273 mov rax, qword [rdx + CPUMCPU.Guest.dr + 3*8] 274 mov dr3, rax 275 mov rax, qword [rdx + CPUMCPU.Guest.dr + 6*8] 276 mov dr6, rax ; not required for AMD-V 277 278 gth_debug_no: 253 279 254 280 ; parameter for all helper functions (pCtx) 255 281 lea rsi, [rdx + CPUMCPU.Guest.fpu] 256 call r ax282 call r9 257 283 258 284 ; Load CPUM pointer into rdx
Note:
See TracChangeset
for help on using the changeset viewer.