Re: [PATCH v3] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Laurent Dufour
On 23/08/2016 02:46, Cyril Bur wrote: > Userspace can begin and suspend a transaction within the signal > handler which means they might enter sys_rt_sigreturn() with the > processor in suspended state. > > sys_rt_sigreturn() wants to restore process context (which may have > been in a transaction

Re: [PATCH v5 04/13] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-08-22 Thread Balbir Singh
> zImage on ppc64 BE is an ELF32 file. This patch set only supports loading > ELF files of the same class as the kernel, so a 64 bit kernel can't load an > ELF32 file. It would be possible to add such support, but it would be a new > feature. > > The distros I was able to check on ppc64 LE and

Re: [PATCH v5 04/13] powerpc: Factor out relocation code from module_64.c to elf_util_64.c.

2016-08-22 Thread Thiago Jung Bauermann
Am Dienstag, 16 August 2016, 16:52:54 schrieb Balbir Singh: > On 16/08/16 09:25, Thiago Jung Bauermann wrote: > > Am Montag, 15 August 2016, 17:46:34 schrieb Balbir Singh: > >> On Thu, Aug 11, 2016 at 08:08:09PM -0300, Thiago Jung Bauermann wrote: > >>> +/** > >>> + * elf64_apply_relocate_add - app

[PATCH] powerpc/ptrace: Fix cppcheck issue in gpr32_set_common/gpr32_get_common.

2016-08-22 Thread wei . guo . simon
From: Simon Guo The ckpt_regs usage in gpr32_set_common/gpr32_get_common() will lead to cppcheck error. [arch/powerpc/kernel/ptrace.c:2062]: (error) Uninitialized variable: ckpt_regs [arch/powerpc/kernel/ptrace.c:2130]: (error) Uninitialized variable: ckpt_regs A straightforward fix to clean it

Re: [PATCH v6 2/7] perf annotate: Add cross arch annotate support

2016-08-22 Thread Namhyung Kim
Hello, On Tue, Aug 23, 2016 at 8:01 AM, Kim Phillips wrote: > On Fri, 19 Aug 2016 18:29:33 +0530 > Ravi Bangoria wrote: > >> Changes in v6: >> - Instead of adding only those instructions defined in #ifdef __arm__, >> add all instructions from default table to arm table. > .. >> +static str

[PATCH 5/5] powerpc/83xx: enable the default of probe

2016-08-22 Thread Kevin Hao
Use the default of probe function of_platform_default_populate_init() to kill the arch specific duplicated codes. Signed-off-by: Kevin Hao --- arch/powerpc/platforms/83xx/asp834x.c | 2 -- arch/powerpc/platforms/83xx/km83xx.c | 2 -- arch/powerpc/platforms/83xx/misc.c| 25

[PATCH 4/5] powerpc/83xx: factor out the common codes of setup arch functions

2016-08-22 Thread Kevin Hao
Factor out the common codes of setup arch functions to a separate function. It does make no sense to print a board specific info in setup arch functions, so use a more general one. For ASP8347E board, there is no pci device node. So it is safe to invoke mpc83xx_setup_pci() in its setup arch functi

[PATCH 3/5] of/platform: introduce a generic way to declare a platform bus

2016-08-22 Thread Kevin Hao
The specific buses which need to be probed at boot time are different between platforms. Instead of put all the buses into the default of_default_bus_match_table[] match tables, this patch introduces a general way to declare a platform bus. Signed-off-by: Kevin Hao --- drivers/of/platform.c

[PATCH 2/5] powerpc: introduce arch_enable_default_of_probe()

2016-08-22 Thread Kevin Hao
We can use this function to enable the default of probe for one board. Signed-off-by: Kevin Hao --- arch/powerpc/include/asm/setup.h | 1 + arch/powerpc/kernel/of_platform.c | 9 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/setup.h b/arch/powe

[PATCH 1/5] of/platform: introduce arch_want_default_of_probe()

2016-08-22 Thread Kevin Hao
In commit fc520f8b4fa3 ("of/platform: disable the of_platform_default_populate_init() for all the ppc boards"), we disable the default of probe for ppc in order to fix some broken boards. But we do want to leverage the default of probe function on ppc arch. So introduce a weak function arch_want_de

[PATCH 0/5] ppc32: use the default of_platform_default_populate_init() for 83xx boards

2016-08-22 Thread Kevin Hao
Hi, This is a follow on patch series of [1]. This tries to drop the arch specific codes of bus probe by using the common of_platform_default_populate_init() function. I just took the 83xx boards as an example. If you guys think that this is doable, I can change the remaining ppc boards to use this

Re: [PATCH v3 02/21] powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use

2016-08-22 Thread Cyril Bur
On Fri, 2016-08-19 at 16:33 +1000, Michael Neuling wrote: > On Wed, 2016-08-17 at 13:43 +1000, Cyril Bur wrote: > > > > Comment from arch/powerpc/kernel/process.c:967: > >  If userspace is inside a transaction (whether active or > >  suspended) and FP/VMX/VSX instructions have ever been enabled >

[PATCH v3] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Cyril Bur
Userspace can begin and suspend a transaction within the signal handler which means they might enter sys_rt_sigreturn() with the processor in suspended state. sys_rt_sigreturn() wants to restore process context (which may have been in a transaction before signal delivery). To do this it must resto

Re: [PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Cyril Bur
On Mon, 2016-08-22 at 19:21 +0800, kbuild test robot wrote: > Hi Cyril, > > [auto build test ERROR on powerpc/next] > [also build test ERROR on v4.8-rc3 next-20160822] > [if your patch is applied to the wrong git tree, please drop us a > note to help improve the system] >

Re: [PATCH V2 4/5] powerpc/64/kexec: Copy image with MMU off when possible

2016-08-22 Thread Balbir Singh
On 19/08/16 18:52, Aneesh Kumar K.V wrote: > From: Benjamin Herrenschmidt > > Currently we turn the MMU off after copying the image, and we make > sure there is no overlap between the hash table and the target pages > in that case. > > That doesn't work for Radix however. In that case, the pag

Re: [PATCH V2 3/5] powerpc/64/kexec: Fix MMU cleanup on radix

2016-08-22 Thread Balbir Singh
On 19/08/16 18:52, Aneesh Kumar K.V wrote: > From: Benjamin Herrenschmidt > > Just using the hash ops won't work anymore since radix will have > NULL in there. Instead create an mmu_cleanup_all() function which > will do the right thing based on the MMU mode. > > For Radix, for now I clear UPR

Re: [PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Cyril Bur
On Sat, 2016-08-20 at 18:03 +0800, Simon Guo wrote: > Hi Cyril, > On Mon, Aug 22, 2016 at 05:32:06PM +1000, Cyril Bur wrote: > > > > diff --git a/arch/powerpc/kernel/signal_32.c > > b/arch/powerpc/kernel/signal_32.c > > index b6aa378..31e4e15 100644 > > --- a/arch/powerpc/kernel/signal_32.c > > ++

Re: [PATCH v6 2/7] perf annotate: Add cross arch annotate support

2016-08-22 Thread Kim Phillips
On Fri, 19 Aug 2016 18:29:33 +0530 Ravi Bangoria wrote: > Changes in v6: > - Instead of adding only those instructions defined in #ifdef __arm__, > add all instructions from default table to arm table. .. > +static struct ins instructions_arm[] = { > { .name = "add", .ops = &mov_op

Re: [PATCH] selftest/powerpc: Add test for sigreturn in transaction

2016-08-22 Thread Cyril Bur
On Mon, 2016-08-22 at 18:53 +0200, Laurent Dufour wrote: > Ensure that kernel is throwing away the suspended transaction when > sigreturn() is called otherwise it if fails to restore the signal > frame's TM SPRS. > > Signed-off-by: Laurent Dufour Reviewed-by: Cyril Bur > --- >  tools/testing/s

Re: [PATCH v2 2/6] powerpc: kexec_file: Add buffer hand-over support for the next kernel

2016-08-22 Thread Thiago Jung Bauermann
Am Montag, 22 August 2016, 15:22:00 schrieb Dave Young: > On 08/22/16 at 12:38am, Thiago Jung Bauermann wrote: > > Am Montag, 22 August 2016, 11:21:35 schrieb Dave Young: > > > On 08/13/16 at 12:18am, Thiago Jung Bauermann wrote: > > > > diff --git a/arch/powerpc/kernel/machine_kexec_64.c > > > > b

Re: [PATCH v2 3/6] kexec_file: Allow skipping checksum calculation for some segments.

2016-08-22 Thread Thiago Jung Bauermann
Am Montag, 22 August 2016, 11:36:43 schrieb Dave Young: > On 08/22/16 at 12:25am, Thiago Jung Bauermann wrote: > > Am Montag, 22 August 2016, 11:17:45 schrieb Dave Young: > > > On 08/18/16 at 06:09pm, Thiago Jung Bauermann wrote: > > > > Am Donnerstag, 18 August 2016, 17:03:30 schrieb Dave Young: >

Re: [PATCH] cxl: use pcibios_free_controller_deferred() when removing vPHBs

2016-08-22 Thread kbuild test robot
Hi Andrew, [auto build test ERROR on char-misc/char-misc-testing] [also build test ERROR on v4.8-rc3 next-20160822] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto

Re: [PATCH v4] powerpc: Do not make the entire heap executable

2016-08-22 Thread Jason Gunthorpe
On Mon, Aug 22, 2016 at 08:37:05PM +0200, Denys Vlasenko wrote: > >Is this going to break any application ? I am asking because you > >mentioned the patch is lightly tested. > > I booted powerpc64 machine with RHEL7 installation, > it did not catch fire. When I authored the original patch my con

[PATCH v5] powerpc: Do not make the entire heap executable

2016-08-22 Thread Denys Vlasenko
On 32-bit powerpc the ELF PLT sections of binaries (built with --bss-plt, or with a toolchain which defaults to it) look like this: [17] .sbss NOBITS 0002aff8 01aff8 14 00 WA 0 0 4 [18] .plt NOBITS 0002b00c 01aff8 84 00 WAX 0 0 4 [1

Re: [PATCH v4] powerpc: Do not make the entire heap executable

2016-08-22 Thread Denys Vlasenko
On 08/21/2016 05:47 PM, Aneesh Kumar K.V wrote: Denys Vlasenko writes: On 32-bit powerpc the ELF PLT sections of binaries (built with --bss-plt, or with a toolchain which defaults to it) look like this: [17] .sbss NOBITS 0002aff8 01aff8 14 00 WA 0 0 4 [18] .p

Re: [PATCH V2 2/5] powerpc/mm: Add radix flush all with IS=3

2016-08-22 Thread Balbir Singh
On Mon, Aug 22, 2016 at 11:41:13AM +0530, Aneesh Kumar K.V wrote: > Benjamin Herrenschmidt writes: > > > On Fri, 2016-08-19 at 14:22 +0530, Aneesh Kumar K.V wrote: > >> Signed-off-by: Aneesh Kumar K.V > >> --- > >>  arch/powerpc/include/asm/book3s/64/tlbflush-radix.h |  1 + > >>  arch/powerpc/mm

[PATCH] powerpc64: Enable CONFIG_E500 and CONFIG_PPC_E500MC for e5500/e6500

2016-08-22 Thread David Engraf
The PowerPC e5500/e6500 architecture is based on the e500mc core. Enable CONFIG_E500 and CONFIG_PPC_E500MC when e5500/e6500 is used. This will also fix using CONFIG_PPC_QEMU_E500 on PPC64. Signed-off-by: David Engraf --- arch/powerpc/platforms/Kconfig.cputype | 6 -- 1 file changed, 4 inser

[PATCH] selftest/powerpc: Add test for sigreturn in transaction

2016-08-22 Thread Laurent Dufour
Ensure that kernel is throwing away the suspended transaction when sigreturn() is called otherwise it if fails to restore the signal frame's TM SPRS. Signed-off-by: Laurent Dufour --- tools/testing/selftests/powerpc/tm/Makefile | 2 +- tools/testing/selftests/powerpc/tm/tm-sigreturn.c | 8

Re: [PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Simon Guo
Hi Cyril, On Mon, Aug 22, 2016 at 05:32:06PM +1000, Cyril Bur wrote: > diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c > index b6aa378..31e4e15 100644 > --- a/arch/powerpc/kernel/signal_32.c > +++ b/arch/powerpc/kernel/signal_32.c > @@ -1226,7 +1226,19 @@ long sys_rt_

Re: [PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread kbuild test robot
Hi Cyril, [auto build test ERROR on powerpc/next] [also build test ERROR on v4.8-rc3 next-20160822] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for convenience) to rec

Re: [PATCH] powerpc/powernv : Drop reference added by kset_find_obj()

2016-08-22 Thread Vasant Hegde
On 08/22/2016 12:17 PM, Mukesh Ojha wrote: In a situation, where Linux kernel gets notified about duplicate error log from OPAL, it is been observed that kernel fails to remove sysfs entries (/sys/firmware/opal/elog/0x) of such error logs. This is because, we currently search the error lo

Re: linux-next: build warnings after merge of the kbuild tree

2016-08-22 Thread Nicholas Piggin
On Fri, 19 Aug 2016 20:44:55 +1000 Nicholas Piggin wrote: > On Fri, 19 Aug 2016 10:37:00 +0200 > Michal Marek wrote: > > > On 2016-08-19 07:09, Stephen Rothwell wrote: [snip] > > > > > > I may be missing something, but genksyms generates the crc's off the > > > preprocessed C source code a

Re: [PATCH] ppc64: allow ptrace to set TM bits

2016-08-22 Thread Laurent Dufour
On 22/08/2016 03:01, Cyril Bur wrote: > On Tue, 2016-08-02 at 13:43 +0800, Simon Guo wrote: >> Hi Laurent, >> On Fri, Jul 29, 2016 at 11:51:22AM +0200, Laurent Dufour wrote: >>> >>> static int set_user_msr(struct task_struct *task, unsigned long >>> msr) >>> { >>> +#ifdef CONFIG_PPC_TRANSACTIONAL

Re: [PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Laurent Dufour
On 22/08/2016 09:32, Cyril Bur wrote: > Userspace can begin and suspend a transaction within the signal > handler which means they might enter sys_rt_sigreturn() with the > processor in suspended state. > > sys_rt_sigreturn() wants to restore process context (which may have > been in a transaction

Re: TM Bad Thing exception easily raised from userspace

2016-08-22 Thread Laurent Dufour
On 22/08/2016 06:18, Cyril Bur wrote: > On Fri, 2016-08-19 at 19:21 +0200, Laurent Dufour wrote: >> Hi, >> >> While working on the TM support for CRIU, I faced a TM Bad Thing >> exception. >> >> Digging further, I found that it is *easy* to raised it from the user >> space. I attached below a simpl

Re: TM Bad Thing exception easily raised from userspace

2016-08-22 Thread Laurent Dufour
On 19/08/2016 22:23, Segher Boessenkool wrote: > Completely off-topic, but... > > On Fri, Aug 19, 2016 at 07:21:44PM +0200, Laurent Dufour wrote: >> asm __volatile__( >> "li 3,1 ;" >> "tbegin.;" >> "beq1f ;

Re: [PATCH V2 1/5] powerpc/64/kexec: NULL check "clear_all" in kexec_sequence

2016-08-22 Thread Balbir Singh
On Fri, Aug 19, 2016 at 02:22:35PM +0530, Aneesh Kumar K.V wrote: > From: Benjamin Herrenschmidt > > With Radix, it can be NULL even on !BOOKE these days so replace > the ifdef with a NULL check which is cleaner anyway. > > Signed-off-by: Benjamin Herrenschmidt > Signed-off-by: Aneesh Kumar K.V

Re: [PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread kbuild test robot
ord what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information] url: https://github.com/0day-ci/linux/commits/Cyril-Bur/powerpc-signals-Discard-transaction-state-from-signal-frames/20160822-131843 base: ht

Re: [PATCH 1/2] Enable storage keys for radix - user mode execution

2016-08-22 Thread Balbir Singh
On Mon, Aug 22, 2016 at 11:32:44AM +0530, Aneesh Kumar K.V wrote: > Balbir Singh writes: > > > ISA 3 defines new encoded access authority that allows instruction > > access prevention in privileged mode and allows normal access > > to problem state. This patch just enables IAMR (Instruction Autho

Re: [PATCH 2/2] Detect instruction fetch denied and report

2016-08-22 Thread Balbir Singh
On Mon, Aug 22, 2016 at 11:35:36AM +0530, Aneesh Kumar K.V wrote: > Balbir Singh writes: > > > ISA 3 allows for prevention of instruction fetch and execution > > of user mode pages. If such an error occurs, SRR1 bit 35 > > reports the error. We catch and report the error in do_page_fault() > > >

Re: [PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Cyril Bur
On Mon, 2016-08-22 at 17:32 +1000, Cyril Bur wrote: The subject prefix should have contained V2. Sorry. > Userspace can begin and suspend a transaction within the signal > handler which means they might enter sys_rt_sigreturn() with the > processor in suspended state. > > sys_rt_sigreturn() want

[PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Cyril Bur
Userspace can begin and suspend a transaction within the signal handler which means they might enter sys_rt_sigreturn() with the processor in suspended state. sys_rt_sigreturn() wants to restore process context (which may have been in a transaction before signal delivery). To do this it must resto

Re: [PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Cyril Bur
On Mon, 2016-08-22 at 17:07 +1000, Michael Neuling wrote: > On Mon, 2016-08-22 at 15:15 +1000, Cyril Bur wrote: > > > > Userspace can begin and suspend a transaction within the signal > > handler which means they might enter sys_rt_sigreturn() with the > > processor in suspended state. > > > > sy

Re: [PATCH v2 2/6] powerpc: kexec_file: Add buffer hand-over support for the next kernel

2016-08-22 Thread Dave Young
On 08/22/16 at 12:38am, Thiago Jung Bauermann wrote: > Am Montag, 22 August 2016, 11:21:35 schrieb Dave Young: > > On 08/13/16 at 12:18am, Thiago Jung Bauermann wrote: > > > diff --git a/arch/powerpc/kernel/machine_kexec_64.c > > > b/arch/powerpc/kernel/machine_kexec_64.c index > > > a484a6346146..

Re: [PATCH] powerpc: signals: Discard transaction state from signal frames

2016-08-22 Thread Michael Neuling
On Mon, 2016-08-22 at 15:15 +1000, Cyril Bur wrote: > Userspace can begin and suspend a transaction within the signal > handler which means they might enter sys_rt_sigreturn() with the > processor in suspended state. > > sys_rt_sigreturn() wants to restore process context (which may have > been in

[PATCH] powerpc/powernv : Drop reference added by kset_find_obj()

2016-08-22 Thread Mukesh Ojha
In a situation, where Linux kernel gets notified about duplicate error log from OPAL, it is been observed that kernel fails to remove sysfs entries (/sys/firmware/opal/elog/0x) of such error logs. This is because, we currently search the error log/dump kobject in the kset list via 'kset_fin