Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Aug 2015 21:15:22 +0200
From:      Svatopluk Kraus <onwahe@gmail.com>
To:        Dmitry Marakasov <amdmi3@amdmi3.ru>
Cc:        Adrian Chadd <adrian.chadd@gmail.com>,  "freebsd-arm@FreeBSD.org" <freebsd-arm@freebsd.org>, Ian Lepore <ian@freebsd.org>
Subject:   Re: Instability likely related to new pmap on Cubieboard A10
Message-ID:  <CAFHCsPUMxiNHoUqxmz2TjELX943v2b8dkJzgTNowJ%2B=%2B7qDSMg@mail.gmail.com>
In-Reply-To: <20150820201020.GC1245@hades.panopticon>
References:  <20150819013834.GD79354@hades.panopticon> <CAJ-VmokJv=nvcEkBogWeNJT65MosxnFcaitWn8FXJu32eahSdw@mail.gmail.com> <20150819120753.GH79354@hades.panopticon> <CAFHCsPVSGuWWY97ac2QVGAE77Lz2gJ12wDLpzH_kNdZsLQxh%2BQ@mail.gmail.com> <20150819134708.GJ79354@hades.panopticon> <CAFHCsPVwZS_rCnvKztg7g2%2BvrOBwQpqpPYyA2=hCLGiiU5=mrQ@mail.gmail.com> <20150819232836.GA1245@hades.panopticon> <CAFHCsPUfMhkCjiip7o6ZwGx4jNb1-Xqptsj9h_CzZ8xtfZswiA@mail.gmail.com> <20150820185417.GB1245@hades.panopticon> <CAFHCsPVrNFEDkq-j99j7a5GDBN2u7kRJRGk6Ggym2v_dre%2BN3A@mail.gmail.com> <20150820201020.GC1245@hades.panopticon>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Thu, Aug 20, 2015 at 10:10 PM, Dmitry Marakasov <amdmi3@amdmi3.ru> wrote:
> * Svatopluk Kraus (onwahe@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

[-- Attachment #2 --]
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);
 }
 
 /*

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFHCsPUMxiNHoUqxmz2TjELX943v2b8dkJzgTNowJ%2B=%2B7qDSMg>