Re: [PATCH v2] powerpc/64: Fix build failure with GCC 8.1

2018-05-30 Thread Christophe LEROY
Le 31/05/2018 à 07:54, Michael Ellerman a écrit : Christophe LEROY writes: Le 29/05/2018 à 11:05, Geert Uytterhoeven a écrit : Hi Christophe, On Tue, May 29, 2018 at 10:56 AM, Christophe LEROY wrote: Le 29/05/2018 à 09:47, Geert Uytterhoeven a écrit : On Tue, May 29, 2018 at 8:03 AM,

Re: [PATCH v2] powerpc/64: Fix build failure with GCC 8.1

2018-05-30 Thread Michael Ellerman
Christophe LEROY writes: > Le 29/05/2018 à 11:05, Geert Uytterhoeven a écrit : >> Hi Christophe, >> On Tue, May 29, 2018 at 10:56 AM, Christophe LEROY >> wrote: >>> Le 29/05/2018 à 09:47, Geert Uytterhoeven a écrit : On Tue, May 29, 2018 at 8:03 AM, Christophe Leroy > ---

Re: [PATCH v5 0/4] powerpc patches for new Kconfig language

2018-05-30 Thread Masahiro Yamada
2018-05-31 13:31 GMT+09:00 Michael Ellerman : > Masahiro Yamada writes: >> 2018-05-30 23:39 GMT+09:00 Michael Ellerman : >>> Nicholas Piggin writes: >>> This series of patches improves th powerpc kbuild system. The motivation was to to be compatible with the new Kconfig scripting

Re: [PATCH 2/2] powerpc: Add support for function error injection

2018-05-30 Thread Michael Ellerman
"Naveen N. Rao" writes: > ... A change log is always nice even if it's short :) > Signed-off-by: Naveen N. Rao > --- > arch/powerpc/Kconfig | 1 + > arch/powerpc/include/asm/error-injection.h | 9 + > arch/powerpc/include/asm/ptrace.h | 5 + > 3

Re: [PATCH v5 7/7] ocxl: Document new OCXL IOCTLs

2018-05-30 Thread Andrew Donnellan
On 11/05/18 16:13, Alastair D'Silva wrote: From: Alastair D'Silva Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan -- Andrew Donnellan OzLabs, ADL Canberra andrew.donnel...@au1.ibm.com IBM Australia Limited

Re: [PATCH v5 6/7] ocxl: Add an IOCTL so userspace knows what OCXL features are available

2018-05-30 Thread Andrew Donnellan
On 11/05/18 16:13, Alastair D'Silva wrote: From: Alastair D'Silva In order for a userspace AFU driver to call the POWER9 specific OCXL_IOCTL_ENABLE_P9_WAIT, it needs to verify that it can actually make that call. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan -- Andrew

Re: [PATCH v5 5/7] ocxl: Expose the thread_id needed for wait on POWER9

2018-05-30 Thread Andrew Donnellan
On 11/05/18 16:13, Alastair D'Silva wrote: From: Alastair D'Silva In order to successfully issue as_notify, an AFU needs to know the TID to notify, which in turn means that this information should be available in userspace so it can be communicated to the AFU. Signed-off-by: Alastair D'Silva

Re: [PATCH] [SCHEME 2]powernv/cpuidle: Add support for new idle state device-tree format

2018-05-30 Thread Akshay Adiga
On Thu, May 31, 2018 at 08:23:20AM +0530, Akshay Adiga wrote: > This patch adds support for new device-tree format for idle state > description. > > Previously if a older kernel runs on a newer firmware, it may enable > all available states irrespective of its capability of handling it. > New

Re: [PATCH] [SCHEME 1] Add support for new idle device tree format

2018-05-30 Thread Akshay Adiga
On Thu, May 31, 2018 at 08:23:04AM +0530, Akshay Adiga wrote: > This patch adds support for new device-tree format for idle state > description. > > Previously if a older kernel runs on a newer firmware, it may enable > all available states irrespective of its capability of handling it. > New

[RFC PATCH 07/11] powerpc/prom_init: Move ibm_arch_vec to __prombss

2018-05-30 Thread Benjamin Herrenschmidt
Make the existing initialized definition constant and copy it to a __prombss copy Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/prom_init.c

[RFC PATCH] powerpc: Add support for adding an ESM blob to the zImage wrapper

2018-05-30 Thread Benjamin Herrenschmidt
For secure VMs, the signing tool will create a ticket called the "ESM blob" with the signatures of the kernel and initrd among other things. This adds support to the wrapper script for adding that blob via the "-e" option to the zImage.pseries. It also adds code to the zImage wrapper itself to

[RFC PATCH 05/11] powerpc/prom_init: Remove support for OPAL v2

2018-05-30 Thread Benjamin Herrenschmidt
We removed support for running under any OPAL version earlier than v3 in 2015 (they never saw the light of day anyway), but we kept some leftovers of this support in prom_init.c, so let's take it out. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 147

[RFC PATCH 04/11] powerpc/prom_init: Replace __initdata with __prombss when applicable

2018-05-30 Thread Benjamin Herrenschmidt
This replaces all occurrences of __initdata for uninitialized data with a new __prombss Currently __promdata is defined to be __initdata but we'll eventually change that. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 55 + 1 file

[RFC PATCH 09/11] powerpc/prom_init: Move a few remaining statics to appropriate sections

2018-05-30 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 67df2758a4e2..f54177a84dbc 100644 --- a/arch/powerpc/kernel/prom_init.c

[RFC PATCH 08/11] powerpc/prom_init: Move const structures to __initconst

2018-05-30 Thread Benjamin Herrenschmidt
As they are no longer used past the end of prom_init Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index

[RFC PATCH 11/11] powerpc: Check prom_init for disallowed sections

2018-05-30 Thread Benjamin Herrenschmidt
prom_init.c must not modify the kernel image outside of the .bss.prominit section. Thus make sure that prom_init.o doesn't have anything in any of these: .data .bss .init.data Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init_check.sh | 16

[RFC PATCH 10/11] powerpc/prom_init: Move __prombss to it's own section and store it in .bss

2018-05-30 Thread Benjamin Herrenschmidt
This makes __prombss its own section, and for now store it in .bss. This will give us the ability later to store it elsewhere and/or free it after boot (it's about 8KB). Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 2 +- arch/powerpc/kernel/vmlinux.lds.S | 3

[RFC PATCH 06/11] powerpc/prom_init: Move prom_radix_disable to __prombss

2018-05-30 Thread Benjamin Herrenschmidt
Initialize it dynamically instead of statically Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 7c3d285750ad..6a7549f64e28

[RFC PATCH 03/11] powerpc/prom_init: Make "default_colors" const

2018-05-30 Thread Benjamin Herrenschmidt
It's never modified either Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 158f9ece064e..860d2dbb6634 100644 ---

[RFC PATCH 02/11] powerpc/prom_init: Make "fake_elf" const

2018-05-30 Thread Benjamin Herrenschmidt
It is never modified Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index d6f52cc141c3..158f9ece064e 100644 ---

[RFC PATCH 01/11] powerpc/prom_init: Make of_workarounds static

2018-05-30 Thread Benjamin Herrenschmidt
It's not used anywhere else Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index f9d6befb55a6..d6f52cc141c3 100644 ---

[no subject]

2018-05-30 Thread Benjamin Herrenschmidt
prom_init is a rather "special" bit of code. Run once when booting from Open Firmware as pretty much the very first thing we do, it will perform all communications with OF before it gets killed and extract the device-tree for the kernel use. It will then re-enter the kernel at its main entry point

Re: [PATCH v5 4/7] ocxl: Rename pnv_ocxl_spa_remove_pe to clarify it's action

2018-05-30 Thread Andrew Donnellan
On 11/05/18 16:13, Alastair D'Silva wrote: From: Alastair D'Silva The function removes the process element from NPU cache. Signed-off-by: Alastair D'Silva Acked-by: Andrew Donnellan -- Andrew Donnellan OzLabs, ADL Canberra andrew.donnel...@au1.ibm.com IBM Australia Limited

Re: [PATCH v5 0/4] powerpc patches for new Kconfig language

2018-05-30 Thread Michael Ellerman
Masahiro Yamada writes: > 2018-05-30 23:39 GMT+09:00 Michael Ellerman : >> Nicholas Piggin writes: >> >>> This series of patches improves th powerpc kbuild system. The >>> motivation was to to be compatible with the new Kconfig scripting >>> language that Yamada-san has implemented here for

Re: [PATCH v5 3/7] powerpc: use task_pid_nr() for TID allocation

2018-05-30 Thread Andrew Donnellan
On 11/05/18 16:12, Alastair D'Silva wrote: From: Alastair D'Silva The current implementation of TID allocation, using a global IDR, may result in an errant process starving the system of available TIDs. Instead, use task_pid_nr(), as mentioned by the original author. The scenario described

Re: [PATCH v5 2/7] powerpc: Use TIDR CPU feature to control TIDR allocation

2018-05-30 Thread Andrew Donnellan
On 11/05/18 16:12, Alastair D'Silva wrote: From: Alastair D'Silva Switch the use of TIDR on it's CPU feature, rather than assuming it is available based on architecture. Signed-off-by: Alastair D'Silva Reviewed-by: Andrew Donnellan -- Andrew Donnellan OzLabs, ADL Canberra

Re: [PATCH v5 1/7] powerpc: Add TIDR CPU feature for POWER9

2018-05-30 Thread Andrew Donnellan
On 11/05/18 16:12, Alastair D'Silva wrote: From: Alastair D'Silva This patch adds a CPU feature bit to show whether the CPU has the TIDR register available, enabling as_notify/wait in userspace. Signed-off-by: Alastair D'Silva Reviewed-by: Andrew Donnellan -- Andrew Donnellan

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-30 Thread Anshuman Khandual
On 05/24/2018 12:51 PM, Ram Pai wrote: > On Wed, May 23, 2018 at 09:50:02PM +0300, Michael S. Tsirkin wrote: >> subj: s/virito/virtio/ >> > ..snip.. >>> machine_subsys_initcall_sync(pseries, tce_iommu_bus_notifier_init); >>> + >>> +bool platform_forces_virtio_dma(struct virtio_device *vdev) >>>

[PATCH] [SCHEME 2]powernv/cpuidle: Add support for new idle state device-tree format

2018-05-30 Thread Akshay Adiga
This patch adds support for new device-tree format for idle state description. Previously if a older kernel runs on a newer firmware, it may enable all available states irrespective of its capability of handling it. New device tree format adds a compatible flag, so that only kernel which has the

[PATCH] [SCHEME 1] Add support for new idle device tree format

2018-05-30 Thread Akshay Adiga
This patch adds support for new device-tree format for idle state description. Previously if a older kernel runs on a newer firmware, it may enable all available states irrespective of its capability of handling it. New device tree format adds a compatible flag, so that only kernel which has the

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

2018-05-30 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the powerpc tree got a conflict in: arch/powerpc/kernel/module_64.c between commit: 06aeb9e3f2bc ("powerpc/kbuild: move -mprofile-kernel check to Kconfig") from the kbuild tree and commit: 250122baed29 ("powerpc64/module: Tighten detection of mcount

Re: [PATCH v2] powerpc: fix build failure by disabling attribute-alias warning

2018-05-30 Thread kbuild test robot
Hi Christophe, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on next-20180530] [cannot apply to v4.17-rc7] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https

Re: [PATCH] powerpc/cell: fix build failure by disabling attribute-alias warning

2018-05-30 Thread kbuild test robot
Hi Christophe, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v4.17-rc7 next-20180530] [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

[powerpc:topic/kbuild 4/4] arch/powerpc/Kconfig:466: syntax error

2018-05-30 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git topic/kbuild head: cfff26c2dc7a18a4d10366896a68fb0ef9c793cb commit: cfff26c2dc7a18a4d10366896a68fb0ef9c793cb [4/4] powerpc/kbuild: move -mprofile-kernel check to Kconfig config: powerpc-allmodconfig compiler:

[RFC PATCH 8/8] powerpc: fix includes in asm/processor.h

2018-05-30 Thread Christophe Leroy
Remove superflous includes and add missing ones Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hw_breakpoint.h | 1 + arch/powerpc/include/asm/processor.h | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/hw_breakpoint.h

[RFC PATCH 7/8] powerpc/book3s: Remove PPC_PIN_SIZE

2018-05-30 Thread Christophe Leroy
PPC_PIN_SIZE is specific to the 44x and is defined in mmu.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 5 - arch/powerpc/include/asm/nohash/32/pgtable.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git

[RFC PATCH 6/8] powerpc: declare set_breakpoint() static

2018-05-30 Thread Christophe Leroy
set_breakpoint() is only used in process.c so make it static Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/debug.h | 1 - arch/powerpc/kernel/process.c| 14 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/debug.h

[RFC PATCH 5/8] powerpc: remove superflous inclusions of asm/fixmap.h

2018-05-30 Thread Christophe Leroy
Files not using fixmap consts or functions don't need asm/fixmap.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/fixmap.h| 2 -- arch/powerpc/kernel/head_8xx.S | 1 - arch/powerpc/mm/dump_hashpagetable.c | 1 - arch/powerpc/sysdev/cpm_common.c | 1 - 4 files

[RFC PATCH 4/8] powerpc: remove superflous inclusions of asm/feature-fixups.h

2018-05-30 Thread Christophe Leroy
files not using feature fixup don't need asm/feature-fixups.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cputable.h | 1 - arch/powerpc/include/asm/firmware.h | 1 - arch/powerpc/include/asm/mmu.h | 1 - arch/powerpc/include/asm/reg.h | 1 + 4 files changed, 1

[RFC PATCH 3/8] powerpc: remove superflous inclusions of asm-compat.h

2018-05-30 Thread Christophe Leroy
ppc-opcode.h doesn't need asm-compat.h neither does dt_cpu_ftrs.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cputable.h | 1 - arch/powerpc/include/asm/feature-fixups.h | 2 ++ arch/powerpc/include/asm/ppc-opcode.h | 1 - 3 files changed, 2 insertions(+), 2

[RFC PATCH 2/8] powerpc: remove unneeded inclusions of cpu_has_feature.h

2018-05-30 Thread Christophe Leroy
Files not using cpu_has_feature() don't need cpu_has_feature.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cacheflush.h | 1 - arch/powerpc/include/asm/cputime.h | 1 - arch/powerpc/include/asm/dbell.h | 1 - arch/powerpc/include/asm/dt_cpu_ftrs.h | 3 ---

[RFC PATCH 0/8] Remove unneccessary included headers

2018-05-30 Thread Christophe Leroy
The purpose of this serie is to limit the number of includes to only the necessary ones in order to reduce the number of files recompiled everytime a header file is modified. This is the start of the work, please provide feedback if any so that I don't go in the wrong direction. Christophe Leroy

[RFC PATCH 1/8] powerpc: remove kdump.h from page.h

2018-05-30 Thread Christophe Leroy
page.h doesn't need kdump.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/page.h | 1 - arch/powerpc/kernel/setup_32.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index

Re: [RFC PATCH] powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book E

2018-05-30 Thread Diana Madalina Craciun
On 05/29/2018 10:16 PM, Scott Wood wrote: > On Tue, 2018-05-29 at 15:22 +, Diana Madalina Craciun wrote: >> Hi Scott, >> >> Thanks for the review. >> >> On 05/22/2018 11:31 PM, Scott Wood wrote: >>> On Tue, 2018-05-22 at 10:10 +0300, Diana Craciun wrote: Implement the barrier_nospec as a

Re: [PATCH v5 0/4] powerpc patches for new Kconfig language

2018-05-30 Thread Masahiro Yamada
2018-05-30 23:39 GMT+09:00 Michael Ellerman : > Nicholas Piggin writes: > >> This series of patches improves th powerpc kbuild system. The >> motivation was to to be compatible with the new Kconfig scripting >> language that Yamada-san has implemented here for merge: >> >>

Re: [PATCH v5 0/4] powerpc patches for new Kconfig language

2018-05-30 Thread Michael Ellerman
Nicholas Piggin writes: > This series of patches improves th powerpc kbuild system. The > motivation was to to be compatible with the new Kconfig scripting > language that Yamada-san has implemented here for merge: > >

Re: [PATCH v5 3/4] powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS

2018-05-30 Thread Masahiro Yamada
2018-05-30 21:19 GMT+09:00 Nicholas Piggin : > The powerpc toolchain can compile combinations of 32/64 bit and > big/little endian, so it's convenient to consider, e.g., > > `CC -m64 -mbig-endian` > > To be the C compiler for the purpose of invoking it to build target > artifacts. So overriding

Re: [PATCH v5 1/4] powerpc/kbuild: set default generic machine type for 32-bit compile

2018-05-30 Thread Masahiro Yamada
2018-05-30 21:19 GMT+09:00 Nicholas Piggin : > Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit > kernels, even with -m32. Debian's powerpc64le is one such case, and > that is because it is built with --with-cpu=power8. > > So when cross compiling a 32-bit kernel with a

Re: [PATCH v5 1/4] powerpc/kbuild: set default generic machine type for 32-bit compile

2018-05-30 Thread Masahiro Yamada
2018-05-30 21:19 GMT+09:00 Nicholas Piggin : > Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit > kernels, even with -m32. Debian's powerpc64le is one such case, and > that is because it is built with --with-cpu=power8. > > So when cross compiling a 32-bit kernel with a

Re: [PATCH v2 1/1] powerpc/pseries: fix EEH recovery of some IOV devices

2018-05-30 Thread Bryant G. Ly
On 5/24/18 7:31 PM, Sam Bobroff wrote: > EEH recovery currently fails on pSeries for some IOV capable PCI > devices, if CONFIG_PCI_IOV is on and the hypervisor doesn't provide > certain device tree properties for the device. (Found on an IOV > capable device using the ipr driver.) > > Recovery

[PATCH] powerpc/mm/hash: Add missing update in slb update sequence.

2018-05-30 Thread Aneesh Kumar K.V
>From ISA "For data accesses, the context synchronizing instruction before the slbie, slbieg, slbia, slbmte, tlbie, or tlbiel instruction ensures that all preceding instructions that access data storage have completed to a point at which they have reported all exceptions they will cause." Add

[PATCH] powerpc/mm: Fix kernel crash on page table free

2018-05-30 Thread Aneesh Kumar K.V
Fix the below crash on BookE 64. pgtable_page_dtor expects struct page *arg. Also call the destructor on non book3s platforms correctly. This free up the split ptl locks correctly if we had allocated them before. Call Trace: [c000f30c7520] [c021eeec] .kmem_cache_free+0x9c/0x44c

[PATCH v5 4/4] powerpc/kbuild: move -mprofile-kernel check to Kconfig

2018-05-30 Thread Nicholas Piggin
This eliminates the workaround that requires disabling -mprofile-kernel by default in Kconfig. [ Note: this depends on https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kconfig-shell-v3 ] Signed-off-by: Nicholas Piggin --- arch/powerpc/Kconfig

[PATCH v5 3/4] powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS

2018-05-30 Thread Nicholas Piggin
The powerpc toolchain can compile combinations of 32/64 bit and big/little endian, so it's convenient to consider, e.g., `CC -m64 -mbig-endian` To be the C compiler for the purpose of invoking it to build target artifacts. So overriding the the CC variable to include thse flags works for this

[PATCH v5 2/4] powerpc/kbuild: remove CROSS32 defines from top level powerpc Makefile

2018-05-30 Thread Nicholas Piggin
Switch VDSO32 build over to use CROSS32_COMPILE directly, and have it pass in -m32 after the standard c_flags. This allows endianness overrides to be removed and the endian and bitness flags moved into standard flags variables. Signed-off-by: Nicholas Piggin --- arch/powerpc/Makefile

[PATCH v5 1/4] powerpc/kbuild: set default generic machine type for 32-bit compile

2018-05-30 Thread Nicholas Piggin
Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit kernels, even with -m32. Debian's powerpc64le is one such case, and that is because it is built with --with-cpu=power8. So when cross compiling a 32-bit kernel with a 64-bit toolchain, set -mcpu=powerpc initially, which is the

[PATCH v5 0/4] powerpc patches for new Kconfig language

2018-05-30 Thread Nicholas Piggin
This series of patches improves th powerpc kbuild system. The motivation was to to be compatible with the new Kconfig scripting language that Yamada-san has implemented here for merge: https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/log/?h=kconfig I have tested on top

Re: [PATCH v4 1/4] powerpc/kbuild: set default generic machine type for 32-bit compile

2018-05-30 Thread Nicholas Piggin
On Tue, 29 May 2018 22:39:48 +0900 Masahiro Yamada wrote: > 2018-05-16 23:14 GMT+09:00 Nicholas Piggin : > > Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit > > kernels, even with -m32. Debian's powerpc64le is one such case, and > > that is because it is built with

[PATCH] powerpc/64s: Fix compiler store ordering to SLB shadow area

2018-05-30 Thread Nicholas Piggin
The stores to update the SLB shadow area must be made as they appear in the C code, so that the hypervisor does not see an entry with mismatched vsid and esid. Use WRITE_ONCE for this. GCC has been observed to elide the first store to esid in the update, which means that if the hypervisor

[PATCH kernel] powerpc/powernv/ioda2: Remove redundand free of TCE pages

2018-05-30 Thread Alexey Kardashevskiy
When IODA2 creates a PE, it creates an IOMMU table with it_ops::free set to pnv_ioda2_table_free() which calls pnv_pci_ioda2_table_free_pages(). Since iommu_tce_table_put() calls it_ops::free when the last reference to the table is released, explicit call to pnv_pci_ioda2_table_free_pages() is

[PATCH v7 5/5] powerpc:selftest update memcmp_64 selftest for VMX implementation

2018-05-30 Thread wei . guo . simon
From: Simon Guo This patch reworked selftest memcmp_64 so that memcmp selftest can cover more test cases. It adds testcases for: - memcmp over 4K bytes size. - s1/s2 with different/random offset on 16 bytes boundary. - enter/exit_vmx_ops pairness. Signed-off-by: Simon Guo ---

[PATCH v7 4/5] powerpc/64: add 32 bytes prechecking before using VMX optimization on memcmp()

2018-05-30 Thread wei . guo . simon
From: Simon Guo This patch is based on the previous VMX patch on memcmp(). To optimize ppc64 memcmp() with VMX instruction, we need to think about the VMX penalty brought with: If kernel uses VMX instruction, it needs to save/restore current thread's VMX registers. There are 32 x 128 bits VMX

[PATCH v7 3/5] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision

2018-05-30 Thread wei . guo . simon
From: Simon Guo This patch add VMX primitives to do memcmp() in case the compare size is equal or greater than 4K bytes. KSM feature can benefit from this. Test result with following test program(replace the "^>" with ""): -- ># cat tools/testing/selftests/powerpc/stringloops/memcmp.c

[PATCH v7 2/5] powerpc: add vcmpequd/vcmpequb ppc instruction macro

2018-05-30 Thread wei . guo . simon
From: Simon Guo Some old tool chains don't know about instructions like vcmpequd. This patch adds .long macro for vcmpequd and vcmpequb, which is a preparation to optimize ppc64 memcmp with VMX instructions. Signed-off-by: Simon Guo --- arch/powerpc/include/asm/ppc-opcode.h | 11 +++

[PATCH v7 1/5] powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp()

2018-05-30 Thread wei . guo . simon
From: Simon Guo Currently memcmp() 64bytes version in powerpc will fall back to .Lshort (compare per byte mode) if either src or dst address is not 8 bytes aligned. It can be opmitized in 2 situations: 1) if both addresses are with the same offset with 8 bytes boundary: memcmp() can compare the

