public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "S. P. Prasanna" <prasanna@in.ibm.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Chuck Ebbert <76306.1226@compuserve.com>, Andi Kleen <ak@suse.de>,
	Andrew Morton <akpm@osdl.org>,
	ananth@in.ibm.com, anil.s.keshavamurthy@intel.com,
	prasanna@in.ibm.com
Subject: [patch] kprobes-x86_64 : entry.s::error_entry is not safe for kprobes
Date: Sat, 5 Aug 2006 01:42:00 +0530	[thread overview]
Message-ID: <20060804201200.GA14739@in.ibm.com> (raw)

This patch moves the entry.S:error_entry to .kprobes.text section,
since code marked unsafe for kprobes jumps directly to entry.S::error_entry,
that must be marked unsafe as Chuck Ebbert suggested.
This patch also moves all the ".previous.text" asm directives to ".previous"
for kprobes section.

Signed-off-by: Prasanna S.P. <prasanna@in.ibm.com>


 arch/x86_64/kernel/entry.S |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff -puN arch/x86_64/kernel/entry.S~kprobes-x86_64-move-error_code-to-kprobes-text-section arch/x86_64/kernel/entry.S
--- linux-2.6.18-rc3/arch/x86_64/kernel/entry.S~kprobes-x86_64-move-error_code-to-kprobes-text-section	2006-08-04 17:09:55.000000000 +0530
+++ linux-2.6.18-rc3-prasanna/arch/x86_64/kernel/entry.S	2006-08-04 17:14:21.000000000 +0530
@@ -813,7 +813,7 @@ paranoid_schedule\trace:
  * Exception entry point. This expects an error code/orig_rax on the stack
  * and the exception handler in %rax.	
  */ 		  				
-ENTRY(error_entry)
+KPROBE_ENTRY(error_entry)
 	_frame RDI
 	/* rdi slot contains rax, oldrax contains error code */
 	cld	
@@ -898,6 +898,7 @@ error_kernelspace:
         je   error_swapgs
 	jmp  error_sti
 END(error_entry)
+	.previous
 	
        /* Reload gs selector with exception handling */
        /* edi:  new selector */ 
@@ -1017,7 +1018,7 @@ ENDPROC(execve)
 KPROBE_ENTRY(page_fault)
 	errorentry do_page_fault
 END(page_fault)
-	.previous .text
+	.previous
 
 ENTRY(coprocessor_error)
 	zeroentry do_coprocessor_error
@@ -1039,7 +1040,7 @@ KPROBE_ENTRY(debug)
 	paranoidentry do_debug, DEBUG_STACK
 	paranoidexit
 END(debug)
-	.previous .text
+	.previous
 
 	/* runs on exception stack */	
 KPROBE_ENTRY(nmi)
@@ -1054,7 +1055,7 @@ KPROBE_ENTRY(nmi)
  	CFI_ENDPROC
 #endif
 END(nmi)
-	.previous .text
+	.previous
 
 KPROBE_ENTRY(int3)
  	INTR_FRAME
@@ -1064,7 +1065,7 @@ KPROBE_ENTRY(int3)
  	jmp paranoid_exit1
  	CFI_ENDPROC
 END(int3)
-	.previous .text
+	.previous
 
 ENTRY(overflow)
 	zeroentry do_overflow
@@ -1113,7 +1114,7 @@ END(stack_segment)
 KPROBE_ENTRY(general_protection)
 	errorentry do_general_protection
 END(general_protection)
-	.previous .text
+	.previous
 
 ENTRY(alignment_check)
 	errorentry do_alignment_check

_
-- 
S.P. Prasanna
Linux Technology Center
India Software Labs, IBM Bangalore
Email: prasanna@in.ibm.com
Ph: 91-80-41776329

                 reply	other threads:[~2006-08-04 14:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060804201200.GA14739@in.ibm.com \
    --to=prasanna@in.ibm.com \
    --cc=76306.1226@compuserve.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox