[PATCH] powerpc: Don't corrupt user registers on 32-bit

2013-10-23 Thread Paul Mackerras
Commit de79f7b9f6 (powerpc: Put FP/VSX and VR state into structures) modified load_up_fpu() and load_up_altivec() in such a way that they now use r7 and r8. Unfortunately, the callers of these functions on 32-bit machines then return to userspace via fast_exception_return, which doesn't restore

Re: [v5][PATCH 2/6] powerpc/book3e: store critical/machine/debug exception thread info

2013-10-23 Thread “tiejun.chen”
On 10/19/2013 06:43 AM, Scott Wood wrote: On Thu, 2013-06-20 at 18:28 +0800, Tiejun Chen wrote: We need to store thread info to these exception thread info like something we already did for PPC32. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com --- arch/powerpc/kernel/exceptions-64e.S |

Re: [v5][PATCH 1/6] powerpc/book3e: load critical/machine/debug exception stack

2013-10-23 Thread “tiejun.chen”
On 10/19/2013 06:37 AM, Scott Wood wrote: On Thu, 2013-06-20 at 18:28 +0800, Tiejun Chen wrote: We always alloc critical/machine/debug check exceptions. This is different from the normal exception. So we should load these exception stack properly like we did for booke. This is booke. Do you

Re: [v5][PATCH 3/6] book3e/kgdb: update thread's dbcr0

2013-10-23 Thread “tiejun.chen”
On 10/19/2013 06:57 AM, Scott Wood wrote: On Thu, 2013-06-20 at 18:28 +0800, Tiejun Chen wrote: gdb always need to generate a single step properly to invoke a kgdb state. But with lazy interrupt, book3e can't always trigger a debug exception with a single step since the current is blocked for

Re: [v5][PATCH 4/6] powerpc/book3e: support kgdb for kernel space

2013-10-23 Thread “tiejun.chen”
On 10/19/2013 06:58 AM, Scott Wood wrote: On Thu, 2013-06-20 at 18:28 +0800, Tiejun Chen wrote: Currently we need to skip this for supporting KGDB. Does it need to depend on CONFIG_KGDB? Either you've fixed the can't quite save properly part, or you haven't. I'm not 100% sure if my change

Re: [v5][PATCH 6/6] book3e/kgdb: Fix a single stgep case of lazy IRQ

2013-10-23 Thread “tiejun.chen”
On 10/19/2013 07:32 AM, Scott Wood wrote: On Thu, 2013-06-20 at 18:28 +0800, Tiejun Chen wrote: When we're in kgdb_singlestep(), we have to work around to get thread_info by copying from the kernel stack before calling kgdb_handle_exception(), then copying it back afterwards. But for PPC64, we

Re: [v5][PATCH 1/6] powerpc/book3e: load critical/machine/debug exception stack

2013-10-23 Thread “tiejun.chen”
On 10/19/2013 07:55 AM, Scott Wood wrote: On Thu, 2013-06-20 at 18:28 +0800, Tiejun Chen wrote: We always alloc critical/machine/debug check exceptions. This is different from the normal exception. So we should load these exception stack properly like we did for booke. Signed-off-by: Tiejun

[v6][PATCH 0/5] powerpc/book3e: powerpc/book3e: make kgdb to work well

2013-10-23 Thread Tiejun Chen
Scott, Tested on fsl-p5040 DS. v6: * rebase * change the C code to initialize the exception stack addresses in the PACA instead. * Clear the PACA_IRQ_HARD_DIS force to exit directly from this debug exception without replaying interrupt. * so drop book3e/kgdb: update thread's dbcr0. v5: *

[v6][PATCH 1/5] powerpc/book3e: initialize crit/mc/dbg kernel stack pointers

2013-10-23 Thread Tiejun Chen
We already allocated critical/machine/debug check exceptions, but we also should initialize those associated kernel stack pointers for use by special exceptions in the PACA. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com --- arch/powerpc/kernel/setup_64.c | 18 -- 1 file

[v6][PATCH 2/5] powerpc/book3e: store crit/mc/dbg exception thread info

2013-10-23 Thread Tiejun Chen
We need to store thread info to these exception thread info like something we already did for PPC32. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com --- arch/powerpc/kernel/exceptions-64e.S | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git