[PATCH v7 0/5] powerpc/64: memcmp() optimization

2018-05-30 Thread wei . guo . simon
From: Simon Guo There is some room to optimize memcmp() in powerpc 64 bits version for following 2 cases: (1) Even src/dst addresses are not aligned with 8 bytes at the beginning, memcmp() can align them and go with .Llong comparision mode without fallback to .Lshort comparision mode do compare

[PATCH] powerpc/powermac: fix spelling mistake "Usupported" -> "Unsupported"

2018-05-30 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in bootx_printf message text. Signed-off-by: Colin Ian King --- arch/powerpc/platforms/powermac/bootx_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powermac/bootx_init.c

Re: [PATCH v4 04/29] KVM: PPC: Book3S PR: Move kvmppc_save_tm/kvmppc_restore_tm to separate file

2018-05-30 Thread Simon Guo
On Wed, May 30, 2018 at 09:40:27AM +1000, Paul Mackerras wrote: > On Wed, May 23, 2018 at 03:01:47PM +0800, wei.guo.si...@gmail.com wrote: > > From: Simon Guo > > > > It is a simple patch just for moving kvmppc_save_tm/kvmppc_restore_tm() > > functionalities to tm.S. There is no logic change.

Re: [PATCH v6 2/4] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision

2018-05-30 Thread Simon Guo
On Wed, May 30, 2018 at 03:35:40AM -0500, Segher Boessenkool wrote: > On Wed, May 30, 2018 at 04:14:02PM +0800, Simon Guo wrote: > > Hi Segher, > > On Mon, May 28, 2018 at 06:05:59AM -0500, Segher Boessenkool wrote: > > > On Fri, May 25, 2018 at 12:07:34PM +0800, wei.guo.si...@gmail.com wrote: > >

Re: [PATCH v6 1/4] powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp()

2018-05-30 Thread Simon Guo
On Wed, May 30, 2018 at 03:27:39AM -0500, Segher Boessenkool wrote: > Hi! > > On Wed, May 30, 2018 at 04:11:50PM +0800, Simon Guo wrote: > > On Mon, May 28, 2018 at 05:35:12AM -0500, Segher Boessenkool wrote: > > > On Fri, May 25, 2018 at 12:07:33PM +0800, wei.guo.si...@gmail.com wrote: > > > If

Re: [PATCH v5 3/3] powerpc/lib: optimise PPC32 memcmp

2018-05-30 Thread Christophe LEROY
Le 29/05/2018 à 22:03, Mathieu Malaterre a écrit : On Mon, May 28, 2018 at 12:49 PM, Christophe Leroy wrote: At the time being, memcmp() compares two chunks of memory byte per byte. This patch optimises the comparison by comparing word by word. A small benchmark performed on an 8xx

Re: [PATCH 1/2] error-injection: Simplify arch specific helpers

2018-05-30 Thread Masami Hiramatsu
On Tue, 29 May 2018 18:06:02 +0530 "Naveen N. Rao" wrote: > We already have an arch-independent way to set the instruction pointer > with instruction_pointer_set(). Using this allows us to get rid of the > need for override_function_with_return() that each architecture has to > implement. > >

