Re: [PATCH v2] powerpc/uprobes: Validation for prefixed instruction

2021-02-04 Thread Ananth N Mavinakayanahalli
On 2/4/21 4:19 PM, Ravi Bangoria wrote: On 2/4/21 4:17 PM, Ravi Bangoria wrote: Don't allow Uprobe on 2nd word of a prefixed instruction. As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Uprobe on such prefixed instruction as well. There are two ways

[PATCH v2 2/2] powerpc/sstep: Fix incorrect return from analyze_instr()

2021-01-25 Thread Ananth N Mavinakayanahalli
says 'did not emulate, may have to single-step'. Fixes: 930d6288a26787 ("powerpc: sstep: Add support for maddhd, maddhdu, maddld instructions") Signed-off-by: Ananth N Mavinakayanahalli Suggested-by: Michael Ellerman Tested-by: Naveen N. Rao Reviewed-by: Sandipan Das --- arch/p

[PATCH v4 1/2] [PATCH] powerpc/sstep: Check instruction validity against ISA version before emulation

2021-01-25 Thread Ananth N Mavinakayanahalli
We currently unconditionally try to emulate newer instructions on older Power versions that could cause issues. Gate it. Fixes: 350779a29f11 ("powerpc: Handle most loads and stores in instruction emulation code") Signed-off-by: Ananth N Mavinakayanahalli --- [v4] Based on feedback

Re: [PATCH] lib/sstep: Fix incorrect return from analyze_instr()

2021-01-24 Thread Ananth N Mavinakayanahalli
On 1/23/21 6:03 AM, Michael Ellerman wrote: Ananth N Mavinakayanahalli writes: We currently just percolate the return value from analyze_instr() to the caller of emulate_step(), especially if it is a -1. For one particular case (opcode = 4) for instructions that aren't currently emulated, we

[PATCH] lib/sstep: Fix incorrect return from analyze_instr()

2021-01-21 Thread Ananth N Mavinakayanahalli
says 'did not emulate, may have to single-step'. Signed-off-by: Ananth N Mavinakayanahalli Tested-by: Naveen N. Rao --- arch/powerpc/lib/sstep.c | 49 +- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/lib/sstep.c b/arch

[PATCH v3] [PATCH] powerpc/sstep: Check ISA 3.0 instruction validity before emulation

2021-01-20 Thread Ananth N Mavinakayanahalli
We currently unconditionally try to emulate newer instructions on older Power versions that could cause issues. Gate it. Signed-off-by: Ananth N Mavinakayanahalli --- [v3] Addressed Naveen's comments on scv and addpcis [v2] Fixed description arch/powerpc/lib/sstep.c | 46

Re: [PATCH] [PATCH] powerpc/sstep: Check ISA 3.0 instruction validity before emulation

2021-01-20 Thread Ananth N Mavinakayanahalli
On 1/20/21 3:44 PM, Naveen N. Rao wrote: On 2021/01/20 03:16PM, Ananth N Mavinakayanahalli wrote: ... diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index bf7a7d62ae8b..ed119858e5e9 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1528,6 +1528,8

[PATCH] [PATCH V2] powerpc/sstep: Check ISA 3.0 instruction validity before emulation

2021-01-20 Thread Ananth N Mavinakayanahalli
We currently unconditionally try to emulate newer instructions on older Power versions that could cause issues. Gate it. Signed-off-by: Ananth N Mavinakayanahalli --- arch/powerpc/lib/sstep.c | 40 1 file changed, 40 insertions(+) diff --git a/arch

[PATCH] [PATCH] powerpc/sstep: Check ISA 3.0 instruction validity before emulation

2021-01-20 Thread Ananth N Mavinakayanahalli
We currently unconditionally try to newer emulate instructions on older Power versions that could cause issues. Gate it. Signed-off-by: Ananth N Mavinakayanahalli --- arch/powerpc/lib/sstep.c | 40 1 file changed, 40 insertions(+) diff --git a/arch

Re: [PATCH v2] powernv/elog: Fix the race while processing OPAL error log event.

2020-10-05 Thread Ananth N Mavinakayanahalli
On 10/5/20 9:42 AM, Mahesh Salgaonkar wrote: Every error log reported by OPAL is exported to userspace through a sysfs interface and notified using kobject_uevent(). The userspace daemon (opal_errd) then reads the error log and acknowledges it error log is saved safely to disk. Once acknowledged

Re: [PATCH v7 8/9] powerpc/mce: Add sysctl control for recovery action on MCE.

2018-08-09 Thread Ananth N Mavinakayanahalli
On Thu, Aug 09, 2018 at 06:02:53PM +1000, Nicholas Piggin wrote: > On Thu, 09 Aug 2018 16:34:07 +1000 > Michael Ellerman wrote: > > > "Aneesh Kumar K.V" writes: > > > On 08/08/2018 08:26 PM, Michael Ellerman wrote: > > >> Mahesh J Salgaonkar writes: > > >>> From: Mahesh Salgaonkar > > >>>

Re: [PATCH] powerpc/kprobes: Fix call trace due to incorrect preempt count

2018-01-17 Thread Ananth N Mavinakayanahalli
r() or optimized_callback()). > > Reported-by: Michael Ellerman <m...@ellerman.id.au> > Signed-off-by: Naveen N. Rao <naveen.n@linux.vnet.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ana...@linux.vnet.ibm.com>

Re: [PATCH v2] ppc64/kprobe: Fix oops when kprobed on 'stdu' instruction

