kernel vm question
David Schultz
das at FreeBSD.ORG
Thu Jan 27 11:21:52 PST 2005
On Thu, Jan 27, 2005, Jacques Fourie wrote:
> Hi,
>
> Yes, I am trying to patch a piece of code in the kernel. The strange
> thing is that this code works without a problem on FreeBSD 4.8 - has
> the VM system changed to such an extent between 4.8 and 4.9 that the
> pages in the kernel code segment are not writeable anymore?
>
> Thanks for the bit about the compiler optimization - at least I
> understand that part now :)
The idea that the compiler is responsible for the different
behavior between 4.8 and 4.9 is just a theory, but it really
doesn't matter; it's not so easy to dynamically change the code
for a function. In addition to the protection bits, you also have
to worry about synchronization with calls to that function, and
about the possibility that a processor may have the old code in
its instruction cache.
More information about the freebsd-hackers
mailing list