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

2017-02-14 Thread Masami Hiramatsu
Hi Naveen, On Wed, 15 Feb 2017 00:28:34 +0530 "Naveen N. Rao" wrote: > diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c > index e51a045f3d3b..a8f414a0b141 100644 > --- a/arch/powerpc/kernel/optprobes.c > +++

[PATCH v9 3/3] PCI: Don't extend device's size when using default alignment for all devices

2017-02-14 Thread Yongji Xie
Currently we reassign the alignment by extending resources' size in pci_reassigndev_resource_alignment(). This could potentially break some drivers when the driver uses the size to locate register whose length is related to the size. Some examples as below: - misc\Hpilo.c: off =

[PATCH v9 2/3] PCI: Add a macro to set default alignment for all PCI devices

2017-02-14 Thread Yongji Xie
When vfio passthroughs a PCI device of which MMIO BARs are smaller than PAGE_SIZE, guest will not handle the mmio accesses to the BARs which leads to mmio emulations in host. This is because vfio will not allow to passthrough one BAR's mmio page which may be shared with other BARs. Otherwise,

[PATCH v9 1/3] PCI: A fix for caculating bridge window's size and alignment

2017-02-14 Thread Yongji Xie
In case that one device's alignment is greater than its size, we may get an incorrect size and alignment for its bus's memory window in pbus_size_mem(). This patch fixes this case. Signed-off-by: Yongji Xie --- drivers/pci/setup-bus.c |4 ++-- 1 files changed, 2

[PATCH v9 0/3] PCI: Introduce a way to enforce all MMIO BARs not to share PAGE_SIZE

2017-02-14 Thread Yongji Xie
This series introduces a way for PCI resource allocator to force MMIO BARs not to share PAGE_SIZE. This would make sense to VFIO driver. Because current VFIO implementation disallows to mmap sub-page(size < PAGE_SIZE) MMIO BARs which may share the same page with other BARs for security reasons.

Re: [PATCH 2/2] powerpc/powernv/opal-dump : Use IRQ_HANDLED instead of numbers in interrupt handler

2017-02-14 Thread Mukesh Ojha
On Wednesday 15 February 2017 10:38 AM, Stewart Smith wrote: Mukesh Ojha writes: Converts all the return explicit number to a more proper IRQ_HANDLED, which looks proper incase of interrupt handler returning case. Signed-off-by: Mukesh Ojha

Re: [v4,1/2] arch/powerpc: Implement Optprobes

2017-02-14 Thread Anju T Sudhakar
Thank You Michael. :) On Tuesday 14 February 2017 06:10 PM, Michael Ellerman wrote: On Wed, 2017-02-08 at 09:50:51 UTC, Anju T wrote: Current infrastructure of kprobe uses the unconditional trap instruction to probe a running kernel. Optprobe allows kprobe to replace the trap with a branch

Re: [PATCH 2/2] powerpc/powernv/opal-dump : Use IRQ_HANDLED instead of numbers in interrupt handler

2017-02-14 Thread Stewart Smith
Mukesh Ojha writes: > Converts all the return explicit number to a more proper IRQ_HANDLED, > which looks proper incase of interrupt handler returning case. > > Signed-off-by: Mukesh Ojha > Reviewed-by: Vasant Hegde

Re: [PATCH 1/2] powerpc/powernv/opal-dump : Handles opal_dump_info properly

2017-02-14 Thread Stewart Smith
Mukesh Ojha writes: > Moves the return value check of 'opal_dump_info' to a proper place which > was previously unnecessarily filling all the dump info even on failure. > > Signed-off-by: Mukesh Ojha > --- >

Re: [PATCH] powernv/opal: Handle OPAL_WRONG_STATE error from OPAL fails

2017-02-14 Thread Stewart Smith
Michael Ellerman writes: > Vipin K Parashar writes: > >> OPAL returns OPAL_WRONG_STATE for XSCOM operations >> >> done to read any core FIR which is sleeping, offline. > > OK. > > Do we know why Linux is causing that to happen? > > It's also

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] powerpc/xmon: add debugfs entry for xmon

