VirtualBox

Changeset 9853 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Jun 20, 2008 1:09:30 PM (17 years ago)
Author:
vboxsync
Message:

kernel gs base can be changed behind our back (swapgs), so always refresh it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWACCMR0A.asm

    r9817 r9853  
    7777
    7878  ; Save a guest and load the corresponding host MSR (trashes rdx & rcx)
     79  ; Only really useful for gs kernel base as that one can be changed behind our back (swapgs)
     80  %macro LOADHOSTMSREX 2
     81    mov     rcx, %1
     82    rdmsr
     83    mov     qword [xSI + %2], rax
     84    pop     rax
     85    pop     rdx
     86    wrmsr
     87  %endmacro
     88
     89  ; Load the corresponding host MSR (trashes rdx & rcx)
    7990  %macro LOADHOSTMSR 1
    8091    mov     rcx, %1
     
    566577    ; Restore the host LSTAR, CSTAR, SFMASK & KERNEL_GSBASE MSRs
    567578    ; @todo use the automatic load feature for MSRs
    568     LOADHOSTMSR MSR_K8_KERNEL_GS_BASE
     579    LOADHOSTMSREX MSR_K8_KERNEL_GS_BASE, CPUMCTX.msrKERNELGSBASE
    569580    LOADHOSTMSR MSR_K8_SF_MASK
    570581    LOADHOSTMSR MSR_K8_CSTAR
     
    599610    ; Restore the host LSTAR, CSTAR, SFMASK & KERNEL_GSBASE MSRs
    600611    ; @todo use the automatic load feature for MSRs
    601     LOADHOSTMSR MSR_K8_KERNEL_GS_BASE
     612    LOADHOSTMSREX MSR_K8_KERNEL_GS_BASE, CPUMCTX.msrKERNELGSBASE
    602613    LOADHOSTMSR MSR_K8_SF_MASK
    603614    LOADHOSTMSR MSR_K8_CSTAR
     
    626637    ; Restore the host LSTAR, CSTAR, SFMASK & KERNEL_GSBASE MSRs
    627638    ; @todo use the automatic load feature for MSRs
    628     LOADHOSTMSR MSR_K8_KERNEL_GS_BASE
     639    LOADHOSTMSREX MSR_K8_KERNEL_GS_BASE, CPUMCTX.msrKERNELGSBASE
    629640    LOADHOSTMSR MSR_K8_SF_MASK
    630641    LOADHOSTMSR MSR_K8_CSTAR
Note: See TracChangeset for help on using the changeset viewer.

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