2017-04-11 Thread Ananth N Mavinakayanahalli
Bangoria <ravi.bango...@linux.vnet.ibm.com> > Reviewed-by: Naveen N. Rao <naveen.n@linux.vnet.ibm.com> Reviewed-by: Ananth N Mavinakayanahalli <ana...@linux.vnet.ibm.com>

Re: [PATCH v2 2/5] powerpc: kretprobes: override default function entry offset

2017-02-24 Thread Ananth N Mavinakayanahalli
On Wed, Feb 22, 2017 at 07:23:38PM +0530, Naveen N. Rao wrote: > With ABIv2, we offset 8 bytes into a function to get at the local entry > point. > Looks good. > Signed-off-by: Naveen N. Rao <naveen.n@linux.vnet.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ana...@linux.vnet.ibm.com>

Re: [PATCH 1/3] powerpc: kprobes: add support for KPROBES_ON_FTRACE

2017-02-14 Thread Ananth N Mavinakayanahalli
On Wed, Feb 15, 2017 at 12:28:34AM +0530, Naveen N. Rao wrote: > Allow kprobes to be placed on ftrace _mcount() call sites. This > optimization avoids the use of a trap, by riding on ftrace > infrastructure. > > This depends on HAVE_DYNAMIC_FTRACE_WITH_REGS which depends on > MPROFILE_KERNEL,

Re: [PATCH 3/3] powerpc: kprobes: emulate instructions on kprobe handler re-entry

2017-02-14 Thread Ananth N Mavinakayanahalli
> > Signed-off-by: Naveen N. Rao <naveen.n@linux.vnet.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ana...@linux.vnet.ibm.com>

Re: [PATCH 2/3] powerpc: kprobes: factor out code to emulate instruction into a helper

2017-02-14 Thread Ananth N Mavinakayanahalli
On Tue, Feb 14, 2017 at 02:08:02PM +0530, Naveen N. Rao wrote: > This helper will be used in a subsequent patch to emulate instructions > on re-entering the kprobe handler. No functional change. > > Signed-off-by: Naveen N. Rao <naveen.n@linux.vnet.ibm.com>

Re: [PATCH 1/3] powerpc: kprobes: fix handling of function offsets on ABIv2

2017-02-14 Thread Ananth N Mavinakayanahalli
> c00d04c8 k _do_fork+0x8[DISABLED] > c00d04d0 k _do_fork+0x10[DISABLED] > c00412b0 k kretprobe_trampoline+0x0 [OPTIMIZED] > > Signed-off-by: Naveen N. Rao <naveen.n@linux.vnet.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ana...@linux.vnet.ibm.com>

Re: [PATCH] powerpc: kprobes: invoke handlers directly

2016-11-20 Thread Ananth N Mavinakayanahalli
ename post_kprobe_handler() to kprobe_post_handler() for > more uniform naming. > > Reported-by: Masami Hiramatsu <mhira...@kernel.org> > Signed-off-by: Naveen N. Rao <naveen.n@linux.vnet.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ana...@linux.vnet.ibm.com>

Re: [PATCH 1/2] perf/powerpc: Fix kprobe and kretprobe handling with kallsyms

2016-04-06 Thread Ananth N Mavinakayanahalli
On Wed, Apr 06, 2016 at 06:02:57PM +0530, Naveen N. Rao wrote: > + if (!pev->uprobes && map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS) > tev->point.offset += PPC64LE_LEP_OFFSET; uprobes check against kallsysms? Am I missing something here? Ananth

Re: [PATCH 2/2] tools/perf: Fix kallsyms perf test on ppc64le

2016-04-06 Thread Ananth N Mavinakayanahalli
l the symbols during symbol table load, > but only adjust the probe trace point. > > Cc: Mark Wielaard <m...@redhat.com> > Cc: Thiago Jung Bauermann <bauer...@linux.vnet.ibm.com> > Cc: Ananth N Mavinakayanahalli <ana...@in.ibm.com> > Cc: Arnaldo Carvalho de

Re: powerpc: Add user-return-notifier support

2015-09-08 Thread Ananth N Mavinakayanahalli
On Tue, Sep 08, 2015 at 07:24:39PM +1000, Michael Ellerman wrote: > On Wed, 2015-09-02 at 10:39 +0530, Ananth N Mavinakayanahalli wrote: > > On Tue, Sep 01, 2015 at 10:29:12PM -0500, Scott Wood wrote: > > > > > Why is this selected by KVM on PPC if KVM on P

Re: powerpc: Add user-return-notifier support

2015-09-01 Thread Ananth N Mavinakayanahalli
On Mon, Aug 31, 2015 at 08:35:17PM +1000, Michael Ellerman wrote: > On Tue, 2015-25-08 at 05:41:10 UTC, Ananth N Mavinakayanahalli wrote: > > Add user return notifier support for powerpc. Similar to x86, this feature > > keys off of the KVM Kconfig. > > Please flesh this out.

Re: powerpc: Add user-return-notifier support

2015-09-01 Thread Ananth N Mavinakayanahalli
On Tue, Sep 01, 2015 at 07:03:12PM -0500, Scott Wood wrote: > On Tue, 2015-09-01 at 12:11 +0530, Ananth N Mavinakayanahalli wrote: > > On Mon, Aug 31, 2015 at 08:35:17PM +1000, Michael Ellerman wrote: > > > On Tue, 2015-25-08 at 05:41:10 UTC, Ananth N Mavinakayanahalli wrote

