[NSWI004] TLB refill

Petr Tuma petr.tuma at d3s.mff.cuni.cz
Mon Dec 14 15:33:30 CET 2020


Hi Georgii,

> 1) In the hints you ask "What happens when timer interrupt occurs when in the middle of TLB exception handling?" I don't see how that is possible. We call TLB exception handler from handle_exception_handle during which the interrupts are disabled, right?

Yes.

> 2) You also asked what happens when handle_tlb_refill returns. Once again wouldn't it just return handle_exception_general?

Not sure what you mean by this. You can look into the assembly comments to see the details, but I do not think anything special happens, the faulting instruction is simply retried.

> 3) My team wrote the code for TLB refill. So in theory we update the TLB with the proper entry, so once the handle_exception_returns it should go back to the instruction that caused the exception. But the code goes back to the handle_exception_general function. And I think I understand why. We experienced the same thing with timer interrupts, where we didn't reset one bit and CPU thought that interrupt was still going on and it would cycle back to handle_exception_general. So some bit is set somewhere, which tells the CPU that exception is still going on. But I don't know which bit I need to reset(or set) to calm the CPU. I suspect EXL has something to do with it, but I'm not sure. I read about it the manual over and over and it seems like it has some many meanings and different consequences that I get lost.

The assembly part of the TLB refill exception handler should take care of details such as enabling interrupts and clearing EXL. If you get a general exception immediately after returning from the handler, you should first look at the CP0 registers to see the reason for the exception.

Petr


More information about the NSWI004 mailing list