Re: [PATCH] cxl: fix NULL dereference in cxl_context_init() on PowerVM guests

2016-07-27 Thread Ian Munsie
Whoops! Acked-by: Ian Munsie ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] cxl: fix NULL dereference in cxl_context_init() on PowerVM guests

2016-07-27 Thread Andrew Donnellan
Commit f67a6722d650 ("cxl: Workaround PE=0 hardware limitation in Mellanox CX4") added a "min_pe" field to struct cxl_service_layer_ops, to allow us to work around a Mellanox CX-4 hardware limitation. When allocating the PE number in cxl_context_init(), we read from ctx->afu->adapter->native->sl_o

[PATCH v3] powernv/pci: Add PHB register dump debugfs handle

2016-07-27 Thread Russell Currey
On EEH events the kernel will print a dump of relevant registers. If EEH is unavailable (i.e. CONFIG_EEH is disabled, a new platform doesn't have EEH support, etc) this information isn't readily available. Add a new debugfs handler to trigger a PHB register dump, so that this information can be ma

Re: [PATCH v3 04/21] powerpc/mm: Do radix device tree scanning earlier

2016-07-27 Thread Balbir Singh
On 28/07/16 00:18, Michael Ellerman wrote: > Like we just did for hash, split the device tree scanning parts out and > call them from mmu_early_init_devtree(). > > Signed-off-by: Michael Ellerman > --- > arch/powerpc/include/asm/book3s/64/mmu.h | 1 + > arch/powerpc/mm/init_64.c

Re: [PATCH v3 02/21] powerpc/mm: Move disable_radix handling into mmu_early_init_devtree()

2016-07-27 Thread Balbir Singh
On 28/07/16 00:17, Michael Ellerman wrote: > Move the handling of the disable_radix command line argument into the > newly created mmu_early_init_devtree(). > > It's an MMU option so it's preferable to have it in an mm related file, > and it also means platforms that don't support radix don't ha

[PATCH v13 30/30] selftests/powerpc: Fix a build issue

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual Fixes the following build failure - cp_abort.c:90:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < NUM_LOOPS; i++) { ^ cp_abort.c:90:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your cod

[PATCH v13 29/30] selftests/powerpc: Add .gitignore file for ptrace executables

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds a .gitignore file for all the executables in the ptrace test directory thus making invisible with git status query. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftests/powerpc/ptrace/.gitignore | 11 +++ 1 file

[PATCH v13 28/30] selftests/powerpc: Add ptrace tests for TM SPR registers

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for TM SPR registers. This also adds ptrace interface based helper functions related to TM SPR registers access. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftests/powerpc/ptrace/Makefile| 3

[PATCH v13 27/30] selftests/powerpc: Add ptrace tests for VSX, VMX registers in suspended TM

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for VSX, VMX registers inside suspended TM context. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftests/powerpc/ptrace/Makefile| 3 +- .../selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c | 222

[PATCH v13 26/30] selftests/powerpc: Add ptrace tests for VSX, VMX registers in TM

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for VSX, VMX registers inside TM context. This also adds ptrace interface based helper functions related to chckpointed VSX, VMX registers access. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftest

[PATCH v13 25/30] selftests/powerpc: Add ptrace tests for VSX, VMX registers

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for VSX, VMX registers. This also adds ptrace interface based helper functions related to VSX, VMX registers access. This also adds some assembly helper functions related to VSX and VMX registers. Signed-off-by: Anshuman Khandual Sig

[PATCH v13 24/30] selftests/powerpc: Add ptrace tests for TAR, PPR, DSCR in suspended TM

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for TAR, PPR, DSCR registers inside suspended TM context. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftests/powerpc/ptrace/Makefile| 2 +- .../selftests/powerpc/ptrace/ptrace-tm-spd-tar.c

[PATCH v13 23/30] selftests/powerpc: Add ptrace tests for TAR, PPR, DSCR in TM

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for TAR, PPR, DSCR registers inside TM context. This also adds ptrace interface based helper functions related to checkpointed TAR, PPR, DSCR register access. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/test

[PATCH v13 22/30] selftests/powerpc: Add ptrace tests for TAR, PPR, DSCR registers

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for TAR, PPR, DSCR registers. This also adds ptrace interface based helper functions related to TAR, PPR, DSCR register access. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftests/powerpc/ptrace/Ma

[PATCH v13 21/30] selftests/powerpc: Add ptrace tests for GPR/FPR registers in suspended TM

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for GPR/FPR registers inside suspended TM context. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftests/powerpc/ptrace/Makefile| 2 +- .../selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c | 327

[PATCH v13 20/30] selftests/powerpc: Add ptrace tests for GPR/FPR registers in TM

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for GPR/FPR registers inside TM context. This adds ptrace interface based helper functions related to checkpointed GPR/FPR access. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftests/powerpc/ptrace

[PATCH v13 19/30] selftests/powerpc: Add ptrace tests for GPR/FPR registers

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for GPR/FPR registers. This adds ptrace interface based helper functions related to GPR/FPR access and some assembly helper functions related to GPR/FPR registers. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools

[PATCH v13 18/30] selftests/powerpc: Add ptrace tests for EBB

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for EBB/PMU specific registers. This also adds some generic ptrace interface based helper functions to be used by other patches later on in the series. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/sel

[PATCH v13 17/30] selftests/powerpc: Use the new SPRN_DSCR_PRIV definiton

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual Now that the new DSCR register definitions (SPRN_DSCR_PRIV and SPRN_DSCR) are defined outside this directory, use them instead. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftests/powerpc/dscr/dscr.h | 10 -- 1 file changed, 4

[PATCH v13 16/30] selftests/powerpc: Add more SPR numbers, TM & VMX instructions to 'reg.h'

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds SPR number for TAR, PPR, DSCR special purpose registers. It also adds TM, VSX, VMX related instructions which will then be used by patches later in the series. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- tools/testing/selftests/powerpc

[PATCH v13 15/30] powerpc/ptrace: Enable support for Performance Monitor registers

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables support for Performance monitor registers related ELF core note NT_PPC_PMU based ptrace requests through PTRACE_GETREGSET, PTRACE_SETREGSET calls. This is achieved through adding one new register sets REGSET_PMU in powerpc corresponding to the ELF core n

[PATCH v13 14/30] powerpc/ptrace: Enable support for EBB registers

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables support for EBB state registers related ELF core note NT_PPC_EBB based ptrace requests through PTRACE_GETREGSET, PTRACE_SETREGSET calls. This is achieved through adding one new register sets REGSET_EBB in powerpc corresponding to the ELF core note sectio

[PATCH v13 13/30] powerpc/ptrace: Enable support for NT_PPPC_TAR, NT_PPC_PPR, NT_PPC_DSCR

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables support for running TAR, PPR, DSCR registers related ELF core notes NT_PPPC_TAR, NT_PPC_PPR, NT_PPC_DSCR based ptrace requests through PTRACE_GETREGSET, PTRACE_SETREGSET calls. This is achieved through adding three new register sets REGSET_TAR, REGSET_PP

[PATCH v13 12/30] powerpc/ptrace: Enable NT_PPC_TM_CTAR, NT_PPC_TM_CPPR, NT_PPC_TM_CDSCR

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables support for all three TM checkpointed SPR states related ELF core note NT_PPC_TM_CTAR, NT_PPC_TM_CPPR, NT_PPC_TM_CDSCR based ptrace requests through PTRACE_GETREGSET, PTRACE_SETREGSET calls. This is achieved through adding three new register sets REGSET

[PATCH v13 11/30] powerpc/ptrace: Enable support for TM SPR state

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables support for TM SPR state related ELF core note NT_PPC_TM_SPR based ptrace requests through PTRACE_GETREGSET, PTRACE_SETREGSET calls. This is achieved through adding a register set REGSET_TM_SPR in powerpc corresponding to the ELF core note section added.

[PATCH v13 10/30] powerpc/ptrace: Enable support for NT_PPC_CVSX

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables support for TM checkpointed VSX register set ELF core note NT_PPC_CVSX based ptrace requests through PTRACE_GETREGSET, PTRACE_SETREGSET calls. This is achieved through adding a register set REGSET_CVSX in powerpc corresponding to the ELF core note sectio

[PATCH v13 09/30] powerpc/ptrace: Enable support for NT_PPC_CVMX

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables support for TM checkpointed VMX register set ELF core note NT_PPC_CVMX based ptrace requests through PTRACE_GETREGSET, PTRACE_SETREGSET calls. This is achieved through adding a register set REGSET_CVMX in powerpc corresponding to the ELF core note sectio

[PATCH v13 08/30] powerpc/ptrace: Enable support for NT_PPC_CFPR

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables support for TM checkpointed FPR register set ELF core note NT_PPC_CFPR based ptrace requests through PTRACE_GETREGSET, PTRACE_SETREGSET calls. This is achieved through adding a register set REGSET_CFPR in powerpc corresponding to the ELF core note sectio

[PATCH v13 07/30] powerpc/ptrace: Enable support for NT_PPC_CGPR

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables support for TM checkpointed GPR register set ELF core note NT_PPC_CGPR based ptrace requests through PTRACE_GETREGSET, PTRACE_SETREGSET calls. This is achieved through adding a register set REGSET_CGPR in powerpc corresponding to the ELF core note sectio

[PATCH v13 06/30] powerpc/ptrace: Adapt gpr32_get, gpr32_set functions for transaction

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch splits gpr32_get, gpr32_set functions to accommodate in transaction ptrace requests implemented in patches later in the series. Signed-off-by: Anshuman Khandual Signed-off-by: Simon Guo --- arch/powerpc/kernel/ptrace.c | 64 ++

[PATCH v13 05/30] powerpc/ptrace: Enable in transaction NT_PPC_VSX ptrace requests

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables in transaction NT_PPC_VSX ptrace requests. The function vsr_get which gets the running value of all VSX registers and the function vsr_set which sets the running value of of all VSX registers work on the running set of VMX registers whose location will b

[PATCH v13 04/30] powerpc/ptrace: Enable in transaction NT_PPC_VMX ptrace requests

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables in transaction NT_PPC_VMX ptrace requests. The function vr_get which gets the running value of all VMX registers and the function vr_set which sets the running value of of all VMX registers work on the running set of VMX registers whose location will be

[PATCH v13 03/30] powerpc/ptrace: Enable in transaction NT_PRFPREG ptrace requests

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch enables in transaction NT_PRFPREG ptrace requests. The function fpr_get which gets the running value of all FPR registers and the function fpr_set which sets the running value of of all FPR registers work on the running set of FPR registers whose location will b

[PATCH v13 02/30] powerpc/process: Add the function flush_tmregs_to_thread

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch creates a function flush_tmregs_to_thread which will then be used by subsequent patches in this series. The function checks for self tracing ptrace interface attempts while in the TM context and logs appropriate warning message. Signed-off-by: Anshuman Khandual

[PATCH v13 01/30] elf: Add powerpc specific core note sections

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds twelve ELF core note sections for powerpc architecture for various registers and register sets which need to be accessed from ptrace interface and then gdb. These additions include special purpose registers like TAR, PPR, DSCR, TM running and checkpointed s

[PATCH v13 00/30] Add new powerpc specific ELF core notes

2016-07-27 Thread wei . guo . simon
From: Simon Guo This patch series adds thirteen new ELF core note sections which can be used with existing ptrace request PTRACE_GETREG/SET-SETREGSET for accessing various transactional memory and other miscellaneous debug register sets on powerpc platform. Signed-off-by: Anshuman Khandual

Re: [PATCH v2] powernv/pci: Add PHB register dump debugfs handle

2016-07-27 Thread Michael Ellerman
Gavin Shan writes: > On Wed, Jul 27, 2016 at 04:14:04PM +1000, Russell Currey wrote: >>diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c >>b/arch/powerpc/platforms/powernv/pci-ioda.c >>index 891fc4a..2b9f114 100644 >>--- a/arch/powerpc/platforms/powernv/pci-ioda.c >>+++ b/arch/powerpc/platf

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

2016-07-27 Thread Michael Ellerman
Stephen Rothwell writes: > Hi Michal, > > After merging the kbuild tree, today's linux-next build (powerpc > ppc64_defconfig) failed like this: > ... > arch/powerpc/mm/hash_utils_64.c:929:10: note: in expansion of macro > 'IS_ENABLED' > else if IS_ENABLED(CONFIG_PPC_NATIVE) > ^ > cc1

[PATCH v2] Make system_reset_pSeries relocatable

2016-07-27 Thread 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 is to do what the slb miss handler does, which is jump to a small stub within the first 64k of relocated address and then jump to the ac

linux-next: build failure after merge of the kbuild tree

2016-07-27 Thread Stephen Rothwell
Hi Michal, After merging the kbuild tree, today's linux-next build (powerpc ppc64_defconfig) failed like this: In file included from :0:0: arch/powerpc/mm/hash_utils_64.c: In function 'hash__early_init_mmu': include/linux/kconfig.h:19:65: error: expected '(' before numeric constant #define o

Re: [PATCH v2] powernv/pci: Add PHB register dump debugfs handle

2016-07-27 Thread Gavin Shan
On Wed, Jul 27, 2016 at 04:14:04PM +1000, Russell Currey wrote: >On EEH events the kernel will print a dump of relevant registers. >If EEH is unavailable (i.e. CONFIG_EEH is disabled, a new platform >doesn't have EEH support, etc) this information isn't readily available. > >Add a new debugfs handl

Re: [PATCH 12/15] cxl: Workaround PE=0 hardware limitation in Mellanox CX4

2016-07-27 Thread Andrew Donnellan
On 14/07/16 07:17, Ian Munsie wrote: mutex_lock(&afu->contexts_lock); idr_preload(GFP_KERNEL); - i = idr_alloc(&ctx->afu->contexts_idr, ctx, 0, + i = idr_alloc(&ctx->afu->contexts_idr, ctx, + ctx->afu->adapter->native->sl_ops->min_pe, As it turns

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

2016-07-27 Thread Benjamin Herrenschmidt
On Thu, 2016-07-28 at 00:18 +1000, Michael Ellerman wrote: > --- a/arch/powerpc/mm/hash_utils_64.c > +++ b/arch/powerpc/mm/hash_utils_64.c > @@ -530,7 +530,7 @@ static bool might_have_hea(void) > * we will never see an HEA ethernet device. > */ >  #ifdef CONFIG_IBMEBUS > -   r

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

2016-07-27 Thread Benjamin Herrenschmidt
On Thu, 2016-07-28 at 00:18 +1000, Michael Ellerman wrote: > > diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h > b/arch/powerpc/include/asm/book3s/64/mmu.h > index 70c995870297..6deda6ecc4f7 100644 > --- a/arch/powerpc/include/asm/book3s/64/mmu.h > +++ b/arch/powerpc/include/asm/book3s/64/mm

Re: [v3] UCC_GETH/UCC_FAST: Use IS_ERR_VALUE_U32 API to avoid IS_ERR_VALUE abuses.

2016-07-27 Thread arvind Yadav
I am also agree with Arnd Bergmann. We should use 'static inline function' instead of macro to deal with error check. On Tuesday 26 July 2016 05:09 PM, Arnd Bergmann wrote: On Saturday, July 23, 2016 11:35:51 PM CEST Arvind Yadav wrote: diff --git a/include/linux/err.h b/include/linux/err.h ind

[PATCH] pasemi: Fix coherent_dma_mask for dma engine

2016-07-27 Thread Darren Stevens
Commit 817820b0226a ("powerpc/iommu: Support "hybrid" iommu/direct DMA ops for coherent_mask < dma_mask) adds a check of coherent_dma_mask for dma allocations. Unfortunately current PASemi code does not set this value for the DMA engine, which ends up with the default value of 0

Re: [V2,1/2] tty/hvc: Use IRQF_SHARED for OPAL hvc consoles

2016-07-27 Thread Michael Ellerman
On Mon, 2016-11-07 at 03:38:57 UTC, Sam Mendoza-Jonas wrote: > Commit 2def86a7200c > ("hvc: Convert to using interrupts instead of opal events") > enabled the use of interrupts in the hvc_driver for OPAL platforms. > However on machines with more than one hvc console, any console after > the first

Re: [PowerPC] Kernel OOPS while compiling LTP test suite on linus mainline

2016-07-27 Thread Michal Hocko
[CC linux-mm] On Wed 27-07-16 16:45:35, Abdul Haleem wrote: > Hi, > > Kernel OOPS messages were seen while compiling linux test project (LTP) > source on 4.7.0-rc5 mainline. > > Kernel config : pseries_le_defconfig > Machine Type : PowerVM LPAR > Machine hardware : LPAR uses 16 vCPUs, and 29G

Re: [v2] selftests/powerpc: exec() with suspended transaction

2016-07-27 Thread Michael Ellerman
On Wed, 2016-29-06 at 11:41:51 UTC, Michael Ellerman wrote: > From: Cyril Bur > > Perform an exec() class syscall with a suspended transaction. > > Signed-off-by: Cyril Bur > [mpe: Fix build errors, use a single binary for the test] > Signed-off-by: Michael Ellerman Applied to powerpc next.

Re: powerpc: Improve comment explaining why we modify VRSAVE

2016-07-27 Thread Michael Ellerman
On Thu, 2016-19-05 at 18:41:34 UTC, Unknown sender due to SPF wrote: > The comment explaining why we modify VRSAVE is misleading, glibc > does rely on the behaviour. Update the comment. > > Signed-off-by: Anton Blanchard > Reviewed-by: Cyril Bur Applied to powerpc next, thanks. https://git.ker

Re: [3/3] powerpc/mm: Drop unused externs for hpte_init_beat[_v3]()

2016-07-27 Thread Michael Ellerman
On Mon, 2016-25-07 at 02:57:51 UTC, Michael Ellerman wrote: > We removed the BEAT support in 2015 in commit bf4981a00636 ("powerpc: > Remove the celleb support"). These externs are unused since then. > > Signed-off-by: Michael Ellerman Applied to powerpc next. https://git.kernel.org/powerpc/c/1

Re: [V2,2/2] tty/hvc: Use opal irqchip interface if available

2016-07-27 Thread Michael Ellerman
On Mon, 2016-11-07 at 03:38:58 UTC, Sam Mendoza-Jonas wrote: > Update the hvc driver to use the OPAL irqchip if made available by the > running firmware. If it is not present, the driver falls back to the > existing OPAL event number. > > Signed-off-by: Samuel Mendoza-Jonas > Acked-by: Michael El

Re: [v2,1/2] powerpc/mm: Fix build break when PPC_NATIVE=n

2016-07-27 Thread Michael Ellerman
On Tue, 2016-26-07 at 03:38:37 UTC, Michael Ellerman wrote: > The recent commit to rework the hash MMU setup broke the build when > CONFIG_PPC_NATIVE=n. Fix it by adding an IS_ENABLED() check before > calling hpte_init_native(). > > Removing the else clause opens the possibility that we don't set

[PATCH V2 8/8] powerpc: Enable support for new DRC devtree properties

2016-07-27 Thread Michael Bringmann
prom_init.c: Enable support for new DRC device tree properties "ibm,drc-info" and "ibm,dynamic-memory-v2" in initial handshake between the Linux kernel and the front end processor. Signed-off-by: Michael Bringmann --- diff -Naur linux-rhel/arch/powerpc/kernel/prom_init.c linux-rhel-patch/arch/po

Resend: [PATCH 7/8] powerpc: Check arch.vec earlier during boot for memory features

2016-07-27 Thread Michael Bringmann
architecture.vec5 features: The boot-time memory management needs to know the form of the "ibm,dynamic-memory-v2" property early during scanning of the flattened device tree. This patch moves execution of the function pseries_probe_fw_features() early enough to be before the scanning of the memory

[PATCH V2 6/8] hotplug/drc-info: Add code to search new devtree properties

2016-07-27 Thread Michael Bringmann
rpadlpar_core.c: Provide parallel routines to search the older device- tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". The code searches for PHP PCI Slots, gets the DRC properties within the current node (using

[PATCH V2 5/8] pseries/drc-info: Search new DRC properties for CPU indexes

2016-07-27 Thread Michael Bringmann
pseries/drc-info: Provide parallel routines to convert between drc_index and CPU numbers at runtime, using the older device-tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". Signed-off-by: Michael Bringmann --- d

[PATCH V2 4/8] pseries/hotplug init: Convert new DRC memory property for hotplug runtime

2016-07-27 Thread Michael Bringmann
hotplug_init: Simplify the code needed for runtime memory hotplug and maintenance with a conversion routine that transforms the compressed property "ibm,dynamic-memory-v2" to the form of "ibm,dynamic-memory" within the "ibm,dynamic-reconfiguration-memory" property. Thus only a single set of routin

[PATCH V2 3/8] powerpc/memory: Parse new memory property to initialize structures.

2016-07-27 Thread Michael Bringmann
powerpc/memory: Add parallel routines to parse the new property "ibm,dynamic-memory-v2" property when it is present, and then to finish initialization of the relevant memory structures with the operating system. This code is shared between the boot-time initialization functions and the runtime fun

[PATCH V2 1/8] powerpc/firmware: Add definitions for new firmware features.

2016-07-27 Thread Michael Bringmann
Firmware Features: Define new bit flags representing the presence of new device tree properties "ibm,drc-info", and "ibm,dynamic-memory-v2". These flags are used to tell the front end processor when the Linux kernel supports the new properties, and by the front end processor to tell the Linux kerne

[PATCH V2 2/8] powerpc/memory: Parse new memory property to register blocks.

2016-07-27 Thread Michael Bringmann
powerpc/memory: Add parallel routines to parse the new property "ibm,dynamic-memory-v2" property when it is present, and then to register the relevant memory blocks with the operating system. This property format is intended to provide a more compact representation of memory when communicating with

Resend: [Patch 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-07-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

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

2016-07-27 Thread Michael Ellerman
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). Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/jump_label.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) v3: New. diff --git

[PATCH v3 20/21] powerpc/mm: Catch usage of cpu/mmu_has_feature() before jump label init

2016-07-27 Thread Michael Ellerman
From: "Aneesh Kumar K.V" This allows us to catch incorrect usage of cpu_has_feature() and mmu_has_feature() prior to jump labels being initialised. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman --- arch/powerpc/Kconfig.debug | 10 ++ arch/powerpc/incl

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

2016-07-27 Thread Michael Ellerman
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: Michael Ellerman --- arch/powerpc/include/asm/mmu.h| 36 arch/powerpc/kernel/cputable.c| 17 + arch/powerpc/li

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

2016-07-27 Thread Michael Ellerman
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 at run time, even though the set of CPU features can never change after boot. We can optimise this by using jum

[PATCH v3 17/21] powerpc: Add kconfig option to use jump labels for cpu/mmu_has_feature()

2016-07-27 Thread Michael Ellerman
Add a kconfig option to control whether we use jump label for the cpu/mmu_has_feature() checks. Currently this does nothing, but we will enabled it in the subsequent patches. Signed-off-by: Michael Ellerman --- arch/powerpc/Kconfig.debug | 9 + 1 file changed, 9 insertions(+) v3: New.

[PATCH v3 16/21] powerpc: Move cpu_has_feature() to a separate file

2016-07-27 Thread Michael Ellerman
From: Kevin Hao We plan to use jump label for cpu_has_feature(). In order to implement this we need to include the linux/jump_label.h in asm/cputable.h. Unfortunately if we do that it leads to an include loop. The root of the problem seems to be that reg.h needs cputable.h (for CPU_FTRs), and th

[PATCH v3 15/21] powerpc: Remove mfvtb()

2016-07-27 Thread Michael Ellerman
From: Kevin Hao This function is only used by get_vtb(). They are almost the same except the reading from the real register. Move the mfspr() to get_vtb() and kill the function mfvtb(). With this, we can eliminate the use of cpu_has_feature() in very core header file like reg.h. This is a prepara

[PATCH v3 14/21] powerpc: Call jump_label_init() in apply_feature_fixups()

2016-07-27 Thread Michael Ellerman
From: "Aneesh Kumar K.V" Call jump_label_init() early so that we can use static keys for CPU and MMU feature checks. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman --- arch/powerpc/lib/feature-fixups.c | 8 1 file changed, 8 insertions(+) v3: Updated comment. diff

[PATCH v3 13/21] jump_label: Make it possible for arches to invoke jump_label_init() earlier

2016-07-27 Thread Michael Ellerman
From: Kevin Hao Some arches (powerpc at least) would like to invoke jump_label_init() much earlier in boot. So check static_key_initialized in order to make sure this function runs only once. Signed-off-by: Kevin Hao Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman --- kernel/

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

2016-07-27 Thread Michael Ellerman
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 mmu_has_feature() to use static keys and we can use them only after static key/jump label is initialized. Any check for featur

[PATCH v3 11/21] powerpc/mm: Add __cpu/__mmu_has_feature()

2016-07-27 Thread Michael Ellerman
In later patches, we will be switching cpu and mmu feature checks to use static keys. For checks in early boot before jump label is initialized we need a variant of cpu/mmu_has_feature() that doesn't use jump labels. So create those called, unimaginatively, __cpu/__mmu_has_feature(). Signed-off-by

[PATCH v3 04/21] powerpc/mm: Do radix device tree scanning earlier

2016-07-27 Thread Michael Ellerman
Like we just did for hash, split the device tree scanning parts out and call them from mmu_early_init_devtree(). Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/book3s/64/mmu.h | 1 + arch/powerpc/mm/init_64.c| 4 +++- arch/powerpc/mm/pgtable-radix.c | 3 +--

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

2016-07-27 Thread Michael Ellerman
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 the fallback case to returning a bool, like mmu_has_feature(). Signed-off-by: Michael Ellerm

[PATCH v3 09/21] powerpc/kernel: Convert cpu_has_feature() to returning bool

2016-07-27 Thread Michael Ellerman
The intention is that the result is only used as a boolean, so enforce that by changing the return type to bool. Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/cputable.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) v3: Split out. diff --git a/arch/powerpc/inclu

[PATCH v3 08/21] powerpc/kernel: Convert mmu_has_feature() to returning bool

2016-07-27 Thread Michael Ellerman
The intention is that the result is only used as a boolean, so enforce that by changing the return type to bool. Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/mmu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) v3: Split out. diff --git a/arch/powerpc/include/asm/mmu

[PATCH v3 07/21] powerpc/mm: Make MMU_FTR_RADIX a MMU family feature

2016-07-27 Thread Michael Ellerman
From: "Aneesh Kumar K.V" MMU feature bits are defined such that we use the lower half to present MMU family features. Remove the strict split of half and also move Radix to a mmu family feature. Radix introduce a new MMU model and strictly speaking it is a new MMU family. This also free up bits w

[PATCH v3 06/21] powerpc/kernel: Check features don't change after patching

2016-07-27 Thread Michael Ellerman
Early in boot we binary patch some sections of code based on the CPU and MMU feature bits. But it is a one-time patching, there is no facility for repatching the code later if the set of features change. It is a major bug if the set of features changes after we've done the code patching - so add a

[PATCH v3 05/21] powerpc/64: Do feature patching before MMU init

2016-07-27 Thread Michael Ellerman
Up until now we needed to do the MMU init before feature patching, because part of the MMU init was scanning the device tree and setting and/or clearing some MMU feature bits. Now that we have split that MMU feature modification out into routines called from early_init_devtree() (called earlier) w

[PATCH v3 03/21] powerpc/mm: Do hash device tree scanning earlier

2016-07-27 Thread Michael Ellerman
Currently MMU initialisation (early_init_mmu()) consists of a mixture of scanning the device tree, setting MMU feature bits, and then also doing actual initialisation of MMU data structures. We'd like to decouple the setting of the MMU features from the actual setup. So split out the device tree s

[PATCH v3 02/21] powerpc/mm: Move disable_radix handling into mmu_early_init_devtree()

2016-07-27 Thread Michael Ellerman
Move the handling of the disable_radix command line argument into the newly created mmu_early_init_devtree(). It's an MMU option so it's preferable to have it in an mm related file, and it also means platforms that don't support radix don't have to carry the code. Signed-off-by: Michael Ellerman

[PATCH v3 01/21] powerpc/mm: Add mmu_early_init_devtree()

2016-07-27 Thread Michael Ellerman
Empty for now, but we'll add to it in the next patch. Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/book3s/64/mmu.h | 1 + arch/powerpc/include/asm/mmu.h | 1 + arch/powerpc/kernel/prom.c | 2 ++ arch/powerpc/mm/init_64.c| 6 ++ 4 files

Re: [PATCH] Make system_reset_pSeries relocatable

2016-07-27 Thread Balbir Singh
On Wed, Jul 27, 2016 at 09:50:03PM +1000, Nicholas Piggin wrote: > On Wed, 27 Jul 2016 17:32:06 +1000 > Balbir Singh wrote: > > > +#ifndef CONFIG_RELOCATABLE > > + b power7_wakeup_common > > +#else > > + /* > > +* We can't just use a direct branch to power7_wakeup_common > > +*

[PowerPC] Kernel OOPS while compiling LTP test suite on linus mainline

2016-07-27 Thread Abdul Haleem
Hi, Kernel OOPS messages were seen while compiling linux test project (LTP) source on4.7.0-rc5 mainline. kernel config : pseries_le_defconfig machine Type : PowerVM LPAR trace messages: *15:34:57* [ 862.548866] Unable to handle kernel paging request for data at address 0x *15:34:57*

Re: [PowerPC] Kernel OOPS while compiling LTP test suite on linus mainline

2016-07-27 Thread Balbir Singh
On Wed, Jul 27, 2016 at 04:45:35PM +0530, Abdul Haleem wrote: > Hi, > > Kernel OOPS messages were seen while compiling linux test project (LTP) > source on 4.7.0-rc5 mainline. > > Kernel config : pseries_le_defconfig > Machine Type : PowerVM LPAR > Machine hardware : LPAR uses 16 vCPUs, and 29G

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 > >> > >> Currently the power management bits are broken w.r.t. relocation. > >> There a

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 is to do what > the slb miss handler does, which

Re: [PATCH] Make system_reset_pSeries relocatable

2016-07-27 Thread Balbir Singh
On Wed, Jul 27, 2016 at 05:32:06PM +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 is to do what > the slb miss handler doe

Re: [PATCH v12 02/30] powerpc/process: Add the function flush_tmregs_to_thread

2016-07-27 Thread Michael Ellerman
Hi Simon, wei.guo.si...@gmail.com writes: > From: Anshuman Khandual > > This patch creates a function flush_tmregs_to_thread which > will then be used by subsequent patches in this series. The > function checks for self tracing ptrace interface attempts > while in the TM context and logs appropr

[PowerPC] Kernel OOPS while compiling LTP test suite on linus mainline

2016-07-27 Thread Abdul Haleem
Hi, Kernel OOPS messages were seen while compiling linux test project (LTP) source on 4.7.0-rc5 mainline. Kernel config : pseries_le_defconfig Machine Type : PowerVM LPAR Machine hardware : LPAR uses 16 vCPUs, and 29G memory trace messages: *15:34:57* [ 862.548866] Unable to handle kernel pa

Re: _PAGE_PRESENT and _PAGE_ACCESSED

2016-07-27 Thread Benjamin Herrenschmidt
On Tue, 2016-07-26 at 19:52 +0200, LEROY Christophe wrote: > In ppc8xx tlbmiss handler, we consider a page valid if both   > _PAGE_PRESENT and _PAGE_ACCESSED are set. > Is there any chance to have _PAGE_ACCESSED set and not _PAGE_PRESENT ? > Otherwise we could simplify the handler by considering th

Re: [PATCH] Make system_reset_pSeries relocatable

2016-07-27 Thread kbuild test robot
Hi, [auto build test ERROR on v4.7-rc7] [cannot apply to powerpc/next next-20160727] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Balbir-Singh/Make-system_reset_pSeries-relocatable/20160727

Re: [PATCH] Make system_reset_pSeries relocatable

2016-07-27 Thread Balbir Singh
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 >> >> Currently the power management bits are broken w.r.t. relocation. >> There are direct branches from system_reset_pSeries to >> power7_wakeup_*. > > S

Re: [PATCH] Make system_reset_pSeries relocatable

2016-07-27 Thread Benjamin Herrenschmidt
On Wed, 2016-07-27 at 17:32 +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_*. Side track: we should really get rid of the _pSeries suffix for these thin

[PATCH v12 30/30] selftests/powerpc: Fix a build issue

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual Fixes the following build failure - cp_abort.c:90:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < NUM_LOOPS; i++) { ^ cp_abort.c:90:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your cod

[PATCH v12 29/30] selftests/powerpc: Add .gitignore file for ptrace executables

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds a .gitignore file for all the executables in the ptrace test directory thus making invisible with git status query. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Shuah Khan Cc: Anton Blanchard Cc: Cyril Bur Cc: Anshuman Khand

[PATCH v12 28/30] selftests/powerpc: Add ptrace tests for TM SPR registers

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for TM SPR registers. This also adds ptrace interface based helper functions related to TM SPR registers access. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Shuah Khan Cc: Anton Blanchard Cc: Cyril Bur

[PATCH v12 27/30] selftests/powerpc: Add ptrace tests for VSX, VMX registers in suspended TM

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for VSX, VMX registers inside suspended TM context. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Shuah Khan Cc: Anton Blanchard Cc: Cyril Bur Cc: Anshuman Khandual Cc: Simon Guo Cc: Ulrich Weigand Cc

[PATCH v12 26/30] selftests/powerpc: Add ptrace tests for VSX, VMX registers in TM

2016-07-27 Thread wei . guo . simon
From: Anshuman Khandual This patch adds ptrace interface test for VSX, VMX registers inside TM context. This also adds ptrace interface based helper functions related to chckpointed VSX, VMX registers access. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Shuah Khan C

  1   2   >