wfjm / w11

PDP-11/70 CPU core and SoC
https://wfjm.github.io/home/w11/
GNU General Public License v3.0
119 stars 18 forks source link

MMU trap delayed/lost when prefetch in s_idecode done #36

Closed wfjm closed 1 year ago

wfjm commented 2 years ago

The s_idecode prefetch logic checks only for tflag and int_pending, but not for pending MMU traps.
If the instruction read of an RR instruction, like ROR R0 or ADD R0,R1 causes an MMU trap, this trap will not executed.
In fact, it's not even queued, it's lost.
Detected in a code review.

No practical consequences, MMU traps are not used by any OS.
But clearly a BUG, such cases should trigger an MMU trap.

wfjm commented 1 year ago

Fixed in 85f1854, MMU traps are now executed precisely for prefetched instructions.