From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Masami Hiramatsu <mhiramat@redhat.com>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
David Miller <davem@davemloft.net>,
hskinnemoen@atmel.com, schwidefsky@de.ibm.com,
tony.luck@intel.com, Ingo Molnar <mingo@elte.hu>,
Paul Mackerras <paulus@samba.org>,
David Wilder <dwilder@us.ibm.com>,
jkenisto@us.ibm.com
Subject: Re: [PATCHv4] kprobes: Introduce kprobe_handle_fault()
Date: Thu, 10 Jan 2008 00:16:21 +0100 [thread overview]
Message-ID: <20080109231620.GA9002@osiris.ibm.com> (raw)
In-Reply-To: <1199916062.6424.60.camel@brick>
> arch/avr32/mm/fault.c | 21 +--------------------
> arch/ia64/mm/fault.c | 24 +-----------------------
> arch/powerpc/mm/fault.c | 25 +------------------------
> arch/s390/mm/fault.c | 25 +------------------------
> arch/sparc64/mm/fault.c | 23 +----------------------
> arch/x86/mm/fault_64.c | 23 ++---------------------
> include/linux/kprobes.h | 17 +++++++++++++++++
> 7 files changed, 24 insertions(+), 134 deletions(-)
Somehow I think you missed arch/x86/mm/fault_32.c :)
> This uncovered a possible bug in the s390 version as that purely
> copied the x86 version unconditionally passing 14 as the trapnr
> rather than the error_code parameter.
> diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
> index 2456b52..a9033cf 100644
> --- a/arch/s390/mm/fault.c
> +++ b/arch/s390/mm/fault.c
> @@ -51,29 +51,6 @@ extern int sysctl_userprocess_debug;
>
> extern void die(const char *,struct pt_regs *,long);
>
> -#ifdef CONFIG_KPROBES
> -static inline int notify_page_fault(struct pt_regs *regs, long err)
> -{
> - int ret = 0;
> -
> - /* kprobe_running() needs smp_processor_id() */
> - if (!user_mode(regs)) {
> - preempt_disable();
> - if (kprobe_running() && kprobe_fault_handler(regs, 14))
> - ret = 1;
> - preempt_enable();
> - }
> -
> - return ret;
> -}
> -#else
> -static inline int notify_page_fault(struct pt_regs *regs, long err)
> -{
> - return 0;
> -}
> -#endif
> -
> -
> /*
> * Unlock any spinlocks which will prevent us from getting the
> * message out.
> @@ -309,7 +286,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int write)
> int si_code;
> int fault;
>
> - if (notify_page_fault(regs, error_code))
> + if (kprobe_handle_fault(regs, 14))
> return;
Uhm.. yes. 14 is HFP-Significance exception. That doesn't make too much
sense. Passing error_code here would be the right thing to do.
Also I just checked with David Wilder: system tap itself doesn't have any
fault handlers. So it should be safe to change this.
next prev parent reply other threads:[~2008-01-09 23:16 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-07 20:24 [PATCHv2] kprobes: Introduce is_kprobe_fault() Harvey Harrison
2008-01-08 5:37 ` Ananth N Mavinakayanahalli
2008-01-08 17:03 ` Masami Hiramatsu
2008-01-08 22:45 ` Paul Mackerras
2008-01-08 23:02 ` Harvey Harrison
2008-01-09 4:19 ` [PATCHv3] kprobes: Introduce kprobe_handle_fault() Harvey Harrison
2008-01-09 6:14 ` Heiko Carstens
2008-01-09 6:22 ` Harvey Harrison
2008-01-09 22:01 ` [PATCHv4] " Harvey Harrison
2008-01-09 23:16 ` Heiko Carstens [this message]
2008-01-10 0:25 ` Harvey Harrison
2008-01-10 0:44 ` [PATCH 1/2] " Harvey Harrison
2008-01-10 3:15 ` Masami Hiramatsu
2008-01-10 12:50 ` Ingo Molnar
2008-01-10 0:45 ` [PATCH 2/2] kprobe: remove preempt_enable/disable from kprobe_handle_fault() Harvey Harrison
2008-01-10 3:15 ` Masami Hiramatsu
2008-01-09 23:31 ` [PATCHv4] kprobes: Introduce kprobe_handle_fault() Masami Hiramatsu
2008-01-09 7:58 ` [PATCHv3] " Christoph Hellwig
2008-01-09 7:57 ` Christoph Hellwig
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=20080109231620.GA9002@osiris.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=davem@davemloft.net \
--cc=dwilder@us.ibm.com \
--cc=harvey.harrison@gmail.com \
--cc=hch@infradead.org \
--cc=hskinnemoen@atmel.com \
--cc=jkenisto@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@redhat.com \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=schwidefsky@de.ibm.com \
--cc=tony.luck@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.