From: NIIBE Y. <gn...@ch...> - 2000-04-30 04:40:19
|
While chasing the bug which stops SH-4 running, I've found two more bugs. But this doesn't fix my problem... I'll commit this tomorrow. Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxsh/kernel/ChangeLog,v retrieving revision 1.11 diff -u -r1.11 ChangeLog --- ChangeLog 2000/04/30 00:51:08 1.11 +++ ChangeLog 2000/04/30 03:45:38 @@ -1,3 +1,11 @@ +2000-04-30 NIIBE Yutaka <gn...@m1...> + + * arch/sh/mm/fault.c (update_mmu_cache): Bug fix. We need to + flush ITLB. + + * arch/sh/kernel/time.c (time_init): Bug fix. The interval + should depend on HZ. + 2000-04-29 NIIBE Yutaka <gn...@m1...> * arch/sh/mm/cache.c (flush_cache_all): Don't touch CCR. Index: arch/sh/kernel/time.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/time.c,v retrieving revision 1.4 diff -u -r1.4 time.c --- arch/sh/kernel/time.c 2000/04/28 17:58:50 1.4 +++ arch/sh/kernel/time.c 2000/04/30 03:45:39 @@ -436,7 +436,7 @@ module_clock = master_clock/pfc; printk("Module clock: %d.%02dMHz\n", (module_clock/1000000), (module_clock % 1000000)/10000); - interval = (module_clock/400); + interval = (module_clock/(HZ*4)); printk("Interval = %ld\n", interval); Index: arch/sh/mm/fault.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/mm/fault.c,v retrieving revision 1.7 diff -u -r1.7 fault.c --- arch/sh/mm/fault.c 2000/04/30 00:50:23 1.7 +++ arch/sh/mm/fault.c 2000/04/30 03:45:39 @@ -261,18 +261,24 @@ unsigned long pteaddr; save_and_cli(flags); +#if defined(__SH4__) /* - * We don't need to set PTEH register. - * It's automatically set by the hardware. + * ITLB is not affected by "ldtlb" instruction. + * So, we need to flush the entry by ourselves. */ + __flush_tlb_page(vma->vm_mm, address&PAGE_MASK); +#endif + + /* Set PTEH register */ + pteaddr = (address & MMU_VPN_MASK) | + (vma->vm_mm->context & MMU_CONTEXT_ASID_MASK); + ctrl_outl(pteaddr, MMU_PTEH); + + /* Set PTEL register */ pteval = pte_val(pte); pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */ pteval |= _PAGE_FLAGS_HARDWARE_DEFAULT; /* add default flags */ - /* Set PTEL register */ ctrl_outl(pteval, MMU_PTEL); - /* Set PTEH register */ - pteaddr = (address & MMU_VPN_MASK) | (vma->vm_mm->context & MMU_CONTEXT_ASID_MASK); - ctrl_outl(pteaddr, MMU_PTEH); /* Load the TLB */ asm volatile("ldtlb": /* no output */ : /* no input */ : "memory"); Bug fix for standard kernel. -------------------------------------- Index: fs/super.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/fs/super.c,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 super.c --- fs/super.c 2000/04/29 15:46:02 1.1.1.6 +++ fs/super.c 2000/04/30 03:45:40 @@ -1562,7 +1562,7 @@ } ROOT_DEV = new_root_dev; mount_root(); -#if 1 +#if 0 shrink_dcache(); printk("change_root: old root has d_count=%d\n", old_root->d_count); #endif Index: mm/vmscan.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/mm/vmscan.c,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 vmscan.c --- mm/vmscan.c 2000/04/29 15:46:04 1.1.1.3 +++ mm/vmscan.c 2000/04/30 03:45:48 @@ -388,7 +388,7 @@ continue; /* small processes are swapped out less */ while ((mm->swap_cnt << 2 * (i + 1) < max_cnt) - && i++ < 10) + && i++ < 10); mm->swap_cnt >>= i; mm->swap_cnt += i; /* if swap_cnt reaches 0 */ /* we're big -> hog treatment */ |
From: NIIBE Y. <gn...@ch...> - 2000-04-30 23:40:17
|
And another one. I'll commit this too. 2000-04-30 NIIBE Yutaka <gn...@m1...> * arch/sh/kernel/entry.S (restore_all): Bug fix. We should consider FPU exception within the critical region. We should not change the IMASK value in this case. Or else, we would introduce a "hole" in the critical region. Index: arch/sh/kernel/entry.S =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/entry.S,v retrieving revision 1.9 diff -u -r1.9 entry.S --- arch/sh/kernel/entry.S 2000/04/30 00:50:23 1.9 +++ arch/sh/kernel/entry.S 2000/04/30 23:27:35 @@ -492,7 +492,16 @@ mov.l 2f, $k1 and $k1, $k2 ! Mask orignal SR value or $k0, $k2 ! Inherit current FD-bit - or $g_imask, $k2 ! Inherit the IMASK-bits + ! + mov $k3, $k0 ! Calculate IMASK-bits + shlr2 $k0 + and #0x3c, $k0 + cmp/eq #0x3c, $k0 + bf/s 7f + mov $g_imask, $k0 + shll2 $k0 + ! +7: or $k0, $k2 ! Set the IMASK-bits ldc $k2, $ssr ! #if defined(__SH4__) @@ -507,7 +516,7 @@ ! There's the case we don't get FPU now stc $sr, $k2 tst $k1, $k2 - bt 7f + bt 8f ! We need to grab FPU here xor $k1, $k2 ldc $k2, $sr ! Grab FPU @@ -519,7 +528,7 @@ ! ! Restoring FPU... ! -7: mov.l 3f, $k1 +8: mov.l 3f, $k1 lds $k1, $fpscr fmov.s @$r15+, $fr0 fmov.s @$r15+, $fr1 |
From: Mitch D. <mj...@au...> - 2000-05-01 02:01:56
|
NIIBE Yutaka wrote: > > While chasing the bug which stops SH-4 running, I've found two more > bugs. But this doesn't fix my problem... > > Index: mm/vmscan.c > =================================================================== > RCS file: /cvsroot/linuxsh/kernel/mm/vmscan.c,v > retrieving revision 1.1.1.3 > diff -u -r1.1.1.3 vmscan.c > --- mm/vmscan.c 2000/04/29 15:46:04 1.1.1.3 > +++ mm/vmscan.c 2000/04/30 03:45:48 > @@ -388,7 +388,7 @@ > continue; > /* small processes are swapped out less */ > while ((mm->swap_cnt << 2 * (i + 1) < max_cnt) > - && i++ < 10) > + && i++ < 10); This code changed in pre7-1, so if it's a bug I don't think we'll be the only people to have it. Regards, Mitch. -- | mailto:mj...@au... | Not the official view of: | | mailto:mj...@al... | Australian Calculator Opn | | Certified Linux Evangelist! | Hewlett Packard Australia | |