VirtualBox

Changeset 30889 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Jul 17, 2010 1:54:47 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63735
Message:

PGM: Cleanups related to pending MMIO/#PF optimizations. Risky.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r30111 r30889  
    55
    66/*
    7  * Copyright (C) 2007 Oracle Corporation
     7 * Copyright (C) 2007-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030#include <iprt/mem.h>
    3131
    32 RT_C_DECLS_BEGIN
     32
     33/*
     34 * Instantiate the ring-0 header/code templates.
     35 */
    3336#define PGM_BTH_NAME(name)          PGM_BTH_NAME_32BIT_PROT(name)
    3437#include "PGMR0Bth.h"
     
    4649#include "PGMR0Bth.h"
    4750#undef PGM_BTH_NAME
    48 
    49 RT_C_DECLS_END
    5051
    5152
     
    162163}
    163164
     165
    164166/**
    165167 * Worker function for PGMR3PhysAllocateLargeHandyPage
     
    186188    return rc;
    187189}
     190
    188191
    189192/**
     
    208211
    209212    /* AMD uses the host's paging mode; Intel has a single mode (EPT). */
    210     AssertMsg(enmShwPagingMode == PGMMODE_32_BIT || enmShwPagingMode == PGMMODE_PAE || enmShwPagingMode == PGMMODE_PAE_NX || enmShwPagingMode == PGMMODE_AMD64 || enmShwPagingMode == PGMMODE_AMD64_NX || enmShwPagingMode == PGMMODE_EPT, ("enmShwPagingMode=%d\n", enmShwPagingMode));
     213    AssertMsg(   enmShwPagingMode == PGMMODE_32_BIT || enmShwPagingMode == PGMMODE_PAE      || enmShwPagingMode == PGMMODE_PAE_NX
     214              || enmShwPagingMode == PGMMODE_AMD64  || enmShwPagingMode == PGMMODE_AMD64_NX || enmShwPagingMode == PGMMODE_EPT,
     215              ("enmShwPagingMode=%d\n", enmShwPagingMode));
    211216
    212217#ifdef VBOX_WITH_STATISTICS
     
    253258     * Call the worker.
    254259     *
    255      * We pretend the guest is in protected mode without paging, so we can use existing code to build the
    256      * nested page tables.
     260     * Note! We pretend the guest is in protected mode without paging, so we
     261     *       can use existing code to build the nested page tables.
    257262     */
    258263    bool fLockTaken = false;
    259264    switch(enmShwPagingMode)
    260265    {
    261     case PGMMODE_32_BIT:
    262         rc = PGM_BTH_NAME_32BIT_PROT(Trap0eHandler)(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken);
    263         break;
    264     case PGMMODE_PAE:
    265     case PGMMODE_PAE_NX:
    266         rc = PGM_BTH_NAME_PAE_PROT(Trap0eHandler)(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken);
    267         break;
    268     case PGMMODE_AMD64:
    269     case PGMMODE_AMD64_NX:
    270         rc = PGM_BTH_NAME_AMD64_PROT(Trap0eHandler)(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken);
    271         break;
    272     case PGMMODE_EPT:
    273         rc = PGM_BTH_NAME_EPT_PROT(Trap0eHandler)(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken);
    274         break;
    275     default:
    276         AssertFailed();
    277         rc = VERR_INVALID_PARAMETER;
    278         break;
     266        case PGMMODE_32_BIT:
     267            rc = PGM_BTH_NAME_32BIT_PROT(Trap0eHandler)(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken);
     268            break;
     269        case PGMMODE_PAE:
     270        case PGMMODE_PAE_NX:
     271            rc = PGM_BTH_NAME_PAE_PROT(Trap0eHandler)(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken);
     272            break;
     273        case PGMMODE_AMD64:
     274        case PGMMODE_AMD64_NX:
     275            rc = PGM_BTH_NAME_AMD64_PROT(Trap0eHandler)(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken);
     276            break;
     277        case PGMMODE_EPT:
     278            rc = PGM_BTH_NAME_EPT_PROT(Trap0eHandler)(pVCpu, uErr, pRegFrame, pvFault, &fLockTaken);
     279            break;
     280        default:
     281            AssertFailed();
     282            rc = VERR_INVALID_PARAMETER;
     283            break;
    279284    }
    280285    if (fLockTaken)
     
    283288        pgmUnlock(pVM);
    284289    }
     290
    285291    if (rc == VINF_PGM_SYNCPAGE_MODIFIED_PDE)
    286292        rc = VINF_SUCCESS;
    287     else
    288293    /* Note: hack alert for difficult to reproduce problem. */
    289     if (    rc == VERR_PAGE_NOT_PRESENT                 /* SMP only ; disassembly might fail. */
    290         || rc == VERR_PAGE_TABLE_NOT_PRESENT           /* seen with UNI & SMP */
    291         || rc == VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT   /* seen with SMP */
    292         || rc == VERR_PAGE_MAP_LEVEL4_NOT_PRESENT)     /* precaution */
     294    else if (   rc == VERR_PAGE_NOT_PRESENT                 /* SMP only ; disassembly might fail. */
     295             || rc == VERR_PAGE_TABLE_NOT_PRESENT           /* seen with UNI & SMP */
     296             || rc == VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT   /* seen with SMP */
     297             || rc == VERR_PAGE_MAP_LEVEL4_NOT_PRESENT)     /* precaution */
    293298    {
    294299        Log(("WARNING: Unexpected VERR_PAGE_TABLE_NOT_PRESENT (%d) for page fault at %RGp error code %x (rip=%RGv)\n", rc, pvFault, uErr, pRegFrame->rip));
    295         /* Some kind of inconsistency in the SMP case; it's safe to just execute the instruction again; not sure about single VCPU VMs though. */
     300        /* Some kind of inconsistency in the SMP case; it's safe to just execute the instruction again; not sure about
     301           single VCPU VMs though. */
    296302        rc = VINF_SUCCESS;
    297303    }
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r30660 r30889  
    13091309}
    13101310
    1311 
    13121311#ifdef LOG_ENABLED
     1312
    13131313/**
    13141314 * Disables flushing of the ring-0 debug log.
     
    13351335        pVCpu->vmm.s.pR0LoggerR0->fFlushingDisabled = false;
    13361336}
    1337 #endif
     1337
     1338#endif /* LOG_ENABLED */
    13381339
    13391340/**
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