VirtualBox

Changeset 68433 in vbox


Ignore:
Timestamp:
Aug 16, 2017 10:12:38 AM (7 years ago)
Author:
vboxsync
Message:

VMM: Nested Hw.virt: SVM bits.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/hm_svm.h

    r68361 r68433  
    996996    /** Cache of the TLB control. */
    997997    SVMTLBCTRL          TLBCtrl;
    998     /** Cache of V_INTR_MASKING bit. */
    999     bool                fVIntrMasking;
     998    /** @} */
     999
     1000    /** @name Nested-guest VMCB guest state.
     1001     * @{ */
     1002    /** Cache of CR3. */
     1003    uint64_t            u64CR3;
    10001004    /** @} */
    10011005
    10021006    /** @name Other miscellaneous state.
    10031007     * @{ */
    1004     /** Whether the fields above are updated or not. */
    1005     bool                fValid;
    10061008    /** Whether a VMRUN was just emulated in R0 and the VMCB is up to date. */
    10071009    bool                fVmrunEmulatedInR0;
     
    10091011     *  processing. */
    10101012    bool                fExitCodeAndInfoUpdated;
     1013    /** Cache of V_INTR_MASKING bit. */
     1014    bool                fVIntrMasking;
     1015    /** Whether the fields above are updated or not. */
     1016    bool                fValid;
    10111017    /** Alignment. */
    10121018    bool                afPadding0[4];
     
    10191025typedef const SVMNESTEDVMCBCACHE *PCSVMNESTEDVMCBCACHE;
    10201026/** @} */
    1021 AssertCompileMemberAlignment(SVMNESTEDVMCBCACHE, fVIntrMasking, 8);
    10221027AssertCompileSizeAlignment(SVMNESTEDVMCBCACHE, 8);
    10231028
  • trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp

    r68363 r68433  
    349349    if (pNstGstVmcbCache->fValid)
    350350    {
    351         PSVMVMCBCTRL pVmcbNstGstCtrl = &pVmcbNstGst->ctrl;
     351        PSVMVMCBCTRL      pVmcbNstGstCtrl  = &pVmcbNstGst->ctrl;
     352        PSVMVMCBSTATESAVE pVmcbNstGstState =&pVmcbNstGst->guest;
    352353        pVmcbNstGstCtrl->u16InterceptRdCRx        = pNstGstVmcbCache->u16InterceptRdCRx;
    353354        pVmcbNstGstCtrl->u16InterceptWrCRx        = pNstGstVmcbCache->u16InterceptWrCRx;
     
    356357        pVmcbNstGstCtrl->u32InterceptXcpt         = pNstGstVmcbCache->u32InterceptXcpt;
    357358        pVmcbNstGstCtrl->u64InterceptCtrl         = pNstGstVmcbCache->u64InterceptCtrl;
     359        pVmcbNstGstState->u64CR3                  = pNstGstVmcbCache->u64CR3;
    358360        pVmcbNstGstCtrl->u64VmcbCleanBits         = pNstGstVmcbCache->u64VmcbCleanBits;
    359361        pVmcbNstGstCtrl->u64IOPMPhysAddr          = pNstGstVmcbCache->u64IOPMPhysAddr;
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r68408 r68433  
    13711371    {
    13721372        Assert(!pVCpu->CTX_SUFF(pVM)->cpum.ro.GuestFeatures.fSvmNestedPaging);
    1373         pVmcbNstGst->guest.u64CR3 = pCtx->cr3;
     1373        int rc = PGMPhysGCPhys2HCPhys(pVCpu->CTX_SUFF(pVM), pCtx->cr3, &pVmcbNstGst->guest.u64CR3);
     1374        AssertRC(rc);
    13741375        pVmcbNstGst->ctrl.u64VmcbCleanBits &= ~HMSVM_VMCB_CLEAN_CRX_EFER;
    13751376        HMCPU_CF_CLEAR(pVCpu, HM_CHANGED_GUEST_CR3);
     
    20392040    PSVMVMCB            pVmcbNstGst      = pCtx->hwvirt.svm.CTX_SUFF(pVmcb);
    20402041    PSVMVMCBCTRL        pVmcbNstGstCtrl  = &pVmcbNstGst->ctrl;
     2042    PSVMVMCBSTATESAVE   pVmcbNstGstState = &pVmcbNstGst->guest;
    20412043    PSVMNESTEDVMCBCACHE pNstGstVmcbCache = &pVCpu->hm.s.svm.NstGstVmcbCache;
    20422044
     
    20472049    pNstGstVmcbCache->u32InterceptXcpt  = pVmcbNstGstCtrl->u32InterceptXcpt;
    20482050    pNstGstVmcbCache->u64InterceptCtrl  = pVmcbNstGstCtrl->u64InterceptCtrl;
     2051    pNstGstVmcbCache->u64CR3            = pVmcbNstGstState->u64CR3;
    20492052    pNstGstVmcbCache->u64IOPMPhysAddr   = pVmcbNstGstCtrl->u64IOPMPhysAddr;
    20502053    pNstGstVmcbCache->u64MSRPMPhysAddr  = pVmcbNstGstCtrl->u64MSRPMPhysAddr;
     
    21282131    if (!pVCpu->hm.s.svm.NstGstVmcbCache.fVmrunEmulatedInR0)
    21292132    {
     2133        /* hmR0SvmLoadGuestVmcbNested needs to be called first which caches the VMCB fields and adjusts others. */
    21302134        hmR0SvmLoadGuestVmcbNested(pVCpu, pCtx);
     2135
    21312136        hmR0SvmLoadGuestControlRegsNested(pVCpu, pVmcbNstGst, pCtx);
    21322137        hmR0SvmLoadGuestSegmentRegs(pVCpu, pVmcbNstGst, pCtx);
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