VirtualBox

Changeset 21942 in vbox for trunk/src/VBox/VMM/VMMSwitcher


Ignore:
Timestamp:
Aug 3, 2009 2:39:00 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50627
Message:

VMM: detect syscall usage on the host.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMSwitcher/PAEand32Bit.mac

    r18927 r21942  
    157157htg_no_sysenter:
    158158
     159    FIXUP FIX_NO_SYSCALL_JMP, 0, htg_no_syscall - NAME(Start) ; this will insert a jmp htg_no_syscall if host doesn't use syscall.
     160    ; clear MSR_K6_EFER_SCE.
     161    mov     ebx, edx                    ; save edx
     162    mov     ecx, MSR_K6_EFER
     163    rdmsr                               ; edx:eax <- MSR[ecx]
     164    and     eax, ~MSR_K6_EFER_SCE
     165    wrmsr
     166    mov     edx, ebx                    ; restore edx
     167    jmp short htg_no_syscall
     168
     169ALIGNCODE(16)
     170htg_no_syscall:
     171
    159172    ;; handle use flags.
    160173    mov     esi, [edx + CPUMCPU.fUseFlags] ; esi == use flags.
     
    216229    ; Store the hypervisor cr3 for later loading
    217230    mov     ebp, [edx + CPUMCPU.Hyper.cr3]
    218    
     231
    219232    ;;
    220233    ;; Load Intermediate memory context.
     
    381394    ; callees expect CPUM ptr
    382395    CPUM_FROM_CPUMCPU(edx)
    383    
     396
    384397%ifdef VBOX_WITH_STATISTICS
    385398    FIXUP FIX_GC_VM_OFF, 1, VM.StatSwitcherToGC
     
    420433    mov     eax, dr3
    421434    mov     [edx + CPUMCPU.Host.dr3], eax
    422    
     435
    423436    ; load hyper DR0-7
    424437    mov     ebx, [edx + CPUMCPU.Hyper.dr]
     
    864877gth_sysenter_no:
    865878
    866     ;; @todo AMD syscall
     879    FIXUP FIX_NO_SYSCALL_JMP, 0, gth_syscall_no - NAME(Start) ; this will insert a jmp gth_syscall_no if host doesn't use syscall.
     880    ; set MSR_K6_EFER_SCE.
     881    mov     ebx, edx                    ; save edx
     882    mov     ecx, MSR_K6_EFER
     883    rdmsr
     884    or      eax, MSR_K6_EFER_SCE
     885    wrmsr
     886    mov     edx, ebx                    ; restore edx
     887    jmp short gth_syscall_no
     888
     889ALIGNCODE(16)
     890gth_syscall_no:
    867891
    868892    ; Restore FPU if guest has used it.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette