Changeset 100966 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Aug 24, 2023 11:23:58 PM (16 months ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll-armv8.cpp
r99053 r100966 114 114 115 115 116 VMM_INT_DECL(void) IEMTlbInvalidateAllPhysicalAllCpus(PVMCC pVM, VMCPUID idCpuCaller )116 VMM_INT_DECL(void) IEMTlbInvalidateAllPhysicalAllCpus(PVMCC pVM, VMCPUID idCpuCaller, IEMTLBPHYSFLUSHREASON enmReason) 117 117 { 118 RT_NOREF(pVM, idCpuCaller );118 RT_NOREF(pVM, idCpuCaller, enmReason); 119 119 } 120 120 -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r100868 r100966 754 754 * @param idCpuCaller The ID of the calling EMT if available to the caller, 755 755 * otherwise NIL_VMCPUID. 756 * @param enmReason The reason we're called. 756 757 * 757 758 * @remarks Caller holds the PGM lock. 758 759 */ 759 VMM_INT_DECL(void) IEMTlbInvalidateAllPhysicalAllCpus(PVMCC pVM, VMCPUID idCpuCaller )760 VMM_INT_DECL(void) IEMTlbInvalidateAllPhysicalAllCpus(PVMCC pVM, VMCPUID idCpuCaller, IEMTLBPHYSFLUSHREASON enmReason) 760 761 { 761 762 #if defined(IEM_WITH_CODE_TLB) || defined(IEM_WITH_DATA_TLB) … … 763 764 if (pVCpuCaller) 764 765 VMCPU_ASSERT_EMT(pVCpuCaller); 765 Log10(("IEMTlbInvalidateAllPhysicalAllCpus \n"));766 Log10(("IEMTlbInvalidateAllPhysicalAllCpus: %d\n", enmReason)); RT_NOREF(enmReason); 766 767 767 768 VMCC_FOR_EACH_VMCPU(pVM) … … 789 790 790 791 #else 791 RT_NOREF(pVM, idCpuCaller );792 RT_NOREF(pVM, idCpuCaller, enmReason); 792 793 #endif 793 794 } … … 978 979 AssertCompile(PGMIEMGCPHYS2PTR_F_NO_MAPPINGR3 == IEMTLBE_F_NO_MAPPINGR3); 979 980 AssertCompile(PGMIEMGCPHYS2PTR_F_UNASSIGNED == IEMTLBE_F_PG_UNASSIGNED); 981 AssertCompile(PGMIEMGCPHYS2PTR_F_CODE_PAGE == IEMTLBE_F_PG_CODE_PAGE); 980 982 if (RT_LIKELY(pVCpu->iem.s.CodeTlb.uTlbPhysRev > IEMTLB_PHYS_REV_INCR)) 981 983 { /* likely */ } … … 983 985 IEMTlbInvalidateAllPhysicalSlow(pVCpu); 984 986 pTlbe->fFlagsAndPhysRev &= ~( IEMTLBE_F_PHYS_REV 985 | IEMTLBE_F_NO_MAPPINGR3 | IEMTLBE_F_PG_NO_READ | IEMTLBE_F_PG_NO_WRITE | IEMTLBE_F_PG_UNASSIGNED); 987 | IEMTLBE_F_NO_MAPPINGR3 988 | IEMTLBE_F_PG_NO_READ 989 | IEMTLBE_F_PG_NO_WRITE 990 | IEMTLBE_F_PG_UNASSIGNED 991 | IEMTLBE_F_PG_CODE_PAGE); 986 992 int rc = PGMPhysIemGCPhys2PtrNoLock(pVCpu->CTX_SUFF(pVM), pVCpu, pTlbe->GCPhys, &pVCpu->iem.s.CodeTlb.uTlbPhysRev, 987 993 &pTlbe->pbMappingR3, &pTlbe->fFlagsAndPhysRev); … … 6413 6419 AssertCompile(PGMIEMGCPHYS2PTR_F_NO_MAPPINGR3 == IEMTLBE_F_NO_MAPPINGR3); 6414 6420 AssertCompile(PGMIEMGCPHYS2PTR_F_UNASSIGNED == IEMTLBE_F_PG_UNASSIGNED); 6421 AssertCompile(PGMIEMGCPHYS2PTR_F_CODE_PAGE == IEMTLBE_F_PG_CODE_PAGE); 6415 6422 if (RT_LIKELY(pVCpu->iem.s.CodeTlb.uTlbPhysRev > IEMTLB_PHYS_REV_INCR)) 6416 6423 { /* likely */ } … … 6419 6426 pTlbe->pbMappingR3 = NULL; 6420 6427 pTlbe->fFlagsAndPhysRev &= ~( IEMTLBE_F_PHYS_REV 6421 | IEMTLBE_F_NO_MAPPINGR3 | IEMTLBE_F_PG_NO_READ | IEMTLBE_F_PG_NO_WRITE | IEMTLBE_F_PG_UNASSIGNED); 6428 | IEMTLBE_F_NO_MAPPINGR3 6429 | IEMTLBE_F_PG_NO_READ 6430 | IEMTLBE_F_PG_NO_WRITE 6431 | IEMTLBE_F_PG_UNASSIGNED 6432 | IEMTLBE_F_PG_CODE_PAGE); 6422 6433 int rc = PGMPhysIemGCPhys2PtrNoLock(pVCpu->CTX_SUFF(pVM), pVCpu, pTlbe->GCPhys, &pVCpu->iem.s.DataTlb.uTlbPhysRev, 6423 6434 &pbMem, &pTlbe->fFlagsAndPhysRev); … … 6748 6759 AssertCompile(PGMIEMGCPHYS2PTR_F_NO_MAPPINGR3 == IEMTLBE_F_NO_MAPPINGR3); 6749 6760 AssertCompile(PGMIEMGCPHYS2PTR_F_UNASSIGNED == IEMTLBE_F_PG_UNASSIGNED); 6761 AssertCompile(PGMIEMGCPHYS2PTR_F_CODE_PAGE == IEMTLBE_F_PG_CODE_PAGE); 6750 6762 pTlbe->pbMappingR3 = NULL; 6751 6763 pTlbe->fFlagsAndPhysRev &= ~( IEMTLBE_F_PHYS_REV 6752 | IEMTLBE_F_NO_MAPPINGR3 | IEMTLBE_F_PG_NO_READ | IEMTLBE_F_PG_NO_WRITE | IEMTLBE_F_PG_UNASSIGNED); 6764 | IEMTLBE_F_NO_MAPPINGR3 6765 | IEMTLBE_F_PG_NO_READ 6766 | IEMTLBE_F_PG_NO_WRITE 6767 | IEMTLBE_F_PG_UNASSIGNED 6768 | IEMTLBE_F_PG_CODE_PAGE); 6753 6769 int rc = PGMPhysIemGCPhys2PtrNoLock(pVCpu->CTX_SUFF(pVM), pVCpu, pTlbe->GCPhys, &pVCpu->iem.s.DataTlb.uTlbPhysRev, 6754 6770 &pbMem, &pTlbe->fFlagsAndPhysRev); -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r99739 r100966 948 948 pgmPhysInvalidatePageMapTLBEntry(pVM, GCPhysPage); 949 949 if (fFlushIemTlbs) 950 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID );950 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID, IEMTLBPHYSFLUSHREASON_RESET_ALIAS); 951 951 952 952 /* … … 1434 1434 */ 1435 1435 if (fFlushIemTlb) 1436 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID );1436 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID, IEMTLBPHYSFLUSHREASON_HANDLER_RESET); 1437 1437 } 1438 1438 } … … 1790 1790 the guest physical address part of the IEM TLBs. Note, we do 1791 1791 this here as we will not invalid */ 1792 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID );1792 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID, IEMTLBPHYSFLUSHREASON_MMIO2_ALIAS); 1793 1793 } 1794 1794 Assert(PGM_PAGE_IS_ZERO(pPage)); -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r99739 r100966 746 746 } 747 747 748 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID );748 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID, IEMTLBPHYSFLUSHREASON_MISC); 749 749 PGM_UNLOCK(pVM); 750 750 } … … 995 995 PGM_PAGE_SET_PDE_TYPE(pVM, pPage, PGM_PAGE_PDE_TYPE_PT); 996 996 pgmPhysInvalidatePageMapTLBEntry(pVM, GCPhys); 997 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID );997 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID, IEMTLBPHYSFLUSHREASON_ALLOCATED); 998 998 999 999 /* Copy the shared page contents to the replacement page. */ … … 1225 1225 PGM_PAGE_SET_WRITTEN_TO(pVM, pPage); 1226 1226 PGM_PAGE_SET_STATE(pVM, pPage, PGM_PAGE_STATE_ALLOCATED); 1227 if (PGM_PAGE_IS_CODE_PAGE(pPage)) 1228 { 1229 PGM_PAGE_CLEAR_CODE_PAGE(pVM, pPage); 1230 IEMTlbInvalidateAllPhysicalAllCpus(pVM, NIL_VMCPUID, IEMTLBPHYSFLUSHREASON_MADE_WRITABLE); 1231 } 1232 1227 1233 Assert(pVM->pgm.s.cMonitoredPages > 0); 1228 1234 pVM->pgm.s.cMonitoredPages--; … … 3737 3743 { 3738 3744 case PGM_PAGE_STATE_ALLOCATED: 3745 Assert(!PGM_PAGE_IS_CODE_PAGE(pPage)); 3739 3746 *pfTlb |= *puTlbPhysRev; 3740 3747 break; … … 3745 3752 case PGM_PAGE_STATE_SHARED: 3746 3753 case PGM_PAGE_STATE_WRITE_MONITORED: 3747 *pfTlb |= *puTlbPhysRev | PGMIEMGCPHYS2PTR_F_NO_WRITE; 3754 if (!PGM_PAGE_IS_CODE_PAGE(pPage)) 3755 *pfTlb |= *puTlbPhysRev | PGMIEMGCPHYS2PTR_F_NO_WRITE; 3756 else 3757 *pfTlb |= *puTlbPhysRev | PGMIEMGCPHYS2PTR_F_NO_WRITE | PGMIEMGCPHYS2PTR_F_CODE_PAGE; 3748 3758 break; 3749 3759 } … … 3769 3779 */ 3770 3780 if (PGM_PAGE_HAS_ACTIVE_HANDLERS(pPage)) 3771 *pfTlb |= *puTlbPhysRev | PGMIEMGCPHYS2PTR_F_NO_WRITE; 3781 { 3782 if (!PGM_PAGE_IS_CODE_PAGE(pPage)) /* ROM pages end up here */ 3783 *pfTlb |= *puTlbPhysRev | PGMIEMGCPHYS2PTR_F_NO_WRITE; 3784 else 3785 *pfTlb |= *puTlbPhysRev | PGMIEMGCPHYS2PTR_F_NO_WRITE | PGMIEMGCPHYS2PTR_F_CODE_PAGE; 3786 } 3772 3787 else 3773 3788 switch (PGM_PAGE_GET_STATE(pPage)) 3774 3789 { 3775 3790 case PGM_PAGE_STATE_ALLOCATED: 3791 Assert(!PGM_PAGE_IS_CODE_PAGE(pPage)); 3776 3792 *pfTlb |= *puTlbPhysRev; 3777 3793 break; … … 3782 3798 case PGM_PAGE_STATE_SHARED: 3783 3799 case PGM_PAGE_STATE_WRITE_MONITORED: 3784 *pfTlb |= *puTlbPhysRev | PGMIEMGCPHYS2PTR_F_NO_WRITE; 3800 if (!PGM_PAGE_IS_CODE_PAGE(pPage)) 3801 *pfTlb |= *puTlbPhysRev | PGMIEMGCPHYS2PTR_F_NO_WRITE; 3802 else 3803 *pfTlb |= *puTlbPhysRev | PGMIEMGCPHYS2PTR_F_NO_WRITE | PGMIEMGCPHYS2PTR_F_CODE_PAGE; 3785 3804 break; 3786 3805 }
Note:
See TracChangeset
for help on using the changeset viewer.