[v6][PATCH 3/5] powerpc/book3e: support kgdb for kernel space

2013-10-23 Thread Tiejun Chen
Currently we need to skip this for supporting KGDB. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com --- arch/powerpc/kernel/exceptions-64e.S |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S

[v6][PATCH 4/5] powerpc/kgdb: use DEFINE_PER_CPU to allocate kgdb's thread_info

2013-10-23 Thread Tiejun Chen
Use DEFINE_PER_CPU to allocate thread_info statically instead of kmalloc(). This can avoid introducing more memory check codes. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com --- arch/powerpc/kernel/kgdb.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[v6][PATCH 5/5] powerpc/book3e/kgdb: Fix a single stgep case of lazy IRQ

2013-10-23 Thread Tiejun Chen
In lazy EE magic, we may have a lazy interrupt occured while entering kgdb, but we really don't want to replay that interrupt for kgdb, so we have to clear the PACA_IRQ_HARD_DIS force to make sure we can exit directly from this debug exception. Signed-off-by: Tiejun Chen tiejun.c...@windriver.com

Re: [PATCH 1/3] sched: Fix nohz_kick_needed to consider the nr_busy of the parent domain's group

2013-10-23 Thread Preeti U Murthy
Hi Peter On 10/23/2013 03:41 AM, Peter Zijlstra wrote: This nohz stuff really needs to be re-thought and made more scalable -- its a royal pain :/ Why not do something like the below instead? It does the following. This patch introduces sd_busy just like your suggested patch, except that it

Re: [PATCH] [RFC] Emulate lwsync to run standard user land on e500 cores

2013-10-23 Thread Scott Wood
On Wed, 2013-10-23 at 00:07 -0500, Kumar Gala wrote: On Oct 18, 2013, at 2:38 AM, Wolfgang Denk wrote: diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index f783c93..f330374 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -986,6

Re: powerpc: Don't corrupt user registers on 32-bit

2013-10-23 Thread Scott Wood
On Wed, Oct 23, 2013 at 09:40:02AM +0100, Paul Mackerras wrote: Commit de79f7b9f6 (powerpc: Put FP/VSX and VR state into structures) modified load_up_fpu() and load_up_altivec() in such a way that they now use r7 and r8. Unfortunately, the callers of these functions on 32-bit machines then

Re: perf events ring buffer memory barrier on powerpc

2013-10-23 Thread Victor Kaplansky
See below. Michael Neuling mi...@neuling.org wrote on 10/23/2013 02:54:54 AM: diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index cd55144..95768c6 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c @@ -87,10 +87,10 @@ again: goto

[PATCH 02/12][v3] pci: fsl: add structure fsl_pci

2013-10-23 Thread Minghuan Lian
PowerPC uses structure pci_controller to describe PCI controller, but ARM uses structure pci_sys_data. In order to support PowerPC and ARM simultaneously, the patch adds a structure fsl_pci that contains most of the members of the pci_controller and pci_sys_data. Meanwhile, it defines a interface

[PATCH 01/12][v3] pci: fsl: derive the common PCI driver to drivers/pci/host

2013-10-23 Thread Minghuan Lian
The Freescale's Layerscape series processors will use ARM cores. The LS1's PCIe controllers is the same as T4240's. So it's better the PCIe controller driver can support PowerPC and ARM simultaneously. This patch is for this purpose. It derives the common functions from

[PATCH 04/12][v3] pci: fsl: add early PCI indirect access support

2013-10-23 Thread Minghuan Lian
The driver needs to read/write PCI configuration very early, at that time architecture-specific PCI controller structure and PCI bus have not been created. The patch provides an interface fsl_arch_fake_pci_bus which should be implemented in architecture-specific PCI driver to fake a PCI controller

[PATCH 05/12][v3] pci: fsl: port PCI ATMU related code

2013-10-23 Thread Minghuan Lian
The patch ports PCI ATMU related code, just uses general IO API iowrite32be/ioread32be instead of out_be32/in_be32, uses structure fsl_pci instead of PowerPC's pci_controller and uses dev_*() instead of pr_*() to output the information. The patch also provides the weak function

[PATCH 03/12][v3] pci: fsl: add PCI indirect access support

