Changeset 8048 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Apr 16, 2008 2:48:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r8047 r8048 820 820 */ 821 821 const unsigned iPDDst = GCPtrPage >> SHW_PD_SHIFT; 822 # 822 # if PGM_SHW_TYPE == PGM_TYPE_32BIT 823 823 PX86PDE pPdeDst = &pVM->pgm.s.CTXMID(p,32BitPD)->a[iPDDst]; 824 # 824 # else 825 825 PX86PDEPAE pPdeDst = &pVM->pgm.s.CTXMID(ap,PaePDs[0])->a[iPDDst]; 826 # 826 # endif 827 827 const SHWPDE PdeDst = *pPdeDst; 828 828 if (!PdeDst.n.u1Present) … … 835 835 * Get the guest PD entry and calc big page. 836 836 */ 837 # 837 # if PGM_GST_TYPE == PGM_TYPE_32BIT 838 838 PX86PD pPDSrc = CTXSUFF(pVM->pgm.s.pGuestPD); 839 839 const unsigned iPDSrc = GCPtrPage >> GST_PD_SHIFT; 840 840 GSTPDE PdeSrc = pPDSrc->a[iPDSrc]; 841 # 841 # else /* PAE */ 842 842 unsigned iPDSrc; 843 843 PX86PDPAE pPDSrc = pgmGstGetPaePDPtr(&pVM->pgm.s, GCPtrPage, &iPDSrc); … … 848 848 else 849 849 PdeSrc.u = 0; 850 # 850 # endif 851 851 852 852 const uint32_t cr4 = CPUMGetGuestCR4(pVM); 853 853 const bool fIsBigPage = PdeSrc.b.u1Size && (cr4 & X86_CR4_PSE); 854 854 855 # 855 # ifdef IN_RING3 856 856 /* 857 857 * If a CR3 Sync is pending we may ignore the invalidate page operation … … 859 859 * This doesn't make sense in GC/R0 so we'll skip it entirely there. 860 860 */ 861 # 861 # ifdef PGM_SKIP_GLOBAL_PAGEDIRS_ON_NONGLOBAL_FLUSH 862 862 if ( VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3) 863 863 || ( VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3_NON_GLOBAL) … … 867 867 ) 868 868 ) 869 # 869 # else 870 870 if (VM_FF_ISPENDING(pVM, VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL) ) 871 # 871 # endif 872 872 { 873 873 STAM_COUNTER_INC(&pVM->pgm.s.StatHCInvalidatePageSkipped); 874 874 return VINF_SUCCESS; 875 875 } 876 # 876 # endif /* IN_RING3 */ 877 877 878 878 … … 905 905 PGM_INVL_GUEST_TLBS(); 906 906 } 907 # 907 # ifdef PGM_SYNC_ACCESSED_BIT 908 908 else if (!PdeSrc.n.u1Accessed) 909 909 { … … 916 916 PGM_INVL_GUEST_TLBS(); 917 917 } 918 # 918 # endif 919 919 else if (!fIsBigPage) 920 920 { … … 924 924 PPGMPOOLPAGE pShwPage = pgmPoolGetPageByHCPhys(pVM, PdeDst.u & SHW_PDE_PG_MASK); 925 925 RTGCPHYS GCPhys = PdeSrc.u & GST_PDE_PG_MASK; 926 # 926 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 927 927 /* Select the right PDE as we're emulating a 4kb page table with 2 shadow page tables. */ 928 928 GCPhys |= (iPDDst & 1) * (PAGE_SIZE/2); 929 # 929 # endif 930 930 if (pShwPage->GCPhys == GCPhys) 931 931 { 932 # 932 # if 0 /* likely cause of a major performance regression; must be SyncPageWorkerTrackDeref then */ 933 933 const unsigned iPTEDst = (GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK; 934 934 PSHWPT pPT = (PSHWPT)PGMPOOL_PAGE_2_PTR(pVM, pShwPage); 935 935 if (pPT->a[iPTEDst].n.u1Present) 936 936 { 937 # 937 # ifdef PGMPOOL_WITH_USER_TRACKING 938 938 /* This is very unlikely with caching/monitoring enabled. */ 939 939 PGM_BTH_NAME(SyncPageWorkerTrackDeref)(pVM, pShwPage, pPT->a[iPTEDst].u & SHW_PTE_PG_MASK); 940 # 940 # endif 941 941 pPT->a[iPTEDst].u = 0; 942 942 } 943 # 943 # else /* Syncing it here isn't 100% safe and it's probably not worth spending time syncing it. */ 944 944 rc = PGM_BTH_NAME(SyncPage)(pVM, PdeSrc, GCPtrPage, 1, 0); 945 945 if (VBOX_SUCCESS(rc)) 946 946 rc = VINF_SUCCESS; 947 # 947 # endif 948 948 STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePage4KBPages)); 949 949 PGM_INVL_PG(GCPtrPage); … … 970 970 PPGMPOOLPAGE pShwPage = pgmPoolGetPageByHCPhys(pVM, PdeDst.u & SHW_PDE_PG_MASK); 971 971 RTGCPHYS GCPhys = PdeSrc.u & GST_PDE_BIG_PG_MASK; 972 # 972 # if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT 973 973 /* Select the right PDE as we're emulating a 4MB page directory with two 2 MB shadow PDEs.*/ 974 974 GCPhys |= GCPtrPage & (1 << X86_PD_PAE_SHIFT); 975 # 975 # endif 976 976 if ( pShwPage->GCPhys == GCPhys 977 977 && pShwPage->enmKind == BTH_PGMPOOLKIND_PT_FOR_BIG) … … 979 979 /* ASSUMES a the given bits are identical for 4M and normal PDEs */ 980 980 /** @todo PAT */ 981 # 981 # ifdef PGM_SYNC_DIRTY_BIT 982 982 if ( (PdeSrc.u & (X86_PDE_P | X86_PDE_RW | X86_PDE_US | X86_PDE_PWT | X86_PDE_PCD)) 983 983 == (PdeDst.u & (X86_PDE_P | X86_PDE_RW | X86_PDE_US | X86_PDE_PWT | X86_PDE_PCD)) 984 984 && ( PdeSrc.b.u1Dirty /** @todo rainy day: What about read-only 4M pages? not very common, but still... */ 985 985 || (PdeDst.u & PGM_PDFLAGS_TRACK_DIRTY))) 986 # 986 # else 987 987 if ( (PdeSrc.u & (X86_PDE_P | X86_PDE_RW | X86_PDE_US | X86_PDE_PWT | X86_PDE_PCD)) 988 988 == (PdeDst.u & (X86_PDE_P | X86_PDE_RW | X86_PDE_US | X86_PDE_PWT | X86_PDE_PCD))) 989 # 989 # endif 990 990 { 991 991 LogFlow(("Skipping flush for big page containing %VGv (PD=%X)-> nothing has changed!\n", GCPtrPage, iPDSrc));
Note:
See TracChangeset
for help on using the changeset viewer.