Lets ignore the modules, start with the main kernel. What about the
following idea:
* by default, "lock;btrl %0" is used.
* a new section for "self-modifying code pointer". The table could be
discarded after boot.
* each spin_unlock-macro adds an entry to the that section.
spin_unlock():
__asm__ __volatile__(
"1: lock; btrl %0"
".section .text.selfmodtable,ax"
".long &1" <<<<<<< pseudo code, but that should be possible
".previous"
...);
During early init, we walk through the .text.selfmodtable pointer table
and exchange all instructions with the optimal version. The only
limitation is that we cannot change the instruction length.
> also, the binary
> module people would be forced to brutally murder you :-)
>
Why? Their .text.selfmodtable section would be empty, i.e. no problems.
-- Manfred
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/