2.5.8 sort kernel tables
Quoted 3 lines · Paul Mackerras
BTW, do you have any valid examples of use of copy_to/from_user or get/put_user in an init section?
i386 uses the exception tables to check at startup for the old i386 bug of pages not being write protected when writing from supervisor mode. That function is __init.
-Andi
Quoted 8 lines · Andi Kleen
Quoted 3 lines · Paul Mackerras
BTW, do you have any valid examples of use of copy_to/from_user or get/put_user in an init section?
i386 uses the exception tables to check at startup for the old i386 bug of pages not being write protected when writing from supervisor mode. That function is
__init.
It used to be, somebody realised that it did not work and took it out of __init. With sorted tables it can be moved back.
/*
* This function cannot be __init, since exceptions don't work in that
* section.
*/
static int do_test_wp_bit(unsigned long vaddr);
That fixes the symptom, not the cause. It is better to sort the tables at boot time than to find each bit of code that might break the tables and change the code.