Re: [RFC PATCH 5/9] powerpc: reverse the soft_enable logic

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:18 +0530 Madhavan Srinivasan wrote: > "paca->soft_enabled" is used as a flag to mask some of interrupts. > Currently supported flags values and their details: > > soft_enabled MSR[EE] > > 0 0 Disabled (PMI

Re: [RFC PATCH 1/9] Add #defs for paca->soft_enabled flags

2016-07-26 Thread Nicholas Piggin
On Tue, 26 Jul 2016 11:35:16 +0530 Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > On Tuesday 26 July 2016 10:57 AM, Nicholas Piggin wrote: > > On Mon, 25 Jul 2016 20:22:14 +0530 > > Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > > >

Re: [RFC PATCH 6/9] powerpc: modify __SOFTEN_TEST to support tri-state soft_enabled flag

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:19 +0530 Madhavan Srinivasan wrote: > Foundation patch to support checking of new flag for > "paca->soft_enabled". Modify the condition checking for the > "soft_enabled" from "equal" to "greater than or equal to". Rather than a "tri-state" and

Re: [PATCH 1/2] powerpc/64: Correct comment on LOAD_HANDLER()

2016-07-26 Thread Nicholas Piggin
On Tue, 26 Jul 2016 15:29:29 +1000 Michael Ellerman wrote: > The comment for LOAD_HANDLER() was wrong. The part about kdump has not > been true since 1f6a93e4c35e ("powerpc: Make it possible to move the > interrupt handlers away from the kernel"). > > Describe how it

Re: [RFC PATCH 8/9] powerpc: Support to replay PMIs

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:21 +0530 Madhavan Srinivasan wrote: > Code to replay the Performance Monitoring Interrupts(PMI). > In the masked_interrupt handler, for PMIs we reset the MSR[EE] > and return. This is due the fact that PMIs are level triggered. > In the

Re: [RFC PATCH 9/9] powerpc: rewrite local_t using soft_irq

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:22 +0530 Madhavan Srinivasan wrote: > https://lkml.org/lkml/2008/12/16/450 > > Modifications to Rusty's benchmark code: > - Executed only local_t test > > Here are the values with the patch. > > Time in ns per iteration > > Local_t

Re: [RFC PATCH 7/9] powerpc: Add support to mask perf interrupts

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:20 +0530 Madhavan Srinivasan wrote: > To support masking of the PMI interrupts, couple of new interrupt > handler macros are added MASKABLE_EXCEPTION_PSERIES_OOL and > MASKABLE_RELON_EXCEPTION_PSERIES_OOL. These are needed to include the >

Re: [RFC PATCH 1/9] Add #defs for paca->soft_enabled flags

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 20:22:14 +0530 Madhavan Srinivasan wrote: > Two #defs LAZY_INTERRUPT_ENABLED and > LAZY_INTERRUPT_DISABLED are added to be used > when updating paca->soft_enabled. This is a very nice patchset, but can this not be a new name? We use "soft

Re: [PATCH 2/2] powerpc/64: Do load of PACAKBASE in LOAD_HANDLER

2016-07-26 Thread Nicholas Piggin
On Tue, 26 Jul 2016 15:29:30 +1000 Michael Ellerman wrote: > The LOAD_HANDLER macro requires that you have previously loaded "reg" > with PACAKBASE. Although that gives callers flexibility to get > PACAKBASE in some interesting way, none of the callers actually do > that. So

Re: [RFC PATCH 7/9] powerpc: Add support to mask perf interrupts

2016-07-26 Thread Nicholas Piggin
On Tue, 26 Jul 2016 12:16:32 +0530 Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > On Tuesday 26 July 2016 12:00 PM, Nicholas Piggin wrote: > > On Tue, 26 Jul 2016 11:55:51 +0530 > > Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > > >

Re: [RFC PATCH 7/9] powerpc: Add support to mask perf interrupts

2016-07-26 Thread Nicholas Piggin
On Tue, 26 Jul 2016 12:52:02 +0530 Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > On Tuesday 26 July 2016 12:40 PM, Nicholas Piggin wrote: > > On Tue, 26 Jul 2016 12:16:32 +0530 > > Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > > >

Re: [RFC PATCH 7/9] powerpc: Add support to mask perf interrupts

2016-07-26 Thread Nicholas Piggin
On Tue, 26 Jul 2016 11:55:51 +0530 Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > On Tuesday 26 July 2016 11:16 AM, Nicholas Piggin wrote: > > On Mon, 25 Jul 2016 20:22:20 +0530 > > Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > > > >>

Re: [PATCH for-4.8 V2 03/10] powerpc/mm/radix: Add radix_set_pte to use in early init

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 18:36:09 +1000 Michael Ellerman wrote: > "Aneesh Kumar K.V" writes: > > > We want to use the static key based feature check in set_pte_at. > > Since we call radix__map_kernel_page early in boot before jump > > label is

Re: [PATCH for-4.8 V2 00/10] Use jump label for cpu/mmu_has_feature

2016-07-24 Thread Nicholas Piggin
On Sat, 23 Jul 2016 14:42:33 +0530 "Aneesh Kumar K.V" wrote: > Changes from V1: > * Update "powerpc/mm: Convert early cpu/mmu feature check to use the > new helpers" based on resend code changes in this area. > > We now do feature fixup early and hence we can

Re: [PATCH for-4.8 V2 08/10] powerpc: use the jump label for cpu_has_feature

2016-07-25 Thread Nicholas Piggin
On Sat, 23 Jul 2016 14:42:41 +0530 "Aneesh Kumar K.V" wrote: > From: Kevin Hao > > The cpu features are fixed once the probe of cpu features are done. > And the function cpu_has_feature() does be used in some hot path. > The checking of the

Re: [PATCH for-4.8 V2 00/10] Use jump label for cpu/mmu_has_feature

2016-07-25 Thread Nicholas Piggin
On Mon, 25 Jul 2016 11:55:50 +0530 "Aneesh Kumar K.V" <aneesh.ku...@linux.vnet.ibm.com> wrote: > Nicholas Piggin <npig...@gmail.com> writes: > > > On Sat, 23 Jul 2016 14:42:33 +0530 > > "Aneesh Kumar K.V" <aneesh.ku...@linux.vnet.ibm.com> w

[PATCH] powerpc/tm: do not use r13 for tabort_syscall

2016-07-24 Thread Nicholas Piggin
tabort_syscall runs with RI=1, so a nested recoverable machine check will load the paca into r13 and overwrite what we loaded it with, because exceptions returning to privileged mode do not restore r13. Fixes: b4b56f9ecab4 (powerpc/tm: Abort syscalls in active transactions) Cc:

Re: [PATCH] powerpc/64: implement a slice mask cache

2016-07-24 Thread Nicholas Piggin
On Sat, 23 Jul 2016 18:49:06 +1000 Benjamin Herrenschmidt <b...@kernel.crashing.org> wrote: > On Sat, 2016-07-23 at 17:10 +1000, Nicholas Piggin wrote: > > I wanted to avoid doing more work under slice_convert_lock, but > > we should just make that a per-mm lock anyway should

Re: [PATCH] powerpc/64: implement a slice mask cache

2016-07-24 Thread Nicholas Piggin
On Sat, 23 Jul 2016 20:36:42 +1000 Balbir Singh <bsinghar...@gmail.com> wrote: > On Sat, Jul 23, 2016 at 05:10:36PM +1000, Nicholas Piggin wrote: > > On Sat, 23 Jul 2016 12:19:37 +1000 > > Balbir Singh <bsinghar...@gmail.com> wrote: > > > > > On Fri,

Re: [PATCH v3 10/21] powerpc/mm: Define radix_enabled() in one place & use static inline

2016-07-28 Thread Nicholas Piggin
On Thu, 28 Jul 2016 00:18:06 +1000 Michael Ellerman wrote: > Currently we have radix_enabled() three times, twice in > asm/book3s/64/mmu.h and then a fallback in asm/mmu.h. > > Consolidate them in asm/mmu.h. While we're at it convert them to be > static inlines, and change

Re: [PATCH v3 18/21] powerpc: Add option to use jump label for cpu_has_feature()

2016-07-28 Thread Nicholas Piggin
On Thu, 28 Jul 2016 00:18:14 +1000 Michael Ellerman wrote: > From: Kevin Hao > > We do binary patching of asm code using CPU features, which is a > one-time operation, done during early boot. However checks of CPU > features in C code are currently done

Re: [PATCH v3 21/21] powerpc/jump_label: Annotate jump label assembly

2016-07-28 Thread Nicholas Piggin
On Thu, 28 Jul 2016 00:18:17 +1000 Michael Ellerman wrote: > Add a comment to the generated assembler for jump labels. This makes > it easier to identify them in asm listings (generated with $ make > foo.s). The series looks in much better shape now. As a disclaimer I did

Re: [PATCH v3 12/21] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers

2016-07-28 Thread Nicholas Piggin
On Thu, 28 Jul 2016 00:18:08 +1000 Michael Ellerman wrote: > From: "Aneesh Kumar K.V" > > This switches early feature checks to use the non static key variant > of the function. In later patches we will be switching > cpu_has_feature() and

Re: [RFC PATCH 1/9] Add #defs for paca->soft_enabled flags

2016-07-28 Thread Nicholas Piggin
On Tue, 26 Jul 2016 11:35:16 +0530 Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > On Tuesday 26 July 2016 10:57 AM, Nicholas Piggin wrote: > > On Mon, 25 Jul 2016 20:22:14 +0530 > > Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > > >

Re: [PATCH v3 19/21] powerpc: Add option to use jump label for mmu_has_feature()

2016-07-28 Thread Nicholas Piggin
On Thu, 28 Jul 2016 00:18:15 +1000 Michael Ellerman wrote: > From: Kevin Hao > > As we just did for CPU features. > > Signed-off-by: Kevin Hao > Signed-off-by: Aneesh Kumar K.V > Signed-off-by:

Re: [PATCH] powerpc/64: implement a slice mask cache

2016-07-23 Thread Nicholas Piggin
On Sat, 23 Jul 2016 12:19:37 +1000 Balbir Singh <bsinghar...@gmail.com> wrote: > On Fri, Jul 22, 2016 at 10:57:28PM +1000, Nicholas Piggin wrote: > > Calculating the slice mask can become a signifcant overhead for > > get_unmapped_area. The mask is relatively smal

Re: [kernel,v2,1/2] powerpc/iommu: Stop using @current in mm_iommu_xxx

2016-07-23 Thread Nicholas Piggin
On Wed, 20 Jul 2016 14:34:30 +1000 Alexey Kardashevskiy wrote: > static long tce_iommu_register_pages(struct tce_container *container, > @@ -128,10 +129,17 @@ static long tce_iommu_register_pages(struct > tce_container *container, ((vaddr + size) < vaddr)) >

[PATCH] Optimise syscall entry for virtual, relocatable case

2016-07-23 Thread Nicholas Piggin
The mflr r10 instruction was left over saving of lr when the code used lr to branch to system_call_entry from the exception handler. That was changed by 6a404806d to use the count register. The value is never used now, so mflr can be removed, and r10 can be used for storage rather than spilling

[PATCH] powerpc/tm: do not use r13 for tabort_syscall

2016-07-22 Thread Nicholas Piggin
tabort_syscall runs with RI=1, so a nested recoverable machine check will load the paca into r13 and overwrite what we loaded it with, because exceptions returning to privileged mode do not restore r13. This has survived testing with sc instruction inside transaction (bare sc, not glibc syscall

Re: [PATCH 05/14] powerpc/pseries: 4GB exception handler offsets

2016-07-22 Thread Nicholas Piggin
On Thu, 21 Jul 2016 14:34:10 + David Laight <david.lai...@aculab.com> wrote: > From: Nicholas Piggin > > Sent: 21 July 2016 07:44 > ... > > @@ -739,7 +739,8 @@ kvmppc_skip_Hinterrupt: > > * Ensure that any handlers that get invoked from the exception >

[RFC] powerpc/64: syscall ABI

2016-07-22 Thread Nicholas Piggin
This adds some documentation for the 64-bit syscall ABI, because we don't seem to have a canonical document anywhere. I have been mostly looking at 64S, so comments about 32-bit and embedded would be welcome too. I have just documented existing practice. The only small issue I have come across is

Re: [PATCH v2 1/3] powerpc: Factor out common code in setup-common.c

2016-07-31 Thread Nicholas Piggin
On Thu, 28 Jul 2016 16:07:16 -0700 Andrey Smirnov wrote: > Factor out a small bit of common code in machine_restart(), > machine_power_off() and machine_halt(). > > Signed-off-by: Andrey Smirnov > --- > > No changes compared to v1. > >

Re: [RFC PATCH v2 09/11] powerpc: Add support to mask perf interrupts

2016-08-01 Thread Nicholas Piggin
On Mon, 1 Aug 2016 11:39:18 +0530 Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > On Monday 01 August 2016 10:59 AM, Nicholas Piggin wrote: > > On Mon, 1 Aug 2016 00:36:27 +0530 > > Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > > And that woul

Re: [PATCH v2 2/3] powerpc: Call chained reset handlers during reset

2016-07-31 Thread Nicholas Piggin
On Thu, 28 Jul 2016 16:07:17 -0700 Andrey Smirnov wrote: > Call out to all restart handlers that were added via > register_restart_handler() API when restarting the machine. > > Signed-off-by: Andrey Smirnov > --- > > No changes compared to

Re: [PATCH v2 3/3] powerpc: Convert fsl_rstcr_restart to a reset handler

2016-07-31 Thread Nicholas Piggin
On Thu, 28 Jul 2016 16:07:18 -0700 Andrey Smirnov wrote: > Convert fsl_rstcr_restart into a function to be registered with > register_reset_handler(). > > Signed-off-by: Andrey Smirnov > --- > > Changes since v1: > > -

Re: [RFC PATCH v2 08/11] powerpc: Add "mask_lvl" paramater to MASKABLE_* macros

2016-07-31 Thread Nicholas Piggin
On Mon, 1 Aug 2016 00:36:26 +0530 Madhavan Srinivasan wrote: > Make it explicit the interrupt masking level supported > by a gievn interrupt handler. Patch correspondingly > extends the MASKABLE_* macros with an addition's parameter. > "mask_lvl" parameter is passed to

Re: [RFC PATCH v2 09/11] powerpc: Add support to mask perf interrupts

2016-07-31 Thread Nicholas Piggin
On Mon, 1 Aug 2016 00:36:27 +0530 Madhavan Srinivasan wrote: > /* > * flags for paca->soft_enabled > */ > #define IRQ_DISABLE_LEVEL_NONE 0 > #define IRQ_DISABLE_LEVEL_LINUX 1 > +#define IRQ_DISABLE_LEVEL_PMU2 > + >

Re: [RFC PATCH v2 10/11] powerpc: Support to replay PMIs

2016-08-01 Thread Nicholas Piggin
On Mon, 1 Aug 2016 00:36:28 +0530 Madhavan Srinivasan wrote: > Code to replay the Performance Monitoring Interrupts(PMI). > In the masked_interrupt handler, for PMIs we reset the MSR[EE] > and return. This is due the fact that PMIs are level triggered. > In the

Re: [RFC PATCH v2 10/11] powerpc: Support to replay PMIs

2016-08-01 Thread Nicholas Piggin
On Mon, 1 Aug 2016 15:52:28 +0530 Madhavan Srinivasan <ma...@linux.vnet.ibm.com> wrote: > On Monday 01 August 2016 02:21 PM, Benjamin Herrenschmidt wrote: > > On Mon, 2016-08-01 at 18:07 +1000, Nicholas Piggin wrote: > >> This will replay hardware_interrupt_common

Re: [PATCH for-4.8 V2 01/10] powerpc/mm: Add __cpu/__mmu_has_feature

2016-07-24 Thread Nicholas Piggin
On Sat, 23 Jul 2016 14:42:34 +0530 "Aneesh Kumar K.V" wrote: > In later patches, we will be switching cpu and mmu feature check to > use static keys. This would require us to have a variant of feature > check that can be used in early boot before jump label is

Re: [PATCH for-4.8 V2 03/10] powerpc/mm/radix: Add radix_set_pte to use in early init

2016-07-25 Thread Nicholas Piggin
On Sat, 23 Jul 2016 14:42:36 +0530 "Aneesh Kumar K.V" wrote: > We want to use the static key based feature check in set_pte_at. Since > we call radix__map_kernel_page early in boot before jump label is > initialized we can't call set_pte_at there. Add

Re: [PATCH] Make system_reset_pSeries relocatable

2016-07-27 Thread Nicholas Piggin
On Wed, 27 Jul 2016 20:01:24 +1000 Balbir Singh wrote: > On Wed, Jul 27, 2016 at 7:53 PM, Benjamin Herrenschmidt > wrote: > > On Wed, 2016-07-27 at 17:32 +1000, Balbir Singh wrote: > >> From: Balbir Singh > >> > >>

Re: [PATCH] Make system_reset_pSeries relocatable

2016-07-27 Thread Nicholas Piggin
On Wed, 27 Jul 2016 17:32:06 +1000 Balbir Singh wrote: > From: Balbir Singh > > Currently the power management bits are broken w.r.t. relocation. > There are direct branches from system_reset_pSeries to > power7_wakeup_*. The correct way to do it

Re: [PATCH kernel 06/15] powerpc/mm/iommu: Put pages on process exit

2016-08-03 Thread Nicholas Piggin
nder container->lock, this does not need additional locking. > > Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> Reviewed-by: Nicholas Piggin <npig...@gmail.com> ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH kernel 05/15] powerpc/iommu: Stop using @current in mm_iommu_xxx

2016-08-03 Thread Nicholas Piggin
havioral change. > > Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> Reviewed-by: Nicholas Piggin <npig...@gmail.com> I still have some questions about the use of mm in the driver, but those aren't issues introduced by this patch, so as it is I think the bug fix of this and th

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-11 Thread Nicholas Piggin
On Wed, 03 Aug 2016 22:13:28 +0200 Arnd Bergmann wrote: > On Wednesday, August 3, 2016 2:44:29 PM CEST Segher Boessenkool wrote: > > Hi Arnd, > > > > On Wed, Aug 03, 2016 at 08:52:48PM +0200, Arnd Bergmann wrote: > > > From my first look, it seems that all of lib/*.o is now

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-11 Thread Nicholas Piggin
On Thu, 11 Aug 2016 15:04:00 +0200 Arnd Bergmann <a...@arndb.de> wrote: > On Thursday, August 11, 2016 10:43:20 PM CEST Nicholas Piggin wrote: > > On Wed, 03 Aug 2016 22:13:28 +0200 > > Final ld time > > inclink > > real0m0.378s > > user0m0

Re: [PATCH v2 1/3] powerpc: Factor out common code in setup-common.c

2016-08-09 Thread Nicholas Piggin
On Tue, 9 Aug 2016 09:30:54 -0700 Andrey Smirnov <andrew.smir...@gmail.com> wrote: > On Sun, Jul 31, 2016 at 8:40 PM, Nicholas Piggin <npig...@gmail.com> wrote: > > On Thu, 28 Jul 2016 16:07:16 -0700 > > Andrey Smirnov <andrew.smir...@gmail.com> wrote: > >

Re: [PATCH v2 3/3] powerpc: Convert fsl_rstcr_restart to a reset handler

2016-08-09 Thread Nicholas Piggin
On Tue, 9 Aug 2016 11:47:37 -0700 Andrey Smirnov <andrew.smir...@gmail.com> wrote: > On Sun, Jul 31, 2016 at 9:03 PM, Nicholas Piggin <npig...@gmail.com> wrote: > > On Thu, 28 Jul 2016 16:07:18 -0700 > > Andrey Smirnov <andrew.smir...@gmail.com> wrote: >

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-03 Thread Nicholas Piggin
On Wed, 03 Aug 2016 14:29:13 +0200 Arnd Bergmann wrote: > On Wednesday, August 3, 2016 10:19:11 PM CEST Stephen Rothwell wrote: > > Hi Arnd, > > > > On Wed, 03 Aug 2016 09:52:23 +0200 Arnd Bergmann wrote: > > > > > > Using a different way to link the kernel

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-04 Thread Nicholas Piggin
On Thu, 04 Aug 2016 14:09:02 +0200 Arnd Bergmann <a...@arndb.de> wrote: > On Thursday, August 4, 2016 9:47:13 PM CEST Nicholas Piggin wrote: > > On Thu, 04 Aug 2016 12:37:41 +0200 Arnd Bergmann <a...@arndb.de> wrote: > > > On Thursday, August 4, 2016 11:00:

Re: [PATCH] powerpc/book3s: Fix MCE console messages for unrecoverable MCE.

2016-08-04 Thread Nicholas Piggin
On Thu, 4 Aug 2016 17:35:45 +0530 Mahesh Jagannath Salgaonkar wrote: > On 08/04/2016 03:27 PM, Michael Ellerman wrote: > > Mahesh J Salgaonkar writes: > > > >> From: Mahesh Salgaonkar > >> > >> When machine

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-04 Thread Nicholas Piggin
On Thu, 04 Aug 2016 12:37:41 +0200 Arnd Bergmann wrote: > On Thursday, August 4, 2016 11:00:49 AM CEST Arnd Bergmann wrote: > > I tried this > > > > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh > > index b5e40ed86e60..89bca1a25916 100755 > > ---

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-04 Thread Nicholas Piggin
On Thu, 4 Aug 2016 22:31:39 +1000 Nicholas Piggin <npig...@gmail.com> wrote: > On Thu, 04 Aug 2016 14:09:02 +0200 > Arnd Bergmann <a...@arndb.de> wrote: > > Nicolas Pitre has done some related work, adding him to Cc. IIRC we have > > actually had multiple implemen

Re: [RFC PATCH] powerpc/Makefile: Add option to build with gold

2016-08-12 Thread Nicholas Piggin
On Fri, 12 Aug 2016 21:30:21 +1000 Michael Ellerman wrote: > This adds a Kconfig option which can be turned on to enable use of the > gold linker. It depends on DEBUG_KERNEL to hopefully hide it from users > who don't really care about it, and also !COMPILE_TEST so that it

[PATCH 1/2] powerpc/pseries: PACA save area fix for general exception vs MCE

2016-08-10 Thread Nicholas Piggin
MCE must not use PACA_EXGEN. When a general exception enables MSR_RI, that means SPRN_SRR[01] and SPRN_SPRG are no longer used. However the PACA save area is still in use. --- arch/powerpc/kernel/exceptions-64s.S | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[RFC][PATCH 0/2] powerpc/pseries machine check reentrancy fixes

2016-08-10 Thread Nicholas Piggin
I noticed a couple of potential issues with MCE handling. I haven't been able to test this yet, but I would like to get some second opinions on it. I know a few people have been looking at the MCE handler recently. Thanks, Nick

[PATCH 2/2] powerpc/pseries: PACA save area fix for MCE vs MCE

2016-08-10 Thread Nicholas Piggin
MCE must not enable MSR_RI until PACA_EXMC is no longer being used. --- arch/powerpc/kernel/exceptions-64s.S | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index

[PATCH 02/14] powerpc/pseries: remove cross-fixup branches in exception code

2016-07-21 Thread Nicholas Piggin
In preparation for reworking the alternate feature patching code, remove a case of cross-fixup branching in the exception code. That is, a branch from one alt feature section targeting another alt feature section. We have the following: BEGIN_FTR_SECTION b do_kvm_0x502 ... do_kvm_0x502:

[PATCH 06/14] powerpc/pseries: h_facility_unavailable realmode exception location

2016-07-21 Thread Nicholas Piggin
The 0xf80 hv_facility_unavailable trampoline branches to the 0xf60 handler. This works because they both do the same thing, but it should be fixed. Signed-off-by: Nick Piggin --- arch/powerpc/kernel/exceptions-64s.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 11/14] powerpc/pseries: use single macro for both parts of OOL exception

2016-07-21 Thread Nicholas Piggin
Simple substitution. Signed-off-by: Nick Piggin --- arch/powerpc/kernel/exceptions-64s.S | 53 1 file changed, 17 insertions(+), 36 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S

[PATCH 14/14] powerpc/pseries: exceptions use short handler load again

2016-07-21 Thread Nicholas Piggin
addis generated by LOAD_HANDLER_4GB is always 0, so it is safe to use 64K handlers. Move decrementer exception back inline. Signed-off-by: Nick Piggin --- arch/powerpc/include/asm/exception-64s.h | 4 ++-- arch/powerpc/kernel/exceptions-64s.S | 21 -

[PATCH 08/14] powerpc/pseries: consolidate exception handler alignment

2016-07-21 Thread Nicholas Piggin
Move exception handler alignment directives into the head-64.h macros, beause they will no longer work in-place after the next patch. This slightly changes functions that have alignments applied and therefore code generation, which is why it was not done initially (see earlier patch).

[PATCH 12/14] powerpc/pseries: remove unused exception code, small cleanups

2016-07-21 Thread Nicholas Piggin
This was not done before the big patches because I only noticed them afterwards. It has become much easier to see which handlers are branched to from which exception vectors now, and to see exactly what vector space is being used for what. Signed-off-by: Nick Piggin ---

[PATCH 09/14] powerpc/64: use gas sections for arranging exception vectors

2016-07-21 Thread Nicholas Piggin
Use assembler sections of fixed size and location to arrange pseries exception vector code (64e also using it in head_64.S for 0x0..0x100). This allows better flexibility in arranging exception code and hiding unimportant details behind macros. Gas sections can be a bit painful to use this way,

[RFC][PATCH 00/14] pseries exception cleanups

2016-07-21 Thread Nicholas Piggin
want to get something out for comments because it's become quite a large change. To that end, it applies to quite an old -linus revision: d325ea859490511322d1f151dc38577ee9a7c6da Rebasing takes a bit of work, but I'll bring it up to date if the response is positive. Thanks, Nick Nicholas Piggin

[PATCH 03/14] powerpc: build-time fixup alternate feature relative addresses

2016-07-21 Thread Nicholas Piggin
Implement build-time fixup of alternate feature relative addresses for the out-of-line ("else") patch code. This is done post-link with a new powerpc build tool that parses relocations and fixup structures, and adjusts branch instructions. The "else" part of the feature patching system currently

[PATCH 04/14] powerpc/pseries: move decrementer exception vector out of line

2016-07-21 Thread Nicholas Piggin
In preparation for extending the reach of exception handler loading, decrementer interrupt has to be moved out of line. The in-line version is already 0x80 bytes long in worst case, so there is no more room for instructions. This is done to make intermediate patch steps build and run. It gets

[PATCH 07/14] powerpc/pseries: improved exception vector macros

2016-07-21 Thread Nicholas Piggin
Add macros that can specify exception vectors more completely (location, type, etc). Move most of the exception code naming out of exception-64s.h, and feed labels to it directly (not quite complete yet). Code is unchanged except for names. Alignment directives scattered around are annoying, but

[PATCH 13/14] powerpc/pseries: consolidate slb exceptions

2016-07-21 Thread Nicholas Piggin
slb exceptions all follow the same pattern, so put it in a macro. Generated code should be the same. Signed-off-by: Nick Piggin --- arch/powerpc/kernel/exceptions-64s.S | 172 ++- 1 file changed, 69 insertions(+), 103 deletions(-) diff --git

[PATCH 01/14] powerpc: add arch/powerpc/tools directory

2016-07-21 Thread Nicholas Piggin
Move a couple of existing scripts under there. Remove scripts directory: a script is a tool, a tool is not a script. Signed-off-by: Nick Piggin --- arch/powerpc/Makefile | 8 ++- arch/powerpc/relocs_check.sh | 59

[PATCH 05/14] powerpc/pseries: 4GB exception handler offsets

2016-07-21 Thread Nicholas Piggin
Add a LOAD_HANDLER_4GB variant which uses an extra instruction to extend the range of handlers to 32-bit. With 16-bit handlers, it is very difficult to move exception vector code around or reserve any more space for new exceptions. So set all handlers to use the new variant. After subsequent

[PATCH 10/14] powerpc/pseries: move related exception code together

2016-07-21 Thread Nicholas Piggin
This is mostly juggling. Generated code should remain the same, except for placement and offsets. We can do this now that code gets moved into the correct section according to its type. Signed-off-by: Nick Piggin --- arch/powerpc/kernel/exceptions-64s.S | 2005

Re: [PATCH 03/14] powerpc: build-time fixup alternate feature relative addresses

2016-07-21 Thread Nicholas Piggin
On Thu, 21 Jul 2016 16:44:02 +1000 Nicholas Piggin <nicholas.pig...@gmail.com> wrote: > fixup_entry data could be stripped at build time after this change. Actually that's crazy, no it couldn't! Fortunately I didn't attempt to try that. Laziness pays off

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-05 Thread Nicholas Piggin
On Thu, 4 Aug 2016 12:06:41 -0500 Segher Boessenkool <seg...@kernel.crashing.org> wrote: > On Thu, Aug 04, 2016 at 06:10:57PM +0200, Arnd Bergmann wrote: > > On Thursday, August 4, 2016 9:47:13 PM CEST Nicholas Piggin wrote: > &

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-05 Thread Nicholas Piggin
On Fri, 05 Aug 2016 18:01:13 +0200 Arnd Bergmann <a...@arndb.de> wrote: > On Friday, August 5, 2016 10:26:25 PM CEST Nicholas Piggin wrote: > > On Fri, 05 Aug 2016 12:17:27 +0200 > > Arnd Bergmann <a...@arndb.de> wrote: > > > > and I also get

Re: [PATCH] powerpc: Align hot loops of memset() and backwards_memcpy()

2016-08-05 Thread Nicholas Piggin
On Thu, 4 Aug 2016 16:53:22 +1000 Anton Blanchard wrote: > From: Anton Blanchard > > Align the hot loops in our assembly implementation of memset() > and backwards_memcpy(). > > backwards_memcpy() is called from tcp_v4_rcv(), so we might > want to optimise

[PATCH 1/5] kbuild: allow architectures to use thin archives instead of ld -r

2016-08-05 Thread Nicholas Piggin
eg...@kernel.crashing.org> Cc: Alan Modra <amo...@gmail.com> Signed-off-by: Stephen Rothwell <s...@canb.auug.org.au> Signed-off-by: Nicholas Piggin <npig...@gmail.com> --- arch/Kconfig| 6 + scripts/Makefile.build | 23

[PATCH 5/5] powerpc/64: use linker dce

2016-08-05 Thread Nicholas Piggin
--- arch/powerpc/kernel/Makefile | 3 +++ arch/powerpc/kernel/vmlinux.lds.S | 2 +- arch/powerpc/platforms/Kconfig.cputype | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 2da380f..b356e59 100644

Re: [RFC][PATCH 0/5] kbuild changes, thin archives, --gc-sections

2016-08-05 Thread Nicholas Piggin
On Fri, 5 Aug 2016 22:11:58 +1000 Nicholas Piggin <npig...@gmail.com> wrote: > Hello, > > I have 3 different things in this patchset. All arch specific, but all > involve kbuild changes, so I'd like to discuss them with kbuild > maintainers. The goal has been to improve

[PATCH 3/5] kbuild: add arch specific post-module-link pass

2016-08-05 Thread Nicholas Piggin
Add an option for architectures to pass over modules after they are linked. powerpc will use this to fix up alternate instruction patch relocations. Signed-off-by: Nicholas Piggin <npig...@gmail.com> --- Documentation/kbuild/makefiles.txt | 6 ++ Makefile

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-05 Thread Nicholas Piggin
On Fri, 05 Aug 2016 12:17:27 +0200 Arnd Bergmann <a...@arndb.de> wrote: > On Friday, August 5, 2016 6:41:08 PM CEST Nicholas Piggin wrote: > > On Thu, 4 Aug 2016 12:06:41 -0500 > > Segher Boessenkool <seg...@kernel.crashing.org> wrote: > > > > > On T

[RFC][PATCH 0/5] kbuild changes, thin archives, --gc-sections

2016-08-05 Thread Nicholas Piggin
Hello, I have 3 different things in this patchset. All arch specific, but all involve kbuild changes, so I'd like to discuss them with kbuild maintainers. The goal has been to improve long standing linking difficulties with the powerpc kernel. * First, building kernel using thin archives rather

[PATCH 2/5] kbuild: allow archs to select build for link dead code/data elimination

2016-08-05 Thread Nicholas Piggin
1923176 14273661 vmlinux 10445269 10041271919707 13369103 vmlinux.dce ~700K text, ~170K data, 6% removed from kernel image size. Signed-off-by: Nicholas Piggin <npig...@gmail.com> --- Makefile | 10 arch/Kconfig

[PATCH 4/5] powerpc: switch to using thin archives

2016-08-05 Thread Nicholas Piggin
From: Stephen Rothwell <s...@canb.auug.org.au> Some change to the way we invoke ar is required so it can be used by scripts/link-vmlinux.sh Signed-off-by: Stephen Rothwell <s...@canb.auug.org.au> Signed-off-by: Nicholas Piggin <npig...@gmail.com> --- arch/powerpc/Makefile

Re: [PATCH 3/5] kbuild: add arch specific post-module-link pass

2016-08-05 Thread Nicholas Piggin
On Fri, 5 Aug 2016 22:12:01 +1000 Nicholas Piggin <npig...@gmail.com> wrote: > Add an option for architectures to pass over modules after they are > linked. powerpc will use this to fix up alternate instruction patch > relocations. For that matter, now I think about it, I

Re: powerpc allyesconfig / allmodconfig linux-next next-20160729 - next-20160729 build failures

2016-08-05 Thread Nicholas Piggin
On Fri, 05 Aug 2016 21:16:00 +0200 Arnd Bergmann <a...@arndb.de> wrote: > On Saturday, August 6, 2016 2:16:42 AM CEST Nicholas Piggin wrote: > > > > > > diff --git a/include/asm-generic/vmlinux.lds.h > > > b/include/asm-generic/vmlinux.lds.h > >

Re: [PATCH] powerpc: rebuild vdsos correctly

2016-08-08 Thread Nicholas Piggin
On Tue, 09 Aug 2016 14:49:25 +1000 Michael Ellerman <m...@ellerman.id.au> wrote: > Nicholas Piggin <npig...@gmail.com> writes: > > > diff --git a/arch/powerpc/kernel/vdso32/Makefile > > b/arch/powerpc/kernel/vdso32/Makefile > > index cbabd14..ae1f245 100644

Re: [PATCH kernel 05/15] powerpc/iommu: Stop using @current in mm_iommu_xxx

2016-08-09 Thread Nicholas Piggin
On Tue, 9 Aug 2016 14:43:00 +1000 Balbir Singh wrote: > On 03/08/16 18:40, Alexey Kardashevskiy wrote: > > -long mm_iommu_get(unsigned long ua, unsigned long entries, > > +long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long > > entries, > >

Re: [PATCH] powerpc/Makefile: Use cflags-y/aflags-y for setting endian options

2016-08-09 Thread Nicholas Piggin
On Tue, 9 Aug 2016 22:43:46 +1000 Michael Ellerman wrote: > When we introduced the little endian support, we added the endian flags > to CC directly using override. I don't know the history of why we did > that, I suspect no one does. > > Although this mostly works, it has

Re: [PATCH 2/5] kbuild: allow archs to select build for link dead code/data elimination

2016-08-07 Thread Nicholas Piggin
On Mon, 8 Aug 2016 00:12:37 -0400 (EDT) Nicolas Pitre <nicolas.pi...@linaro.org> wrote: > On Mon, 8 Aug 2016, Nicholas Piggin wrote: > > > On Sun, 7 Aug 2016 01:33:45 -0400 (EDT) > > Nicolas Pitre <nicolas.pi...@linaro.org> wrote: > > > > &

Re: [PATCH 2/5] kbuild: allow archs to select build for link dead code/data elimination

2016-08-07 Thread Nicholas Piggin
On Sat, 6 Aug 2016 22:14:23 +0200 Sam Ravnborg <s...@ravnborg.org> wrote: > On Fri, Aug 05, 2016 at 10:12:00PM +1000, Nicholas Piggin wrote: > > Introduce LINKER_DCE option for architectures to select if they want > > to build with -ffunction-sections, -fdata-sections, a

Re: [RFC][PATCH 0/5] kbuild changes, thin archives, --gc-sections

2016-08-07 Thread Nicholas Piggin
On Sun, 07 Aug 2016 22:23:02 +0200 Arnd Bergmann <a...@arndb.de> wrote: > On Friday, August 5, 2016 10:11:58 PM CEST Nicholas Piggin wrote: > > Hello, > > > > I have 3 different things in this patchset. All arch specific, but all > > involve kbuild cha

Re: [PATCH 1/5] kbuild: allow architectures to use thin archives instead of ld -r

2016-08-07 Thread Nicholas Piggin
On Sat, 6 Aug 2016 22:10:45 +0200 Sam Ravnborg <s...@ravnborg.org> wrote: > Hi Nicholas. > > On Fri, Aug 05, 2016 at 10:11:59PM +1000, Nicholas Piggin wrote: > > From: Stephen Rothwell <s...@canb.auug.org.au> > > > > ld -r is an incremental link u

Re: [PATCH 2/5] kbuild: allow archs to select build for link dead code/data elimination

2016-08-07 Thread Nicholas Piggin
On Sun, 7 Aug 2016 01:33:45 -0400 (EDT) Nicolas Pitre <nicolas.pi...@linaro.org> wrote: > On Fri, 5 Aug 2016, Nicholas Piggin wrote: > > > Introduce LINKER_DCE option for architectures to select if they want > > to build with -ffunction-sections, -fdata-sections, and lin

Re: [PATCH 1/5] kbuild: allow architectures to use thin archives instead of ld -r

2016-08-07 Thread Nicholas Piggin
On Sun, 7 Aug 2016 16:40:54 +0200 Sam Ravnborg wrote: > On Sun, Aug 07, 2016 at 11:49:46AM +1000, Stephen Rothwell wrote: > > Hi Sam, > > > > On Sat, 6 Aug 2016 22:10:45 +0200 Sam Ravnborg wrote: > > > > > > Did you by any chance evalue the use of INPUT

Re: [PATCH 3/5] kbuild: add arch specific post-module-link pass

2016-08-07 Thread Nicholas Piggin
On Sat, 6 Aug 2016 22:16:29 +0200 Sam Ravnborg <s...@ravnborg.org> wrote: > On Fri, Aug 05, 2016 at 10:12:01PM +1000, Nicholas Piggin wrote: > > Add an option for architectures to pass over modules after they are > > linked. powerpc will use this to fix up altern

[PATCH] powerpc: rebuild vdsos correctly

2016-08-08 Thread Nicholas Piggin
When using if_changed, we need to add FORCE to dependencies, otherwise we don't get command line change checking amongst other things. This has resulted in vdsos not being rebuilt when switching between big and little endian. Signed-off-by: Nicholas Piggin <npig...@gmail.com> --- Ther

[PATCH] powerpc/64be: must build vdso32 as BE on LE host

2016-08-08 Thread Nicholas Piggin
vdso32 should be built with `gcc -m32 --big-endian` when compiling a big endian kernel. Signed-off-by: Nicholas Piggin <npig...@gmail.com> --- arch/powerpc/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 709a22a..bf183b2a

Re: MPC5200 does not boot

2016-08-01 Thread Nicholas Piggin
On Tue, 02 Aug 2016 12:44:33 +1000 Benjamin Herrenschmidt wrote: > On Tue, 2016-08-02 at 00:44 +0200, Michal Sojka wrote: > > Hi Benjamin, > > > > the following commit causes my MPC5200 not to boot. > > > > commit 9402c684613163888714df0955fa1f17142b08bf > > >   

  1   2   3   4   5   6   7   8   9   10   >