Browse files

Fix incorrect return to physical address upon ITLB page fault exception

When returning from itlb page fault we need to return to
the virtual address which caused the page fault and not the physical address.
We therefore overwrite the content of "ea" (exception address) register with
the result of rcsr ITLBMA.
  • Loading branch information...
1 parent 4225524 commit 0b65466c149be9125e05cc9d7a72210bfb943d63 @fallen committed Jun 14, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 software/mmu-bios/crt0.S
@@ -122,11 +122,12 @@ _dtlb_miss_exception_handler:
sw (sp+0), ra
calli .save_all
+ rcsr r1, itlbma /* get virtual address which caused the page fault */
+ mv ea, r1 /* when returning from exception we branch back to that virtual address */
calli itlb_miss_handler
bi .restore_all_and_eret
- nop
.byte 0x10

0 comments on commit 0b65466

Please sign in to comment.