|
From: Nicholas N. <nj...@cs...> - 2005-02-15 00:45:05
|
On Mon, 14 Feb 2005, Jeremy Fitzhardinge wrote: > A thought I just had in the shower: if the table entries are actually > pages, you can use mprotect to mark them as client-accessible or not. > Then the sequence looks like: > mov %addr, %tmp > shrl $n, %tmp /* %tmp /= (superblocksize / pagesize) */ > testb $0, table(%tmp) /* any memory-touching instruction; > faults if %addr is bad */ > > This would use no cache and has no jumps, but it does use TLB entries > for the table, so it isn't completely free. But it's worth considering. And you have to call mprotect whenever you switch between generated code and Valgrind code, right? That could be expensive. N |