A system includes a memory, a plurality of pages held in the memory, an
instruction translation look aside buffer (ITLB), a first data
translation look aside buffer (DTLB), and a translation look aside (TLB)
miss handler. The system also includes an executable/non-executable (x)
indicator associated with each page in memory. The TLB miss handler sets
the x-indicator for a particular page to indicate "non-executable" when
that page is accessed in a mode that allows writing to that page. The
ITLB or the ITLB miss handler refuses to allow instructions from a page
with an associated x-indicator of "non-executable" to be loaded into the
instruction buffer.