VirtualBox

Changeset 41072 in vbox


Ignore:
Timestamp:
Apr 26, 2012 4:35:04 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77640
Message:

VMM: fix VERR_PAGE_TABLE_NOT_PRESENT guru meditation caused by failing to disassemble an instruction because the guest's PDE/PTE is invalid, see #6043 for details.

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r40453 r41072  
    360360        if (PAGE_ADDRESS(InstrGC) == PAGE_ADDRESS(InstrGC + sizeof(State.aOpcode) - 1))
    361361        {
    362            if (rc == VERR_PAGE_TABLE_NOT_PRESENT)
    363               HWACCMInvalidatePage(pVCpu, InstrGC);
     362            /*
     363             * If we fail to find the page via the guest's page tables we invalidate the page
     364             * in the host TLB (pertaining to the guest in the NestedPaging case). See #6043
     365             */
     366            if (rc == VERR_PAGE_TABLE_NOT_PRESENT || rc == VERR_PAGE_NOT_PRESENT)
     367                HWACCMInvalidatePage(pVCpu, InstrGC);
    364368
    365369           Log(("emDisCoreOne: read failed with %d\n", rc));
     
    449453        if (PAGE_ADDRESS(GCPtrInstr) == PAGE_ADDRESS(GCPtrInstr + sizeof(State.aOpcode) - 1))
    450454        {
    451            if (rc == VERR_PAGE_TABLE_NOT_PRESENT)
    452               HWACCMInvalidatePage(pVCpu, GCPtrInstr);
     455            /*
     456             * If we fail to find the page via the guest's page tables we invalidate the page
     457             * in the host TLB (pertaining to the guest in the NestedPaging case). See #6043
     458             */
     459            if (rc == VERR_PAGE_TABLE_NOT_PRESENT || rc == VERR_PAGE_NOT_PRESENT)
     460                HWACCMInvalidatePage(pVCpu, GCPtrInstr);
    453461
    454462           Log(("EMInterpretDisasOneEx: read failed with %d\n", rc));
  • trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp

    r40776 r41072  
    15221522    unsigned        cbOp;
    15231523    rc = EMInterpretDisasOne(pVM, pVCpu, pCtxCore, pDis, &cbOp);
    1524     AssertRC(rc);
    15251524    if (RT_FAILURE(rc))
    15261525    {
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r40655 r41072  
    19191919        {
    19201920            rc = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, enmShwPagingMode, CPUMCTX2CORE(pCtx), GCPhysFault, errCode);
    1921             if (rc == VINF_SUCCESS)
     1921
     1922            /*
     1923             * If we succeed, resume execution.
     1924             * Or, if fail in interpreting the instruction because we couldn't get the guest physical address
     1925             * of the page containing the instruction via the guest's page tables (we would invalidate the guest page
     1926             * in the host TLB), resume execution which would cause a guest page fault to let the guest handle this
     1927             * weird case. See #6043.
     1928             */
     1929            if (   rc == VINF_SUCCESS
     1930                || rc == VERR_PAGE_TABLE_NOT_PRESENT
     1931                || rc == VERR_PAGE_NOT_PRESENT)
    19221932            {
    19231933                Log2(("PGMR0Trap0eHandlerNPMisconfig(,,,%RGp) at %RGv -> resume\n", GCPhysFault, (RTGCPTR)pCtx->rip));
     
    19351945        rc = PGMR0Trap0eHandlerNestedPaging(pVM, pVCpu, enmShwPagingMode, errCode, CPUMCTX2CORE(pCtx), GCPhysFault);
    19361946        Log2(("PGMR0Trap0eHandlerNestedPaging %RGv returned %Rrc\n", (RTGCPTR)pCtx->rip, VBOXSTRICTRC_VAL(rc)));
    1937         if (rc == VINF_SUCCESS)
     1947
     1948        /*
     1949         * Same case as PGMR0Trap0eHandlerNPMisconfig(). See comment above, #6043.
     1950         */
     1951        if (   rc == VINF_SUCCESS
     1952            || rc == VERR_PAGE_TABLE_NOT_PRESENT
     1953            || rc == VERR_PAGE_NOT_PRESENT)
    19381954        {   /* We've successfully synced our shadow pages, so let's just continue execution. */
    19391955            Log2(("Shadow page fault at %RGv cr2=%RGp error code %x\n", (RTGCPTR)pCtx->rip, GCPhysFault, errCode));
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r40832 r41072  
    34963496        rc = PGMR0Trap0eHandlerNestedPaging(pVM, pVCpu, PGMMODE_EPT, errCode, CPUMCTX2CORE(pCtx), GCPhys);
    34973497        Log2(("PGMR0Trap0eHandlerNestedPaging %RGv returned %Rrc\n", (RTGCPTR)pCtx->rip, VBOXSTRICTRC_VAL(rc)));
     3498
     3499        /*
     3500         * Note! We probably should handle failure to get the instruction page (VERR_PAGE_NOT_PRESENT,
     3501         * VERR_PAGE_TABLE_NOT_PRESENT). See #6043.
     3502         */
    34983503        if (rc == VINF_SUCCESS)
    34993504        {   /* We've successfully synced our shadow pages, so let's just continue execution. */
     
    35423547
    35433548        rc = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, PGMMODE_EPT, CPUMCTX2CORE(pCtx), GCPhys, UINT32_MAX);
     3549
     3550        /*
     3551         * Note! We probably should handle failure to get the instruction page (VERR_PAGE_NOT_PRESENT,
     3552         * VERR_PAGE_TABLE_NOT_PRESENT). See #6043.
     3553         */
    35443554        if (rc == VINF_SUCCESS)
    35453555        {
     
    44344444    Log2(("VMXR0InvalidatePage %RGv\n", GCVirt));
    44354445
    4436     /* Only relevant if we want to use VPID.
     4446    /* Only relevant if we want to use VPID as otherwise every VMX transition
     4447     * will flush the TLBs and paging-structure caches.
    44374448     * In the nested paging case we still see such calls, but
    44384449     * can safely ignore them. (e.g. after cr3 updates)
Note: See TracChangeset for help on using the changeset viewer.

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