VirtualBox

Changeset 13038 in vbox for trunk


Ignore:
Timestamp:
Oct 7, 2008 11:29:51 AM (16 years ago)
Author:
vboxsync
Message:

#1865: More PGM changes.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/Makefile.kmk

    r13035 r13038  
    4141VMMR3_DEFS     += VBOX_WITH_PREALLOC_RAM_BY_DEFAULT
    4242endif
    43 VMMR3_DEFS.darwin = VBOX_WITH_2X_4GB_ADDR_SPACE
     43VMMR3_DEFS.darwin = VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3
    4444VMMR3_INCS     := \
    4545        $(PATH_SUB_CURRENT) \
     
    270270VMMGC_DEFS     += VBOX_WITH_IDT_PATCHING
    271271endif
    272 VMMGC_DEFS.darwin = VBOX_WITH_2X_4GB_ADDR_SPACE
     272VMMGC_DEFS.darwin = VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_RC
    273273VMMGC_SYSSUFF   = .gc
    274274VMMGC_LIBS      = \
     
    357357VMMR0_DEFS     += VBOX_WITH_IDT_PATCHING
    358358endif
    359 VMMR0_DEFS.darwin = VBOX_WITH_2X_4GB_ADDR_SPACE
     359VMMR0_DEFS.darwin = VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_0
    360360ifeq ($(VBOX_LDR_FMT),pe)
    361361VMMR0_LDFLAGS   = -Entry:VMMR0EntryEx
  • trunk/src/VBox/VMM/PGM.cpp

    r13035 r13038  
    18731873        pVM->pgm.s.pRamRangesRC = MMHyperR3ToRC(pVM, pVM->pgm.s.pRamRangesR3);
    18741874        for (PPGMRAMRANGE pCur = pVM->pgm.s.pRamRangesR3; pCur->pNextR3; pCur = pCur->pNextR3)
    1875 #ifdef VBOX_WITH_NEW_PHYS_CODE
    18761875            pCur->pNextRC = MMHyperR3ToRC(pVM, pCur->pNextR3);
    1877 #else
    1878         {
    1879             pCur->pNextRC = MMHyperR3ToRC(pVM, pCur->pNextR3);
    1880             if (pCur->pavHCChunkGC)
    1881                 pCur->pavHCChunkGC = MMHyperHC2GC(pVM, pCur->pavHCChunkHC);
    1882         }
    1883 #endif
    18841876    }
    18851877
  • trunk/src/VBox/VMM/PGMInternal.h

    r13035 r13038  
    222222#ifdef IN_GC
    223223# define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) PGMGCDynMapHCPage(pVM, HCPhys, (void **)(ppv))
    224 #elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE)
     224#elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    225225# define PGM_HCPHYS_2_PTR(pVM, HCPhys, ppv) PGMR0DynMapHCPage(pVM, HCPhys, (void **)(ppv))
    226226#else
     
    242242#ifdef IN_GC
    243243# define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) PGMGCDynMapGCPage(pVM, GCPhys, (void **)(ppv))
    244 #elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE)
     244#elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    245245# define PGM_GCPHYS_2_PTR(pVM, GCPhys, ppv) PGMR0DynMapGCPage(pVM, GCPhys, (void **)(ppv))
    246246#else
     
    262262#ifdef IN_GC
    263263# define PGM_GCPHYS_2_PTR_EX(pVM, GCPhys, ppv) PGMGCDynMapGCPageEx(pVM, GCPhys, (void **)(ppv))
    264 #elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE)
     264#elif defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    265265# define PGM_GCPHYS_2_PTR_EX(pVM, GCPhys, ppv) PGMR0DynMapGCPageEx(pVM, GCPhys, (void **)(ppv))
    266266#else
     
    935935    /** MM_RAM_* flags */
    936936    uint32_t                            fFlags;
    937 #ifdef VBOX_WITH_NEW_PHYS_CODE
    938937    uint32_t                            u32Alignment; /**< alignment. */
    939 #else
    940     /** HC virtual lookup ranges for chunks - RC Ptr.
    941      * Currently only used with MM_RAM_FLAGS_DYNAMIC_ALLOC ranges. */
    942     RCPTRTYPE(PRTHCPTR)                 pavHCChunkGC;
     938#ifndef VBOX_WITH_NEW_PHYS_CODE
    943939    /** HC virtual lookup ranges for chunks - R3/R0 Ptr.
    944940     * Currently only used with MM_RAM_FLAGS_DYNAMIC_ALLOC ranges. */
     
    30493045#endif /* !IN_GC */
    30503046
    3051 
    3052 #ifndef VBOX_WITH_NEW_PHYS_CODE
     3047#if !defined(IN_GC) /** @todo && !defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) */
     3048
     3049# ifndef VBOX_WITH_NEW_PHYS_CODE
    30533050/**
    30543051 * Convert GC Phys to HC Virt.
     
    30873084    return VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS;
    30883085}
    3089 #endif /* !VBOX_WITH_NEW_PHYS_CODE */
     3086# endif /* !VBOX_WITH_NEW_PHYS_CODE */
    30903087
    30913088
     
    31353132}
    31363133
     3134#endif /* !IN_GC && !defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) */
    31373135
    31383136/**
     
    31653163    {
    31663164        unsigned idx = (off >> PGM_DYNAMIC_CHUNK_SHIFT);
     3165#if defined(IN_GC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
     3166        PRTR3PTR paChunkR3Ptrs = (PRTR3PTR)MMHyperR3ToCC(PGM2VM(pPGM), pRam->pavHCChunkHC);
     3167        *pHCPtr = paChunkR3Ptrs[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK);
     3168#else
    31673169        *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
     3170#endif
    31683171        return VINF_SUCCESS;
    31693172    }
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r13035 r13038  
    246246    pNew->pvR3          = NULL;
    247247    pNew->pavHCChunkHC  = NULL;
    248     pNew->pavHCChunkGC  = 0;
    249248
    250249#ifndef VBOX_WITH_NEW_PHYS_CODE
     
    252251    rc = MMHyperAlloc(pVM, (cb >> PGM_DYNAMIC_CHUNK_SHIFT) * sizeof(void *), 16, MM_TAG_PGM, (void **)&pNew->pavHCChunkHC);
    253252    AssertRCReturn(rc, rc);
    254     pNew->pavHCChunkGC = MMHyperCCToRC(pVM, pNew->pavHCChunkHC);
    255253    pNew->fFlags |= MM_RAM_FLAGS_DYNAMIC_ALLOC;
    256254
     
    491489        pNew->pvR3          = NULL;
    492490        pNew->pavHCChunkHC  = NULL;
    493         pNew->pavHCChunkGC  = 0;
    494491
    495492        uint32_t iPage = cPages;
     
    703700            pNew->RamRange.pvR3 = pvPages;      ///@todo remove this [new phys code]
    704701            pNew->RamRange.pavHCChunkHC = NULL; ///@todo remove this [new phys code]
    705             pNew->RamRange.pavHCChunkGC = 0;    ///@todo remove this [new phys code]
    706702
    707703            uint32_t iPage = cPages;
     
    17771773        pNew->fFlags        = fFlags;
    17781774        pNew->pavHCChunkHC  = NULL;
    1779         pNew->pavHCChunkGC  = 0;
    17801775
    17811776        unsigned iPage = cb >> PAGE_SHIFT;
     
    17951790            rc = MMHyperAlloc(pVM, (cb >> PGM_DYNAMIC_CHUNK_SHIFT) * sizeof(void *), 16, MM_TAG_PGM, (void **)&pNew->pavHCChunkHC);
    17961791            AssertMsgReturn(rc == VINF_SUCCESS, ("MMHyperAlloc(,%#x,,,) -> %Vrc\n", cbRam, cb), rc);
    1797 
    1798             pNew->pavHCChunkGC = MMHyperHC2GC(pVM, pNew->pavHCChunkHC);
    1799             Assert(pNew->pavHCChunkGC);
    18001792
    18011793            /* Physical memory will be allocated on demand. */
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r12932 r13038  
    553553    {
    554554        pVM->pgm.s.apGstPaePDsHC[i]    = 0;
    555         pVM->pgm.s.apGstPaePDsGC[i]    = 0;       
     555        pVM->pgm.s.apGstPaePDsGC[i]    = 0;
    556556        pVM->pgm.s.aGCPhysGstPaePDs[i] = NIL_RTGCPHYS;
    557557    }
     
    798798        if (Pde.n.u1Present)
    799799        {
    800             if (    !Pde.b.u1Size 
     800            if (    !Pde.b.u1Size
    801801# if PGM_GST_TYPE != PGM_TYPE_AMD64
    802802                ||  !(pState->cr4 & X86_CR4_PSE)
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r13035 r13038  
    893893    {
    894894        unsigned iChunk = (off >> PGM_DYNAMIC_CHUNK_SHIFT);
     895#if defined(IN_GC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) /* ASSUMES this is a rare occurence */
     896        PRTR3PTR paChunkR3Ptrs = (PRTR3PTR)MMHyperR3ToCC(pVM, pRam->pavHCChunkHC);
     897        *pHCPtr = paChunkR3Ptrs[iChunk] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK);
     898#else
    895899        *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[iChunk] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
     900#endif
    896901    }
    897902    else if (RT_LIKELY(pRam->pvR3))
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r13037 r13038  
    170170VMMR0DECL(int) PGMR0DynMapGCPage(PVM pVM, RTGCPHYS GCPhys, void **ppv)
    171171{
    172     Assert(!(GCPhys & PAGE_OFFSET));
     172    Assert(!(GCPhys & PAGE_OFFSET_MASK));
    173173    return VERR_NOT_IMPLEMENTED;
    174174}
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