소스 검색

[PATCH] x86_64: Don't allow kprobes on __switch_to

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: jkenisto@us.ibm.com, prasanna@in.ibm.com

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andi Kleen 19 년 전
부모
커밋
099f318b8d
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      arch/x86_64/kernel/process.c

+ 3 - 1
arch/x86_64/kernel/process.c

@@ -516,8 +516,10 @@ out:
  * This could still be optimized: 
  * This could still be optimized: 
  * - fold all the options into a flag word and test it with a single test.
  * - fold all the options into a flag word and test it with a single test.
  * - could test fs/gs bitsliced
  * - 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)
 __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 {
 {
 	struct thread_struct *prev = &prev_p->thread,
 	struct thread_struct *prev = &prev_p->thread,