Changeset 14764 in vbox for trunk/src/VBox/VMM/VMMSwitcher
- Timestamp:
- Nov 28, 2008 9:38:27 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40080
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMSwitcher/32BitToAMD64.asm
r14653 r14764 138 138 pop dword [edx + CPUMCPU.Host.eflags] 139 139 140 FIXUP FIX_NO_SYSENTER_JMP, 0, htg_no_sysenter - NAME(Start) ; this will insert a jmp htg_no_sysenter if host doesn't use sysenter.141 ; save MSR_IA32_SYSENTER_CS register.142 mov ecx, MSR_IA32_SYSENTER_CS143 mov ebx, edx ; save edx144 rdmsr ; edx:eax <- MSR[ecx]145 mov [ebx + CPUMCPU.Host.SysEnter.cs], eax146 mov [ebx + CPUMCPU.Host.SysEnter.cs + 4], edx147 xor eax, eax ; load 0:0 to cause #GP upon sysenter148 xor edx, edx149 wrmsr150 xchg ebx, edx ; restore edx151 jmp short htg_no_sysenter152 153 ALIGNCODE(16)154 htg_no_sysenter:155 156 140 ;; handle use flags. 157 141 mov esi, [edx + CPUMCPU.fUseFlags] ; esi == use flags. … … 173 157 mov eax, cr4 174 158 mov [edx + CPUMCPU.Host.cr4], eax 159 160 CPUM_FROM_CPUMCPU(edx) 161 ; Load new gdt so we can do far jump after going into 64 bits mode 162 lgdt [edx + CPUM.Hyper.gdtr] 175 163 176 164 ;; … … 438 426 lss esp, [edx + CPUMCPU.Host.esp] 439 427 440 FIXUP FIX_NO_SYSENTER_JMP, 0, gth_sysenter_no - NAME(Start) ; this will insert a jmp gth_sysenter_no if host doesn't use sysenter.441 442 ; restore MSR_IA32_SYSENTER_CS register.443 mov ecx, MSR_IA32_SYSENTER_CS444 mov eax, [edx + CPUMCPU.Host.SysEnter.cs]445 mov ebx, [edx + CPUMCPU.Host.SysEnter.cs + 4]446 xchg edx, ebx ; save/load edx447 wrmsr ; MSR[ecx] <- edx:eax448 xchg edx, ebx ; restore edx449 jmp short gth_sysenter_no450 451 ALIGNCODE(16)452 gth_sysenter_no:453 454 ;; @todo AMD syscall455 456 428 ; Restore FPU if guest has used it. 457 429 ; Using fxrstor should ensure that we're not causing unwanted exception on the host. … … 487 459 488 460 ; Control registers. 489 ; Would've liked to have these higher eup in case of crashes, but461 ; Would've liked to have these higher up in case of crashes, but 490 462 ; the fpu stuff must be done before we restore cr0. 491 463 mov ecx, [edx + CPUMCPU.Host.cr4]
Note:
See TracChangeset
for help on using the changeset viewer.