|
From: Jeremy F. <je...@go...> - 2005-02-14 18:04:17
|
On Mon, 2005-02-14 at 11:18 +0000, Julian Seward wrote: > > movl %addr, %tmp > shrl $n, %tmp > testb $0, offset(%ebp, %tmp, 1) > jz OK > <handle failure somehow> > OK: 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. J |