VirtualBox

Changeset 71640 in vbox


Ignore:
Timestamp:
Apr 4, 2018 6:30:54 AM (7 years ago)
Author:
vboxsync
Message:

VMM: Nested hw.virt: Abstract SVM V_INTR_MASKING so we can refer to the original VMCB value rather than a potentially modified
value while executing the nested-guest in hardware-assisted SVM.

Location:
trunk
Files:
3 edited

Legend:

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

    r71108 r71640  
    14681468 *
    14691469 * @returns @c true if in intercept is active, @c false otherwise.
    1470  * @param   pVCpu   The cross context virtual CPU structure of the calling EMT.
     1470 * @param   pVCpu       The cross context virtual CPU structure of the calling EMT.
    14711471 * @param   pCtx        Pointer to the context.
    14721472 * @param   uVector     The exception / interrupt vector.
     
    14831483}
    14841484
     1485
     1486/**
     1487 * Checks if the guest VMCB has virtual-interrupt masking enabled.
     1488 *
     1489 * @returns @c true if virtual-interrupts are masked, @c false otherwise.
     1490 * @param   pVCpu       The cross context virtual CPU structure of the calling EMT.
     1491 * @param   pCtx        Pointer to the context.
     1492 *
     1493 * @remarks Should only be called when SVM feature is exposed to the guest.
     1494 */
     1495DECLINLINE(bool) CPUMIsGuestSvmVirtIntrMasking(PVMCPU pVCpu, PCCPUMCTX pCtx)
     1496{
     1497    PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb);
     1498    Assert(pVmcb);
     1499    if (!pCtx->hwvirt.svm.fHMCachedVmcb)
     1500    {
     1501        PCSVMVMCBCTRL pVmcbCtrl = &pCtx->hwvirt.svm.CTX_SUFF(pVmcb)->ctrl;
     1502        return pVmcbCtrl->IntCtrl.n.u1VIntrMasking;
     1503    }
     1504    return HMIsGuestSvmVirtIntrMasking(pVCpu, pCtx);
     1505}
     1506
     1507
    14851508/**
    14861509 * Updates the NextRIP (NRIP) field in the nested-guest VMCB.
     
    14891512 * @param   pCtx        Pointer to the context.
    14901513 * @param   cbInstr     The length of the current instruction in bytes.
     1514 *
     1515 * @remarks Should only be called when SVM feature is exposed to the guest.
    14911516 */
    14921517DECLINLINE(void) CPUMGuestSvmUpdateNRip(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t cbInstr)
  • trunk/include/VBox/vmm/hm_svm.h

    r71415 r71640  
    11371137VMM_INT_DECL(bool) HMIsGuestSvmWriteDRxInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uDr);
    11381138VMM_INT_DECL(bool) HMIsGuestSvmXcptInterceptSet(PVMCPU pVCpu, PCCPUMCTX pCtx, uint8_t uVector);
     1139VMM_INT_DECL(bool) HMIsGuestSvmVirtIntrMasking(PVMCPU pVCpu, PCCPUMCTX pCtx);
    11391140VMM_INT_DECL(bool) HMCanSvmNstGstTakePhysIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
    11401141VMM_INT_DECL(bool) HMCanSvmNstGstTakeVirtIntr(PVMCPU pVCpu, PCCPUMCTX pCtx);
  • trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp

    r71529 r71640  
    543543
    544544/**
     545 * Checks if the guest VMCB has virtual-interrupts masking enabled.
     546 *
     547 * @returns true if virtual-interrupts are masked, @c false otherwise.
     548 * @param   pVCpu   The cross context virtual CPU structure of the calling EMT.
     549 * @param   pCtx    Pointer to the context.
     550 */
     551VMM_INT_DECL(bool) HMIsGuestSvmVirtIntrMasking(PVMCPU pVCpu, PCCPUMCTX pCtx)
     552{
     553    Assert(pCtx->hwvirt.svm.fHMCachedVmcb); NOREF(pCtx);
     554    PCSVMNESTEDVMCBCACHE pVmcbNstGstCache = &pVCpu->hm.s.svm.NstGstVmcbCache;
     555    return pVmcbNstGstCache->fVIntrMasking;
     556}
     557
     558
     559/**
    545560 * Checks whether the SVM nested-guest is in a state to receive physical (APIC)
    546561 * interrupts.
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