Index: trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAll.cpp	(revision 92343)
+++ trunk/src/VBox/VMM/VMMAll/PGMAll.cpp	(revision 92344)
@@ -1011,167 +1011,4 @@
     STAM_PROFILE_STOP(&pVCpu->pgm.s.Stats.CTX_MID_Z(Stat,Prefetch), a);
     AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || RT_FAILURE(rc), ("rc=%Rrc\n", rc));
-    return rc;
-}
-
-
-/**
- * Verifies a range of pages for read or write access
- *
- * Only checks the guest's page tables
- *
- * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
- * @param   Addr        Guest virtual address to check
- * @param   cbSize      Access size
- * @param   fAccess     Access type (r/w, user/supervisor (X86_PTE_*))
- * @remarks Current not in use.
- */
-VMMDECL(int) PGMIsValidAccess(PVMCPUCC pVCpu, RTGCPTR Addr, uint32_t cbSize, uint32_t fAccess)
-{
-    /*
-     * Validate input.
-     */
-    if (fAccess & ~(X86_PTE_US | X86_PTE_RW))
-    {
-        AssertMsgFailed(("PGMIsValidAccess: invalid access type %08x\n", fAccess));
-        return VERR_INVALID_PARAMETER;
-    }
-
-    uint64_t fPage;
-    int rc = PGMGstGetPage(pVCpu, (RTGCPTR)Addr, &fPage, NULL);
-    if (RT_FAILURE(rc))
-    {
-        Log(("PGMIsValidAccess: access violation for %RGv rc=%d\n", Addr, rc));
-        return VINF_EM_RAW_GUEST_TRAP;
-    }
-
-    /*
-     * Check if the access would cause a page fault
-     *
-     * Note that hypervisor page directories are not present in the guest's tables, so this check
-     * is sufficient.
-     */
-    bool fWrite = !!(fAccess & X86_PTE_RW);
-    bool fUser  = !!(fAccess & X86_PTE_US);
-    if (  !(fPage & X86_PTE_P)
-        || (fWrite && !(fPage & X86_PTE_RW))
-        || (fUser  && !(fPage & X86_PTE_US)) )
-    {
-        Log(("PGMIsValidAccess: access violation for %RGv attr %#llx vs %d:%d\n", Addr, fPage, fWrite, fUser));
-        return VINF_EM_RAW_GUEST_TRAP;
-    }
-    if (    RT_SUCCESS(rc)
-        &&  PAGE_ADDRESS(Addr) != PAGE_ADDRESS(Addr + cbSize))
-        return PGMIsValidAccess(pVCpu, Addr + PAGE_SIZE, (cbSize > PAGE_SIZE) ? cbSize - PAGE_SIZE : 1, fAccess);
-    return rc;
-}
-
-
-/**
- * Verifies a range of pages for read or write access
- *
- * Supports handling of pages marked for dirty bit tracking and CSAM
- *
- * @returns VBox status code.
- * @param   pVCpu       The cross context virtual CPU structure.
- * @param   Addr        Guest virtual address to check
- * @param   cbSize      Access size
- * @param   fAccess     Access type (r/w, user/supervisor (X86_PTE_*))
- */
-VMMDECL(int) PGMVerifyAccess(PVMCPUCC pVCpu, RTGCPTR Addr, uint32_t cbSize, uint32_t fAccess)
-{
-    PVM pVM = pVCpu->CTX_SUFF(pVM);
-
-    AssertMsg(!(fAccess & ~(X86_PTE_US | X86_PTE_RW)), ("PGMVerifyAccess: invalid access type %08x\n", fAccess));
-
-    /*
-     * Get going.
-     */
-    uint64_t fPageGst;
-    int rc = PGMGstGetPage(pVCpu, (RTGCPTR)Addr, &fPageGst, NULL);
-    if (RT_FAILURE(rc))
-    {
-        Log(("PGMVerifyAccess: access violation for %RGv rc=%d\n", Addr, rc));
-        return VINF_EM_RAW_GUEST_TRAP;
-    }
-
-    /*
-     * Check if the access would cause a page fault
-     *
-     * Note that hypervisor page directories are not present in the guest's tables, so this check
-     * is sufficient.
-     */
-    const bool fWrite = !!(fAccess & X86_PTE_RW);
-    const bool fUser  = !!(fAccess & X86_PTE_US);
-    if (   !(fPageGst & X86_PTE_P)
-        || (fWrite  && !(fPageGst & X86_PTE_RW))
-        || (fUser   && !(fPageGst & X86_PTE_US)) )
-    {
-        Log(("PGMVerifyAccess: access violation for %RGv attr %#llx vs %d:%d\n", Addr, fPageGst, fWrite, fUser));
-        return VINF_EM_RAW_GUEST_TRAP;
-    }
-
-    if (!pVM->pgm.s.fNestedPaging)
-    {
-        /*
-         * Next step is to verify if we protected this page for dirty bit tracking or for CSAM scanning
-         */
-        rc = PGMShwGetPage(pVCpu, (RTGCPTR)Addr, NULL, NULL);
-        if (    rc == VERR_PAGE_NOT_PRESENT
-            ||  rc == VERR_PAGE_TABLE_NOT_PRESENT)
-        {
-            /*
-             * Page is not present in our page tables.
-             * Try to sync it!
-             */
-            Assert(X86_TRAP_PF_RW == X86_PTE_RW && X86_TRAP_PF_US == X86_PTE_US);
-            uint32_t  const uErr   = fAccess & (X86_TRAP_PF_RW | X86_TRAP_PF_US);
-            uintptr_t const idxBth = pVCpu->pgm.s.idxBothModeData;
-            AssertReturn(idxBth < RT_ELEMENTS(g_aPgmBothModeData), VERR_PGM_MODE_IPE);
-            AssertReturn(g_aPgmBothModeData[idxBth].pfnVerifyAccessSyncPage, VERR_PGM_MODE_IPE);
-            rc = g_aPgmBothModeData[idxBth].pfnVerifyAccessSyncPage(pVCpu, Addr, fPageGst, uErr);
-            if (rc != VINF_SUCCESS)
-                return rc;
-        }
-        else
-            AssertMsg(rc == VINF_SUCCESS, ("PGMShwGetPage %RGv failed with %Rrc\n", Addr, rc));
-    }
-
-#if 0 /* def VBOX_STRICT; triggers too often now */
-    /*
-     * This check is a bit paranoid, but useful.
-     */
-    /* Note! This will assert when writing to monitored pages (a bit annoying actually). */
-    uint64_t fPageShw;
-    rc = PGMShwGetPage(pVCpu, (RTGCPTR)Addr, &fPageShw, NULL);
-    if (    (rc == VERR_PAGE_NOT_PRESENT || RT_FAILURE(rc))
-        || (fWrite && !(fPageShw & X86_PTE_RW))
-        || (fUser  && !(fPageShw & X86_PTE_US)) )
-    {
-        AssertMsgFailed(("Unexpected access violation for %RGv! rc=%Rrc write=%d user=%d\n",
-                         Addr, rc, fWrite && !(fPageShw & X86_PTE_RW), fUser && !(fPageShw & X86_PTE_US)));
-        return VINF_EM_RAW_GUEST_TRAP;
-    }
-#endif
-
-    if (    RT_SUCCESS(rc)
-        &&  (   PAGE_ADDRESS(Addr) != PAGE_ADDRESS(Addr + cbSize - 1)
-             || Addr + cbSize < Addr))
-    {
-        /* Don't recursively call PGMVerifyAccess as we might run out of stack. */
-        for (;;)
-        {
-            Addr += PAGE_SIZE;
-            if (cbSize > PAGE_SIZE)
-                cbSize -= PAGE_SIZE;
-            else
-                cbSize = 1;
-            rc = PGMVerifyAccess(pVCpu, Addr, 1, fAccess);
-            if (rc != VINF_SUCCESS)
-                break;
-            if (PAGE_ADDRESS(Addr) == PAGE_ADDRESS(Addr + cbSize - 1))
-                break;
-        }
-    }
     return rc;
 }
