Hello, On Wed, Jan 24, 2007 at 12:31:16AM +0100, Michael Niedermayer wrote: > On Wed, Jan 24, 2007 at 12:39:00AM +0200, Siarhei Siamashka wrote: [...] > > So all there mprotect calls in my code are done in order to ensure that cache > > flushing works correctly. So we do: > > * mmap some memory block with permission to execute code from it > > * generate a simple code for function that should return 0 > > * call this code and check that it really returned 0 > > * do mprotect to disable and reenable code execution (and hope that it does > > cache flush) > > * generate a simple code for function that should return 1 > > * call this code and check that it really returned 1 (without mprotect calls > > it would still return 0) > > i do not like this redundant mess, especially because a simple task switch > at the right moment will make it look as if everything is ok Wouldn't any even half-decent OS do the appropriate flush if you just mmap it noexec but write and then mprotect it to not writable but executable? Greetings, Reimar D?ffinger
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4