Changeset 18988 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Apr 17, 2009 1:00:59 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EM.cpp
r18939 r18988 1694 1694 uint64_t fFlags = 0; 1695 1695 RTGCPHYS GCPhys = 0; 1696 int rc2 = PGMGstGetPage(pV M, pVCpu, uCR2, &fFlags, &GCPhys);1696 int rc2 = PGMGstGetPage(pVCpu, uCR2, &fFlags, &GCPhys); 1697 1697 Log(("emR3RawGuestTrap: cs:eip=%04x:%08x: trap=%02x err=%08x cr2=%08x cr0=%08x%s: Phys=%RGp fFlags=%08llx %s %s %s%s rc2=%d\n", 1698 1698 pCtx->cs, pCtx->eip, u8TrapNo, uErrorCode, uCR2, (uint32_t)pCtx->cr0, (enmType == TRPM_SOFTWARE_INT) ? " software" : "", GCPhys, fFlags, -
trunk/src/VBox/VMM/PATM/CSAM.cpp
r18927 r18988 1167 1167 if (PAGE_ADDRESS(pCurInstrGC) != PAGE_ADDRESS(pCurInstrGC + opsize - 1)) 1168 1168 { 1169 if (!PGMGstIsPagePresent(pV M, pVCpu, pCurInstrGC + opsize - 1))1169 if (!PGMGstIsPagePresent(pVCpu, pCurInstrGC + opsize - 1)) 1170 1170 { 1171 1171 /// @todo fault in the page … … 1230 1230 if (PAGE_ADDRESS(addr) != PAGE_ADDRESS(pCurInstrGC )) 1231 1231 { 1232 if (!PGMGstIsPagePresent(pV M, pVCpu, addr))1232 if (!PGMGstIsPagePresent(pVCpu, addr)) 1233 1233 { 1234 1234 Log(("Page for current instruction %RRv is not present!!\n", addr)); … … 1298 1298 addr = *(RTRCPTR *)(pJumpTableHC + cpu.param1.scale * i); 1299 1299 1300 rc2 = PGMGstGetPage(pV M, pVCpu, addr, &fFlags, NULL);1300 rc2 = PGMGstGetPage(pVCpu, addr, &fFlags, NULL); 1301 1301 if ( rc2 != VINF_SUCCESS 1302 1302 || (fFlags & X86_PTE_US) … … 1446 1446 } 1447 1447 1448 rc = PGMGstGetPage(pV M, pVCpu, addr, &fFlags, &GCPhys);1448 rc = PGMGstGetPage(pVCpu, addr, &fFlags, &GCPhys); 1449 1449 /* Returned at a very early stage (no paging yet presumably). */ 1450 1450 if (rc == VERR_NOT_SUPPORTED) … … 1492 1492 pPageRec->page.GCPhys = 0; 1493 1493 pPageRec->page.fFlags = 0; 1494 rc = PGMGstGetPage(pV M, pVCpu, addr, &pPageRec->page.fFlags, &pPageRec->page.GCPhys);1494 rc = PGMGstGetPage(pVCpu, addr, &pPageRec->page.fFlags, &pPageRec->page.GCPhys); 1495 1495 if (rc == VINF_SUCCESS) 1496 1496 pPageRec->page.u64Hash = csamR3CalcPageHash(pVM, addr); … … 1639 1639 pPage->page.fMonitorActive = false; 1640 1640 pPage->page.pBitmap = (uint8_t *)MMR3HeapAllocZ(pVM, MM_TAG_CSAM_PATCH, PAGE_SIZE/sizeof(uint8_t)); 1641 rc = PGMGstGetPage(pV M, pVCpu, GCPtr, &pPage->page.fFlags, &pPage->page.GCPhys);1641 rc = PGMGstGetPage(pVCpu, GCPtr, &pPage->page.fFlags, &pPage->page.GCPhys); 1642 1642 AssertMsg(RT_SUCCESS(rc) || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT, ("rc = %Rrc\n", rc)); 1643 1643 … … 1670 1670 AssertRC(rc); 1671 1671 1672 rc = PGMShwModifyPage(pV M, pVCpu, GCPtr, 1, 0, ~(uint64_t)X86_PTE_RW);1672 rc = PGMShwModifyPage(pVCpu, GCPtr, 1, 0, ~(uint64_t)X86_PTE_RW); 1673 1673 Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT); 1674 1674 … … 1743 1743 uint64_t fFlags; 1744 1744 1745 rc = PGMGstGetPage(pV M, pVCpu, pPageAddrGC, &fFlags, NULL);1745 rc = PGMGstGetPage(pVCpu, pPageAddrGC, &fFlags, NULL); 1746 1746 AssertMsg(RT_SUCCESS(rc) || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT, ("rc = %Rrc\n", rc)); 1747 1747 if ( rc == VINF_SUCCESS … … 1782 1782 AssertRC(rc); 1783 1783 1784 rc = PGMShwModifyPage(pV M, pVCpu, pPageAddrGC, 1, 0, ~(uint64_t)X86_PTE_RW);1784 rc = PGMShwModifyPage(pVCpu, pPageAddrGC, 1, 0, ~(uint64_t)X86_PTE_RW); 1785 1785 Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT); 1786 1786 … … 1804 1804 1805 1805 /* Make sure it's readonly. Page invalidation may have modified the attributes. */ 1806 rc = PGMShwModifyPage(pV M, pVCpu, pPageAddrGC, 1, 0, ~(uint64_t)X86_PTE_RW);1806 rc = PGMShwModifyPage(pVCpu, pPageAddrGC, 1, 0, ~(uint64_t)X86_PTE_RW); 1807 1807 Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT); 1808 1808 } … … 1813 1813 uint64_t fPageShw; 1814 1814 RTHCPHYS GCPhys; 1815 rc = PGMShwGetPage(pV M, pVCpu, pPageAddrGC, &fPageShw, &GCPhys);1815 rc = PGMShwGetPage(pVCpu, pPageAddrGC, &fPageShw, &GCPhys); 1816 1816 // AssertMsg( (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT) 1817 1817 // || !(fPageShw & X86_PTE_RW) … … 1826 1826 AssertRC(rc); 1827 1827 /* The page was changed behind our back. It won't be made read-only until the next SyncCR3, so force it here. */ 1828 rc = PGMShwModifyPage(pV M, pVCpu, pPageAddrGC, 1, 0, ~(uint64_t)X86_PTE_RW);1828 rc = PGMShwModifyPage(pVCpu, pPageAddrGC, 1, 0, ~(uint64_t)X86_PTE_RW); 1829 1829 Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT); 1830 1830 } … … 2206 2206 2207 2207 /* Enable write protection again. (use the fault address as it might be an alias) */ 2208 rc = PGMShwModifyPage(pV M, pVCpu, pVM->csam.s.pvDirtyFaultPage[i], 1, 0, ~(uint64_t)X86_PTE_RW);2208 rc = PGMShwModifyPage(pVCpu, pVM->csam.s.pvDirtyFaultPage[i], 1, 0, ~(uint64_t)X86_PTE_RW); 2209 2209 Assert(rc == VINF_SUCCESS || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT); 2210 2210 … … 2216 2216 uint64_t fFlags; 2217 2217 2218 rc = PGMGstGetPage(pV M, pVCpu, GCPtr, &fFlags, NULL);2218 rc = PGMGstGetPage(pVCpu, GCPtr, &fFlags, NULL); 2219 2219 AssertMsg(RT_SUCCESS(rc) || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT, ("rc = %Rrc\n", rc)); 2220 2220 if ( rc == VINF_SUCCESS … … 2250 2250 2251 2251 Log(("csamR3FlushCodePages: %RRv\n", GCPtr)); 2252 PGMShwSetPage(pV M, pVCpu, GCPtr, 1, 0);2252 PGMShwSetPage(pVCpu, GCPtr, 1, 0); 2253 2253 /* Resync the page to make sure instruction fetch will fault */ 2254 2254 CSAMMarkPage(pVM, GCPtr, false); -
trunk/src/VBox/VMM/PATM/PATM.cpp
r18927 r18988 4108 4108 4109 4109 RTGCPHYS GCPhys; 4110 rc = PGMGstGetPage(pV M, pVCpu, pInstrGC, NULL, &GCPhys);4110 rc = PGMGstGetPage(pVCpu, pInstrGC, NULL, &GCPhys); 4111 4111 if (rc != VINF_SUCCESS) 4112 4112 { … … 6078 6078 if (Cpu.pCurInstr->opcode == OP_PUSH) 6079 6079 { 6080 rc = PGMShwGetPage(pV M, pVCpu, pCtx->esp, &fFlags, NULL);6080 rc = PGMShwGetPage(pVCpu, pCtx->esp, &fFlags, NULL); 6081 6081 if ( rc == VINF_SUCCESS 6082 6082 && ((fFlags & (X86_PTE_P|X86_PTE_RW)) == (X86_PTE_P|X86_PTE_RW)) ) … … 6099 6099 6100 6100 /* Typical pushf (most patches)/push (call patch) trap because of a monitored page. */ 6101 rc = PGMShwModifyPage(pV M, pVCpu, pCtx->esp, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW);6101 rc = PGMShwModifyPage(pVCpu, pCtx->esp, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW); 6102 6102 AssertMsgRC(rc, ("PGMShwModifyPage -> rc=%Rrc\n", rc)); 6103 6103 if (rc == VINF_SUCCESS) … … 6105 6105 6106 6106 /* The guest page *must* be present. */ 6107 rc = PGMGstGetPage(pV M, pVCpu, pCtx->esp, &fFlags, NULL);6107 rc = PGMGstGetPage(pVCpu, pCtx->esp, &fFlags, NULL); 6108 6108 if (rc == VINF_SUCCESS && (fFlags & X86_PTE_P)) 6109 6109 { -
trunk/src/VBox/VMM/PATM/VMMGC/CSAMGC.cpp
r18927 r18988 88 88 * Make this particular page R/W. 89 89 */ 90 int rc = PGMShwModifyPage(pV M, pVCpu, pvFault, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW);90 int rc = PGMShwModifyPage(pVCpu, pvFault, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW); 91 91 AssertMsgRC(rc, ("PGMShwModifyPage -> rc=%Rrc\n", rc)); 92 92 ASMInvalidatePage((void *)pvFault); … … 129 129 */ 130 130 Log(("CSAMGCCodePageWriteHandler: enabled r/w for page %RGv\n", pvFault)); 131 rc = PGMShwModifyPage(pV M, pVCpu, pvFault, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW);131 rc = PGMShwModifyPage(pVCpu, pvFault, 1, X86_PTE_RW, ~(uint64_t)X86_PTE_RW); 132 132 AssertMsgRC(rc, ("PGMShwModifyPage -> rc=%Rrc\n", rc)); 133 133 ASMInvalidatePage((void *)pvFault); -
trunk/src/VBox/VMM/PGM.cpp
r18984 r18988 1986 1986 pgmR3ModeDataSwitch(pVM, pVCpu, pVCpu->pgm.s.enmShadowMode, pVCpu->pgm.s.enmGuestMode); 1987 1987 1988 PGM_SHW_PFN(Relocate, pV M)(pVM,pVCpu, offDelta);1989 PGM_GST_PFN(Relocate, pV M)(pVM,pVCpu, offDelta);1990 PGM_BTH_PFN(Relocate, pV M)(pVM, pVCpu, offDelta);1988 PGM_SHW_PFN(Relocate, pVCpu)(pVCpu, offDelta); 1989 PGM_GST_PFN(Relocate, pVCpu)(pVCpu, offDelta); 1990 PGM_BTH_PFN(Relocate, pVCpu)(pVM, pVCpu, offDelta); 1991 1991 } 1992 1992 … … 2147 2147 PVMCPU pVCpu = &pVM->aCpus[i]; 2148 2148 2149 rc = PGM_GST_PFN(Exit, pV M)(pVM,pVCpu);2149 rc = PGM_GST_PFN(Exit, pVCpu)(pVCpu); 2150 2150 AssertRC(rc); 2151 2151 } … … 3814 3814 { 3815 3815 LogFlow(("PGMR3ChangeMode: Shadow mode: %s -> %s\n", PGMGetModeName(pVCpu->pgm.s.enmShadowMode), PGMGetModeName(enmShadowMode))); 3816 if (PGM_SHW_PFN(Exit, pV M))3816 if (PGM_SHW_PFN(Exit, pVCpu)) 3817 3817 { 3818 int rc = PGM_SHW_PFN(Exit, pV M)(pVM,pVCpu);3818 int rc = PGM_SHW_PFN(Exit, pVCpu)(pVCpu); 3819 3819 if (RT_FAILURE(rc)) 3820 3820 { … … 3829 3829 3830 3830 /* guest */ 3831 if (PGM_GST_PFN(Exit, pV M))3832 { 3833 int rc = PGM_GST_PFN(Exit, pV M)(pVM,pVCpu);3831 if (PGM_GST_PFN(Exit, pVCpu)) 3832 { 3833 int rc = PGM_GST_PFN(Exit, pVCpu)(pVCpu); 3834 3834 if (RT_FAILURE(rc)) 3835 3835 { … … 3854 3854 { 3855 3855 case PGMMODE_32_BIT: 3856 rc = PGM_SHW_NAME_32BIT(Enter)(pV M, pVCpu);3856 rc = PGM_SHW_NAME_32BIT(Enter)(pVCpu); 3857 3857 break; 3858 3858 case PGMMODE_PAE: 3859 3859 case PGMMODE_PAE_NX: 3860 rc = PGM_SHW_NAME_PAE(Enter)(pV M, pVCpu);3860 rc = PGM_SHW_NAME_PAE(Enter)(pVCpu); 3861 3861 break; 3862 3862 case PGMMODE_AMD64: 3863 3863 case PGMMODE_AMD64_NX: 3864 rc = PGM_SHW_NAME_AMD64(Enter)(pV M, pVCpu);3864 rc = PGM_SHW_NAME_AMD64(Enter)(pVCpu); 3865 3865 break; 3866 3866 case PGMMODE_NESTED: 3867 rc = PGM_SHW_NAME_NESTED(Enter)(pV M, pVCpu);3867 rc = PGM_SHW_NAME_NESTED(Enter)(pVCpu); 3868 3868 break; 3869 3869 case PGMMODE_EPT: 3870 rc = PGM_SHW_NAME_EPT(Enter)(pV M, pVCpu);3870 rc = PGM_SHW_NAME_EPT(Enter)(pVCpu); 3871 3871 break; 3872 3872 case PGMMODE_REAL: … … 3899 3899 { 3900 3900 case PGMMODE_REAL: 3901 rc = PGM_GST_NAME_REAL(Enter)(pV M, pVCpu, NIL_RTGCPHYS);3901 rc = PGM_GST_NAME_REAL(Enter)(pVCpu, NIL_RTGCPHYS); 3902 3902 switch (pVCpu->pgm.s.enmShadowMode) 3903 3903 { … … 3923 3923 3924 3924 case PGMMODE_PROTECTED: 3925 rc = PGM_GST_NAME_PROT(Enter)(pV M, pVCpu, NIL_RTGCPHYS);3925 rc = PGM_GST_NAME_PROT(Enter)(pVCpu, NIL_RTGCPHYS); 3926 3926 switch (pVCpu->pgm.s.enmShadowMode) 3927 3927 { … … 3948 3948 case PGMMODE_32_BIT: 3949 3949 GCPhysCR3 = CPUMGetGuestCR3(pVCpu) & X86_CR3_PAGE_MASK; 3950 rc = PGM_GST_NAME_32BIT(Enter)(pV M, pVCpu, GCPhysCR3);3950 rc = PGM_GST_NAME_32BIT(Enter)(pVCpu, GCPhysCR3); 3951 3951 switch (pVCpu->pgm.s.enmShadowMode) 3952 3952 { … … 3982 3982 3983 3983 GCPhysCR3 = CPUMGetGuestCR3(pVCpu) & X86_CR3_PAE_PAGE_MASK; 3984 rc = PGM_GST_NAME_PAE(Enter)(pV M, pVCpu, GCPhysCR3);3984 rc = PGM_GST_NAME_PAE(Enter)(pVCpu, GCPhysCR3); 3985 3985 switch (pVCpu->pgm.s.enmShadowMode) 3986 3986 { … … 4008 4008 case PGMMODE_AMD64: 4009 4009 GCPhysCR3 = CPUMGetGuestCR3(pVCpu) & UINT64_C(0xfffffffffffff000); /** @todo define this mask! */ 4010 rc = PGM_GST_NAME_AMD64(Enter)(pV M, pVCpu, GCPhysCR3);4010 rc = PGM_GST_NAME_AMD64(Enter)(pVCpu, GCPhysCR3); 4011 4011 switch (pVCpu->pgm.s.enmShadowMode) 4012 4012 { … … 4497 4497 4498 4498 /** @todo SMP support!! */ 4499 PGMShwGetPage( pVM,&pVM->aCpus[0], (RTGCPTR)(u32Address + (i << X86_PT_SHIFT)), &fPageShw, &pPhysHC);4499 PGMShwGetPage(&pVM->aCpus[0], (RTGCPTR)(u32Address + (i << X86_PT_SHIFT)), &fPageShw, &pPhysHC); 4500 4500 Log(("Found %RGp at %RGv -> flags=%llx\n", PhysSearch, (RTGCPTR)(u32Address + (i << X86_PT_SHIFT)), fPageShw)); 4501 4501 } -
trunk/src/VBox/VMM/PGMGst.h
r18927 r18988 27 27 /* r3 */ 28 28 PGM_GST_DECL(int, InitData)(PVM pVM, PPGMMODEDATA pModeData, bool fResolveGCAndR0); 29 PGM_GST_DECL(int, Enter)(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhysCR3);30 PGM_GST_DECL(int, Relocate)(PVM pVM, PVMCPU pVCpu, RTGCPTR offDelta);31 PGM_GST_DECL(int, Exit)(PVM pVM, PVMCPU pVCpu);29 PGM_GST_DECL(int, Enter)(PVMCPU pVCpu, RTGCPHYS GCPhysCR3); 30 PGM_GST_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta); 31 PGM_GST_DECL(int, Exit)(PVMCPU pVCpu); 32 32 33 33 /* all */ 34 PGM_GST_DECL(int, GetPage)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys);35 PGM_GST_DECL(int, ModifyPage)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask);36 PGM_GST_DECL(int, GetPDE)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPDE);34 PGM_GST_DECL(int, GetPage)(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys); 35 PGM_GST_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask); 36 PGM_GST_DECL(int, GetPDE)(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPDE); 37 37 __END_DECLS 38 38 … … 89 89 * 90 90 * @returns VBox status code. 91 * @param pVM VM handle.92 91 * @param pVCpu The VMCPU to operate on. 93 92 * @param GCPhysCR3 The physical address from the CR3 register. 94 93 */ 95 PGM_GST_DECL(int, Enter)(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhysCR3)94 PGM_GST_DECL(int, Enter)(PVMCPU pVCpu, RTGCPHYS GCPhysCR3) 96 95 { 97 96 /* 98 97 * Map and monitor CR3 99 98 */ 100 int rc = PGM_BTH_PFN(MapCR3, pV M)(pVM, pVCpu, GCPhysCR3);99 int rc = PGM_BTH_PFN(MapCR3, pVCpu)(pVCpu->pVMR3, pVCpu, GCPhysCR3); 101 100 return rc; 102 101 } … … 107 106 * 108 107 * @returns VBox status code. 109 * @param pVM The VM handle.110 108 * @param pVCpu The VMCPU to operate on. 111 109 * @param offDelta The reloation offset. 112 110 */ 113 PGM_GST_DECL(int, Relocate)(PVM pVM, PVMCPU pVCpu, RTGCPTR offDelta)111 PGM_GST_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta) 114 112 { 115 113 pVCpu->pgm.s.pGst32BitPdRC += offDelta; … … 129 127 * 130 128 * @returns VBox status code. 131 * @param pVM VM handle.132 129 * @param pVCpu The VMCPU to operate on. 133 130 */ 134 PGM_GST_DECL(int, Exit)(PVM pVM, PVMCPU pVCpu)131 PGM_GST_DECL(int, Exit)(PVMCPU pVCpu) 135 132 { 136 133 int rc; 137 134 138 rc = PGM_BTH_PFN(UnmapCR3, pV M)(pVM, pVCpu);135 rc = PGM_BTH_PFN(UnmapCR3, pVCpu)(pVCpu->pVMR3, pVCpu); 139 136 return rc; 140 137 } -
trunk/src/VBox/VMM/PGMInternal.h
r18986 r18988 1983 1983 #define PGM_GST_NAME_RC_AMD64_STR(name) "pgmRCGstAMD64" #name 1984 1984 #define PGM_GST_NAME_R0_AMD64_STR(name) "pgmR0GstAMD64" #name 1985 #define PGM_GST_PFN(name, pV M)((pVCpu)->pgm.s.PGM_CTX(pfn,Gst##name))1985 #define PGM_GST_PFN(name, pVCpu) ((pVCpu)->pgm.s.PGM_CTX(pfn,Gst##name)) 1986 1986 #define PGM_GST_DECL(type, name) PGM_CTX_DECL(type) PGM_GST_NAME(name) 1987 1987 … … 2002 2002 #define PGM_SHW_NAME_R0_EPT_STR(name) "pgmR0ShwEPT" #name 2003 2003 #define PGM_SHW_DECL(type, name) PGM_CTX_DECL(type) PGM_SHW_NAME(name) 2004 #define PGM_SHW_PFN(name, pV M)((pVCpu)->pgm.s.PGM_CTX(pfn,Shw##name))2004 #define PGM_SHW_PFN(name, pVCpu) ((pVCpu)->pgm.s.PGM_CTX(pfn,Shw##name)) 2005 2005 2006 2006 /* Shw_Gst */ … … 2064 2064 2065 2065 #define PGM_BTH_DECL(type, name) PGM_CTX_DECL(type) PGM_BTH_NAME(name) 2066 #define PGM_BTH_PFN(name, pV M)((pVCpu)->pgm.s.PGM_CTX(pfn,Bth##name))2066 #define PGM_BTH_PFN(name, pVCpu) ((pVCpu)->pgm.s.PGM_CTX(pfn,Bth##name)) 2067 2067 /** @} */ 2068 2068 … … 2080 2080 * @{ 2081 2081 */ 2082 DECLR3CALLBACKMEMBER(int, pfnR3ShwRelocate,(PVM pVM, PVMCPU pVCpu, RTGCPTR offDelta));2083 DECLR3CALLBACKMEMBER(int, pfnR3ShwExit,(PVM pVM, PVMCPU pVCpu));2084 DECLR3CALLBACKMEMBER(int, pfnR3ShwGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));2085 DECLR3CALLBACKMEMBER(int, pfnR3ShwModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2086 2087 DECLRCCALLBACKMEMBER(int, pfnRCShwGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));2088 DECLRCCALLBACKMEMBER(int, pfnRCShwModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2089 2090 DECLR0CALLBACKMEMBER(int, pfnR0ShwGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));2091 DECLR0CALLBACKMEMBER(int, pfnR0ShwModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2082 DECLR3CALLBACKMEMBER(int, pfnR3ShwRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 2083 DECLR3CALLBACKMEMBER(int, pfnR3ShwExit,(PVMCPU pVCpu)); 2084 DECLR3CALLBACKMEMBER(int, pfnR3ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 2085 DECLR3CALLBACKMEMBER(int, pfnR3ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2086 2087 DECLRCCALLBACKMEMBER(int, pfnRCShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 2088 DECLRCCALLBACKMEMBER(int, pfnRCShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2089 2090 DECLR0CALLBACKMEMBER(int, pfnR0ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 2091 DECLR0CALLBACKMEMBER(int, pfnR0ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2092 2092 /** @} */ 2093 2093 … … 2095 2095 * @{ 2096 2096 */ 2097 DECLR3CALLBACKMEMBER(int, pfnR3GstRelocate,(PVM pVM, PVMCPU pVCpu, RTGCPTR offDelta));2098 DECLR3CALLBACKMEMBER(int, pfnR3GstExit,(PVM pVM, PVMCPU pVCpu));2099 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));2100 DECLR3CALLBACKMEMBER(int, pfnR3GstModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2101 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPDE,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde));2102 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));2103 DECLRCCALLBACKMEMBER(int, pfnRCGstModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2104 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPDE,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde));2105 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));2106 DECLR0CALLBACKMEMBER(int, pfnR0GstModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2107 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPDE,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde));2097 DECLR3CALLBACKMEMBER(int, pfnR3GstRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 2098 DECLR3CALLBACKMEMBER(int, pfnR3GstExit,(PVMCPU pVCpu)); 2099 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 2100 DECLR3CALLBACKMEMBER(int, pfnR3GstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2101 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 2102 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 2103 DECLRCCALLBACKMEMBER(int, pfnRCGstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2104 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 2105 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 2106 DECLR0CALLBACKMEMBER(int, pfnR0GstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2107 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 2108 2108 /** @} */ 2109 2109 … … 2590 2590 * @{ 2591 2591 */ 2592 DECLR3CALLBACKMEMBER(int, pfnR3ShwRelocate,(PVM pVM, PVMCPU pVCpu, RTGCPTR offDelta));2593 DECLR3CALLBACKMEMBER(int, pfnR3ShwExit,(PVM pVM, PVMCPU pVCpu));2594 DECLR3CALLBACKMEMBER(int, pfnR3ShwGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));2595 DECLR3CALLBACKMEMBER(int, pfnR3ShwModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2596 2597 DECLRCCALLBACKMEMBER(int, pfnRCShwGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));2598 DECLRCCALLBACKMEMBER(int, pfnRCShwModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2599 2600 DECLR0CALLBACKMEMBER(int, pfnR0ShwGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys));2601 DECLR0CALLBACKMEMBER(int, pfnR0ShwModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2592 DECLR3CALLBACKMEMBER(int, pfnR3ShwRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 2593 DECLR3CALLBACKMEMBER(int, pfnR3ShwExit,(PVMCPU pVCpu)); 2594 DECLR3CALLBACKMEMBER(int, pfnR3ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 2595 DECLR3CALLBACKMEMBER(int, pfnR3ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2596 2597 DECLRCCALLBACKMEMBER(int, pfnRCShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 2598 DECLRCCALLBACKMEMBER(int, pfnRCShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2599 2600 DECLR0CALLBACKMEMBER(int, pfnR0ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 2601 DECLR0CALLBACKMEMBER(int, pfnR0ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2602 2602 2603 2603 /** @} */ … … 2606 2606 * @{ 2607 2607 */ 2608 DECLR3CALLBACKMEMBER(int, pfnR3GstRelocate,(PVM pVM, PVMCPU pVCpu, RTGCPTR offDelta));2609 DECLR3CALLBACKMEMBER(int, pfnR3GstExit,(PVM pVM, PVMCPU pVCpu));2610 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));2611 DECLR3CALLBACKMEMBER(int, pfnR3GstModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2612 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPDE,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde));2613 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));2614 DECLRCCALLBACKMEMBER(int, pfnRCGstModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2615 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPDE,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde));2608 DECLR3CALLBACKMEMBER(int, pfnR3GstRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 2609 DECLR3CALLBACKMEMBER(int, pfnR3GstExit,(PVMCPU pVCpu)); 2610 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 2611 DECLR3CALLBACKMEMBER(int, pfnR3GstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2612 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 2613 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 2614 DECLRCCALLBACKMEMBER(int, pfnRCGstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2615 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 2616 2616 #if HC_ARCH_BITS == 64 2617 2617 RTRCPTR alignment3; /**< structure size alignment. */ 2618 2618 #endif 2619 2619 2620 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys));2621 DECLR0CALLBACKMEMBER(int, pfnR0GstModifyPage,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask));2622 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPDE,(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde));2620 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 2621 DECLR0CALLBACKMEMBER(int, pfnR0GstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 2622 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 2623 2623 /** @} */ 2624 2624 -
trunk/src/VBox/VMM/PGMShw.h
r18927 r18988 121 121 /* r3 */ 122 122 PGM_SHW_DECL(int, InitData)(PVM pVM, PPGMMODEDATA pModeData, bool fResolveGCAndR0); 123 PGM_SHW_DECL(int, Enter)(PVM pVM, PVMCPU pVCpu);124 PGM_SHW_DECL(int, Relocate)(PVM pVM, PVMCPU pVCpu, RTGCPTR offDelta);125 PGM_SHW_DECL(int, Exit)(PVM pVM, PVMCPU pVCpu);123 PGM_SHW_DECL(int, Enter)(PVMCPU pVCpu); 124 PGM_SHW_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta); 125 PGM_SHW_DECL(int, Exit)(PVMCPU pVCpu); 126 126 127 127 /* all */ 128 PGM_SHW_DECL(int, GetPage)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys);129 PGM_SHW_DECL(int, ModifyPage)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask);128 PGM_SHW_DECL(int, GetPage)(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys); 129 PGM_SHW_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask); 130 130 __END_DECLS 131 131 … … 175 175 * 176 176 * @returns VBox status code. 177 * @param pVM VM handle.178 177 * @param pVCpu The VMCPU to operate on. 179 178 */ 180 PGM_SHW_DECL(int, Enter)(PVM pVM, PVMCPU pVCpu)179 PGM_SHW_DECL(int, Enter)(PVMCPU pVCpu) 181 180 { 182 181 #if PGM_SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT 183 182 RTGCPHYS GCPhysCR3 = RT_BIT_64(63); 184 183 PPGMPOOLPAGE pNewShwPageCR3; 184 PVM pVM = pVCpu->pVMR3; 185 185 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 186 186 … … 211 211 * 212 212 * @returns VBox status code. 213 * @param pVM The VM handle.214 213 * @param pVCpu The VMCPU to operate on. 215 214 * @param offDelta The reloation offset. 216 215 */ 217 PGM_SHW_DECL(int, Relocate)(PVM pVM, PVMCPU pVCpu, RTGCPTR offDelta)216 PGM_SHW_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta) 218 217 { 219 218 pVCpu->pgm.s.pShwPageCR3RC += offDelta; … … 226 225 * 227 226 * @returns VBox status code. 228 * @param pVM VM handle.229 227 * @param pVCpu The VMCPU to operate on. 230 228 */ 231 PGM_SHW_DECL(int, Exit)(PVM pVM, PVMCPU pVCpu)229 PGM_SHW_DECL(int, Exit)(PVMCPU pVCpu) 232 230 { 233 231 #if PGM_SHW_TYPE == PGM_TYPE_NESTED || PGM_SHW_TYPE == PGM_TYPE_EPT 234 232 if (pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)) 235 233 { 234 PVM pVM = pVCpu->pVMR3; 236 235 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 237 236 -
trunk/src/VBox/VMM/SELM.cpp
r18927 r18988 1559 1559 { 1560 1560 RTGCPHYS GCPhys = NIL_RTGCPHYS; 1561 rc = PGMGstGetPage(pV M, pVCpu, GCPtrTss, NULL, &GCPhys); AssertRC(rc);1561 rc = PGMGstGetPage(pVCpu, GCPtrTss, NULL, &GCPhys); AssertRC(rc); 1562 1562 Log(("SELMR3SyncTSS: Updating TSS ring 0 stack to %04X:%08X from %04X:%08X; TSS Phys=%VGp)\n", 1563 1563 Tss.ss0, Tss.esp0, (ssr0 & ~1), espr0, GCPhys)); … … 1893 1893 { 1894 1894 RTGCPHYS GCPhys; 1895 rc = PGMGstGetPage(pV M, pVCpu, GCPtrTss, NULL, &GCPhys); AssertRC(rc);1895 rc = PGMGstGetPage(pVCpu, GCPtrTss, NULL, &GCPhys); AssertRC(rc); 1896 1896 AssertMsgFailed(("TSS out of sync!! (%04X:%08X vs %04X:%08X (guest)) Tss=%RGv Phys=%RGp\n", 1897 1897 (pVM->selm.s.Tss.ss1 & ~1), pVM->selm.s.Tss.esp1, -
trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
r18927 r18988 456 456 PIOMMMIORANGE pMMIODst; 457 457 RTGCPHYS PhysDst; 458 rc = PGMGstGetPage( pVM,(RTGCPTR)pu8Virt, NULL, &PhysDst);458 rc = PGMGstGetPage((RTGCPTR)pu8Virt, NULL, &PhysDst); 459 459 PhysDst |= (RTGCUINTPTR)pu8Virt & PAGE_OFFSET_MASK; 460 460 if ( RT_SUCCESS(rc) … … 1876 1876 uint64_t fFlags; 1877 1877 RTHCPHYS HCPhys; 1878 rc = PGMShwGetPage(pV M, pVCpu, (RTGCPTR)GCPhys, &fFlags, &HCPhys);1878 rc = PGMShwGetPage(pVCpu, (RTGCPTR)GCPhys, &fFlags, &HCPhys); 1879 1879 Assert(rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT); 1880 1880 cb -= PAGE_SIZE; -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r18958 r18988 451 451 * Call the worker. 452 452 */ 453 int rc = PGM_BTH_PFN(Trap0eHandler, pV M)(pVM, pVCpu, uErr, pRegFrame, pvFault);453 int rc = PGM_BTH_PFN(Trap0eHandler, pVCpu)(pVM, pVCpu, uErr, pRegFrame, pvFault); 454 454 if (rc == VINF_PGM_SYNCPAGE_MODIFIED_PDE) 455 455 rc = VINF_SUCCESS; … … 479 479 { 480 480 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_MID_Z(Stat,Prefetch), a); 481 int rc = PGM_BTH_PFN(PrefetchPage, pV M)(pVM, pVCpu, GCPtrPage);481 int rc = PGM_BTH_PFN(PrefetchPage, pVCpu)(pVM, pVCpu, GCPtrPage); 482 482 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_MID_Z(Stat,Prefetch), a); 483 483 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || RT_FAILURE(rc), ("rc=%Rrc\n", rc)); … … 535 535 536 536 uint64_t fPage; 537 int rc = PGMGstGetPage(pV M, pVCpu, (RTGCPTR)Addr, &fPage, NULL);537 int rc = PGMGstGetPage(pVCpu, (RTGCPTR)Addr, &fPage, NULL); 538 538 if (RT_FAILURE(rc)) 539 539 { … … 584 584 */ 585 585 uint64_t fPageGst; 586 int rc = PGMGstGetPage(pV M, pVCpu, (RTGCPTR)Addr, &fPageGst, NULL);586 int rc = PGMGstGetPage(pVCpu, (RTGCPTR)Addr, &fPageGst, NULL); 587 587 if (RT_FAILURE(rc)) 588 588 { … … 612 612 * Next step is to verify if we protected this page for dirty bit tracking or for CSAM scanning 613 613 */ 614 rc = PGMShwGetPage(pV M, pVCpu, (RTGCPTR)Addr, NULL, NULL);614 rc = PGMShwGetPage(pVCpu, (RTGCPTR)Addr, NULL, NULL); 615 615 if ( rc == VERR_PAGE_NOT_PRESENT 616 616 || rc == VERR_PAGE_TABLE_NOT_PRESENT) … … 622 622 Assert(X86_TRAP_PF_RW == X86_PTE_RW && X86_TRAP_PF_US == X86_PTE_US); 623 623 uint32_t uErr = fAccess & (X86_TRAP_PF_RW | X86_TRAP_PF_US); 624 rc = PGM_BTH_PFN(VerifyAccessSyncPage, pV M)(pVM, pVCpu, Addr, fPageGst, uErr);624 rc = PGM_BTH_PFN(VerifyAccessSyncPage, pVCpu)(pVM, pVCpu, Addr, fPageGst, uErr); 625 625 if (rc != VINF_SUCCESS) 626 626 return rc; … … 636 636 /** @note this will assert when writing to monitored pages (a bit annoying actually) */ 637 637 uint64_t fPageShw; 638 rc = PGMShwGetPage(pV M, pVCpu, (RTGCPTR)Addr, &fPageShw, NULL);638 rc = PGMShwGetPage(pVCpu, (RTGCPTR)Addr, &fPageShw, NULL); 639 639 if ( (rc == VERR_PAGE_NOT_PRESENT || RT_FAILURE(rc)) 640 640 || (fWrite && !(fPageShw & X86_PTE_RW)) … … 710 710 { 711 711 if ( pgmGetMapping(pVM, GCPtrPage) 712 && PGMGstGetPage(pV M, pVCpu, GCPtrPage, NULL, NULL) != VERR_PAGE_TABLE_NOT_PRESENT)712 && PGMGstGetPage(pVCpu, GCPtrPage, NULL, NULL) != VERR_PAGE_TABLE_NOT_PRESENT) 713 713 { 714 714 LogFlow(("PGMGCInvalidatePage: Conflict!\n")); … … 731 731 */ 732 732 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePage), a); 733 rc = PGM_BTH_PFN(InvalidatePage, pV M)(pVM, pVCpu, GCPtrPage);733 rc = PGM_BTH_PFN(InvalidatePage, pVCpu)(pVM, pVCpu, GCPtrPage); 734 734 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePage), a); 735 735 … … 782 782 * 783 783 * @returns VBox status. 784 * @param pVM VM Handle.785 784 * @param pVCpu VMCPU handle. 786 785 * @param GCPtr Guest Context virtual address of the page. … … 790 789 * @remark You should use PGMMapGetPage() for pages in a mapping. 791 790 */ 792 VMMDECL(int) PGMShwGetPage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)793 { 794 return PGM_SHW_PFN(GetPage, pVM)(pVM,pVCpu, GCPtr, pfFlags, pHCPhys);791 VMMDECL(int) PGMShwGetPage(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys) 792 { 793 return PGM_SHW_PFN(GetPage, pVCpu)(pVCpu, GCPtr, pfFlags, pHCPhys); 795 794 } 796 795 … … 800 799 * 801 800 * @returns VBox status. 802 * @param pVM VM handle.803 801 * @param pVCpu VMCPU handle. 804 802 * @param GCPtr The address of the first page. … … 807 805 * @remark You must use PGMMapSetPage() for pages in a mapping. 808 806 */ 809 VMMDECL(int) PGMShwSetPage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags)810 { 811 return PGMShwModifyPage(pV M, pVCpu, GCPtr, cb, fFlags, 0);807 VMMDECL(int) PGMShwSetPage(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags) 808 { 809 return PGMShwModifyPage(pVCpu, GCPtr, cb, fFlags, 0); 812 810 } 813 811 … … 819 817 * 820 818 * @returns VBox status code. 821 * @param pVM VM handle.822 819 * @param pVCpu VMCPU handle. 823 820 * @param GCPtr Virtual address of the first page in the range. … … 828 825 * @remark You must use PGMMapModifyPage() for pages in a mapping. 829 826 */ 830 VMMDECL(int) PGMShwModifyPage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask)827 VMMDECL(int) PGMShwModifyPage(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask) 831 828 { 832 829 AssertMsg(!(fFlags & X86_PTE_PAE_PG_MASK), ("fFlags=%#llx\n", fFlags)); … … 843 840 * Call worker. 844 841 */ 845 return PGM_SHW_PFN(ModifyPage, pV M)(pVM,pVCpu, GCPtr, cb, fFlags, fMask);842 return PGM_SHW_PFN(ModifyPage, pVCpu)(pVCpu, GCPtr, cb, fFlags, fMask); 846 843 } 847 844 … … 1257 1254 * 1258 1255 * @returns VBox status. 1259 * @param pVM VM Handle.1260 1256 * @param pVCpu VMCPU handle. 1261 1257 * @param GCPtr Guest Context virtual address of the page. … … 1264 1260 * This is page aligned. The fact that the 1265 1261 */ 1266 VMMDECL(int) PGMGstGetPage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)1267 { 1268 return PGM_GST_PFN(GetPage, pVM)(pVM,pVCpu, GCPtr, pfFlags, pGCPhys);1262 VMMDECL(int) PGMGstGetPage(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys) 1263 { 1264 return PGM_GST_PFN(GetPage, pVCpu)(pVCpu, GCPtr, pfFlags, pGCPhys); 1269 1265 } 1270 1266 … … 1275 1271 * @returns true if the page is present. 1276 1272 * @returns false if the page is not present. 1277 * @param pVM The VM handle.1278 1273 * @param pVCpu VMCPU handle. 1279 1274 * @param GCPtr Address within the page. 1280 1275 */ 1281 VMMDECL(bool) PGMGstIsPagePresent(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr)1282 { 1283 int rc = PGMGstGetPage(pV M, pVCpu, GCPtr, NULL, NULL);1276 VMMDECL(bool) PGMGstIsPagePresent(PVMCPU pVCpu, RTGCPTR GCPtr) 1277 { 1278 int rc = PGMGstGetPage(pVCpu, GCPtr, NULL, NULL); 1284 1279 return RT_SUCCESS(rc); 1285 1280 } … … 1290 1285 * 1291 1286 * @returns VBox status. 1292 * @param pVM VM handle.1293 1287 * @param pVCpu VMCPU handle. 1294 1288 * @param GCPtr The address of the first page. … … 1296 1290 * @param fFlags Page flags X86_PTE_*, excluding the page mask of course. 1297 1291 */ 1298 VMMDECL(int) PGMGstSetPage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags)1299 { 1300 return PGMGstModifyPage(pV M, pVCpu, GCPtr, cb, fFlags, 0);1292 VMMDECL(int) PGMGstSetPage(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags) 1293 { 1294 return PGMGstModifyPage(pVCpu, GCPtr, cb, fFlags, 0); 1301 1295 } 1302 1296 … … 1308 1302 * 1309 1303 * @returns VBox status code. 1310 * @param pVM VM handle.1311 1304 * @param pVCpu VMCPU handle. 1312 1305 * @param GCPtr Virtual address of the first page in the range. … … 1316 1309 * Be very CAREFUL when ~'ing constants which could be 32-bit! 1317 1310 */ 1318 VMMDECL(int) PGMGstModifyPage(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask)1311 VMMDECL(int) PGMGstModifyPage(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask) 1319 1312 { 1320 1313 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_MID_Z(Stat,GstModifyPage), a); … … 1338 1331 * Call worker. 1339 1332 */ 1340 int rc = PGM_GST_PFN(ModifyPage, pV M)(pVM,pVCpu, GCPtr, cb, fFlags, fMask);1333 int rc = PGM_GST_PFN(ModifyPage, pVCpu)(pVCpu, GCPtr, cb, fFlags, fMask); 1341 1334 1342 1335 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_MID_Z(Stat,GstModifyPage), a); … … 1687 1680 RTGCPHYS GCPhysOldCR3 = pVCpu->pgm.s.GCPhysCR3; 1688 1681 pVCpu->pgm.s.GCPhysCR3 = GCPhysCR3; 1689 rc = PGM_BTH_PFN(MapCR3, pV M)(pVM, pVCpu, GCPhysCR3);1682 rc = PGM_BTH_PFN(MapCR3, pVCpu)(pVM, pVCpu, GCPhysCR3); 1690 1683 if (RT_LIKELY(rc == VINF_SUCCESS)) 1691 1684 { … … 1780 1773 { 1781 1774 pVCpu->pgm.s.GCPhysCR3 = GCPhysCR3; 1782 rc = PGM_BTH_PFN(MapCR3, pV M)(pVM, pVCpu, GCPhysCR3);1775 rc = PGM_BTH_PFN(MapCR3, pVCpu)(pVM, pVCpu, GCPhysCR3); 1783 1776 AssertRCSuccess(rc); /* Assumes VINF_PGM_SYNC_CR3 doesn't apply to nested paging. */ /** @todo this isn't true for the mac, but we need hw to test/fix this. */ 1784 1777 } … … 1866 1859 { 1867 1860 pVCpu->pgm.s.GCPhysCR3 = GCPhysCR3; 1868 rc = PGM_BTH_PFN(MapCR3, pV M)(pVM, pVCpu, GCPhysCR3);1861 rc = PGM_BTH_PFN(MapCR3, pVCpu)(pVM, pVCpu, GCPhysCR3); 1869 1862 } 1870 1863 #ifdef IN_RING3 … … 1886 1879 */ 1887 1880 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_MID_Z(Stat,SyncCR3), a); 1888 rc = PGM_BTH_PFN(SyncCR3, pV M)(pVM, pVCpu, cr0, cr3, cr4, fGlobal);1881 rc = PGM_BTH_PFN(SyncCR3, pVCpu)(pVM, pVCpu, cr0, cr3, cr4, fGlobal); 1889 1882 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_MID_Z(Stat,SyncCR3), a); 1890 1883 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || RT_FAILURE(rc), ("rc=%Rrc\n", rc)); … … 2514 2507 GCPtr += PAGE_SIZE) 2515 2508 { 2516 int rc = PGMGstGetPage(pV M, pVCpu, (RTGCPTR)GCPtr, NULL, NULL);2509 int rc = PGMGstGetPage(pVCpu, (RTGCPTR)GCPtr, NULL, NULL); 2517 2510 if (rc != VERR_PAGE_TABLE_NOT_PRESENT) 2518 2511 { … … 2544 2537 { 2545 2538 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_MID_Z(Stat,SyncCR3), a); 2546 unsigned cErrors = PGM_BTH_PFN(AssertCR3, pV M)(pVM, pVCpu, cr3, cr4, 0, ~(RTGCPTR)0);2539 unsigned cErrors = PGM_BTH_PFN(AssertCR3, pVCpu)(pVM, pVCpu, cr3, cr4, 0, ~(RTGCPTR)0); 2547 2540 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_MID_Z(Stat,SyncCR3), a); 2548 2541 return cErrors; -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r18947 r18988 652 652 RTGCPHYS GCPhys; 653 653 uint64_t fPageGst; 654 PGMGstGetPage(pV M, pVCpu, pvFault, &fPageGst, &GCPhys);654 PGMGstGetPage(pVCpu, pvFault, &fPageGst, &GCPhys); 655 655 Log(("Page out of sync: %RGv eip=%08x PdeSrc.n.u1User=%d fPageGst=%08llx GCPhys=%RGp scan=%d\n", 656 656 pvFault, pRegFrame->eip, PdeSrc.n.u1User, fPageGst, GCPhys, CSAMDoesPageNeedScanning(pVM, (RTRCPTR)pRegFrame->eip))); … … 661 661 { 662 662 uint64_t fPageGst; 663 rc = PGMGstGetPage(pV M, pVCpu, pvFault, &fPageGst, NULL);663 rc = PGMGstGetPage(pVCpu, pvFault, &fPageGst, NULL); 664 664 if ( RT_SUCCESS(rc) 665 665 && !(fPageGst & X86_PTE_US)) … … 787 787 RTGCPHYS GCPhys; 788 788 uint64_t fPageGst; 789 rc = PGMGstGetPage(pV M, pVCpu, pvFault, &fPageGst, &GCPhys);789 rc = PGMGstGetPage(pVCpu, pvFault, &fPageGst, &GCPhys); 790 790 Assert(RT_SUCCESS(rc) && fPageGst & X86_PTE_RW); 791 791 LogFlow(("Obsolete physical monitor page out of sync %RGv - phys %RGp flags=%08llx\n", pvFault, GCPhys, (uint64_t)fPageGst)); 792 792 793 793 uint64_t fPageShw; 794 rc = PGMShwGetPage(pV M, pVCpu, pvFault, &fPageShw, NULL);794 rc = PGMShwGetPage(pVCpu, pvFault, &fPageShw, NULL); 795 795 AssertMsg(RT_SUCCESS(rc) && fPageShw & X86_PTE_RW, ("rc=%Rrc fPageShw=%RX64\n", rc, fPageShw)); 796 796 # endif /* VBOX_STRICT */ … … 806 806 { 807 807 uint64_t fPageGst; 808 rc = PGMGstGetPage(pV M, pVCpu, pvFault, &fPageGst, NULL);808 rc = PGMGstGetPage(pVCpu, pvFault, &fPageGst, NULL); 809 809 if ( RT_SUCCESS(rc) 810 810 && !(fPageGst & X86_PTE_RW)) … … 831 831 /* Get guest page flags. */ 832 832 uint64_t fPageGst; 833 rc = PGMGstGetPage(pV M, pVCpu, pvFault, &fPageGst, NULL);833 rc = PGMGstGetPage(pVCpu, pvFault, &fPageGst, NULL); 834 834 if (RT_SUCCESS(rc)) 835 835 { 836 836 uint64_t fPageShw; 837 rc = PGMShwGetPage(pV M, pVCpu, pvFault, &fPageShw, NULL);837 rc = PGMShwGetPage(pVCpu, pvFault, &fPageShw, NULL); 838 838 839 839 /* … … 3404 3404 # if !defined(IN_RING0) && PGM_GST_TYPE != PGM_TYPE_AMD64 3405 3405 # if PGM_GST_TYPE == PGM_TYPE_32BIT 3406 rc = PGMShwGetPage(pV M, pVCpu, (RTGCPTR)pPGM->pGst32BitPdRC, NULL, &HCPhysShw);3406 rc = PGMShwGetPage(pVCpu, (RTGCPTR)pPGM->pGst32BitPdRC, NULL, &HCPhysShw); 3407 3407 # else 3408 rc = PGMShwGetPage(pV M, pVCpu, (RTGCPTR)pPGM->pGstPaePdptRC, NULL, &HCPhysShw);3408 rc = PGMShwGetPage(pVCpu, (RTGCPTR)pPGM->pGstPaePdptRC, NULL, &HCPhysShw); 3409 3409 # endif 3410 3410 AssertRCReturn(rc, 1); -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r18987 r18988 25 25 *******************************************************************************/ 26 26 __BEGIN_DECLS 27 PGM_GST_DECL(int, GetPage)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys);28 PGM_GST_DECL(int, ModifyPage)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask);29 PGM_GST_DECL(int, GetPDE)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPDE);27 PGM_GST_DECL(int, GetPage)(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys); 28 PGM_GST_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask); 29 PGM_GST_DECL(int, GetPDE)(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPDE); 30 30 PGM_GST_DECL(bool, HandlerVirtualUpdate)(PVM pVM, uint32_t cr4); 31 31 __END_DECLS … … 42 42 * 43 43 * @returns VBox status. 44 * @param pVM VM Handle.45 44 * @param pVCpu The VMCPU handle. 46 45 * @param GCPtr Guest Context virtual address of the page. Page aligned! … … 49 48 * This is page aligned. The fact that the 50 49 */ 51 PGM_GST_DECL(int, GetPage)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)50 PGM_GST_DECL(int, GetPage)(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys) 52 51 { 53 52 #if PGM_GST_TYPE == PGM_TYPE_REAL \ … … 64 63 #elif PGM_GST_TYPE == PGM_TYPE_32BIT || PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64 65 64 65 PVM pVM = pVCpu->CTX_SUFF(pVM); 66 66 /* 67 67 * Get the PDE. … … 168 168 * 169 169 * @returns VBox status code. 170 * @param pVM VM handle.171 170 * @param pVCpu The VMCPU handle. 172 171 * @param GCPtr Virtual address of the first page in the range. Page aligned! … … 175 174 * @param fMask The AND mask - page flags X86_PTE_*. 176 175 */ 177 PGM_GST_DECL(int, ModifyPage)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask)176 PGM_GST_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask) 178 177 { 179 178 #if PGM_GST_TYPE == PGM_TYPE_32BIT \ … … 181 180 || PGM_GST_TYPE == PGM_TYPE_AMD64 182 181 182 PVM pVM = pVCpu->CTX_SUFF(pVM); 183 183 for (;;) 184 184 { … … 275 275 * 276 276 * @returns VBox status code. 277 * @param pVM The virtual machine.278 277 * @param pVCpu The VMCPU handle. 279 278 * @param GCPtr Guest context pointer 280 279 * @param pPDE Pointer to guest PDE structure 281 280 */ 282 PGM_GST_DECL(int, GetPDE)(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPDE)281 PGM_GST_DECL(int, GetPDE)(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPDE) 283 282 { 284 283 #if PGM_GST_TYPE == PGM_TYPE_32BIT \ -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r18927 r18988 1425 1425 RTGCPHYS GCPhysGst; 1426 1426 uint64_t fGst; 1427 int rc = PGMGstGetPage(pV M, pVCpu, (RTGCPTR)GCPtr, &fGst, &GCPhysGst);1427 int rc = PGMGstGetPage(pVCpu, (RTGCPTR)GCPtr, &fGst, &GCPhysGst); 1428 1428 if ( rc == VERR_PAGE_NOT_PRESENT 1429 1429 || rc == VERR_PAGE_TABLE_NOT_PRESENT) -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r18927 r18988 1283 1283 VMMDECL(int) PGMPhysGCPtr2GCPhys(PVMCPU pVCpu, RTGCPTR GCPtr, PRTGCPHYS pGCPhys) 1284 1284 { 1285 int rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu ->CTX_SUFF(pVM), pVCpu, (RTGCUINTPTR)GCPtr, NULL, pGCPhys);1285 int rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, (RTGCUINTPTR)GCPtr, NULL, pGCPhys); 1286 1286 if (pGCPhys && RT_SUCCESS(rc)) 1287 1287 *pGCPhys |= (RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK; … … 1304 1304 PVM pVM = pVCpu->CTX_SUFF(pVM); 1305 1305 RTGCPHYS GCPhys; 1306 int rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, (RTGCUINTPTR)GCPtr, NULL, &GCPhys);1306 int rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, (RTGCUINTPTR)GCPtr, NULL, &GCPhys); 1307 1307 if (RT_SUCCESS(rc)) 1308 1308 rc = PGMPhysGCPhys2HCPhys(pVM, GCPhys | ((RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK), pHCPhys); … … 1328 1328 VM_ASSERT_EMT(pVM); /* no longer safe for use outside the EMT thread! */ 1329 1329 RTGCPHYS GCPhys; 1330 int rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, (RTGCUINTPTR)GCPtr, NULL, &GCPhys);1330 int rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, (RTGCUINTPTR)GCPtr, NULL, &GCPhys); 1331 1331 if (RT_SUCCESS(rc)) 1332 1332 rc = PGMPhysGCPhys2R3Ptr(pVM, GCPhys | ((RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK), 1 /* we always stay within one page */, pR3Ptr); … … 2385 2385 memcpy(pvDst, pvSrc, cb); 2386 2386 PGMPhysReleasePageMappingLock(pVM, &Lock); 2387 rc = PGMGstModifyPage(pV M, pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); AssertRC(rc);2387 rc = PGMGstModifyPage(pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); AssertRC(rc); 2388 2388 return VINF_SUCCESS; 2389 2389 } … … 2392 2392 memcpy(pvDst, pvSrc, cbPage); 2393 2393 PGMPhysReleasePageMappingLock(pVM, &Lock); 2394 rc = PGMGstModifyPage(pV M, pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); AssertRC(rc);2394 rc = PGMGstModifyPage(pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); AssertRC(rc); 2395 2395 GCPtrDst = (RTGCPTR)((RTGCUINTPTR)GCPtrDst + cbPage); 2396 2396 pvSrc = (const uint8_t *)pvSrc + cbPage; … … 2412 2412 memcpy(pvDst, pvSrc, cb); 2413 2413 PGMPhysReleasePageMappingLock(pVM, &Lock); 2414 rc = PGMGstModifyPage(pV M, pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); AssertRC(rc);2414 rc = PGMGstModifyPage(pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); AssertRC(rc); 2415 2415 return VINF_SUCCESS; 2416 2416 } … … 2419 2419 memcpy(pvDst, pvSrc, PAGE_SIZE); 2420 2420 PGMPhysReleasePageMappingLock(pVM, &Lock); 2421 rc = PGMGstModifyPage(pV M, pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); AssertRC(rc);2421 rc = PGMGstModifyPage(pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); AssertRC(rc); 2422 2422 GCPtrDst = (RTGCPTR)((RTGCUINTPTR)GCPtrDst + PAGE_SIZE); 2423 2423 pvSrc = (const uint8_t *)pvSrc + PAGE_SIZE; … … 2462 2462 { 2463 2463 /* Convert virtual to physical address + flags */ 2464 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, (RTGCUINTPTR)GCPtrSrc, &fFlags, &GCPhys);2464 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, (RTGCUINTPTR)GCPtrSrc, &fFlags, &GCPhys); 2465 2465 AssertMsgRCReturn(rc, ("GetPage failed with %Rrc for %RGv\n", rc, GCPtrSrc), rc); 2466 2466 GCPhys |= (RTGCUINTPTR)GCPtrSrc & PAGE_OFFSET_MASK; … … 2469 2469 if (!(fFlags & X86_PTE_A)) 2470 2470 { 2471 rc = PGMGstModifyPage(pV M, pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)(X86_PTE_A));2471 rc = PGMGstModifyPage(pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)(X86_PTE_A)); 2472 2472 AssertRC(rc); 2473 2473 } … … 2482 2482 { 2483 2483 /* Convert virtual to physical address + flags */ 2484 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, (RTGCUINTPTR)GCPtrSrc, &fFlags, &GCPhys);2484 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, (RTGCUINTPTR)GCPtrSrc, &fFlags, &GCPhys); 2485 2485 AssertMsgRCReturn(rc, ("GetPage failed with %Rrc for %RGv\n", rc, GCPtrSrc), rc); 2486 2486 GCPhys |= (RTGCUINTPTR)GCPtrSrc & PAGE_OFFSET_MASK; … … 2489 2489 if (!(fFlags & X86_PTE_A)) 2490 2490 { 2491 rc = PGMGstModifyPage(pV M, pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)(X86_PTE_A));2491 rc = PGMGstModifyPage(pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)(X86_PTE_A)); 2492 2492 AssertRC(rc); 2493 2493 } … … 2543 2543 { 2544 2544 /* Convert virtual to physical address + flags */ 2545 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, (RTGCUINTPTR)GCPtrDst, &fFlags, &GCPhys);2545 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, (RTGCUINTPTR)GCPtrDst, &fFlags, &GCPhys); 2546 2546 AssertMsgRCReturn(rc, ("GetPage failed with %Rrc for %RGv\n", rc, GCPtrDst), rc); 2547 2547 GCPhys |= (RTGCUINTPTR)GCPtrDst & PAGE_OFFSET_MASK; … … 2554 2554 if ((fFlags & (X86_PTE_A | X86_PTE_D)) != (X86_PTE_A | X86_PTE_D)) 2555 2555 { 2556 rc = PGMGstModifyPage(pV M, pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D));2556 rc = PGMGstModifyPage(pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); 2557 2557 AssertRC(rc); 2558 2558 } … … 2567 2567 { 2568 2568 /* Convert virtual to physical address + flags */ 2569 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, (RTGCUINTPTR)GCPtrDst, &fFlags, &GCPhys);2569 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, (RTGCUINTPTR)GCPtrDst, &fFlags, &GCPhys); 2570 2570 AssertMsgRCReturn(rc, ("GetPage failed with %Rrc for %RGv\n", rc, GCPtrDst), rc); 2571 2571 GCPhys |= (RTGCUINTPTR)GCPtrDst & PAGE_OFFSET_MASK; … … 2578 2578 if ((fFlags & (X86_PTE_A | X86_PTE_D)) != (X86_PTE_A | X86_PTE_D)) 2579 2579 { 2580 rc = PGMGstModifyPage(pV M, pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D));2580 rc = PGMGstModifyPage(pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); 2581 2581 AssertRC(rc); 2582 2582 } … … 2645 2645 RTGCPHYS GCPhys; 2646 2646 uint64_t fFlags; 2647 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, GCPtrSrc, &fFlags, &GCPhys);2647 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, GCPtrSrc, &fFlags, &GCPhys); 2648 2648 if (RT_SUCCESS(rc)) 2649 2649 { … … 2668 2668 if (!(fFlags & X86_PTE_A)) 2669 2669 { 2670 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pV M, pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A);2670 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A); 2671 2671 AssertRC(rc); 2672 2672 } … … 2684 2684 uint64_t fFlags2; 2685 2685 RTGCPHYS GCPhys2; 2686 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, GCPtrSrc, &fFlags1, &GCPhys1);2686 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, GCPtrSrc, &fFlags1, &GCPhys1); 2687 2687 if (RT_SUCCESS(rc)) 2688 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, GCPtrSrc + cb1, &fFlags2, &GCPhys2);2688 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, GCPtrSrc + cb1, &fFlags2, &GCPhys2); 2689 2689 if (RT_SUCCESS(rc)) 2690 2690 { … … 2721 2721 if (!(fFlags1 & X86_PTE_A)) 2722 2722 { 2723 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pV M, pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A);2723 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A); 2724 2724 AssertRC(rc); 2725 2725 } 2726 2726 if (!(fFlags2 & X86_PTE_A)) 2727 2727 { 2728 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pV M, pVCpu, GCPtrSrc + cb1, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A);2728 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pVCpu, GCPtrSrc + cb1, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A); 2729 2729 AssertRC(rc); 2730 2730 } … … 2811 2811 RTGCPHYS GCPhys; 2812 2812 uint64_t fFlags; 2813 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, GCPtrSrc, &fFlags, &GCPhys);2813 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, GCPtrSrc, &fFlags, &GCPhys); 2814 2814 if (RT_SUCCESS(rc)) 2815 2815 { … … 2840 2840 { 2841 2841 /** @todo access bit emulation isn't 100% correct. */ 2842 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pV M, pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A);2842 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A); 2843 2843 AssertRC(rc); 2844 2844 } … … 2857 2857 uint64_t fFlags2; 2858 2858 RTGCPHYS GCPhys2; 2859 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, GCPtrSrc, &fFlags1, &GCPhys1);2859 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, GCPtrSrc, &fFlags1, &GCPhys1); 2860 2860 if (RT_SUCCESS(rc)) 2861 2861 { 2862 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, GCPtrSrc + cb1, &fFlags2, &GCPhys2);2862 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, GCPtrSrc + cb1, &fFlags2, &GCPhys2); 2863 2863 if (RT_SUCCESS(rc)) 2864 2864 { … … 2905 2905 if (!(fFlags1 & X86_PTE_A)) 2906 2906 { 2907 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pV M, pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A);2907 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pVCpu, GCPtrSrc, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A); 2908 2908 AssertRC(rc); 2909 2909 } 2910 2910 if (!(fFlags2 & X86_PTE_A)) 2911 2911 { 2912 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pV M, pVCpu, GCPtrSrc + cb1, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A);2912 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pVCpu, GCPtrSrc + cb1, 1, X86_PTE_A, ~(uint64_t)X86_PTE_A); 2913 2913 AssertRC(rc); 2914 2914 } … … 3002 3002 RTGCPHYS GCPhys; 3003 3003 uint64_t fFlags; 3004 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, GCPtrDst, &fFlags, &GCPhys);3004 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, GCPtrDst, &fFlags, &GCPhys); 3005 3005 if (RT_SUCCESS(rc)) 3006 3006 { … … 3033 3033 { 3034 3034 /** @todo dirty & access bit emulation isn't 100% correct. */ 3035 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pV M, pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D));3035 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pVCpu, GCPtrDst, 1, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); 3036 3036 AssertRC(rc); 3037 3037 } … … 3051 3051 uint64_t fFlags2; 3052 3052 RTGCPHYS GCPhys2; 3053 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, GCPtrDst, &fFlags1, &GCPhys1);3053 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, GCPtrDst, &fFlags1, &GCPhys1); 3054 3054 if (RT_SUCCESS(rc)) 3055 3055 { 3056 rc = PGM_GST_PFN(GetPage,pVCpu)(pV M, pVCpu, GCPtrDst + cb1, &fFlags2, &GCPhys2);3056 rc = PGM_GST_PFN(GetPage,pVCpu)(pVCpu, GCPtrDst + cb1, &fFlags2, &GCPhys2); 3057 3057 if (RT_SUCCESS(rc)) 3058 3058 { … … 3102 3102 if (!(fFlags1 & (X86_PTE_A | X86_PTE_RW))) 3103 3103 { 3104 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pV M, pVCpu, GCPtrDst, 1, (X86_PTE_A | X86_PTE_RW), ~(uint64_t)(X86_PTE_A | X86_PTE_RW));3104 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pVCpu, GCPtrDst, 1, (X86_PTE_A | X86_PTE_RW), ~(uint64_t)(X86_PTE_A | X86_PTE_RW)); 3105 3105 AssertRC(rc); 3106 3106 } 3107 3107 if (!(fFlags2 & (X86_PTE_A | X86_PTE_RW))) 3108 3108 { 3109 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pV M, pVCpu, GCPtrDst + cb1, 1, (X86_PTE_A | X86_PTE_RW), ~(uint64_t)(X86_PTE_A | X86_PTE_RW));3109 rc = PGM_GST_PFN(ModifyPage,pVCpu)(pVCpu, GCPtrDst + cb1, 1, (X86_PTE_A | X86_PTE_RW), ~(uint64_t)(X86_PTE_A | X86_PTE_RW)); 3110 3110 AssertRC(rc); 3111 3111 } -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r18986 r18988 3824 3824 3825 3825 /* Exit the current shadow paging mode as well; nested paging and EPT use a root CR3 which will get flushed here. */ 3826 rc = PGM_SHW_PFN(Exit, pVCpu)(pV M, pVCpu);3826 rc = PGM_SHW_PFN(Exit, pVCpu)(pVCpu); 3827 3827 AssertRC(rc); 3828 3828 -
trunk/src/VBox/VMM/VMMAll/PGMAllShw.h
r18927 r18988 121 121 *******************************************************************************/ 122 122 __BEGIN_DECLS 123 PGM_SHW_DECL(int, GetPage)(PVM pVM, PVMCPU pVCpu, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys);124 PGM_SHW_DECL(int, ModifyPage)(PVM pVM, PVMCPU pVCpu, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask);123 PGM_SHW_DECL(int, GetPage)(PVMCPU pVCpu, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys); 124 PGM_SHW_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCUINTPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask); 125 125 __END_DECLS 126 126 … … 131 131 * 132 132 * @returns VBox status. 133 * @param pVM VM Handle.134 133 * @param pVCpu The VMCPU handle. 135 134 * @param GCPtr Guest Context virtual address of the page. … … 139 138 * @remark You should use PGMMapGetPage() for pages in a mapping. 140 139 */ 141 PGM_SHW_DECL(int, GetPage)(PVM pVM, PVMCPU pVCpu, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)140 PGM_SHW_DECL(int, GetPage)(PVMCPU pVCpu, RTGCUINTPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys) 142 141 { 143 142 #if PGM_SHW_TYPE == PGM_TYPE_NESTED … … 145 144 146 145 #else /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */ 146 PVM pVM = pVCpu->CTX_SUFF(pVM); 147 147 148 /* 148 149 * Get the PDE. … … 269 270 * 270 271 * @returns VBox status code. 271 * @param pVM VM handle.272 272 * @param pVCpu The VMCPU handle. 273 273 * @param GCPtr Virtual address of the first page in the range. Page aligned! … … 278 278 * @remark You must use PGMMapModifyPage() for pages in a mapping. 279 279 */ 280 PGM_SHW_DECL(int, ModifyPage)(PVM pVM, PVMCPU pVCpu, RTGCUINTPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask)280 PGM_SHW_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCUINTPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask) 281 281 { 282 282 # if PGM_SHW_TYPE == PGM_TYPE_NESTED … … 284 284 285 285 # else /* PGM_SHW_TYPE != PGM_TYPE_NESTED && PGM_SHW_TYPE != PGM_TYPE_EPT */ 286 PVM pVM = pVCpu->CTX_SUFF(pVM); 286 287 int rc; 287 288 -
trunk/src/VBox/VMM/VMMGC/MMRamGC.cpp
r18927 r18988 139 139 * And mark the relevant guest page as accessed and dirty. 140 140 */ 141 PGMGstModifyPage( pVM,VMMGetCpu0(pVM), (RTGCPTR)(RTRCUINTPTR)pDst, cb, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D));141 PGMGstModifyPage(VMMGetCpu0(pVM), (RTGCPTR)(RTRCUINTPTR)pDst, cb, X86_PTE_A | X86_PTE_D, ~(uint64_t)(X86_PTE_A | X86_PTE_D)); 142 142 143 143 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.