Date: Tue, 29 Jun 2010 16:32:52 +0530 From: "Jayachandran C." <c.jayachandran@gmail.com> To: Luiz Otavio O Souza <lists.br@gmail.com> Cc: freebsd-mips@freebsd.org Subject: Re: Merging 64 bit changes to -HEAD Message-ID: <AANLkTilQIqF4FCfgLdVcKdcsAUVjCmr89Lu0TEXUFdYN@mail.gmail.com> In-Reply-To: <C6D73C96-3640-4502-A9D7-B3597E37E80A@gmail.com> References: <AANLkTik8jFkB7FTIIhyjalkfv1c0yXqse57Jzz527uf_@mail.gmail.com> <897604F6-95C4-49A8-B11F-277A74C8DBAE@gmail.com> <AANLkTilfW_zOFKuIa0gJ3ahTo-vGC1VNk99a1H24uFRq@mail.gmail.com> <AANLkTil78NFxH016C7MntD8L3d4rFlCudJ0Lv22L0KCb@mail.gmail.com> <3C0AEF9B-AE0C-4459-A4E1-2C8C30C10FD6@gmail.com> <AANLkTint7Hyf79EH29OLsIfreQRd7dQMdvX9wRq4v_yG@mail.gmail.com> <C6D73C96-3640-4502-A9D7-B3597E37E80A@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Tue, Jun 29, 2010 at 2:28 AM, Luiz Otavio O Souza <lists.br@gmail.com> wrote:
>> Thanks for the the update. Looks like pmap_map for kernel is failing,
>> may be the new tlb_update code causes this. Can you apply the
>> attached patch and see if the problem still persists, it replaces the
>> new tlb_update code with the older version.
>>
>> Obviously not a fix, but if we can narrow it down to this function,
>> fixing will be easier.
>>
>> JC.
>> <try.diff>
>
> JC,
>
> This fix the problem ! Thanks ! Now, at least, you know where to look :)
The new tlb_update does not seem to update the tlb entry if the tlbp
fails. Here's a patch that should make the new function behave like
the older one. The patch is in attached file 'tlb-update.diff'.
If that does not work, I'm not sure what the issue is. You could also
try try the nop-change.diff attached. It tries to switch the ssnop
used for delay in the new code with 'nop' which was used by the old
code.
Thanks,
JC.
[-- Attachment #2 --]
Index: sys/mips/mips/tlb.c
===================================================================
--- sys/mips/mips/tlb.c (revision 209521)
+++ sys/mips/mips/tlb.c (working copy)
@@ -217,19 +217,21 @@
void
tlb_update(struct pmap *pmap, vm_offset_t va, pt_entry_t pte)
{
- register_t mask, asid;
- register_t s;
+ pt_entry_t other;
+ register_t mask, asid, hi, s;
int i;
va &= ~PAGE_MASK;
+ other = pte & PTE_G;
pte &= ~TLBLO_SWBITS_MASK;
+ hi = TLBHI_ENTRY(va, pmap_asid(pmap));
s = intr_disable();
mask = mips_rd_pagemask();
asid = mips_rd_entryhi() & TLBHI_ASID_MASK;
mips_wr_pagemask(0);
- mips_wr_entryhi(TLBHI_ENTRY(va, pmap_asid(pmap)));
+ mips_wr_entryhi(hi);
tlb_probe();
i = mips_rd_index();
if (i >= 0) {
@@ -241,6 +243,17 @@
mips_wr_entrylo1(pte);
}
tlb_write_indexed();
+ } else {
+ mips_wr_pagemask(0);
+ mips_wr_entryhi(hi);
+ if ((va & PAGE_SIZE) == 0) {
+ mips_wr_entrylo0(pte);
+ mips_wr_entrylo1(other);
+ } else {
+ mips_wr_entrylo0(other);
+ mips_wr_entrylo1(pte);
+ }
+ tlb_write_random();
}
mips_wr_entryhi(asid);
[-- Attachment #3 --]
Index: sys/mips/include/cpuregs.h
===================================================================
--- sys/mips/include/cpuregs.h (revision 209521)
+++ sys/mips/include/cpuregs.h (working copy)
@@ -119,7 +119,7 @@
* Pick a reasonable default based on the "typical" spacing described in the
* "CP0 Hazards" chapter of MIPS Architecture Book Vol III.
*/
-#define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop
+#define COP0_SYNC nop; nop; nop; nop; nop
#endif
#define COP0_HAZARD_FPUENABLE nop; nop; nop; nop;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTilQIqF4FCfgLdVcKdcsAUVjCmr89Lu0TEXUFdYN>