Re: [PATCH v6 2/4] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision

2018-05-30 Thread Segher Boessenkool
On Wed, May 30, 2018 at 04:14:02PM +0800, Simon Guo wrote: > Hi Segher, > On Mon, May 28, 2018 at 06:05:59AM -0500, Segher Boessenkool wrote: > > On Fri, May 25, 2018 at 12:07:34PM +0800, wei.guo.si...@gmail.com wrote: > > > + /* save and restore cr0 */ > > > + mfocrf r5,64 > > > + EXIT_VMX_OPS >

[PATCH v3] powerpc/lib: implement strlen() in assembly

2018-05-30 Thread Christophe Leroy
The generic implementation of strlen() reads strings byte per byte. This patch implements strlen() in assembly based on a read of entire words, in the same spirit as what some other arches and glibc do. On a 8xx the time spent in strlen is reduced by 50-60% for long strings. Signed-off-by:

Re: [PATCH v6 1/4] powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp()

2018-05-30 Thread Segher Boessenkool
Hi! On Wed, May 30, 2018 at 04:11:50PM +0800, Simon Guo wrote: > On Mon, May 28, 2018 at 05:35:12AM -0500, Segher Boessenkool wrote: > > On Fri, May 25, 2018 at 12:07:33PM +0800, wei.guo.si...@gmail.com wrote: > > If this doesn't use cr0 anymore, you can do rlwinm r6,r6,0,7 instead of > > andi

