VirtualBox

Changeset 31786 in vbox


Ignore:
Timestamp:
Aug 19, 2010 12:18:48 PM (14 years ago)
Author:
vboxsync
Message:

PGM: AMD-V + NP optimization (IOM sometimes makes use of uErr).

Location:
trunk
Files:
4 edited

Legend:

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

    r31636 r31786  
    423423VMMR0DECL(int)      PGMR0SharedModuleCheck(PVM pVM, PGVM pGVM, VMCPUID idCpu, PGMMSHAREDMODULE pModule, uint32_t cRegions, PGMMSHAREDREGIONDESC pRegions);
    424424VMMR0DECL(int)      PGMR0Trap0eHandlerNestedPaging(PVM pVM, PVMCPU pVCpu, PGMMODE enmShwPagingMode, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPHYS pvFault);
    425 VMMR0DECL(VBOXSTRICTRC) PGMR0Trap0eHandlerNPMisconfig(PVM pVM, PVMCPU pVCpu, PGMMODE enmShwPagingMode, PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysFault);
     425VMMR0DECL(VBOXSTRICTRC) PGMR0Trap0eHandlerNPMisconfig(PVM pVM, PVMCPU pVCpu, PGMMODE enmShwPagingMode, PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysFault, uint32_t uErr);
    426426# ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
    427427VMMR0DECL(int)      PGMR0DynMapInit(void);
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r31569 r31786  
    18861886        if ((errCode & (X86_TRAP_PF_RSVD | X86_TRAP_PF_P)) == (X86_TRAP_PF_RSVD | X86_TRAP_PF_P))
    18871887        {
    1888             rc = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, enmShwPagingMode, CPUMCTX2CORE(pCtx), GCPhysFault);
     1888            rc = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, enmShwPagingMode, CPUMCTX2CORE(pCtx), GCPhysFault, errCode);
    18891889            if (rc == VINF_SUCCESS)
    18901890            {
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r31646 r31786  
    34583458        Log(("VMX_EXIT_EPT_MISCONFIG for %RGp\n", GCPhys));
    34593459
    3460         rc = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, PGMMODE_EPT, CPUMCTX2CORE(pCtx), GCPhys);
     3460        rc = PGMR0Trap0eHandlerNPMisconfig(pVM, pVCpu, PGMMODE_EPT, CPUMCTX2CORE(pCtx), GCPhys, UINT32_MAX);
    34613461        if (rc == VINF_SUCCESS)
    34623462        {
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r31593 r31786  
    323323 * @param   pRegFrame           Trap register frame.
    324324 * @param   GCPhysFault         The fault address.
     325 * @param   uErr                The error code, UINT32_MAX if not available
     326 *                              (VT-x).
    325327 */
    326328VMMR0DECL(VBOXSTRICTRC) PGMR0Trap0eHandlerNPMisconfig(PVM pVM, PVMCPU pVCpu, PGMMODE enmShwPagingMode,
    327                                                       PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysFault)
     329                                                      PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysFault, uint32_t uErr)
    328330{
    329331#ifdef PGM_WITH_MMIO_OPTIMIZATIONS
     
    336338    pgmLock(pVM);
    337339    PPGMPHYSHANDLER pHandler = pgmHandlerPhysicalLookup(pVM, GCPhysFault);
    338     if (RT_LIKELY(pHandler))
     340    if (RT_LIKELY(pHandler && pHandler->enmType != PGMPHYSHANDLERTYPE_PHYSICAL_WRITE))
    339341    {
    340342        if (pHandler->CTX_SUFF(pfnHandler))
     
    345347            pgmUnlock(pVM);
    346348
    347             rc = pfnHandler(pVM, RTGCPTR_MAX /*uErr*/, pRegFrame, GCPhysFault, GCPhysFault, pvUser);
     349            Log6(("PGMR0Trap0eHandlerNPMisconfig: calling %p(,%#x,,%RGp,%p)\n", pfnHandler, uErr, GCPhysFault, pvUser));
     350            rc = pfnHandler(pVM, uErr == UINT32_MAX ? RTGCPTR_MAX : uErr, pRegFrame, GCPhysFault, GCPhysFault, pvUser);
    348351
    349352#ifdef VBOX_WITH_STATISTICS
     
    358361        {
    359362            pgmUnlock(pVM);
     363            Log(("PGMR0Trap0eHandlerNPMisconfig: %RGp (uErr=%#x) -> R3\n", GCPhysFault, uErr));
    360364            rc = VINF_EM_RAW_EMULATE_INSTR;
    361365        }
     
    366370         * Must be out of sync, so do a SyncPage and restart the instruction.
    367371         */
     372        Log(("PGMR0Trap0eHandlerNPMisconfig: Out of sync page at %RGp (uErr=%#x)\n", GCPhysFault, uErr));
    368373        STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatR0NpMiscfgSyncPage);
    369374        rc = pgmShwSyncNestedPageLocked(pVCpu, GCPhysFault, 1 /*cPages*/, enmShwPagingMode);
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