VirtualBox

Changeset 9814 in vbox


Ignore:
Timestamp:
Jun 19, 2008 11:09:21 AM (17 years ago)
Author:
vboxsync
Message:

FS & GS base msr fixes

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

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

    r9593 r9814  
    459459    LOADGUESTMSR MSR_K8_KERNEL_GS_BASE, CPUMCTX.msrKERNELGSBASE
    460460
     461    ; Load the guest MSRs for FS & GS base (saved in MYPUSHSEGS)
     462    mov     rcx, MSR_K8_FS_BASE
     463    mov     rax, qword [xSI + CPUMCTX.msrFSBASE]
     464    wrmsr
     465
     466    mov     rcx, MSR_K8_GS_BASE
     467    mov     rax, qword [xSI + CPUMCTX.msrGSBASE]
     468    wrmsr
     469
    461470    ; Save the pCtx pointer
    462471    push    xSI
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r9805 r9814  
    969969        pVM->hwaccm.s.vmx.pfnStartVM  = VMXR0StartVM64;
    970970#endif
    971         rc = VMXWriteVMCS(VMX_VMCS_GUEST_FS_BASE, pCtx->msrFSBASE);
    972         AssertRC(rc);
    973         rc = VMXWriteVMCS(VMX_VMCS_GUEST_GS_BASE, pCtx->msrGSBASE);
    974         AssertRC(rc);
    975971    }
    976972    else
     
    20952091        VMXReadVMCS(VMX_VMCS_GUEST_SYSENTER_ESP,     &val);
    20962092        pCtx->SysEnter.esp      = val;
    2097 
    2098         /* 64 bits guest mode? */
    2099         if (pCtx->msrEFER & MSR_K6_EFER_LMA)
    2100         {
    2101             /* Note: we assume that either you can't rely on fs/gs base staying intact when switching in and out of 64 bits mode or that in
    2102              *       reality it really doesn't matter (as the guest OS restores them manually).
    2103              */
    2104             VMXReadVMCS(VMX_VMCS_GUEST_FS_BASE, &val);
    2105             pCtx->msrFSBASE = val;
    2106             VMXReadVMCS(VMX_VMCS_GUEST_GS_BASE, &val);
    2107             pCtx->msrGSBASE = val;
    2108         }
    21092093    }
    21102094
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