Re: [PATCH v6 2/4] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision

2018-05-30 Thread Simon Guo
Hi Michael, On Mon, May 28, 2018 at 09:59:29PM +1000, Michael Ellerman wrote: > Hi Simon, > > wei.guo.si...@gmail.com writes: > > diff --git a/arch/powerpc/lib/memcmp_64.S b/arch/powerpc/lib/memcmp_64.S > > index f20e883..4ba7bb6 100644 > > --- a/arch/powerpc/lib/memcmp_64.S > > +++

Re: [PATCH v6 2/4] powerpc/64: enhance memcmp() with VMX instruction for long bytes comparision

2018-05-30 Thread Simon Guo
Hi Segher, On Mon, May 28, 2018 at 06:05:59AM -0500, Segher Boessenkool wrote: > On Fri, May 25, 2018 at 12:07:34PM +0800, wei.guo.si...@gmail.com wrote: > > + /* save and restore cr0 */ > > + mfocrf r5,64 > > + EXIT_VMX_OPS > > + mtocrf 64,r5 > > + b .LcmpAB_lightweight > >

Re: [PATCH v6 1/4] powerpc/64: Align bytes before fall back to .Lshort in powerpc64 memcmp()

2018-05-30 Thread Simon Guo
Hi Segher, On Mon, May 28, 2018 at 05:35:12AM -0500, Segher Boessenkool wrote: > On Fri, May 25, 2018 at 12:07:33PM +0800, wei.guo.si...@gmail.com wrote: > > _GLOBAL(memcmp) > > cmpdi cr1,r5,0 > > > > - /* Use the short loop if both strings are not 8B aligned */ > > - or r6,r3,r4

[PATCH v6 2/2] powerpc/lib: optimise PPC32 memcmp

2018-05-30 Thread Christophe Leroy
At the time being, memcmp() compares two chunks of memory byte per byte. This patch optimises the comparison by comparing word by word. On the same way as commit 15c2d45d17418 ("powerpc: Add 64bit optimised memcmp"), this patch moves memcmp() into a dedicated file named memcmp_32.S A small

[PATCH v6 1/2] powerpc/lib: optimise 32 bits __clear_user()

2018-05-30 Thread Christophe Leroy
Rewrite clear_user() on the same principle as memset(0), making use of dcbz to clear complete cache lines. This code is a copy/paste of memset(), with some modifications in order to retrieve remaining number of bytes to be cleared, as it needs to be returned in case of error. On the same way as

[PATCH v6 0/2] powerpc/lib: Optimisation of memcmp() and __clear_user() for PPC32

2018-05-30 Thread Christophe Leroy
This serie intends to optimise memcmp() and __clear_user() for PPC32 in the same spirit as already done on PPC64. The first patch rewrites __clear_user() by using dcbz intruction The second patch rewrites memcmp() to compare 32 bits words instead of comparing byte per byte. As shown in each

Re: [PATCH] powerpc/ptrace: Use copy_{from, to}_user() rather than open-coding

2018-05-30 Thread Samuel Mendoza-Jonas
On Tue, 2018-05-29 at 22:57 +1000, Michael Ellerman wrote: > From: Al Viro > > In PPC_PTRACE_GETHWDBGINFO and PPC_PTRACE_SETHWDEBUG we do an > access_ok() check and then __copy_{from,to}_user(). > > Instead we should just use copy_{from,to}_user() which does all that > for us and is less error

Re: [PATCH v2] powerpc/numa: Correct kernel message severity

2018-05-30 Thread Vipin K Parashar
Hi, Any progress/update with this patch ? Please do let know, if something more is needed here. Regards, Vipin On Wednesday 14 March 2018 01:22 PM, Vipin K Parashar wrote: printk() in unmap_cpu_from_node() uses KERN_ERR message severity, for a WARNING message. Change it to pr_warn().