![](http://datasheet.mmic.net.cn/370000/-PD30101_datasheet_16680756/-PD30101_140.png)
CHAPTER 5 EXCEPTION PROCESSING
109
(3) TLB Modified exception
Cause
The TLB Modified exception occurs when a virtual address referenced by the store instruction matches
a TLB entry that is marked valid (the V bit is set to 1) but is not writeable (the D bit is set to 0). This
exception is not maskable.
Processing
The common exception vector is used for this exception, and the Mod code in the ExcCode field of the
Cause register is set.
When this exception occurs, the BadVAddr, Context, XContext and EntryHi registers contain the virtual
address that failed address translation. The EntryHi register also contains the ASID from which the
translation fault occurred. The contents of the EntryLo register are undefined.
The EPC register contains the address of the instruction that caused the exception unless that
instruction is in a branch delay slot, in which case the EPC register contains the address of the
preceding branch instruction and the BD bit of the Cause register is set to 1.
Servicing
The kernel uses the failed virtual address or virtual page number to identify the corresponding access
control bits. The page identified may or may not permit write accesses; if writes are not permitted, a
write protection violation occurs.
If write accesses are permitted, the page frame is marked dirty (/writeable) by the kernel in its own data
structures.
The TLBP instruction places the index of the TLB entry that must be altered into the Index register. The
EntryLo register is loaded with a word containing the physical page frame and access control bits (with
the D bit set to 1), and the EntryHi and EntryLo registers are written into the TLB.