2017-02-14 Thread panxinhui
在 2017/2/15 上午1:35, Guilherme G. Piccoli 写道: > On 14/02/2017 01:58, Pan Xinhui wrote: >> >> >> 在 2017/2/14 10:35, Nicholas Piggin 写道: >>> On Mon, 13 Feb 2017 19:00:42 -0200 >>> >>> xmon state changing after the first sysrq+x violates principle of least >>> astonishment, so I think that should be

[PATCH] KVM: Prevent double-free on HPT resize commit path

2017-02-14 Thread David Gibson
resize_hpt_release(), called once the HPT resize of a KVM guest is completed (successfully or unsuccessfully) free()s the state structure for the resize. It is currently not safe to call with a NULL pointer. However, one of the error paths in kvm_vm_ioctl_resize_hpt_commit() can invoke it with a

Re: [PATCH 2/2] powerpc/powernv/opal-dump : Use IRQ_HANDLED instead of numbers in interrupt handler

2017-02-14 Thread Jeremy Kerr
Hi Mukesh, > Converts all the return explicit number to a more proper IRQ_HANDLED, > which looks proper incase of interrupt handler returning case. This looks good to me, but can you describe the effects of those changes to the interrupt handler's return code? ie, what happened in the erroneous

Re: [PATCH 1/2] powerpc/powernv/opal-dump : Handles opal_dump_info properly

2017-02-14 Thread Jeremy Kerr
Hi Mukesh, > Moves the return value check of 'opal_dump_info' to a proper place which > was previously unnecessarily filling all the dump info even on failure. Acked-by: Jeremy Kerr Thanks! Jeremy

[PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change

2017-02-14 Thread Pan Xinhui
Once xmon is triggered by sysrq-x, it is enabled always afterwards even if it is disabled during boot. This will cause a system reset interrut fail to dump. So keep xmon in its original state after exit. Signed-off-by: Pan Xinhui --- arch/powerpc/xmon/xmon.c | 5

linux-next: manual merge of the kvm tree with the powerpc tree

2017-02-14 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the kvm tree got a conflict in: arch/powerpc/kvm/book3s_hv_rm_xics.c between commit: ab9bad0ead9a ("powerpc/powernv: Remove separate entry for OPAL real mode calls") from the powerpc tree and commit: 21acd0e4df04 ("KVM: PPC: Book 3S: XICS: Don't

Re: [PATCH V2 2/2] powerpc/mm/autonuma: Switch ppc64 to its own implementeation of saved write

2017-02-14 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > Michael Ellerman writes: > >> "Aneesh Kumar K.V" writes: >>> diff --git a/arch/powerpc/include/asm/book3s/64/mmu-hash.h >>> b/arch/powerpc/include/asm/book3s/64/mmu-hash.h >>>

Re: [PATCH V2 1/2] mm/autonuma: Let architecture override how the write bit should be stashed in a protnone pte.

2017-02-14 Thread Andrew Morton
On Tue, 14 Feb 2017 21:59:23 +1100 Michael Ellerman wrote: > "Aneesh Kumar K.V" writes: > > > On Tuesday 14 February 2017 11:19 AM, Michael Ellerman wrote: > >> "Aneesh Kumar K.V" writes: > >> > >>>

Re: [PATCH] powerpc/xmon: add debugfs entry for xmon

2017-02-14 Thread Michael Ellerman
"Guilherme G. Piccoli" writes: > On 14/02/2017 01:58, Pan Xinhui wrote: >> 在 2017/2/14 10:35, Nicholas Piggin 写道: >>> On Mon, 13 Feb 2017 19:00:42 -0200 >>> >>> xmon state changing after the first sysrq+x violates principle of least >>> astonishment, so I think that

Re: [bug report] powerpc/powernv: Support EEH reset for VF PE

2017-02-14 Thread Russell Currey
On Tue, 2017-02-14 at 16:39 +0300, Dan Carpenter wrote: > Hello Wei Yang, > > The patch 9312bc5bab59: "powerpc/powernv: Support EEH reset for VF > PE" from Mar 4, 2016, leads to the following static checker warning: > > arch/powerpc/platforms/powernv/eeh-powernv.c:1033

Re: [PATCH 1/5] selftests: Fix selftests build to just build, not run tests

2017-02-14 Thread Michael Ellerman
On 15 February 2017 03:14:24 GMT+11:00, Shuah Khan wrote: >On 02/13/2017 07:09 PM, Michael Ellerman wrote: >> Michael Ellerman writes: >> >>> In commit 88baa78d1f31 ("selftests: remove duplicated all and clean >>> target"), the "all" target was

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

2017-02-14 Thread Naveen N. Rao
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, which is only currently enabled on powerpc64le with newer toolchains. Based

[PATCH 3/3] powerpc: kprobes: prefer ftrace when probing function entry

2017-02-14 Thread Naveen N. Rao
KPROBES_ON_FTRACE avoids much of the overhead with regular kprobes as it eliminates the need for a trap, as well as the need to emulate or single-step instructions. Though OPTPROBES provides us with similar performance, we have limited optprobes trampoline slots. As such, when asked to probe at a

[PATCH 2/3] powerpc: introduce a new helper to obtain function entry points

2017-02-14 Thread Naveen N. Rao
kprobe_lookup_name() is specific to the kprobe subsystem and may not always return the function entry point (in a subsequent patch). For looking up function entry points, introduce a separate helper and use the same in optprobes.c Signed-off-by: Naveen N. Rao ---

Re: [PATCH] powerpc/xmon: add debugfs entry for xmon

2017-02-14 Thread Guilherme G. Piccoli
On 14/02/2017 09:37, Michael Ellerman wrote: > "Guilherme G. Piccoli" writes: > >> Currently the xmon debugger is set only via kernel boot command-line. >> It's disabled by default, and can be enabled with "xmon=on" on the >> command-line. Also, xmon may be accessed

Re: [PATCH] powerpc/xmon: add debugfs entry for xmon

2017-02-14 Thread Guilherme G. Piccoli
On 14/02/2017 01:58, Pan Xinhui wrote: > > > 在 2017/2/14 10:35, Nicholas Piggin 写道: >> On Mon, 13 Feb 2017 19:00:42 -0200 >> >> xmon state changing after the first sysrq+x violates principle of least >> astonishment, so I think that should be fixed. >> > hi, Nick > yes, as long as xmon is

[PATCH 3/3] powerpc/mm: move mmap_sem unlocking in do_page_fault()

2017-02-14 Thread Laurent Dufour
Since the fault retry is now handled earlier, we can release the mmap_sem lock earlier too and remove later unlocking previously done in mm_fault_error(). Signed-off-by: Laurent Dufour --- arch/powerpc/mm/fault.c | 19 --- 1 file changed, 4

[PATCH 2/3] powerpc/mm: handle VM_FAULT_RETRY earlier

2017-02-14 Thread Laurent Dufour
In do_page_fault() if handle_mm_fault() returns VM_FAULT_RETRY, retry the page fault handling before anything else. This would simplify the handling of the mmap_sem lock in this part of the code. Signed-off-by: Laurent Dufour --- arch/powerpc/mm/fault.c | 67

[PATCH 1/3] powerpc/mm: move mmap_sem unlock up from do_sigbus

2017-02-14 Thread Laurent Dufour
Move mmap_sem releasing in the do_sigbus()'s unique caller : mm_fault_error() No functional changes. Signed-off-by: Laurent Dufour --- arch/powerpc/mm/fault.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/mm/fault.c

[PATCH 0/3] powerpc/mm: page fault handler cleaning

2017-02-14 Thread Laurent Dufour
This series attempts to clean the page fault handler in the way it has been done previously for the x86 architecture [1]. The goal is to manage the mmap_sem earlier and only in do_page_fault(). This done by handling the retry case earlier, before handling the error case. This way the semaphore

Re: [PATCH 1/5] selftests: Fix selftests build to just build, not run tests

2017-02-14 Thread Shuah Khan
On 02/13/2017 07:09 PM, Michael Ellerman wrote: > Michael Ellerman writes: > >> In commit 88baa78d1f31 ("selftests: remove duplicated all and clean >> target"), the "all" target was removed from individual Makefiles and >> added to lib.mk. >> >> However the "all" target was

[bug report] powernv/opal: Convert opal message events to opal irq domain

2017-02-14 Thread Dan Carpenter
Hello Alistair Popple, The patch a295af24d0d2: "powernv/opal: Convert opal message events to opal irq domain" from May 15, 2015, leads to the following static checker warning: arch/powerpc/platforms/powernv/opal.c:297 opal_message_init() info: return a literal instead of 'irq'

[PATCH v4 2/2] powerpc: emulate_step tests for load/store instructions

2017-02-14 Thread Ravi Bangoria
Add new selftest that test emulate_step for Normal, Floating Point, Vector and Vector Scalar - load/store instructions. Test should run at boot time if CONFIG_KPROBES_SANITY_TEST and CONFIG_PPC64 is set. Sample log: [0.762063] emulate_step smoke test: start. [0.762219] emulate_step

[PATCH v4 1/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Ravi Bangoria
emulate_step() uses a number of underlying kernel functions that were initially not enabled for LE. This has been rectified since. So, fix emulate_step() for LE for the corresponding instructions. Reported-by: Anton Blanchard Signed-off-by: Ravi Bangoria

[PATCH v4 0/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Ravi Bangoria
emulate_step is the basic infrastructure which is used by number of other kernel infrastructures like kprobe, hw-breakpoint(data breakpoint) etc. In case of kprobe, enabling emulation of load/store instructions will speedup the execution of probed instruction. In case of kernel-space breakpoint,

[bug report] powerpc/powernv: Support EEH reset for VF PE

2017-02-14 Thread Dan Carpenter
Hello Wei Yang, The patch 9312bc5bab59: "powerpc/powernv: Support EEH reset for VF PE" from Mar 4, 2016, leads to the following static checker warning: arch/powerpc/platforms/powernv/eeh-powernv.c:1033 pnv_eeh_reset_vf_pe() info: return a literal instead of 'ret'

Re: linux-next: manual merge of the kvm tree with the powerpc tree

2017-02-14 Thread Paolo Bonzini
On 14/02/2017 09:45, Michael Ellerman wrote: >> If possible, please pull only up to "powerpc/64: Allow for relocation-on >> interrupts from guest to host" and cherry-pick the top two patches >> ("powerpc/64: CONFIG_RELOCATABLE support for hmi interrupts" and >> "powerpc/powernv: Remove separate

Re: powerpc: Add a prototype for mcount() so it can be versioned

2017-02-14 Thread Michael Ellerman
On Fri, 2017-02-10 at 02:40:02 UTC, Michael Ellerman wrote: > Currently we get a warning that _mcount() can't be versioned: > > WARNING: EXPORT symbol "_mcount" [vmlinux] version generation failed, > symbol will not be versioned. > > Add a prototype to asm-prototypes.h to fix it. > > The

Re: powerpc: Fix confusing help text for DISABLE_MPROFILE_KERNEL

2017-02-14 Thread Michael Ellerman
On Fri, 2017-02-10 at 01:16:59 UTC, Anton Blanchard wrote: > From: Anton Blanchard > > The final paragraph of the help text is reversed - we want to > enable this option by default, and disable it if the toolchain > has a working -mprofile-kernel. > > Signed-off-by: Anton

Re: [v4,1/2] arch/powerpc: Implement Optprobes

2017-02-14 Thread Michael Ellerman
On Wed, 2017-02-08 at 09:50:51 UTC, Anju T wrote: > Current infrastructure of kprobe uses the unconditional trap instruction > to probe a running kernel. Optprobe allows kprobe to replace the trap with > a branch instruction to a detour buffer. Detour buffer contains instructions > to create an in

Re: [1/3] powerpc: asm/ppc-opcode.h: introduce __PPC_SH64()

2017-02-14 Thread Michael Ellerman
On Wed, 2017-02-08 at 08:57:29 UTC, Anju T wrote: > From: "Naveen N. Rao" > > Introduce __PPC_SH64() as a 64-bit variant to encode shift field in some > of the shift and rotate instructions operating on double-words. Convert > some of the BPF instruction macros

Re: [3/3] powerpc: kprobes: remove kprobe_exceptions_notify()

2017-02-14 Thread Michael Ellerman
On Tue, 2017-02-07 at 19:54:16 UTC, "Naveen N. Rao" wrote: > ... as the weak variant will do. > > Signed-off-by: Naveen N. Rao Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/0ddde5004d26c483c9e67005b2be5b cheers

Re: [1/3] kprobes: introduce weak variant of kprobe_exceptions_notify

2017-02-14 Thread Michael Ellerman
On Tue, 2017-02-07 at 19:54:14 UTC, "Naveen N. Rao" wrote: > kprobe_exceptions_notify() is not used on some of the architectures such > as arm[64] and powerpc anymore. Introduce a weak variant for such > architectures. > > Signed-off-by: Naveen N. Rao > Acked-by:

Re: powerpc/powernv: Fix opal_exit tracepoint opcode

2017-02-14 Thread Michael Ellerman
On Tue, 2017-02-07 at 10:01:01 UTC, Michael Ellerman wrote: > Currently the opal_exit tracepoint usually shows the opcode as 0: > > -0 [047] d.h. 635.654292: opal_entry: opcode=63 > -0 [047] d.h. 635.654296: opal_exit: opcode=0 retval=0 > kopald-1209 [019] d... 636.420943:

Re: powerpc: Fix inconsistent of_node_to_nid EXPORT_SYMBOL handling

2017-02-14 Thread Michael Ellerman
On Wed, 2017-02-01 at 22:52:42 UTC, Shailendra Singh wrote: > The generic implementation of of_node_to_nid is EXPORT_SYMBOL. > > The powerpc implementation added by following commit is EXPORT_SYMBOL_GPL. > commit 953039c8df7b ("[PATCH] powerpc: Allow devices to register with numa > topology") >

Re: [-next] powerpc/pseries: Fix typo in parameter description

2017-02-14 Thread Michael Ellerman
On Thu, 2017-01-12 at 15:09:21 UTC, Wei Yongjun wrote: > From: Wei Yongjun > > Fix typo in parameter description. > > Signed-off-by: Wei Yongjun Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/b0b5a76579ea62a9eeb720e71fdaa9

Re: [PATCHv2, 1/4] pseries: Add hypercall wrappers for hash page table resizing

2017-02-14 Thread Michael Ellerman
On Fri, 2016-12-09 at 00:07:35 UTC, David Gibson wrote: > This adds the hypercall numbers and wrapper functions for the hash page > table resizing hypercalls. > > It also adds a new firmware feature flag to track the presence of the > HPT resizing calls. > > Signed-off-by: David Gibson

Re: [PATCH V2 2/2] powerpc/mm/autonuma: Switch ppc64 to its own implementeation of saved write

2017-02-14 Thread Aneesh Kumar K.V
Michael Ellerman writes: > "Aneesh Kumar K.V" writes: >> diff --git a/arch/powerpc/include/asm/book3s/64/mmu-hash.h >> b/arch/powerpc/include/asm/book3s/64/mmu-hash.h >> index 0735d5a8049f..8720a406bbbe 100644 >> ---

Re: [PATCH] powerpc/xmon: add turn off xmon option

2017-02-14 Thread Michael Ellerman
Pan Xinhui writes: > Once xmon is triggered, there is no interface to turn it off again. > However there exists disable/enable xmon code flows. And more important, > System reset interrupt on powerVM will fire an oops to make a dump. At > that time, xmon should not

[PATCH] powerpc/mm: Fix build break when CMA=n && SPAPR_TCE_IOMMU=y

2017-02-14 Thread Michael Ellerman
Currently the build breaks if CMA=n and SPAPR_TCE_IOMMU=y: arch/powerpc/mm/mmu_context_iommu.c: In function ‘mm_iommu_get’: arch/powerpc/mm/mmu_context_iommu.c:193:42: error: ‘MIGRATE_CMA’ undeclared (first use in this function) if (get_pageblock_migratetype(page) == MIGRATE_CMA) {

Re: [PATCH] powerpc/xmon: add debugfs entry for xmon

2017-02-14 Thread Michael Ellerman
Pan Xinhui writes: > 在 2017/2/14 10:35, Nicholas Piggin 写道: >> On Mon, 13 Feb 2017 19:00:42 -0200 >> "Guilherme G. Piccoli" wrote: >>> * I had this patch partially done for some time, and after a discussion >>> at the kernel slack channel

Re: [PATCH v3 2/2] powerpc: emulate_step tests for load/store instructions

2017-02-14 Thread Ravi Bangoria
On Tuesday 14 February 2017 04:16 PM, Michael Ellerman wrote: > Ravi Bangoria writes: > >> diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile >> index 0e649d7..ddc879d 100644 >> --- a/arch/powerpc/lib/Makefile >> +++ b/arch/powerpc/lib/Makefile

Re: [PATCH] powerpc/xmon: add debugfs entry for xmon

2017-02-14 Thread Michael Ellerman
"Guilherme G. Piccoli" writes: > Currently the xmon debugger is set only via kernel boot command-line. > It's disabled by default, and can be enabled with "xmon=on" on the > command-line. Also, xmon may be accessed via sysrq mechanism, but once > we enter xmon via

Re: [PATCH v3 1/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Ravi Bangoria
Thanks Michael, On Tuesday 14 February 2017 03:50 PM, Michael Ellerman wrote: > Ravi Bangoria writes: > >> emulate_step() uses a number of underlying kernel functions that were >> initially not enabled for LE. This has been rectified since. > When exactly? ie.

Re: [PATCH V2 2/2] powerpc/mm/autonuma: Switch ppc64 to its own implementeation of saved write

2017-02-14 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > diff --git a/arch/powerpc/include/asm/book3s/64/mmu-hash.h > b/arch/powerpc/include/asm/book3s/64/mmu-hash.h > index 0735d5a8049f..8720a406bbbe 100644 > --- a/arch/powerpc/include/asm/book3s/64/mmu-hash.h > +++

Re: [PATCH 2/2] powerpc/mm/autonuma: Switch ppc64 to its own implementeation of saved write

2017-02-14 Thread Michael Ellerman
Michael Neuling writes: > On Thu, 2017-02-09 at 08:30 +0530, Aneesh Kumar K.V wrote: >> With this our protnone becomes a present pte with READ/WRITE/EXEC bit >> cleared. >> By default we also set _PAGE_PRIVILEGED on such pte. This is now used to help >> us identify a protnone

Re: [PATCH V2 1/2] mm/autonuma: Let architecture override how the write bit should be stashed in a protnone pte.

2017-02-14 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > On Tuesday 14 February 2017 11:19 AM, Michael Ellerman wrote: >> "Aneesh Kumar K.V" writes: >> >>> Autonuma preserves the write permission across numa fault to avoid taking >>> a writefault after a

Re: [PATCH v3 2/2] powerpc: emulate_step tests for load/store instructions

2017-02-14 Thread Michael Ellerman
Ravi Bangoria writes: > diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile > index 0e649d7..ddc879d 100644 > --- a/arch/powerpc/lib/Makefile > +++ b/arch/powerpc/lib/Makefile > @@ -33,3 +33,7 @@ obj-$(CONFIG_ALTIVEC) += xor_vmx.o >

Re: [PATCH v3 2/2] powerpc: emulate_step tests for load/store instructions

2017-02-14 Thread Michael Ellerman
Ravi Bangoria writes: > diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c > index fce05a3..5c5ae66 100644 > --- a/arch/powerpc/kernel/kprobes.c > +++ b/arch/powerpc/kernel/kprobes.c > @@ -528,6 +528,8 @@ int __kprobes

Re: [PATCH v3 1/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Michael Ellerman
Ravi Bangoria writes: > emulate_step() uses a number of underlying kernel functions that were > initially not enabled for LE. This has been rectified since. When exactly? ie. which commit. Should we backport this? ie. is it actually a bug people are hitting in

Re: [PATCH v2 1/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Ravi Bangoria
On Tuesday 14 February 2017 02:17 PM, Naveen N. Rao wrote: > On 2017/02/14 01:32PM, Ravi Bangoria wrote: >> emulate_step() uses a number of underlying kernel functions that were >> initially not enabled for LE. This has been rectified since. So, fix >> emulate_step() for LE for the corresponding

[PATCH v3 2/2] powerpc: emulate_step tests for load/store instructions

2017-02-14 Thread Ravi Bangoria
Add new selftest that test emulate_step for Normal, Floating Point, Vector and Vector Scalar - load/store instructions. Test should run at boot time if CONFIG_KPROBES_SANITY_TEST and CONFIG_PPC64 is set. Sample log: [0.762063] emulate_step smoke test: start. [0.762219] emulate_step

[PATCH v3 1/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Ravi Bangoria
emulate_step() uses a number of underlying kernel functions that were initially not enabled for LE. This has been rectified since. So, fix emulate_step() for LE for the corresponding instructions. Reported-by: Anton Blanchard Signed-off-by: Ravi Bangoria

[PATCH v3 0/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Ravi Bangoria
emulate_step is the basic infrastructure which is used by number of other kernel infrastructures like kprobe, hw-breakpoint(data breakpoint) etc. In case of kprobe, enabling emulation of load/store instructions will speedup the execution of probed instruction. In case of kernel-space breakpoint,

Re: [PATCH v2 1/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Naveen N. Rao
On 2017/02/14 01:32PM, Ravi Bangoria wrote: > emulate_step() uses a number of underlying kernel functions that were > initially not enabled for LE. This has been rectified since. So, fix > emulate_step() for LE for the corresponding instructions. > > Reported-by: Anton Blanchard

Re: [PATCH] powerpc/xmon: Fix data-breakpoint

2017-02-14 Thread Ravi Bangoria
Hi Michael, Can you please pull this patch. Thanks, Ravi On Tuesday 22 November 2016 02:55 PM, Ravi Bangoria wrote: > Xmon data-breakpoint feature is broken. > > Whenever there is a watchpoint match occurs, hw_breakpoint_handler will > be called by do_break via notifier chains mechanism. If

Re: linux-next: manual merge of the kvm tree with the powerpc tree

2017-02-14 Thread Michael Ellerman
Paolo Bonzini writes: > On 10/02/2017 04:59, Stephen Rothwell wrote: >> Hi all, >> >> Today's linux-next merge of the kvm tree got a conflict in: >> >> arch/powerpc/include/asm/head-64.h >> >> between commit: >> >> 852e5da99d15 ("powerpc/64s: Tidy up after exception

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

2017-02-14 Thread Ananth N Mavinakayanahalli
On Tue, Feb 14, 2017 at 02:08:03PM +0530, Naveen N. Rao wrote: > On kprobe handler re-entry, try to emulate the instruction rather than > single stepping always. > > As a related change, remove the duplicate saving of msr as that is > already done in set_current_kprobe() > > Signed-off-by:

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 Acked-by: Ananth N

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

2017-02-14 Thread Ananth N Mavinakayanahalli
On Tue, Feb 14, 2017 at 02:08:01PM +0530, Naveen N. Rao wrote: > commit 239aeba76409 ("perf powerpc: Fix kprobe and kretprobe handling > with kallsyms on ppc64le") changed how we use the offset field in struct > kprobe on ABIv2. perf now offsets from the GEP (Global entry point) if an > offset is

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

2017-02-14 Thread Naveen N. Rao
On kprobe handler re-entry, try to emulate the instruction rather than single stepping always. As a related change, remove the duplicate saving of msr as that is already done in set_current_kprobe() Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c

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

2017-02-14 Thread Naveen N. Rao
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 --- arch/powerpc/kernel/kprobes.c | 52 ++- 1 file changed, 31

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

2017-02-14 Thread Naveen N. Rao
commit 239aeba76409 ("perf powerpc: Fix kprobe and kretprobe handling with kallsyms on ppc64le") changed how we use the offset field in struct kprobe on ABIv2. perf now offsets from the GEP (Global entry point) if an offset is specified and otherwise chooses the LEP (Local entry point). Fix the

[PATCH v2 2/2] powerpc: emulate_step tests for load/store instructions

2017-02-14 Thread Ravi Bangoria
Add new selftest that test emulate_step for Normal, Floating Point, Vector and Vector Scalar - load/store instructions. Test should run at boot time if CONFIG_KPROBES_SANITY_TEST and CONFIG_PPC64 is set. Sample log: [0.762063] emulate_step smoke test: start. [0.762219] emulate_step

[PATCH v2 1/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Ravi Bangoria
emulate_step() uses a number of underlying kernel functions that were initially not enabled for LE. This has been rectified since. So, fix emulate_step() for LE for the corresponding instructions. Reported-by: Anton Blanchard Signed-off-by: Ravi Bangoria

[PATCH v2 0/2] powerpc: Emulation support for load/store instructions on LE

2017-02-14 Thread Ravi Bangoria
emulate_step is the basic infrastructure which is used by number of other kernel infrastructures like kprobe, hw-breakpoint(data breakpoint) etc. In case of kprobe, enabling emulation of load/store instructions will speedup the execution of probed instruction. In case of kernel-space breakpoint,