X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Farmv7%2Fmm_virt.c;h=64b5d570504d4c961cd1b7f00c1088c77d6eb9fa;hb=05c5d7098a054591d75113ecc3503979cc5754c9;hp=0c2f043869988e24617fc156f115f3d6281ee1de;hpb=f0ffa8c904a7a99e115e926b4bf59d9749e86334;p=tpg%2Facess2.git diff --git a/Kernel/arch/armv7/mm_virt.c b/Kernel/arch/armv7/mm_virt.c index 0c2f0438..64b5d570 100644 --- a/Kernel/arch/armv7/mm_virt.c +++ b/Kernel/arch/armv7/mm_virt.c @@ -126,7 +126,9 @@ int MM_int_AllocateCoarse(tVAddr VAddr, int Domain) } // TLBIALL - TLBIALL(); + TLBIALL(); + + memset( (void*)&table1[ (VAddr >> 12) & ~(1024-1) ], 0, 0x1000 ); LEAVE('i', 0); return 0; @@ -737,7 +739,7 @@ tVAddr MM_MapTemp(tPAddr PAddr) if( MM_int_GetPageInfo(ret, &pi) == 0 ) continue; - Log("MapTemp %P at %p by %p", PAddr, ret, __builtin_return_address(0)); +// Log("MapTemp %P at %p by %p", PAddr, ret, __builtin_return_address(0)); MM_RefPhys(PAddr); // Counter the MM_Deallocate in FreeTemp MM_Map(ret, PAddr); @@ -922,7 +924,7 @@ void MM_DumpTables(tVAddr Start, tVAddr End) pi_old.Size = 0; - Debug("Page Table Dump:"); + Debug("Page Table Dump (%p to %p):", Start, End); range_start = Start; for( addr = Start; i == 0 || (addr && addr < End); i = 1 ) { @@ -954,7 +956,7 @@ void MM_DumpTables(tVAddr Start, tVAddr End) Debug("Done"); } -// NOTE: Runs in abort context, not much differe, just a smaller stack +// NOTE: Runs in abort context, not much difference, just a smaller stack void MM_PageFault(Uint32 PC, Uint32 Addr, Uint32 DFSR, int bPrefetch) { int rv; @@ -975,8 +977,10 @@ void MM_PageFault(Uint32 PC, Uint32 Addr, Uint32 DFSR, int bPrefetch) for(;;); } + #if TRACE_COW Log_Notice("MMVirt", "COW %p caused by %p, ZERO duped to %P (RefCnt(%i)--)", Addr, PC, newpage, MM_GetRefCount(pi.PhysAddr)); + #endif MM_DerefPhys(pi.PhysAddr); pi.PhysAddr = newpage; @@ -1003,16 +1007,20 @@ void MM_PageFault(Uint32 PC, Uint32 Addr, Uint32 DFSR, int bPrefetch) memcpy( dst, src, PAGE_SIZE ); MM_FreeTemp( (tVAddr)dst ); + #if TRACE_COW Log_Notice("MMVirt", "COW %p caused by %p, %P duped to %P (RefCnt(%i)--)", Addr, PC, pi.PhysAddr, newpage, MM_GetRefCount(pi.PhysAddr)); + #endif MM_DerefPhys(pi.PhysAddr); pi.PhysAddr = newpage; } + #if TRACE_COW else { Log_Notice("MMVirt", "COW %p caused by %p, took last reference to %P", Addr, PC, pi.PhysAddr); } + #endif // Unset COW pi.AP = AP_RW_BOTH; MM_int_SetPageInfo(Addr, &pi); @@ -1023,6 +1031,10 @@ void MM_PageFault(Uint32 PC, Uint32 Addr, Uint32 DFSR, int bPrefetch) Log_Error("MMVirt", "Code at %p accessed %p (DFSR = 0x%x)%s", PC, Addr, DFSR, (bPrefetch ? " - Prefetch" : "") ); + if( Addr < 0x80000000 ) + MM_DumpTables(0, 0x80000000); + else + MM_DumpTables(0x80000000, -1); for(;;); }