Re: powerpc: Add user-return-notifier support

2015-09-01 Thread Ananth N Mavinakayanahalli
On Tue, Sep 01, 2015 at 10:29:12PM -0500, Scott Wood wrote: > On Wed, 2015-09-02 at 08:07 +0530, Ananth N Mavinakayanahalli wrote: > > On Tue, Sep 01, 2015 at 07:03:12PM -0500, Scott Wood wrote: > > > On Tue, 2015-09-01 at 12:11 +0530, Ananth N Mavinakayanahalli wrote: > >

[PATCH] powerpc: Add user-return-notifier support

2015-08-24 Thread Ananth N Mavinakayanahalli
Add user return notifier support for powerpc. Similar to x86, this feature keys off of the KVM Kconfig. Signed-off-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- Documentation/features/debug/user-ret-profiler/arch-support.txt |2 +- arch/powerpc/Kconfig

[PATCH V3 2/2] kprobes: Mark OPTPROBES na for powerpc

2015-07-20 Thread Ananth N Mavinakayanahalli
to be had with a direct jump instead of a breakpoint, but the caveats need to be traded off with the complexity it brings in. For now, mark OPTPROBES na for powerpc. Signed-off-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- .../features/debug/optprobes/arch-support.txt |2 +- 1 file

Re: [PATCH] kprobes: Mark OPTPROBES n/a for powerpc

2015-07-20 Thread Ananth N Mavinakayanahalli
On Sun, Jul 19, 2015 at 11:21:50AM +0900, Masami Hiramatsu wrote: On 2015/07/16 19:56, Ananth N Mavinakayanahalli wrote: Kprobes uses a breakpoint instruction to trap into execution flow and the probed instruction is single-stepped from an alternate location. On some architectures like

Re: [PATCH] kprobes: Mark OPTPROBES n/a for powerpc

2015-07-20 Thread Ananth N Mavinakayanahalli
On Tue, Jul 21, 2015 at 12:53:07PM +1000, Michael Ellerman wrote: On Sun, 2015-07-19 at 11:21 +0900, Masami Hiramatsu wrote: On 2015/07/16 19:56, Ananth N Mavinakayanahalli wrote: Kprobes uses a breakpoint instruction to trap into execution flow and the probed instruction is single

[PATCH V2 1/2] Documentation/features: Add na key to arch-support.txt

2015-07-17 Thread Ananth N Mavinakayanahalli
To be used for features we will not support on a particular architecture. The git log that adds this needs to provide the justification 'why?' Signed-off-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- Documentation/features/arch-support.txt |1 + 1 file changed, 1 insertion(+) diff

[PATCH V2 2/2] kprobes: Mark OPTPROBES na for powerpc

2015-07-17 Thread Ananth N Mavinakayanahalli
-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- .../features/debug/optprobes/arch-support.txt |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/features/debug/optprobes/arch-support.txt b/Documentation/features/debug/optprobes/arch-support.txt index

[PATCH] kprobes: Mark OPTPROBES n/a for powerpc

2015-07-16 Thread Ananth N Mavinakayanahalli
-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- .../features/debug/optprobes/arch-support.txt |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/features/debug/optprobes/arch-support.txt b/Documentation/features/debug/optprobes/arch-support.txt index

Re: [PATCHv2 2/8] perf probe: Improve detection of file/function name in the probe pattern

2015-03-12 Thread Ananth N Mavinakayanahalli
in more detail. Masami, can I have your Acked-by or Reviewed-by? Arnaldo, FWIW, I have reviewed this code... Reviewed-by: Ananth N Mavinakayanahalli ana...@in.ibm.com - Arnaldo Signed-off-by: Naveen N. Rao naveen.n@linux.vnet.ibm.com --- tools/perf/util/probe-event.c | 23

Re: [RFC PATCH 8/8] perf probe powerpc: Fixup function entry if using kallsyms lookup

2014-12-09 Thread Ananth N Mavinakayanahalli
-by from ppc developers should speed up this process. Hi Arnaldo, Yes, I have reviewed the patches. So, for all patches... Reviewed-by: Ananth N Mavinakayanahalli ana...@in.ibm.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https

Re: [RFC PATCH 0/8] Fix perf probe issues on powerpc

2014-12-09 Thread Ananth N Mavinakayanahalli
| 6 +++ 9 files changed, 170 insertions(+), 30 deletions(-) create mode 100644 tools/perf/arch/powerpc/util/elf-sym-decode.c create mode 100644 tools/perf/util/elf_sym.h For the full patchset... Reviewed-by: Ananth N Mavinakayanahalli ana...@in.ibm.com

Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix Failed to find blacklist error on ia64 and ppc64

2014-05-08 Thread Ananth N Mavinakayanahalli
On Thu, May 08, 2014 at 02:40:00PM +0900, Masami Hiramatsu wrote: (2014/05/08 13:47), Ananth N Mavinakayanahalli wrote: On Wed, May 07, 2014 at 08:55:51PM +0900, Masami Hiramatsu wrote: ... +#if defined(CONFIG_PPC64) (!defined(_CALL_ELF) || _CALL_ELF == 1) +/* + * On PPC64 ABIv1

Re: [RFT PATCH -next ] [BUGFIX] kprobes: Fix Failed to find blacklist error on ia64 and ppc64

