[FIX] __switch_to instrumentation on x86
What's been done here:
- patch next task: value on top of next's stack is patched;
- for that we need for regs structure (containing sp register);
- it requires changing API of the following functions:
- patch_suspended_task(): added regs argument;
- set_task_trampoline(): task -> patch address;
- arch_get_patch_addr() added (takes task and regs and returns
address to patch).
Known issues:
- x86 __switch_to instrumentation won't work at multi-core systems
(because there is no code, that removes retprobes on user stop;
because there is no regs argument passed to
dbi_unregister_kretprobe());
- I've left both old arch_get_task_pc()/arch_set_task_pc() and new
arch_get_patch_addr() APIs. They do rougly same things.
Tested on:
- i386 Qemu, Buildroot rootfs, Linux kernel 3.8.2;
- ARM Qemu, Buildroot rootfs, Linux kernel 3.8.2;
- U1HD, GT-I8800_c210v30_cluster_20121002_1.