Instability likely related to new pmap on Cubieboard A10

Svatopluk Kraus onwahe at gmail.com
Sat Aug 22 19:15:24 UTC 2015


On Thu, Aug 20, 2015 at 10:10 PM, Dmitry Marakasov <amdmi3 at amdmi3.ru> wrote:
> * Svatopluk Kraus (onwahe at gmail.com) wrote:
>
>> >> If it helps, set it again to 1 and try attached patch, please.
>> >>
>> >> If neither the first nor the seconf attemp will work, can you send me
>> >> output like before but from another panic. I would like to see
>> >> diference.
>> >
>> > Just for the case, with patch and sp_enabled back to 1:
>> >
>> > https://people.freebsd.org/~amdmi3/pmap3.log
>> >
>>
>> Thanks. Meantime, I tried most recent HEAD on pandaboard and
>> beaglebone black and no problem there. Do you have enabled INVARIANTS
>> and INVARIANT_SUPPORT in your config?
>
> I've enabled them at some point - at least last two runs had these
> enabled. Any other way I could help? Maybe I should check if it was
> new pmap commit which caused this, and if not, bisect it?
>

Can you try attached semi-debug patch, please? I want to be sure that
problem is not on patched place.

Thanks,
Svata
-------------- next part --------------
Index: sys/arm/arm/pmap-v6-new.c
===================================================================
--- sys/arm/arm/pmap-v6-new.c	(revision 286961)
+++ sys/arm/arm/pmap-v6-new.c	(working copy)
@@ -1669,6 +1669,9 @@
 	pmap_pte2list_init(&pv_vafree, pv_chunkbase, pv_maxchunks);
 }
 
+uint32_t pmap_qenter_nozero;
+uint32_t pmap_qenter_valid;
+
 /*
  *  Add a list of wired pages to the kva
  *  this routine is only used for temporary
@@ -1681,12 +1684,10 @@
 void
 pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count)
 {
-	u_int anychanged;
 	pt2_entry_t *epte2p, *pte2p, pte2;
 	vm_page_t m;
 	vm_paddr_t pa;
 
-	anychanged = 0;
 	pte2p = pt2map_entry(sva);
 	epte2p = pte2p + count;
 	while (pte2p < epte2p) {
@@ -1693,16 +1694,18 @@
 		m = *ma++;
 		pa = VM_PAGE_TO_PHYS(m);
 		pte2 = pte2_load(pte2p);
-		if ((pte2_pa(pte2) != pa) ||
-		    (pte2_attr(pte2) != m->md.pat_mode)) {
-			anychanged++;
-			pte2_store(pte2p, PTE2_KERN(pa, PTE2_AP_KRW,
-			    m->md.pat_mode));
-		}
-		pte2p++;
+		if (pte2 != 0)
+			pmap_qenter_nozero++;
+		if (pte2_is_valid(pte2))
+			pmap_qenter_valid++;
+		if (pte2_pa(pte2) == pa && pte2_attr(pte2) != m->md.pat_mode)
+			panic("%s: va %#x pa %#x old %x new %x", __func__,
+			    sva, pa, pte2_attr(pte2), m->md.pat_mode);
+		pte2_clear(pte2p);
+		tlb_flush(sva);
+		pte2_store(pte2p++, PTE2_KERN(pa, PTE2_AP_KRW, m->md.pat_mode));
+		sva += PAGE_SIZE;
 	}
-	if (__predict_false(anychanged))
-		tlb_flush_range(sva, count * PAGE_SIZE);
 }
 
 /*


More information about the freebsd-arm mailing list