2014-05-07 Thread Ananth N Mavinakayanahalli
On Wed, May 07, 2014 at 08:55:51PM +0900, Masami Hiramatsu wrote: ... +#if defined(CONFIG_PPC64) (!defined(_CALL_ELF) || _CALL_ELF == 1) +/* + * On PPC64 ABIv1 the function pointer actually points to the + * function's descriptor. The first entry in the descriptor is the + * address of the

Re: [PATCH] powerpc: ftrace: bugfix for test_24bit_addr

2014-02-25 Thread Ananth N Mavinakayanahalli
On Wed, Feb 26, 2014 at 10:23:01AM +0800, Liu Ping Fan wrote: The branch target should be the func addr, not the addr of func_descr_t. So using ppc_function_entry() to generate the right target addr. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- This bug will make ftrace fail

Re: [PATCH] powerpc: OE=1 Form Instructions Not Decoded Correctly

2013-09-10 Thread Ananth N Mavinakayanahalli
On Mon, Sep 09, 2013 at 03:20:58PM -0500, Tom Musta wrote: Isn't that code occasionally used with uprobes too nowadays ? Yes. I believe so. I'm going to back-pedal a little. I reread code and can connect single step code to kprobes but not necessarily to uprobes. So I am not sure

Re: [PATCH] powerpc/rtas_flash: New return code to indicate FW entitlement expiry

2013-04-22 Thread Ananth N Mavinakayanahalli
On Tue, Apr 23, 2013 at 10:40:10AM +1000, Benjamin Herrenschmidt wrote: On Fri, 2013-04-19 at 17:14 +0530, Vasant Hegde wrote: Add new return code to rtas_flash to indicate firmware entitlement expiry. This will be used by the update_flash script to return appropriate message to the user.

Re: [PATCH] powerpc/rtas_flash: New return code to indicate FW entitlement expiry

2013-04-22 Thread Ananth N Mavinakayanahalli
On Tue, Apr 23, 2013 at 03:32:30PM +1000, Benjamin Herrenschmidt wrote: On Tue, 2013-04-23 at 10:35 +0530, Ananth N Mavinakayanahalli wrote: On Tue, Apr 23, 2013 at 10:40:10AM +1000, Benjamin Herrenschmidt wrote: On Fri, 2013-04-19 at 17:14 +0530, Vasant Hegde wrote: Add new return code

[PATCH 1/3] uprobes: add trap variant helper

2013-03-22 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com Some architectures like powerpc have multiple variants of the trap instruction. Introduce an additional helper is_trap_insn() for run-time handling of non-uprobe traps on such architectures. While there, change is_swbp_at_addr

[PATCH 2/3] uprobes/powerpc: teach uprobes to ignore gdb breakpoints

2013-03-22 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com Powerpc has many trap variants that could be used by entities like gdb. Currently, running gdb on a program being traced by uprobes causes an endless loop since uprobes doesn't understand that the trap was inserted by some other entity

[PATCH 3/3] uprobes/powerpc: ignore trap variants during register

2013-03-22 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com The current implementation of uprobes assumes that uprobes always wins even when a register request is at a location with a conditional breakpoint by some other entity. Refer to [1] for more details. Remove the breakpoint instruction check

Re: [PATCH 1/3] uprobes: add trap variant helper

