VirtualBox

Changeset 15354 in vbox for trunk/src/VBox/VMM/VMMGC


Ignore:
Timestamp:
Dec 12, 2008 8:51:41 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
40788
Message:

Flush the VMCS write cache first (before any other vmreads/vmwrites!)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMGC/HWACCMGCA.asm

    r15332 r15354  
    127127    push    qword [rbp + 16 + 8];
    128128
     129    ;/* Save segment registers */
     130    MYPUSHSEGS rax
     131
     132%ifdef VMX_USE_CACHED_VMCS_ACCESSES
     133    ; Flush the VMCS write cache first (before any other vmreads/vmwrites!)
     134    mov     rbx, [rbp + 24 + 8]                             ; pCache
     135    mov     ecx, [xBX + VMCSCACHE.Write.cValidEntries]
     136    cmp     ecx, 0
     137    je      .no_cached_writes
     138    mov     edx, ecx
     139    mov     ecx, 0
     140    jmp     .cached_write
     141   
     142ALIGN(16)   
     143.cached_write:
     144    mov     eax, [xBX + VMCSCACHE.Write.aField + xCX*4]
     145    vmwrite xAX, [xBX + VMCSCACHE.Write.aFieldVal + xCX*8]
     146    inc     xCX
     147    cmp     xCX, xDX
     148    jl     .cached_write
     149
     150    mov     dword [xBX + VMCSCACHE.Write.cValidEntries], 0
     151.no_cached_writes:
     152
     153    ; Save the pCache pointer
     154    push    xBX
     155%endif
     156
    129157    ; Signal that we're in 64 bits mode now!
    130158    mov     eax, VMX_VMCS_CTRL_EXIT_CONTROLS
     
    179207    ; *
    180208    ; */
    181 
    182     ;/* Save segment registers */
    183     MYPUSHSEGS rax
    184 
    185 
    186 %ifdef VMX_USE_CACHED_VMCS_ACCESSES
    187     mov     rbx, [rbp + 24 + 8]                             ; pCache
    188     mov     ecx, [xBX + VMCSCACHE.Write.cValidEntries]
    189     cmp     ecx, 0
    190     je      .no_cached_writes
    191     mov     edx, ecx
    192     mov     ecx, 0
    193     jmp     .cached_write
    194    
    195 ALIGN(16)   
    196 .cached_write:
    197     mov     eax, [xBX + VMCSCACHE.Write.aField + xCX*4]
    198     vmwrite xAX, [xBX + VMCSCACHE.Write.aFieldVal + xCX*8]
    199     inc     xCX
    200     cmp     xCX, xDX
    201     jl     .cached_write
    202 
    203     mov     dword [xBX + VMCSCACHE.Write.cValidEntries], 0
    204 .no_cached_writes:
    205 
    206     ; Save the pCache pointer
    207     push    xBX
    208 %endif
    209209
    210210    ; Load the guest LSTAR, CSTAR, SFMASK & KERNEL_GSBASE MSRs
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