Changeset 104885 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Jun 11, 2024 12:37:11 PM (6 months ago)
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PGM-armv8.cpp
r104870 r104885 238 238 AssertRCReturn(rc, rc); 239 239 240 pgmR3PhysChunkInvalidateTLB(pVM ); /* includes pgmPhysInvalidatePageMapTLB call */240 pgmR3PhysChunkInvalidateTLB(pVM, false /*fInRendezvous*/); /* includes pgmPhysInvalidatePageMapTLB call */ 241 241 242 242 /* -
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r104870 r104885 934 934 AssertRCReturn(rc, rc); 935 935 936 pgmR3PhysChunkInvalidateTLB(pVM ); /* includes pgmPhysInvalidatePageMapTLB call */936 pgmR3PhysChunkInvalidateTLB(pVM, false /*fInRendezvous*/); /* includes pgmPhysInvalidatePageMapTLB call */ 937 937 938 938 /* … … 1417 1417 PGM_REG_COUNTER(&pPgmCpu->cA20Changes, "/PGM/CPU%u/cA20Changes", "Number of A20 gate changes."); 1418 1418 1419 PGM_REG_COUNTER(&pPgmCpu->StatRZRamRangeTlbMisses, "/PGM/CPU%u/RZ/RamRange/TlbMisses", "TLB misses (lockless)."); 1420 PGM_REG_COUNTER(&pPgmCpu->StatRZRamRangeTlbLocking, "/PGM/CPU%u/RZ/RamRange/TlbLocking", "Lockless TLB failed, falling back on locked lookup."); 1421 PGM_REG_COUNTER(&pPgmCpu->StatRZPageMapTlbMisses, "/PGM/CPU%u/RZ/Page/MapTlbMisses", "Lockless page map TLB failed, falling back on locked lookup."); 1422 1423 PGM_REG_COUNTER(&pPgmCpu->StatR3RamRangeTlbMisses, "/PGM/CPU%u/R3/RamRange/TlbMisses", "TLB misses (lockless)."); 1424 PGM_REG_COUNTER(&pPgmCpu->StatR3RamRangeTlbLocking, "/PGM/CPU%u/R3/RamRange/TlbLocking", "Lockless TLB failed, falling back on locked lookup."); 1425 PGM_REG_COUNTER(&pPgmCpu->StatR3PageMapTlbMisses, "/PGM/CPU%u/R3/Page/MapTlbMisses", "Lockless page map TLB failed, falling back on locked lookup."); 1426 1419 1427 #ifdef VBOX_WITH_STATISTICS 1420 1428 PGMCPUSTATS *pCpuStats = &pVM->apCpusR3[idCpu]->pgm.s.Stats; … … 1429 1437 # endif 1430 1438 /* R0 only: */ 1431 PGM_REG_PROFILE(&pCpuStats->StatR0NpMiscfg, 1432 PGM_REG_COUNTER(&pCpuStats->StatR0NpMiscfgSyncPage, 1439 PGM_REG_PROFILE(&pCpuStats->StatR0NpMiscfg, "/PGM/CPU%u/R0/NpMiscfg", "PGMR0Trap0eHandlerNPMisconfig() profiling."); 1440 PGM_REG_COUNTER(&pCpuStats->StatR0NpMiscfgSyncPage, "/PGM/CPU%u/R0/NpMiscfgSyncPage", "SyncPage calls from PGMR0Trap0eHandlerNPMisconfig()."); 1433 1441 1434 1442 /* RZ only: */ … … 1569 1577 PGM_REG_COUNTER(&pCpuStats->StatRZFlushTLBSameCR3Global, "/PGM/CPU%u/RZ/FlushTLB/SameCR3Global", "The number of times PGMFlushTLB was called with the same CR3, global. (flush)"); 1570 1578 PGM_REG_PROFILE(&pCpuStats->StatRZGstModifyPage, "/PGM/CPU%u/RZ/GstModifyPage", "Profiling of the PGMGstModifyPage() body."); 1579 PGM_REG_COUNTER(&pCpuStats->StatRZRamRangeTlbHits, "/PGM/CPU%u/RZ/RamRange/TlbHits", "TLB hits (lockless)."); 1580 PGM_REG_COUNTER(&pCpuStats->StatRZPageMapTlbHits, "/PGM/CPU%u/RZ/Page/MapTlbHits", "TLB hits (lockless)."); 1571 1581 1572 1582 PGM_REG_PROFILE(&pCpuStats->StatR3SyncCR3, "/PGM/CPU%u/R3/SyncCR3", "Profiling of the PGMSyncCR3() body."); … … 1614 1624 PGM_REG_COUNTER(&pCpuStats->StatR3FlushTLBSameCR3Global, "/PGM/CPU%u/R3/FlushTLB/SameCR3Global", "The number of times PGMFlushTLB was called with the same CR3, global. (flush)"); 1615 1625 PGM_REG_PROFILE(&pCpuStats->StatR3GstModifyPage, "/PGM/CPU%u/R3/GstModifyPage", "Profiling of the PGMGstModifyPage() body."); 1626 PGM_REG_COUNTER(&pCpuStats->StatR3RamRangeTlbHits, "/PGM/CPU%u/R3/RamRange/TlbHits", "TLB hits (lockless)."); 1627 PGM_REG_COUNTER(&pCpuStats->StatR3PageMapTlbHits, "/PGM/CPU%u/R3/Page/MapTlbHits", "TLB hits (lockless)."); 1616 1628 #endif /* VBOX_WITH_STATISTICS */ 1617 1629 1618 1630 #undef PGM_REG_PROFILE 1619 1631 #undef PGM_REG_COUNTER 1620 1621 1632 } 1622 1633 -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r104870 r104885 1422 1422 } 1423 1423 1424 /* Update the RAM range entry to indicate that it is no longer mapped. */ 1425 pRam->GCPhys = NIL_RTGCPHYS; 1424 /* Update the RAM range entry to indicate that it is no longer mapped. 1425 The GCPhys member is accessed by the lockless TLB lookup code, so update 1426 it last and atomically to be on the safe side. */ 1426 1427 pRam->GCPhysLast = NIL_RTGCPHYS; 1428 ASMAtomicWriteU64(&pRam->GCPhys, NIL_RTGCPHYS); 1427 1429 1428 1430 /* … … 2654 2656 #endif 2655 2657 { 2656 pgmPhysInvalidatePageMapTLB(pVM );2658 pgmPhysInvalidatePageMapTLB(pVM, false /*fInRendezvous*/); 2657 2659 return VINF_SUCCESS; 2658 2660 } … … 2679 2681 } 2680 2682 2681 pgmPhysInvalidatePageMapTLB(pVM );2683 pgmPhysInvalidatePageMapTLB(pVM, false /*fInRendezvous*/); 2682 2684 return rc; 2683 2685 } … … 2851 2853 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 2852 2854 2853 pgmPhysInvalidatePageMapTLB(pVM );2855 pgmPhysInvalidatePageMapTLB(pVM, false /*fInRendezvous*/); 2854 2856 /*pgmPhysInvalidRamRangeTlbs(pVM); - not necessary */ 2855 2857 … … 3427 3429 } 3428 3430 } 3429 pgmPhysInvalidatePageMapTLB(pVM );3431 pgmPhysInvalidatePageMapTLB(pVM, false /*fInRendezvous*/); 3430 3432 PGM_UNLOCK(pVM); 3431 3433 return !cFound && hMmio2 != NIL_PGMMMIO2HANDLE ? VERR_NOT_FOUND : rc; … … 3671 3673 3672 3674 /* Flush physical page map TLB. */ 3673 pgmPhysInvalidatePageMapTLB(pVM );3675 pgmPhysInvalidatePageMapTLB(pVM, false /*fInRendezvous*/); 3674 3676 3675 3677 #ifdef VBOX_WITH_NATIVE_NEM … … 3905 3907 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 3906 3908 3907 pgmPhysInvalidatePageMapTLB(pVM );3909 pgmPhysInvalidatePageMapTLB(pVM, false /*fInRendezvous*/); 3908 3910 /* pgmPhysInvalidRamRangeTlbs(pVM); - not necessary */ 3909 3911 … … 4779 4781 4780 4782 /* Flush physical page map TLB. */ 4781 pgmPhysInvalidatePageMapTLB(pVM );4783 pgmPhysInvalidatePageMapTLB(pVM, false /*fInRendezvous*/); 4782 4784 4783 4785 /* … … 4938 4940 } 4939 4941 } 4940 pgmPhysInvalidatePageMapTLB(pVM );4942 pgmPhysInvalidatePageMapTLB(pVM, false /*fInRendezvous*/); 4941 4943 pgmPhysInvalidRamRangeTlbs(pVM); 4942 4944 … … 5777 5779 #endif 5778 5780 5781 #if 0 /* This is too much work with the PGMCPU::PhysTlb as well. We flush them all instead. */ 5779 5782 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.PhysTlbR3.aEntries); i++) 5780 5783 if (pVM->pgm.s.PhysTlbR3.aEntries[i].pMap == pChunk) 5781 5784 return 0; 5785 #endif 5782 5786 5783 5787 pArg->pChunk = pChunk; … … 5901 5905 } 5902 5906 5903 pgmR3PhysChunkInvalidateTLB(pVM ); /* includes pgmPhysInvalidatePageMapTLB call */5907 pgmR3PhysChunkInvalidateTLB(pVM, true /*fInRendezvous*/); /* includes pgmPhysInvalidatePageMapTLB call */ 5904 5908 } 5905 5909 } … … 6043 6047 * Invalidates the TLB for the ring-3 mapping cache. 6044 6048 * 6045 * @param pVM The cross context VM structure. 6046 */ 6047 DECLHIDDEN(void) pgmR3PhysChunkInvalidateTLB(PVM pVM) 6049 * @param pVM The cross context VM structure. 6050 * @param fInRendezvous Set if we're in a rendezvous. 6051 */ 6052 DECLHIDDEN(void) pgmR3PhysChunkInvalidateTLB(PVM pVM, bool fInRendezvous) 6048 6053 { 6049 6054 PGM_LOCK_VOID(pVM); … … 6054 6059 } 6055 6060 /* The page map TLB references chunks, so invalidate that one too. */ 6056 pgmPhysInvalidatePageMapTLB(pVM );6061 pgmPhysInvalidatePageMapTLB(pVM, fInRendezvous); 6057 6062 PGM_UNLOCK(pVM); 6058 6063 }
Note:
See TracChangeset
for help on using the changeset viewer.