2013-03-22 Thread Ananth N Mavinakayanahalli
On Fri, Mar 22, 2013 at 03:54:06PM +0100, Oleg Nesterov wrote: On 03/22, Ananth N Mavinakayanahalli wrote: +/** + * is_trap_insn - check if instruction is breakpoint instruction. + * @insn: instruction to be checked. + * Default implementation of is_trap_insn + * Returns true if @insn

[PATCH v2 1/4] uprobes: add trap variant helper

2013-03-22 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com Some architectures like powerpc have multiple variants of the trap instruction. Introduce an additional helper is_trap_insn() for run-time handling of non-uprobe traps on such architectures. While there, change is_swbp_at_addr

[PATCH v2 2/4] uprobes: refuse uprobe on trap variants

2013-03-22 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com Refuse to place a uprobe if a trap variant already exists in the file copy at the address. Signed-off-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- kernel/events/uprobes.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index

[PATCH v2 4/4] uprobes/powerpc: remove additional trap instruction check

2013-03-22 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com prepare_uprobe() already checks if the underlying unstruction (on file) is a trap variant. We don't need to check this again. Signed-off-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- arch/powerpc/kernel/uprobes.c |6 -- 1 file

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Ananth N Mavinakayanahalli
On Wed, Mar 20, 2013 at 05:06:44PM +0100, Oleg Nesterov wrote: On 03/20, Ananth N Mavinakayanahalli wrote: On Wed, Mar 20, 2013 at 01:26:39PM +0100, Oleg Nesterov wrote: But, at the same time, is the new definition fine for verify_opcode()? IOW, powerpc has another is_trap() insn(s

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Ananth N Mavinakayanahalli
On Wed, Mar 20, 2013 at 05:07:28PM +0100, Oleg Nesterov wrote: On 03/20, Ananth N Mavinakayanahalli wrote: On Wed, Mar 20, 2013 at 01:43:01PM +0100, Oleg Nesterov wrote: On 03/20, Oleg Nesterov wrote: But we did not install UPROBE_SWBP_INSN. Is it fine? I hope yes, just

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Ananth N Mavinakayanahalli
On Thu, Mar 21, 2013 at 05:00:02PM +0100, Oleg Nesterov wrote: On 03/21, Ananth N Mavinakayanahalli wrote: ? On Wed, Mar 20, 2013 at 05:07:28PM +0100, Oleg Nesterov wrote: On 03/20, Ananth N Mavinakayanahalli wrote: On Wed, Mar 20, 2013 at 01:43:01PM +0100, Oleg Nesterov wrote

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-21 Thread Ananth N Mavinakayanahalli
On Thu, Mar 21, 2013 at 04:58:09PM +0100, Oleg Nesterov wrote: On 03/21, Ananth N Mavinakayanahalli wrote: On Wed, Mar 20, 2013 at 05:06:44PM +0100, Oleg Nesterov wrote: But we did not install UPROBE_SWBP_INSN. Is it fine? I hope yes, just to verify. If not, we need 2

[PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com GDB uses a variant of the trap instruction that is different from the one used by uprobes. Currently, running gdb on a program being traced by uprobes causes an endless loop since uprobes doesn't understand that the trap is inserted by some other

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Ananth N Mavinakayanahalli
On Wed, Mar 20, 2013 at 01:26:39PM +0100, Oleg Nesterov wrote: Hi Ananth, First of all, let me remind that I know nothing about powerpc ;) But iirc we already discussed this a bit, I forgot the details but still I have some concerns... On 03/20, Ananth N Mavinakayanahalli wrote: GDB

Re: [PATCH] powerpc/uprobes: teach uprobes to ignore gdb breakpoints

2013-03-20 Thread Ananth N Mavinakayanahalli
On Wed, Mar 20, 2013 at 01:43:01PM +0100, Oleg Nesterov wrote: On 03/20, Oleg Nesterov wrote: But we did not install UPROBE_SWBP_INSN. Is it fine? I hope yes, just to verify. If not, we need 2 definitions. is_uprobe_insn() should still check insns == UPROBE_SWBP_INSN, and is_swbp_insn()

Re: [PATCH v2 2/4] powerpc: Move the single step enable code to a generic path

2012-12-10 Thread Ananth N Mavinakayanahalli
. Signed-off-by: Suzuki K. Poulose suz...@in.ibm.com Cc: Ananth N Mavinakaynahalli ana...@in.ibm.com Cc: Kumar Gala ga...@kernel.crashing.org Cc: linuxppc-...@ozlabs.org Acked-by: Ananth N Mavinakayanahalli ana...@in.ibm.com ___ Linuxppc-dev mailing

[PATCH] Rename opcode_t in probes.h to ppc_opcode_t

2012-09-06 Thread Ananth N Mavinakayanahalli
, I suppose we can try to change that ATM driver to use a different type name... We can make it ppc_opcode_t. Attached is the patch that fixes this. Regards, Ananth --- From: Ananth N Mavinakayanahalli ana...@in.ibm.com tree: git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git next

Re: linux-next: build failure after merge of the final tree (powerpc tree related)

2012-09-06 Thread Ananth N Mavinakayanahalli
On Thu, Sep 06, 2012 at 05:11:53PM +1000, Stephen Rothwell wrote: Hi all, After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this: In file included from drivers/atm/fore200e.c:70:0: drivers/atm/fore200e.h:263:3: error: redefinition of typedef

Re: [PATCH v5 3/3] powerpc: Uprobes port to powerpc

2012-09-04 Thread Ananth N Mavinakayanahalli
On Wed, Sep 05, 2012 at 03:26:59PM +1000, Benjamin Herrenschmidt wrote: On Fri, 2012-08-24 at 13:01 +0530, Ananth N Mavinakayanahalli wrote: From: Ananth N Mavinakayanahalli ana...@in.ibm.com This is the port of uprobes to powerpc. Usage is similar to x86. Guys, can you do a minimum

[PATCH 1/3] powerpc: Consolidate *probe definitions

2012-08-24 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com Move is_trap() and relatives to a common file to be shared between *probes. Code movement only; no change in functionality. Suggested by Michael Ellerman. Signed-off-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- arch/powerpc/include/asm

[PATCH 2/3] powerpc: Add trap_nr to thread_struct

2012-08-24 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com Add thread_struct.trap_nr and use it to store the last exception the thread experienced. In this patch, we populate the field at various places where we force_sig_info() to the process. This is also used in uprobes to determine if the probed

[PATCH v5 3/3] powerpc: Uprobes port to powerpc

2012-08-24 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com This is the port of uprobes to powerpc. Usage is similar to x86. [root@ ~]# ./bin/perf probe -x /lib64/libc.so.6 malloc Added new event: probe_libc:malloc(on 0xb4860) You can now use it in all perf tools, such as: perf record

Re: [PATCH v4 2/2] powerpc: Uprobes port to powerpc

2012-08-24 Thread Ananth N Mavinakayanahalli
On Fri, Aug 24, 2012 at 05:07:31PM +1000, Benjamin Herrenschmidt wrote: On Fri, 2012-08-24 at 11:13 +1000, Michael Ellerman wrote: Yeah. A NULL regs here is a kernel bug, so I think it's actually preferable to crash than silently return. Or best, if you think there's a remote chance

[PATCH 1/2] powerpc: Add trap_nr to thread_struct

2012-08-22 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com Add thread_struct.trap_nr and use it to store the last exception the thread experienced. In this patch, we populate the field at various places where we force_sig_info() to the process. This is also used in uprobes to determine if the probed

[PATCH v4 2/2] powerpc: Uprobes port to powerpc

2012-08-22 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com This is the port of uprobes to powerpc. Usage is similar to x86. [root@ ~]# ./bin/perf probe -x /lib64/libc.so.6 malloc Added new event: probe_libc:malloc(on 0xb4860) You can now use it in all perf tools, such as: perf record

Re: [PATCH v3 2/2] powerpc: Uprobes port to powerpc

2012-08-22 Thread Ananth N Mavinakayanahalli
On Tue, Aug 21, 2012 at 03:09:30PM +0200, Oleg Nesterov wrote: ... This is true for Intel like architectures that have *one* swbp instruction. On Powerpc, gdb for instance, can insert a trap variant at the address. Therefore, is_swbp_insn() by definition should return true for all trap

Re: [PATCH v4 2/2] powerpc: Uprobes port to powerpc

2012-08-22 Thread Ananth N Mavinakayanahalli
On Thu, Aug 23, 2012 at 02:28:20PM +1000, Michael Ellerman wrote: On Wed, 2012-08-22 at 13:57 +0530, Ananth N Mavinakayanahalli wrote: From: Ananth N Mavinakayanahalli ana...@in.ibm.com This is the port of uprobes to powerpc. Usage is similar to x86. Hi Ananth, Excuse my ignorance

Re: [PATCH v3 2/2] powerpc: Uprobes port to powerpc

2012-08-21 Thread Ananth N Mavinakayanahalli
On Fri, Aug 17, 2012 at 05:00:31PM +0200, Oleg Nesterov wrote: On 08/17, Ananth N Mavinakayanahalli wrote: On Thu, Aug 16, 2012 at 05:21:12PM +0200, Oleg Nesterov wrote: Hmm, I am not sure. is_swbp_insn(insn), as it is used in the arch agnostic code, should only return true if insn

Re: [PATCH v3 2/2] powerpc: Uprobes port to powerpc

2012-08-16 Thread Ananth N Mavinakayanahalli
On Thu, Aug 16, 2012 at 05:21:12PM +0200, Oleg Nesterov wrote: ... So, the arch agnostic code itself takes care of this case... Yes. I forgot about install_breakpoint()-is_swbp_insn() check which returns -ENOTSUPP, somehow I thought arch_uprobe_analyze_insn() does this. or am I

Re: [PATCH v3 2/2] powerpc: Uprobes port to powerpc

2012-08-15 Thread Ananth N Mavinakayanahalli
On Thu, Aug 16, 2012 at 07:41:53AM +1000, Benjamin Herrenschmidt wrote: On Wed, 2012-08-15 at 18:59 +0200, Oleg Nesterov wrote: On 07/26, Ananth N Mavinakayanahalli wrote: From: Ananth N Mavinakayanahalli ana...@in.ibm.com This is the port of uprobes to powerpc. Usage is similar

[PATCH 1/2] powerpc: Add trap_nr to thread_struct

2012-07-25 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com Add thread_struct.trap_nr and use it to store the last exception the thread experienced. In this patch, we populate the field at various places where we force_sig_info() to the process. This is also used in uprobes to determine if the probed

[PATCH v3 2/2] powerpc: Uprobes port to powerpc

2012-07-25 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com This is the port of uprobes to powerpc. Usage is similar to x86. [root@ ~]# ./bin/perf probe -x /lib64/libc.so.6 malloc Added new event: probe_libc:malloc(on 0xb4860) You can now use it in all perf tools, such as: perf record

Re: [PATCH 2/2] [POWERPC] uprobes: powerpc port

2012-06-11 Thread Ananth N Mavinakayanahalli
On Tue, Jun 12, 2012 at 02:01:46PM +1000, Michael Ellerman wrote: On Fri, 2012-06-08 at 14:51 +0530, Ananth N Mavinakayanahalli wrote: On Fri, Jun 08, 2012 at 04:38:17PM +1000, Michael Ellerman wrote: On Fri, 2012-06-08 at 11:49 +0530, Ananth N Mavinakayanahalli wrote: On Fri, Jun 08

Re: [PATCH 2/2] [POWERPC] uprobes: powerpc port

2012-06-08 Thread Ananth N Mavinakayanahalli
On Fri, Jun 08, 2012 at 03:51:54PM +1000, Michael Ellerman wrote: On Fri, 2012-06-08 at 10:06 +0530, Ananth N Mavinakayanahalli wrote: On Wed, Jun 06, 2012 at 11:08:04AM -0700, Jim Keniston wrote: On Wed, 2012-06-06 at 15:05 +0530, Ananth N Mavinakayanahalli wrote: On Wed, Jun 06, 2012

Re: [PATCH 2/2] [POWERPC] uprobes: powerpc port

2012-06-08 Thread Ananth N Mavinakayanahalli
On Fri, Jun 08, 2012 at 04:17:44PM +1000, Michael Ellerman wrote: On Fri, 2012-06-08 at 11:31 +0530, Ananth N Mavinakayanahalli wrote: On Fri, Jun 08, 2012 at 03:51:54PM +1000, Michael Ellerman wrote: On Fri, 2012-06-08 at 10:06 +0530, Ananth N Mavinakayanahalli wrote: On Wed, Jun 06

Re: [PATCH 2/2] [POWERPC] uprobes: powerpc port

2012-06-08 Thread Ananth N Mavinakayanahalli
On Fri, Jun 08, 2012 at 04:38:17PM +1000, Michael Ellerman wrote: On Fri, 2012-06-08 at 11:49 +0530, Ananth N Mavinakayanahalli wrote: On Fri, Jun 08, 2012 at 04:17:44PM +1000, Michael Ellerman wrote: On Fri, 2012-06-08 at 11:31 +0530, Ananth N Mavinakayanahalli wrote: On Fri, Jun 08

[PATCH v2 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn()

2012-06-08 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com On RISC architectures like powerpc, instructions are fixed size. Instruction analysis on such platforms is just a matter of (insn % 4). Pass the vaddr at which the uprobe is to be inserted so that arch_uprobe_analyze_insn() can flag misaligned

[PATCH v2 2/2] [POWERPC] uprobes: powerpc port

2012-06-08 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com This is the port of uprobes to powerpc. Usage is similar to x86. One TODO in this port compared to x86 is the uprobe abort_xol() logic. x86 depends on the thread_struct.trap_nr (absent in powerpc) to determine if a signal was caused when

Re: [PATCH 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn()

2012-06-07 Thread Ananth N Mavinakayanahalli
On Wed, Jun 06, 2012 at 05:14:23PM +0530, Srikar Dronamraju wrote: * Ingo Molnar mi...@kernel.org [2012-06-06 11:40:15]: * Ananth N Mavinakayanahalli ana...@in.ibm.com wrote: On Wed, Jun 06, 2012 at 11:23:52AM +0200, Peter Zijlstra wrote: On Wed, 2012-06-06 at 14:49 +0530, Ananth

Re: [PATCH 2/2] [POWERPC] uprobes: powerpc port

2012-06-07 Thread Ananth N Mavinakayanahalli
On Wed, Jun 06, 2012 at 11:08:04AM -0700, Jim Keniston wrote: On Wed, 2012-06-06 at 15:05 +0530, Ananth N Mavinakayanahalli wrote: On Wed, Jun 06, 2012 at 11:27:02AM +0200, Peter Zijlstra wrote: On Wed, 2012-06-06 at 14:51 +0530, Ananth N Mavinakayanahalli wrote: ... For the kernel

[PATCH 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn()

2012-06-06 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com On RISC architectures like powerpc, instructions are fixed size. Instruction analysis on such platforms is just a matter of (insn % 4). Pass the vaddr at which the uprobe is to be inserted so that arch_uprobe_analyze_insn() can flag misaligned

[PATCH 2/2] [POWERPC] uprobes: powerpc port

2012-06-06 Thread Ananth N Mavinakayanahalli
From: Ananth N Mavinakayanahalli ana...@in.ibm.com This is the port of uprobes to powerpc. Usage is similar to x86. One TODO in this port compared to x86 is the uprobe abort_xol() logic. x86 depends on the thread_struct.trap_nr (absent in powerpc) to determine if a signal was caused when

Re: [PATCH 2/2] [POWERPC] uprobes: powerpc port

2012-06-06 Thread Ananth N Mavinakayanahalli
On Wed, Jun 06, 2012 at 11:27:02AM +0200, Peter Zijlstra wrote: On Wed, 2012-06-06 at 14:51 +0530, Ananth N Mavinakayanahalli wrote: One TODO in this port compared to x86 is the uprobe abort_xol() logic. x86 depends on the thread_struct.trap_nr (absent in powerpc) to determine if a signal

Re: [PATCH 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn()

2012-06-06 Thread Ananth N Mavinakayanahalli
On Wed, Jun 06, 2012 at 11:23:52AM +0200, Peter Zijlstra wrote: On Wed, 2012-06-06 at 14:49 +0530, Ananth N Mavinakayanahalli wrote: +int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, loff_t vaddr) Don't we traditionally use unsigned long to pass vaddrs

Re: [PATCH 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn()

2012-06-06 Thread Ananth N Mavinakayanahalli
On Wed, Jun 06, 2012 at 11:40:15AM +0200, Ingo Molnar wrote: * Ananth N Mavinakayanahalli ana...@in.ibm.com wrote: On Wed, Jun 06, 2012 at 11:23:52AM +0200, Peter Zijlstra wrote: On Wed, 2012-06-06 at 14:49 +0530, Ananth N Mavinakayanahalli wrote: +int arch_uprobe_analyze_insn(struct

Re: [PATCH] powerpc: Export PIR data through sysfs

2011-11-10 Thread Ananth N Mavinakayanahalli
On Wed, Nov 09, 2011 at 09:48:25AM -0600, Scott Wood wrote: On Wed, Nov 09, 2011 at 10:11:24AM +0530, Ananth N Mavinakayanahalli wrote: On Tue, Nov 08, 2011 at 10:59:46AM -0600, Scott Wood wrote: On 11/08/2011 12:58 AM, Ananth N Mavinakayanahalli wrote: On Mon, Nov 07, 2011 at 11:18:32AM

Re: [PATCH] powerpc: Export PIR data through sysfs

2011-11-10 Thread Ananth N Mavinakayanahalli
On Fri, Nov 11, 2011 at 03:18:14PM +1100, Benjamin Herrenschmidt wrote: On Thu, 2011-11-10 at 14:18 +0530, Ananth N Mavinakayanahalli wrote: From: Ananth N Mavinakayanahalli ana...@in.ibm.com The Processor Identification Register (PIR) on some powerpc platforms provides information

[PATCH V2] powerpc: Export PIR data through sysfs

2011-11-10 Thread Ananth N Mavinakayanahalli
On Fri, Nov 11, 2011 at 10:17:55AM +0530, Ananth N Mavinakayanahalli wrote: At this rate we're going to end up with no bits left for CPU features way too quickly... Especially for something we only care about once at boot time. Wouldn't CPU_FTR_PPCAS_ARCH_V2 be a good enough test

Re: [PATCH] powerpc: Export PIR data through sysfs

2011-11-08 Thread Ananth N Mavinakayanahalli
On Tue, Nov 08, 2011 at 10:59:46AM -0600, Scott Wood wrote: On 11/08/2011 12:58 AM, Ananth N Mavinakayanahalli wrote: On Mon, Nov 07, 2011 at 11:18:32AM -0600, Scott Wood wrote: What use does userspace have for this? If you want to return the currently executing CPU (which unless you're

Re: [PATCH] powerpc: Export PIR data through sysfs

2011-11-07 Thread Ananth N Mavinakayanahalli
On Mon, Nov 07, 2011 at 11:18:32AM -0600, Scott Wood wrote: On 11/06/2011 10:47 PM, Ananth N Mavinakayanahalli wrote: The Processor Identification Register (PIR) on powerpc provides information to decode the processor identification tag. Decoding this information platform specfic

[PATCH] powerpc: Export PIR data through sysfs

2011-11-06 Thread Ananth N Mavinakayanahalli
powerpc platforms that don't have it. Code in the kernel referencing PIR isn't under a platform ifdef). Signed-off-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- arch/powerpc/kernel/sysfs.c |6 ++ 1 file changed, 6 insertions(+) Index: linux-3.1/arch/powerpc/kernel/sysfs.c

Re: [v2 PATCH 2/2] booke/kprobe: remove unnecessary preempt_enable_no_resched

2011-07-10 Thread Ananth N Mavinakayanahalli
On Mon, Jul 11, 2011 at 10:39:35AM +0800, Tiejun Chen wrote: When enable CONFIG_PREEMPT we will trigger the following call trace: BUG: scheduling while atomic: swapper/1/0x1000 ... krpobe always goes through the following path: program_check_exception() | +

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-28 Thread Ananth N Mavinakayanahalli
On Mon, Jun 27, 2011 at 03:31:05PM +0530, Ananth N Mavinakayanahalli wrote: On Sun, Jun 26, 2011 at 11:47:13PM +0900, Masami Hiramatsu wrote: (2011/06/24 19:29), Steven Rostedt wrote: On Fri, 2011-06-24 at 17:21 +0800, Yong Zhang wrote: Hi, When I use kprobe to do something, I found

Re: [BUG?]3.0-rc4+ftrace+kprobe: set kprobe at instruction 'stwu' lead to system crash/freeze

2011-06-27 Thread Ananth N Mavinakayanahalli
On Sun, Jun 26, 2011 at 11:47:13PM +0900, Masami Hiramatsu wrote: (2011/06/24 19:29), Steven Rostedt wrote: On Fri, 2011-06-24 at 17:21 +0800, Yong Zhang wrote: Hi, When I use kprobe to do something, I found some wired thing. When CONFIG_FUNCTION_TRACER is disabled: (gdb)

[RFC PATCH] powerpc: Emulate nop too

2010-05-27 Thread Ananth N Mavinakayanahalli
Hi Paul, While we are at it, can we also add nop to the list of emulated instructions? Ananth --- From: Ananth N Mavinakayanahalli ana...@in.ibm.com Emulate ori 0,0,0 (nop). The long winded way is to do: case 24: rd = (instr 21) 0x1f; if (rd != 0

Re: [RFC PATCH] powerpc: Emulate nop too

2010-05-27 Thread Ananth N Mavinakayanahalli
On Thu, May 27, 2010 at 03:22:45PM -0500, Kumar Gala wrote: On May 27, 2010, at 9:12 AM, Ananth N Mavinakayanahalli wrote: Hi Paul, While we are at it, can we also add nop to the list of emulated instructions? Dare I ask why we need to emulate nop? We are close to getting

Re: [RFC PATCH] powerpc: Emulate nop too

2010-05-27 Thread Ananth N Mavinakayanahalli
On Fri, May 28, 2010 at 12:28:43PM +1000, Michael Neuling wrote: In message 20100527141203.ga20...@in.ibm.com you wrote: Hi Paul, While we are at it, can we also add nop to the list of emulated instructions? Ananth --- From: Ananth N Mavinakayanahalli ana...@in.ibm.com

powerpc: remove resume_execution() in kprobes

2010-05-27 Thread Ananth N Mavinakayanahalli
On Fri, May 28, 2010 at 12:05:56PM +1000, Paul Mackerras wrote: On Thu, May 27, 2010 at 07:42:03PM +0530, Ananth N Mavinakayanahalli wrote: While we are at it, can we also add nop to the list of emulated instructions? I have a patch in development that emulates most of the arithmetic

Re: [RFC PATCH] powerpc: Emulate nop too

2010-05-27 Thread Ananth N Mavinakayanahalli
are at it, can we also add nop to the list of emulated instructions? Ananth --- From: Ananth N Mavinakayanahalli ana...@in.ibm.com Emulate ori 0,0,0 (nop). The long winded way is to do: case 24: rd = (instr 21) 0x1f

Re: [PowerPC] 2.6.33-git11 : Badness at kernel/kprobes.c:264

2010-03-08 Thread Ananth N Mavinakayanahalli
-off-by: Ananth N Mavinakayanahalli ana...@in.ibm.com --- Index: linux-8mar/kernel/kprobes.c === --- linux-8mar.orig/kernel/kprobes.c2010-03-08 17:10:33.0 +0530 +++ linux-8mar/kernel/kprobes.c 2010-03-08 17:12:12.0

  1   2   >