2013-10-23 Thread Minghuan Lian
The patch adds PCI indirect read/write functions. The main code is ported from arch/powerpc/sysdev/indirect_pci.c. We use general IO API iowrite32be/ioread32be instead of out_be32/in_be32, and use structure fsl_Pci instead of PowerPC's pci_controller. The patch also provides fsl_pcie_check_link()

[PATCH 09/12][v3] pci: fsl: update PCI PM driver

2013-10-23 Thread Minghuan Lian
The patch updates PCI PM driver, uses fsl_pci instead of pci_controller. Signed-off-by: Minghuan Lian minghuan.l...@freescale.com --- change log: v1-v3: Derived from http://patchwork.ozlabs.org/patch/278965/ Based on upstream master. Based on the discussion of RFC version here

[PATCH 07/12][v3] pci: fsl: port PCI platform driver

2013-10-23 Thread Minghuan Lian
1. The patch ports FSL PCI platform driver. probe function initialize fsl_pci and register it to architecture PCI system, remove function removes fsl_pci from architecture PCI system. fsl_arch_pci_sys_register() and fsl_arch_pci_sys_remove() should be implemented in architecture-specific driver to

[PATCH 10/12][v3] pci: fsl: support function fsl_pci_assign_primary

2013-10-23 Thread Minghuan Lian
Change pci_ids to fsl_pci_ids Freescale-specific name and change static to extern modifier for using in fsl_pci_assign_primary(). Signed-off-by: Minghuan Lian minghuan.l...@freescale.com --- change log: v1-v3: Derived from http://patchwork.ozlabs.org/patch/278965/ Based on upstream master. Based

[PATCH 08/12][v3] pci: fsl: add PowerPC PCI driver

2013-10-23 Thread Minghuan Lian
1. Implement fsl_arch_pci64_dma_offset() to return PowerPC PCI64 DMA offset 2. Implement fsl_arch_sys_to_pci() to convert pci_controller to fsl_pci 3. Implement fsl_arch_fake_pci_bus() to fake pci_controller and PCI bus. 4. Implement fsl_arch_pci_exclude_device() to call

[PATCH 06/12][v3] pci: fsl: port PCI controller setup code

2013-10-23 Thread Minghuan Lian
PCI controller setup code will initialize structure fsl_pci according to PCI dts node and initialize PCI command register and ATMU. The patch uses general API of_pci_parse_bus_range to parse PCI bus range, uses general of_address's API to parse PCI IO/MEM ranges. Signed-off-by: Minghuan Lian

[PATCH 11/12][v3] pci: fsl: update PCI EDAC driver

2013-10-23 Thread Minghuan Lian
1. The pci-fsl-common driver has set fsl_pci to device as drvdata, so EDAC driver can not call dev_set_drvdata() again. fsl_pci contains regs field to point PCI CCSR, so EDAC may directly use the pointer and not need to call devm_ioremap(). 2. Add mpc85xx_pci_err_remove() to disable PCI error

[PATCH 12/12][v3] pci: fsl: fix function check_pci_ctl_endpt_part

2013-10-23 Thread Minghuan Lian
The new FSL PCI driver does not use cfg_addr of pci_controller, we may directly access PCI CCSR using fsl_pci-regs. Signed-off-by: Minghuan Lian minghuan.l...@freescale.com --- change log: v1-v3: The new patch to fix function check_pci_ctl_endpt_part Based on upstream master. Based on the

Re: Missing _restvr_20 and _savevr_20 subroutines for lib/raid6/altivec8.o

2013-10-23 Thread Ben Hutchings
On Wed, 2013-10-23 at 00:28 -0500, Kumar Gala wrote: On Oct 19, 2013, at 5:24 PM, Ben Hutchings wrote: When building lib/raid6/altivec8.o with gcc 4.8 on Debian, the compiler is generating references to two new runtime subroutines which are apparently not included in the kernel:

Re: perf events ring buffer memory barrier on powerpc

