Skip to content

Commit

Permalink
[PATCH] x86_64: Don't allow kprobes on __switch_to
Browse files Browse the repository at this point in the history
kprobes cannot deal with the funny calling conventions when it
runs on a different stack when it returns. If someone wants
to instrument context switch they can add a probe to schedule()
instead.

Cc: [email protected], [email protected]

Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Feb 5, 2006
1 parent 16acc0c commit 099f318
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/x86_64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,10 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long rsp,
* This could still be optimized:
* - fold all the options into a flag word and test it with a single test.
* - could test fs/gs bitsliced
*
* Kprobes not supported here. Set the probe on schedule instead.
*/
struct task_struct *
__kprobes struct task_struct *
__switch_to(struct task_struct *prev_p, struct task_struct *next_p)
{
struct thread_struct *prev = &prev_p->thread,
Expand Down

0 comments on commit 099f318

Please sign in to comment.