A JIT compiler will read data (byte code) from one area of the memory, write machine code to another area of the memory, and then execute it.
When PAE is enabled, we have access to the No Execute Bit. I assume any intelligent OS will then make a distinction between pages containing code and pages containing data; I assume code pages would not be writeable and data pages would not be executable.
If a JIT compiler is part of the kernel this is a non-issue, as the kernel has the authority to change page protection at will.
But how does a user-mode program do this? Any area it can write to it cannot execute; any area it can execute it cannot write to.
JIT Compiler with PAE paging protection
Re: JIT Compiler with PAE paging protection
It asks the kernel nicely to change the permissions for it.
Re: JIT Compiler with PAE paging protection
There are various OS-specific syscalls to do this. For example, on Linux have a look at mprotect().
Regards,
John.
Regards,
John.
Re: JIT Compiler with PAE paging protection
D'oh, I guess that shouldn't have been too hard to figure out on my own