From: Paul Mackerras <paulus@samba.org>
To: "K.Prasad" <prasad@linux.vnet.ibm.com>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
Benjamin Herrenschmidt <benh@au1.ibm.com>
Subject: Re: [Patch 0/5] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XXII
Date: Tue, 15 Jun 2010 11:54:59 +1000 [thread overview]
Message-ID: <20100615015459.GA30479@drongo> (raw)
In-Reply-To: <20100604065145.GA2408@in.ibm.com>
On Fri, Jun 04, 2010 at 12:21:45PM +0530, K.Prasad wrote:
> Meanwhile I tested the per-cpu breakpoints with the new emulate_step
> patch (refer linuxppc-dev message-id:
> 20100602112903.GB30149@brick.ozlabs.ibm.com) and they continue to fail
> due to emulate_step() failure, in my case, on a "lwz r0,0(r28)"
> instruction.
You need to pass the instruction word to emulate_step(), not the
instruction address. Also you need to have the full GPR set
available. The patch below fixes these problems. I'll fold these
changes into your patch 2/5.
Paul.
---
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 3e423fb..f53029a 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -828,6 +828,7 @@ END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
/* We have a data breakpoint exception - handle it */
handle_dabr_fault:
+ bl .save_nvgprs
ld r4,_DAR(r1)
ld r5,_DSISR(r1)
addi r3,r1,STACK_FRAME_OVERHEAD
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index ef70cf0..489049c 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -35,6 +35,7 @@
#include <asm/hw_breakpoint.h>
#include <asm/processor.h>
#include <asm/sstep.h>
+#include <asm/uaccess.h>
/*
* Stores the breakpoints currently in use on each breakpoint address
@@ -203,6 +204,7 @@ int __kprobes hw_breakpoint_handler(struct die_args *args)
int stepped = 1;
struct arch_hw_breakpoint *info;
unsigned long dar = regs->dar;
+ unsigned int instr;
/* Disable breakpoints during exception handling */
set_dabr(0);
@@ -255,7 +257,11 @@ int __kprobes hw_breakpoint_handler(struct die_args *args)
goto out;
}
- stepped = emulate_step(regs, regs->nip);
+ stepped = 0;
+ instr = 0;
+ if (!__get_user_inatomic(instr, (unsigned int *) regs->nip))
+ stepped = emulate_step(regs, instr);
+
/*
* emulate_step() could not execute it. We've failed in reliably
* handling the hw-breakpoint. Unregister it and throw a warning
next prev parent reply other threads:[~2010-06-15 1:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-28 6:39 [Patch 0/5] PPC64-HWBKPT: Hardware Breakpoint interfaces - ver XXII K.Prasad
2010-06-02 11:33 ` Paul Mackerras
2010-06-04 6:51 ` K.Prasad
2010-06-04 9:06 ` Paul Mackerras
2010-06-07 7:03 ` K.Prasad
2010-06-07 11:25 ` Paul Mackerras
2010-06-09 10:32 ` K.Prasad
2010-06-10 4:23 ` Paul Mackerras
2010-06-15 1:54 ` Paul Mackerras [this message]
2010-06-15 6:09 ` K.Prasad
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=20100615015459.GA30479@drongo \
--to=paulus@samba.org \
--cc=benh@au1.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=prasad@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).