On Mon, 2 Jun 2003, Atsushi Nemoto wrote: > Please ignore it. I missed an another fix. The beqz lacks delay > slot. Here is a new patch. > > diff -u linux-mips-cvs/arch/mips64/mm/tlbex-r4k.S linux.new/arch/mips64/mm/tlbex-r4k.S > --- linux-mips-cvs/arch/mips64/mm/tlbex-r4k.S Mon Apr 28 09:44:54 2003 > +++ linux.new/arch/mips64/mm/tlbex-r4k.S Mon Jun 2 20:16:41 2003 > @@ -72,9 +72,12 @@ > /* > * Determine that fault address is within vmalloc range. > */ > + bgez \ptr, \not_vmalloc # check overflow > + nop > dla \tmp, ekptbl > sltu \tmp, \ptr, \tmp > beqz \tmp, \not_vmalloc # not vmalloc > + nop > .endm The missing delay slot filler might be called a feature, but LOAD_KPTE2 is so far always used near such code it cannot be avoided. So the "nop" is correct. Please pay attention to proper indentation of instructions in branch delay slots -- this helps avoiding such errors. I don't think a separate overflow check is needed, even I see how the code can fail for large offsets into XKSEG. How about this patch? Does it work for you? It would not incur unnecessary overhead. Maciej -- + Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: macro@ds2.pg.gda.pl, PGP key available + patch-mips-2.4.21-pre4-20030505-load_kpte2-0 diff -up --recursive --new-file linux-mips-2.4.21-pre4-20030505.macro/arch/mips64/mm/tlbex-r4k.S linux-mips-2.4.21-pre4-20030505/arch/mips64/mm/tlbex-r4k.S --- linux-mips-2.4.21-pre4-20030505.macro/arch/mips64/mm/tlbex-r4k.S 2003-04-27 02:56:39.000000000 +0000 +++ linux-mips-2.4.21-pre4-20030505/arch/mips64/mm/tlbex-r4k.S 2003-06-03 12:54:41.000000000 +0000 @@ -73,8 +73,9 @@ * Determine that fault address is within vmalloc range. */ dla \tmp, ekptbl - sltu \tmp, \ptr, \tmp + slt \tmp, \ptr, \tmp beqz \tmp, \not_vmalloc # not vmalloc + nop .endm