2013-10-23 Thread Frederic Weisbecker
On Wed, Oct 23, 2013 at 10:54:54AM +1100, Michael Neuling wrote: Frederic, In the perf ring buffer code we have this in perf_output_get_handle(): if (!local_dec_and_test(rb-nest)) goto out; /* * Publish the known good head. Rely on the full barrier

Re: perf events ring buffer memory barrier on powerpc

2013-10-23 Thread Frederic Weisbecker
2013/10/23 Frederic Weisbecker fweis...@gmail.com: On Wed, Oct 23, 2013 at 10:54:54AM +1100, Michael Neuling wrote: Frederic, In the perf ring buffer code we have this in perf_output_get_handle(): if (!local_dec_and_test(rb-nest)) goto out; /* * Publish

Re: powerpc: Don't corrupt user registers on 32-bit

2013-10-23 Thread Alexander Graf
Am 23.10.2013 um 11:20 schrieb Scott Wood scottw...@freescale.com: On Wed, Oct 23, 2013 at 09:40:02AM +0100, Paul Mackerras wrote: Commit de79f7b9f6 (powerpc: Put FP/VSX and VR state into structures) modified load_up_fpu() and load_up_altivec() in such a way that they now use r7 and r8.

Re: [PATCH 1/3] sched: Fix nohz_kick_needed to consider the nr_busy of the parent domain's group

2013-10-23 Thread Vincent Guittot
Hi Preeti On 23 October 2013 11:50, Preeti U Murthy pre...@linux.vnet.ibm.com wrote: Hi Peter On 10/23/2013 03:41 AM, Peter Zijlstra wrote: This nohz stuff really needs to be re-thought and made more scalable -- its a royal pain :/ Why not do something like the below instead? It does the

[PATCH 0/8] treewide: Remove OOM message after input_alloc_device

2013-10-23 Thread Joe Perches
Joe Perches (8): Documentation: Remove OOM message after input_allocate_device cell: Remove OOM message after input_allocate_device hid: Remove OOM message after input_allocate_device input: Remove OOM message after input_allocate_device media: Remove OOM message after

[PATCH 2/8] cell: Remove OOM message after input_allocate_device

2013-10-23 Thread Joe Perches
Emitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done. Signed-off-by: Joe Perches j...@perches.com --- arch/powerpc/platforms/cell/cbe_powerbutton.c | 1 - 1 file changed, 1 deletion(-) diff --git

Re: [Cbe-oss-dev] [PATCH 2/8] cell: Remove OOM message after input_allocate_device

2013-10-23 Thread Geoff Levand
Hi Joe, On Wed, 2013-10-23 at 12:14 -0700, Joe Perches wrote: Emitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done. Signed-off-by: Joe Perches j...@perches.com --- arch/powerpc/platforms/cell/cbe_powerbutton.c | 1 - 1

Re: [PATCH] [RFC] Emulate lwsync to run standard user land on e500 cores

2013-10-23 Thread Kumar Gala
On Oct 23, 2013, at 5:15 AM, Scott Wood wrote: On Wed, 2013-10-23 at 00:07 -0500, Kumar Gala wrote: On Oct 18, 2013, at 2:38 AM, Wolfgang Denk wrote: diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index f783c93..f330374 100644 --- a/arch/powerpc/kernel/traps.c +++

Re: [PATCH 3/3] sched: Aggressive balance in domains whose groups share package resources

2013-10-23 Thread Preeti U Murthy
Hi Peter, On 10/23/2013 03:53 AM, Peter Zijlstra wrote: On Mon, Oct 21, 2013 at 05:15:02PM +0530, Vaidyanathan Srinivasan wrote: kernel/sched/fair.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 828ed97..bbcd96b

Re: [PATCH 02/12][v3] pci: fsl: add structure fsl_pci

2013-10-23 Thread Kumar Gala
On Oct 23, 2013, at 5:41 AM, Minghuan Lian wrote: PowerPC uses structure pci_controller to describe PCI controller, but ARM uses structure pci_sys_data. In order to support PowerPC and ARM simultaneously, the patch adds a structure fsl_pci that contains most of the members of the

RE: [PATCH 02/12][v3] pci: fsl: add structure fsl_pci

2013-10-23 Thread Zang Roy-R61911
-Original Message- From: Kumar Gala [mailto:ga...@kernel.crashing.org] Sent: Wednesday, October 23, 2013 11:11 PM To: Lian Minghuan-B31939 Cc: linuxppc-dev@lists.ozlabs.org list; Arnd Bergmann; Zang Roy-R61911; Wood Scott-B07421; Bjorn Helgaas; linux-...@vger.kernel.org; linux-arm-