The R5900 TLB refill handler is limited to 128 bytes, corresponding to 32 instructions. Commit eaccf2f32090df98f70b47edf07d15a82792e428 is a provisional fix. Commit 8ff93271c3507155222567cc66e137234d419e78 verifies that the R5900 TLB refill handler does not overflow.
Installing a 256 byte TLB refill handler for the R5900 at address 0x80000000 overwrites the performance counter (see #26) handler at address 0x80000080, according to the TX79 manual, p. 5-7:
Table 5-2. Exception Vectors for Level 1 exceptions
Exceptions
Vector Address
BEV = 0
BEV = 1
TLB Refill (EXL = 0)
0x8000 0000
0xBFC0 0200
TLB Refill (EXL = 1)
0x8000 0180
0xBFC0 0380
Interrupt
0x8000 0200
0xBFC0 0400
Others
0x8000 0180
0xBFC0 0380
Table 5-3. Exception Vectors for Level 2 exceptions
The R5900 TLB refill handler is limited to 128 bytes, corresponding to 32 instructions. Commit eaccf2f32090df98f70b47edf07d15a82792e428 is a provisional fix. Commit 8ff93271c3507155222567cc66e137234d419e78 verifies that the R5900 TLB refill handler does not overflow.
Installing a 256 byte TLB refill handler for the R5900 at address 0x80000000 overwrites the performance counter (see #26) handler at address 0x80000080, according to the TX79 manual, p. 5-7: