VirtualBox

儲存庫 vbox 的更動 15328


忽略:
時間撮記:
2008-12-11 下午06:14:32 (16 年 以前)
作者:
vboxsync
訊息:

VT-x switcher updates

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/VMMGC/HWACCMGCA.asm

    r15307 r15328  
    8686 %endmacro
    8787
    88 ; trashes rax & rdx
    89  %macro VMCSWRITE 2
    90     mov     eax, %1
    91     vmwrite rax, %2
    92  %endmacro
    93 
    94 ; trashes rax & rdx
    95  %macro VMCSREAD 2
    96     mov     eax, %1
    97     vmread  %2, rax
    98  %endmacro
    99 
    10088BEGINCODE
    10189BITS 64
     
    134122   
    135123.vmptrld_success:
     124
     125    ; Save the VMCS pointer on the stack
     126    push    qword [rbp + 16 + 8];
     127
    136128    ; Signal that we're in 64 bits mode now!
    137     VMCSREAD VMX_VMCS_CTRL_EXIT_CONTROLS,       rdx
     129    mov     eax, VMX_VMCS_CTRL_EXIT_CONTROLS
     130    vmread  rdx, rax
    138131    or      rdx, VMX_VMCS_CTRL_EXIT_CONTROLS_HOST_AMD64
    139     VMCSWRITE VMX_VMCS_CTRL_EXIT_CONTROLS,      rdx 
     132    vmwrite rax, rdx
    140133   
    141134    ; Save the host state that's relevant in the temporary 64 bits mode
    142     mov     rax, cr0
    143     VMCSWRITE VMX_VMCS_HOST_CR0,                rax
    144     mov     rax, cr3
    145     VMCSWRITE VMX_VMCS_HOST_CR3,                rax
    146     mov     rax, cr4
    147     VMCSWRITE VMX_VMCS_HOST_CR4,                rax
    148     mov     rax, cs
    149     VMCSWRITE VMX_VMCS_HOST_FIELD_CS,           rax
    150     mov     rax, ss
    151     VMCSWRITE VMX_VMCS_HOST_FIELD_SS,           rax
     135    mov     rdx, cr0
     136    mov     eax, VMX_VMCS_HOST_CR0
     137    vmwrite rax, rdx
     138
     139    mov     rdx, cr3
     140    mov     eax, VMX_VMCS_HOST_CR3
     141    vmwrite rax, rdx
     142
     143    mov     rdx, cr4
     144    mov     eax, VMX_VMCS_HOST_CR4
     145    vmwrite rax, rdx
     146
     147    mov     rdx, cs
     148    mov     eax, VMX_VMCS_HOST_FIELD_CS
     149    vmwrite rax, rdx
     150
     151    mov     rdx, ss
     152    mov     eax, VMX_VMCS_HOST_FIELD_SS
     153    vmwrite rax, rdx
    152154
    153155    sub     rsp, 8*2
    154156    sgdt    [rsp]
    155     mov     rax, [rsp+2]
    156     VMCSWRITE VMX_VMCS_HOST_GDTR_BASE,          rax
     157    mov     eax, VMX_VMCS_HOST_GDTR_BASE
     158    vmwrite rax, [rsp+2]
    157159    add     rsp, 8*2
    158160   
     
    245247    mov     rsi, qword [rsi + CPUMCTX.esi]
    246248
     249    jmp     near .vmstart64_invalid_vmxon_ptr
     250
    247251    vmlaunch
    248252    jmp     .vmlaunch64_done;      ;/* here if vmlaunch detected a failure. */
     
    304308.vmstart64_end:
    305309    ; Signal that we're going back to 32 bits mode!
    306     VMCSREAD VMX_VMCS_CTRL_EXIT_CONTROLS,       rdx
     310    mov      eax, VMX_VMCS_CTRL_EXIT_CONTROLS
     311    vmread   rdx, rax
    307312    and      rdx, ~VMX_VMCS_CTRL_EXIT_CONTROLS_HOST_AMD64
    308     VMCSWRITE VMX_VMCS_CTRL_EXIT_CONTROLS,      rdx
     313    vmwrite  rax, rdx
    309314
    310315    ; Write back the data and disable the VMCS
    311     vmclear [rbp + 16 + 8]  ;pVMCS
     316    vmclear qword [rsp]  ;Pushed pVMCS
     317    add     rsp, 8
    312318
    313319.vmstart64_vmoff_end:
     
    322328    pop     rsi         ; pCtx (needed in rsi by the macros below)
    323329
    324     ; Restore the host LSTAR, CSTAR, SFMASK & KERNEL_GSBASE MSRs
    325     ;; @todo use the automatic load feature for MSRs
    326     SAVEGUESTMSR MSR_K8_KERNEL_GS_BASE, CPUMCTX.msrKERNELGSBASE
    327 
    328330%ifdef VMX_USE_CACHED_VMCS_ACCESSES
    329331    add     xSP, xS     ; pCache
     
    339341.vmstart64_start_failed:
    340342    pop     rsi         ; pCtx (needed in rsi by the macros below)
    341 
    342     ; Restore the host LSTAR, CSTAR, SFMASK & KERNEL_GSBASE MSRs
    343     ;; @todo use the automatic load feature for MSRs
    344     SAVEGUESTMSR MSR_K8_KERNEL_GS_BASE, CPUMCTX.msrKERNELGSBASE
    345343
    346344%ifdef VMX_USE_CACHED_VMCS_ACCESSES
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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