Skip to contentSkip to conversation

x86-64: move save_paranoid into .kprobes.text

PATCH In review Jan Beulich 1 participant 2 messages Mar 12, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86-64: move save_paranoid into .kprobes.text

This appears to be necessary as the function gets called from kprobes- unsafe exception handling stubs (i.e. which themselves live in .kprobes.text).

---
 arch/x86/kernel/entry_64.S |    2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/entry_64.S +2 -0
@@ -372,6 +372,7 @@ ENTRY(save_rest)
 END(save_rest)
 
 /* save complete stack frame */
+	.pushsection .kprobes.text, "ax"
 ENTRY(save_paranoid)
 	XCPT_FRAME 1 RDI+8
 	cld
@@ -400,6 +401,7 @@ ENTRY(save_paranoid)
 1:	ret
 	CFI_ENDPROC
 END(save_paranoid)
+	.popsection
 
 /*
  * A newly forked process directly context switches into this address.
#1 lore raw
Commit-ID:  c2810188c1b810c68139608a207befae0a4f1e69
Gitweb:     http://git.kernel.org/tip/c2810188c1b810c68139608a207befae0a4f1e69
Author:     "Jan Beulich" <[email protected]>
AuthorDate: Thu, 12 Mar 2009 10:38:55 +0000
Commit:     Ingo Molnar <[email protected]>
CommitDate: Thu, 12 Mar 2009 11:57:46 +0100

x86-64: move save_paranoid into .kprobes.text

Impact: mark save_paranoid as non-kprobe-able code

This appears to be necessary as the function gets called from kprobes-unsafe exception handling stubs (i.e. which themselves live in .kprobes.text).

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/entry_64.S |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kernel/entry_64.S +2 -0
index 54866bb..a331ec3 100644
@@ -368,6 +368,7 @@ ENTRY(save_rest)
 END(save_rest)
 
 /* save complete stack frame */
+	.pushsection .kprobes.text, "ax"
 ENTRY(save_paranoid)
 	XCPT_FRAME 1 RDI+8
 	cld
@@ -396,6 +397,7 @@ ENTRY(save_paranoid)
 1:	ret
 	CFI_ENDPROC
 END(save_paranoid)
+	.popsection
 
 /*
  * A newly forked process directly context switches into this address.