Subject: [PATCH -tip ] [BUGFIX] x86/kprobes: Prevent kprobes to probe on save_args

Prevent kprobes to probe on save_args() since this function
will be called from breakpoint exception handler. That will
cause infinit loop on breakpoint handling.

Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Ananth N Mavinakayanahalli <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: [email protected]
Cc: [email protected]
---

arch/x86/kernel/entry_64.S | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index fe2690d..e3ba417 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -295,6 +295,7 @@ ENDPROC(native_usergs_sysret64)
.endm

/* save partial stack frame */
+ .pushsection .kprobes.text, "ax"
ENTRY(save_args)
XCPT_FRAME
cld
@@ -334,6 +335,7 @@ ENTRY(save_args)
ret
CFI_ENDPROC
END(save_args)
+ .popsection

ENTRY(save_rest)
PARTIAL_FRAME 1 REST_SKIP+8


Subject: [tip:perf/urgent] x86/kprobes: Prevent kprobes to probe on save_args()

Commit-ID: de31ec8a31046111befd16a7083e3bdda2ff42cf
Gitweb: http://git.kernel.org/tip/de31ec8a31046111befd16a7083e3bdda2ff42cf
Author: Masami Hiramatsu <[email protected]>
AuthorDate: Thu, 18 Nov 2010 19:16:55 +0900
Committer: Ingo Molnar <[email protected]>
CommitDate: Thu, 18 Nov 2010 13:40:19 +0100

x86/kprobes: Prevent kprobes to probe on save_args()

Prevent kprobes to probe on save_args() since this function
will be called from breakpoint exception handler. That will
cause infinit loop on breakpoint handling.

Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: [email protected]
Cc: Ananth N Mavinakayanahalli <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/kernel/entry_64.S | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index fe2690d..e3ba417 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -295,6 +295,7 @@ ENDPROC(native_usergs_sysret64)
.endm

/* save partial stack frame */
+ .pushsection .kprobes.text, "ax"
ENTRY(save_args)
XCPT_FRAME
cld
@@ -334,6 +335,7 @@ ENTRY(save_args)
ret
CFI_ENDPROC
END(save_args)
+ .popsection

ENTRY(save_rest)
PARTIAL_FRAME 1 REST_SKIP+8