VirtualBox

Changeset 9115 in vbox for trunk


Ignore:
Timestamp:
May 26, 2008 11:18:34 AM (17 years ago)
Author:
vboxsync
Message:

HWACCM: Invalidate pages changed by PGMHandlerPhysicalPageTempOff.
Note that PGMHandlerPhysicalPageReset will trigger a TLB flush.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/hwacc_svm.h

    r9008 r9115  
    697697HWACCMR0DECL(int) SVMR0InvalidatePage(PVM pVM, RTGCPTR GCVirt);
    698698
     699/**
     700 * Invalidates a guest page by physical address
     701 *
     702 * NOTE: Assumes the current instruction references this physical page though a virtual address!!
     703 *
     704 * @returns VBox status code.
     705 * @param   pVM         The VM to operate on.
     706 * @param   GCPhys      Page to invalidate
     707 */
     708HWACCMR0DECL(int) SVMR0InvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys);
     709
    699710#endif /* IN_RING0 */
    700711
  • trunk/include/VBox/hwaccm.h

    r9021 r9115  
    8585
    8686/**
     87 * Invalidates a guest page by physical address
     88 *
     89 * NOTE: Assumes the current instruction references this physical page though a virtual address!!
     90 *
     91 * @returns VBox status code.
     92 * @param   pVM         The VM to operate on.
     93 * @param   GCPhys      Page to invalidate
     94 */
     95HWACCMDECL(int) HWACCMInvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys);
     96
     97/**
    8798 * Checks if nested paging is enabled
    8899 *
  • trunk/src/VBox/VMM/VMMAll/HWACCMAll.cpp

    r9034 r9115  
    9090}
    9191
     92
     93/**
     94 * Invalidates a guest page by physical address
     95 *
     96 * NOTE: Assumes the current instruction references this physical page though a virtual address!!
     97 *
     98 * @returns VBox status code.
     99 * @param   pVM         The VM to operate on.
     100 * @param   GCPhys      Page to invalidate
     101 */
     102HWACCMDECL(int) HWACCMInvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys)
     103{
     104    if (!HWACCMIsNestedPagingActive(pVM))
     105        return VINF_SUCCESS;
     106
     107#ifdef IN_RING0
     108    /* @todo Intel for nested paging */
     109    if (pVM->hwaccm.s.svm.fSupported)
     110    {
     111        SVMR0InvalidatePhysPage(pVM, GCPhys);
     112    }
     113#else
     114    HWACCMFlushTLB(pVM);
     115#endif
     116    return VINF_SUCCESS;
     117}
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r9008 r9115  
    889889            AssertRCReturn(rc, rc);
    890890            PGM_PAGE_SET_HNDL_PHYS_STATE(pPage, PGM_PAGE_HNDL_PHYS_STATE_DISABLED);
     891#ifdef IN_RING0
     892            HWACCMInvalidatePhysPage(pVM, GCPhysPage);
     893#endif
    891894            return VINF_SUCCESS;
    892895        }
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r9110 r9115  
    19191919}
    19201920
     1921
     1922/**
     1923 * Invalidates a guest page by physical address
     1924 *
     1925 * NOTE: Assumes the current instruction references this physical page though a virtual address!!
     1926 *
     1927 * @returns VBox status code.
     1928 * @param   pVM         The VM to operate on.
     1929 * @param   GCPhys      Page to invalidate
     1930 */
     1931HWACCMR0DECL(int) SVMR0InvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys)
     1932{
     1933    bool fFlushPending = pVM->hwaccm.s.svm.fAlwaysFlushTLB | pVM->hwaccm.s.svm.fForceTLBFlush;
     1934
     1935    /* Skip it if a TLB flush is already pending. */
     1936    if (!fFlushPending)
     1937    {
     1938        CPUMCTX    *pCtx;
     1939        int         rc;
     1940        SVM_VMCB   *pVMCB;
     1941
     1942        rc = CPUMQueryGuestCtxPtr(pVM, &pCtx);
     1943        AssertRCReturn(rc, rc);
     1944
     1945        Log2(("SVMR0InvalidatePhysPage %VGp\n", GCPhys));
     1946        AssertReturn(pVM, VERR_INVALID_PARAMETER);
     1947        Assert(pVM->hwaccm.s.svm.fSupported);
     1948
     1949        pVMCB = (SVM_VMCB *)pVM->hwaccm.s.svm.pVMCB;
     1950        AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_EM_INTERNAL_ERROR);
     1951
     1952        return SVMR0InterpretInvpg(pVM, CPUMCTX2CORE(pCtx), pVMCB->ctrl.TLBCtrl.n.u32ASID);
     1953    }
     1954    return VINF_SUCCESS;
     1955}
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