[PATCH v10 01/18] counter: Introduce the Generic Counter interface

2019-04-02 Thread William Breathitt Gray
This patch introduces the Generic Counter interface for supporting counter devices. In the context of the Generic Counter interface, a counter is defined as a device that reports one or more "counts" based on the state changes of one or more "signals" as evaluated by a defined "count function."

[PATCH v10 17/18] counter: ftm-quaddec: Documentation: Add specific counter sysfs documentation

2019-04-02 Thread William Breathitt Gray
From: Patrick Havelange This adds documentation for the specific prescaler entry. Signed-off-by: Patrick Havelange Signed-off-by: William Breathitt Gray --- .../ABI/testing/sysfs-bus-counter-ftm-quaddec| 16 1 file changed, 16 insertions(+) create mode 100644

Re: [PATCH 2/5] powerpc: Fix vDSO clock_getres()

2019-04-02 Thread Christophe Leroy
On 04/01/2019 11:51 AM, Vincenzo Frascino wrote: clock_getres in the vDSO library has to preserve the same behaviour of posix_get_hrtimer_res(). In particular, posix_get_hrtimer_res() does: sec = 0; ns = hrtimer_resolution; and hrtimer_resolution depends on the enablement of the

[PATCH v10 05/18] counter: 104-quad-8: Add Generic Counter interface support

2019-04-02 Thread William Breathitt Gray
This patch adds support for the Generic Counter interface to the 104-QUAD-8 driver. The existing 104-QUAD-8 device interface should not be affected by this patch; all changes are intended as supplemental additions as perceived by the user. Generic Counter Counts are created for the eight

[PATCH v10 07/18] counter: Add STM32 Timer quadrature encoder

2019-04-02 Thread William Breathitt Gray
From: Benjamin Gaignard Implement counter part of the STM32 timer hardware block by using counter API. Hardware only supports X2 and X4 quadrature modes. A ceiling value can be set to define the maximum value reachable by the counter. Signed-off-by: Benjamin Gaignard Co-authored-by: Fabrice

[PATCH v10 06/18] counter: 104-quad-8: Documentation: Add Generic Counter sysfs documentation

2019-04-02 Thread William Breathitt Gray
This patch adds standard documentation for the Generic Counter interface userspace sysfs attributes of the 104-QUAD-8 driver. Acked-by: Jonathan Cameron Signed-off-by: William Breathitt Gray --- .../ABI/testing/sysfs-bus-counter-104-quad-8 | 36 +++ MAINTAINERS

[PATCH v10 12/18] include/fsl: add common FlexTimer #defines in a separate header.

2019-04-02 Thread William Breathitt Gray
From: Patrick Havelange Several files are/will be using the same #defines to use the Flextimer module. Regroup them in a common file. Reviewed-by: Esben Haabendal Signed-off-by: Patrick Havelange Signed-off-by: William Breathitt Gray --- include/linux/fsl/ftm.h | 88

[PATCH v10 16/18] counter: add FlexTimer Module Quadrature decoder counter driver

2019-04-02 Thread William Breathitt Gray
From: Patrick Havelange This driver exposes the counter for the quadrature decoder of the FlexTimer Module, present in the LS1021A soc. Signed-off-by: Patrick Havelange Signed-off-by: William Breathitt Gray --- drivers/counter/Kconfig | 9 + drivers/counter/Makefile | 1 +

[PATCH 8/9] Gives arches opportunity to use generically defined boot cmdline manipulation

2019-04-02 Thread Christophe Leroy
Most arches have similar boot command line manipulation options. This patchs adds the definition in init/Kconfig, gated by CONFIG_HAVE_CMDLINE that the arches can select to use them. In order to use this, a few arches will have to change their CONFIG options: - riscv has to replace

[PATCH v10 02/18] counter: Documentation: Add Generic Counter sysfs documentation

2019-04-02 Thread William Breathitt Gray
This patch adds standard documentation for the userspace sysfs attributes of the Generic Counter interface. Reviewed-by: Jonathan Cameron Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-counter | 230 MAINTAINERS

[PATCH v10 15/18] dt-bindings: counter: ftm-quaddec

2019-04-02 Thread William Breathitt Gray
From: Patrick Havelange FlexTimer quadrature decoder driver. Reviewed-by: Esben Haabendal Signed-off-by: Patrick Havelange Signed-off-by: William Breathitt Gray --- .../bindings/counter/ftm-quaddec.txt | 18 ++ 1 file changed, 18 insertions(+) create mode 100644

[PATCH v10 14/18] drivers/clocksource: timer-fsl-ftm: use common header for FlexTimer #defines

2019-04-02 Thread William Breathitt Gray
From: Patrick Havelange Common #defines have been moved to "linux/fsl/ftm.h". Thus making use of this file. Also FTM_SC_CLK_SHIFT has been renamed to FTM_SC_CLK_MASK_SHIFT. Reviewed-by: Esben Haabendal Signed-off-by: Patrick Havelange Signed-off-by: William Breathitt Gray ---

[PATCH 9/9] powerpc: use generic CMDLINE manipulations

2019-04-02 Thread Christophe Leroy
This patch moves powerpc to the centraly defined CMDLINE options. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 48 +++- 1 file changed, 3 insertions(+), 45 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index

Re: [RFC PATCH v2 3/3] kasan: add interceptors for all string functions

2019-04-02 Thread Christophe Leroy
Hi Dmitry, Andrey and others, Do you have any comments to this series ? I'd like to know if this approach is ok or if it is better to keep doing as in https://patchwork.ozlabs.org/patch/1055788/ Thanks Christophe Le 28/03/2019 à 16:00, Christophe Leroy a écrit : In the same spirit as

Re: [PATCH] powerpc/powernv: Add mmap to opal export sysfs nodes

2019-04-02 Thread Oliver
On Fri, Mar 15, 2019 at 11:55 AM Jordan Niethe wrote: > > The sysfs nodes created under /opal/exports/ do not currently support > mmap. Skiboot trace buffers are not yet added to this location but > this is a suitable for them to be exported to. Adding mmap support makes > using these trace

[PATCH v10 11/18] iio: counter: Add deprecation markings for IIO Counter attributes

2019-04-02 Thread William Breathitt Gray
The IIO counter subdirectory is now superceded by the Counter subsystem. This patch adds deprecation warnings to the documentation of the relevant IIO Counter sysfs attributes. Acked-by: Jonathan Cameron Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-iio

[PATCH v10 10/18] dt-bindings: counter: Adjust dt-bindings for STM32 lptimer move

2019-04-02 Thread William Breathitt Gray
From: Fabrice Gasnier The STM32 LP Timer counter driver now resides under the Counter subsystem. This patch adjusts dt-bindings to account for the STM32 lptimer driver move. Cc: Mark Rutland Signed-off-by: Fabrice Gasnier Acked-by: Rob Herring Signed-off-by: William Breathitt Gray ---

Re: [PATCH stable v4.14 13/32] powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E

2019-04-02 Thread Joakim Tjernlund
On Tue, 2019-04-02 at 17:19 +1100, Michael Ellerman wrote: > > Joakim Tjernlund writes: > > On Fri, 2019-03-29 at 22:26 +1100, Michael Ellerman wrote: > > > From: Diana Craciun > > > > > > commit ebcd1bfc33c7a90df941df68a6e5d4018c022fba upstream. > > > > > > Implement the barrier_nospec as a

Re: [PATCH stable v4.14 13/32] powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E

2019-04-02 Thread Michael Ellerman
Joakim Tjernlund writes: > On Fri, 2019-03-29 at 22:26 +1100, Michael Ellerman wrote: >> From: Diana Craciun >> >> commit ebcd1bfc33c7a90df941df68a6e5d4018c022fba upstream. >> >> Implement the barrier_nospec as a isync;sync instruction sequence. >> The implementation uses the infrastructure

[PATCH v10 00/18] Introduce the Counter subsystem

2019-04-02 Thread William Breathitt Gray
Changes in v10: - Fix minor typographical errors in documentation - Merge the FlexTimer Module Quadrature decoder counter driver patches This revision is functionally identical to the last; changes in this version were made to fix minor typos in the documentation files and also to pull in the

[PATCH v10 09/18] counter: stm32-lptimer: add counter device

2019-04-02 Thread William Breathitt Gray
From: Fabrice Gasnier Add support for new counter device to stm32-lptimer. Signed-off-by: Fabrice Gasnier Reviewed-by: Jonathan Cameron Signed-off-by: William Breathitt Gray --- drivers/counter/Kconfig | 10 + drivers/counter/Makefile | 1 +

[PATCH 5/9] powerpc: convert to generic builtin command line

2019-04-02 Thread Christophe Leroy
This updates the powerpc code to use the new cmdline building function. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/prom_init.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c

[PATCH v10 03/18] docs: Add Generic Counter interface documentation

2019-04-02 Thread William Breathitt Gray
This patch adds high-level documentation about the Generic Counter interface. Reviewed-by: Jonathan Cameron Signed-off-by: William Breathitt Gray --- Documentation/driver-api/generic-counter.rst | 342 +++ Documentation/driver-api/index.rst | 1 + MAINTAINERS

[PATCH v10 04/18] iio: 104-quad-8: Update license boilerplate

2019-04-02 Thread William Breathitt Gray
This patch simplifies the boilerplate license text by making use of a SPDX license identifier line. Signed-off-by: William Breathitt Gray --- drivers/iio/counter/104-quad-8.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/iio/counter/104-quad-8.c

[PATCH v10 13/18] drivers/pwm: pwm-fsl-ftm: use common header for FlexTimer #defines

2019-04-02 Thread William Breathitt Gray
From: Patrick Havelange This also fixes the wrong value for the previously defined FTM_MODE_INIT macro (it was not used). Reviewed-by: Esben Haabendal Signed-off-by: Patrick Havelange Signed-off-by: William Breathitt Gray --- drivers/pwm/pwm-fsl-ftm.c | 44

[PATCH v10 08/18] dt-bindings: counter: Document stm32 quadrature encoder

2019-04-02 Thread William Breathitt Gray
From: Benjamin Gaignard Add bindings for STM32 Timer quadrature encoder. It is a sub-node of STM32 Timer which implement the quadratic encoder part of the hardware. Cc: Mark Rutland Signed-off-by: Benjamin Gaignard Acked-by: Rob Herring Signed-off-by: William Breathitt Gray ---

[PATCH v10 18/18] LS1021A: dtsi: add ftm quad decoder entries

2019-04-02 Thread William Breathitt Gray
From: Patrick Havelange Add the 4 Quadrature counters for this board. Reviewed-by: Esben Haabendal Signed-off-by: Patrick Havelange Signed-off-by: William Breathitt Gray --- arch/arm/boot/dts/ls1021a.dtsi | 28 1 file changed, 28 insertions(+) diff --git

Re: [PATCH 2/5] powerpc: Fix vDSO clock_getres()

2019-04-02 Thread Vincenzo Frascino
Hi Christophe, thank you for your review. On 02/04/2019 06:54, Christophe Leroy wrote: > > > On 04/01/2019 11:51 AM, Vincenzo Frascino wrote: >> clock_getres in the vDSO library has to preserve the same behaviour >> of posix_get_hrtimer_res(). >> >> In particular, posix_get_hrtimer_res() does:

Re: [PATCH 2/5] powerpc: Fix vDSO clock_getres()

2019-04-02 Thread Vincenzo Frascino
On 02/04/2019 07:14, Christophe Leroy wrote: > > > On 04/01/2019 11:51 AM, Vincenzo Frascino wrote: >> clock_getres in the vDSO library has to preserve the same behaviour >> of posix_get_hrtimer_res(). >> >> In particular, posix_get_hrtimer_res() does: >> sec = 0; >> ns =

[PATCH 0/9] Improve boot command line handling

2019-04-02 Thread Christophe Leroy
The purpose of this series is to improve and enhance the handling of kernel boot arguments. It is first focussed on powerpc but also extends the capability for other arches. This is based on suggestion from Daniel Walker Christophe Leroy (9): powerpc: enable appending of CONFIG_CMDLINE to

[PATCH 2/9] Add generic function to build command line.

2019-04-02 Thread Christophe Leroy
This code provides architectures with a way to build command line based on what is built in the kernel and what is handed over by the bootloader, based on selected compile-time options. Signed-off-by: Christophe Leroy --- include/linux/cmdline.h | 34 ++ 1 file

[PATCH 3/9] drivers: of: use cmdline building function

2019-04-02 Thread Christophe Leroy
This patch uses the new cmdline building function to concatenate the of provided cmdline with built-in parts based on compile-time options. Signed-off-by: Christophe Leroy --- drivers/of/fdt.c| 23 --- include/linux/cmdline.h | 2 +- 2 files changed, 5

[PATCH 1/9] powerpc: enable appending of CONFIG_CMDLINE to bootloader's cmdline.

2019-04-02 Thread Christophe Leroy
Today, powerpc defined CONFIG_CMDLINE for when bootloader doesn't provide a command line or for overriding it. On same way as ARM, this patch adds the option of appending the CONFIG_CMDLINE to bootloader's provided command line. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig

[PATCH 4/9] powerpc/prom_init: get rid of PROM_SCRATCH_SIZE

2019-04-02 Thread Christophe Leroy
PROM_SCRATCH_SIZE is same as sizeof(prom_scratch) Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/prom_init.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index

[PATCH 6/9] Add capability to prepend the command line

2019-04-02 Thread Christophe Leroy
This patchs adds an option of prepend a text to the command line instead of appending it. Signed-off-by: Christophe Leroy --- include/linux/cmdline.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h index

[PATCH 7/9] powerpc: add capability to prepend default command line

2019-04-02 Thread Christophe Leroy
This patch activates the capability to prepend default arguments to the command line. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 2972348e52be..22d6a48bd2ca 100644 ---

[PATCH v2] mm: Fix modifying of page protection by insert_pfn_pmd()

2019-04-02 Thread Aneesh Kumar K.V
With some architectures like ppc64, set_pmd_at() cannot cope with a situation where there is already some (different) valid entry present. Use pmdp_set_access_flags() instead to modify the pfn which is built to deal with modifying existing PMD entries. This is similar to commit cae85cb8add3

[PATCH v2 2/3] powernv/mce: Print correct severity for mce error.

2019-04-02 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Currently all machine check errors are printed as severe errors which isn't correct. Print soft errors as warning instead of severe errors. Signed-off-by: Mahesh Salgaonkar --- change in v2: - Use kernel types i.e. u8, u64 etc. - Define sync_error as bool. ---

[PATCH v2 3/3] powernv/mce: print additional information about mce error.

2019-04-02 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Print more information about mce error whether it is an hardware or software error. Some of the mce errors can be easily categorized as hardware or software errors e.g. UEs are due to hardware error, where as error triggered due to invalid usage of tlbie is a pure

RE: [PATCH] ASoC: fsl_esai: Support synchronous mode

2019-04-02 Thread S.j. Wang
Hi > > Shengjiu, > > On Mon, Apr 01, 2019 at 11:39:10AM +, S.j. Wang wrote: > > In ESAI synchronous mode, the clock is generated by Tx, So we should > > always set registers of Tx which relate with the bit clock and frame > > clock generation (TCCR, TCR, ECR), even there is only Rx is

[PATCH] powerpc/watchdog: Use hrtimers for per-CPU heartbeat

2019-04-02 Thread Nicholas Piggin
Using a jiffies timer creates a dependency on the tick_do_timer_cpu incrementing jiffies. If that CPU has locked up and jiffies is not incrementing, the watchdog heartbeat timer for all CPUs stops and creates false positives and confusing warnings on local CPUs, and also causes the SMP detector to

[PATCH v2 1/3] powernv/mce: reduce mce console logs to lesser lines.

2019-04-02 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Also add cpu number while displaying mce log. This will help cleaner logs when mce hits on multiple cpus simultaneously. before the changes the mce o/p was: [ 127.223515] Severe Machine check interrupt [Recovered] [ 127.223530] NIP [dba80280]:

Re: [RFC PATCH] powerpc/mm: Reduce memory usage for mm_context_t for radix

2019-04-02 Thread Aneesh Kumar K.V
On 4/2/19 9:06 PM, Christophe Leroy wrote: Le 02/04/2019 à 16:34, Aneesh Kumar K.V a écrit : Currently, our mm_context_t on book3s64 include all hash specific context details like slice mask, subpage protection details. We can skip allocating those on radix. This will help us to save 8K per

Re: [PATCH stable v4.14 00/32] powerpc spectre backports for 4.14

2019-04-02 Thread Greg KH
On Tue, Apr 02, 2019 at 03:21:09PM +, Diana Madalina Craciun wrote: > On 3/31/2019 12:53 PM, Michael Ellerman wrote: > > Greg KH writes: > >> On Fri, Mar 29, 2019 at 03:51:16PM +0100, Greg KH wrote: > >>> On Fri, Mar 29, 2019 at 10:25:48PM +1100, Michael Ellerman wrote: > -BEGIN PGP

[RFC PATCH] powerpc/mm: Reduce memory usage for mm_context_t for radix

2019-04-02 Thread Aneesh Kumar K.V
Currently, our mm_context_t on book3s64 include all hash specific context details like slice mask, subpage protection details. We can skip allocating those on radix. This will help us to save 8K per mm_context with radix translation. With the patch applied we have sizeof(mm_context_t) = 136

Re: [PATCH stable v4.14 00/32] powerpc spectre backports for 4.14

2019-04-02 Thread Diana Madalina Craciun
On 3/31/2019 12:53 PM, Michael Ellerman wrote: > Greg KH writes: >> On Fri, Mar 29, 2019 at 03:51:16PM +0100, Greg KH wrote: >>> On Fri, Mar 29, 2019 at 10:25:48PM +1100, Michael Ellerman wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Greg, Please queue up these powerpc patches

VLC doesn't play videos anymore since the PowerPC fixes 5.1-3

2019-04-02 Thread Christian Zigotzky
Hi All, I figured out, that the VLC player doesn't play videos anymore since the PowerPC fixes 5.1-3 [1]. VLC plays videos with the RC1 of kernel 5.1 without any problems. VLC error messages: [100ea580] ts demux warning: first packet for pid=1104 cc=0xe [100ea580] ts demux warning: first

[PATCH 3.16 92/99] block/swim3: Fix -EBUSY error when re-opening device after unmount

2019-04-02 Thread Ben Hutchings
3.16.65-rc1 review patch. If anyone has any objections, please let me know. -- From: Finn Thain commit 296dcc40f2f2e402facf7cd26cf3f2c8f4b17d47 upstream. When the block device is opened with FMODE_EXCL, ref_count is set to -1. This value doesn't get reset when the device is

Re: [PATCH v2] mm: Fix modifying of page protection by insert_pfn_pmd()

2019-04-02 Thread Jan Kara
On Tue 02-04-19 17:21:25, Aneesh Kumar K.V wrote: > With some architectures like ppc64, set_pmd_at() cannot cope with > a situation where there is already some (different) valid entry present. > > Use pmdp_set_access_flags() instead to modify the pfn which is built to > deal with modifying

Re: powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations

2019-04-02 Thread Aneesh Kumar K.V
Michael Ellerman writes: > Ben Hutchings writes: >> On Mon, 2019-03-25 at 01:03 +0100, Andreas Schwab wrote: >>> On Mär 24 2019, Ben Hutchings wrote: >>> >>> > Presumably you have CONFIG_PPC_BOOK3S_64 enabled and >>> > CONFIG_SPARSEMEM >>> > disabled? Was this configuration actually usable?

Re: [RFC PATCH v2 3/3] kasan: add interceptors for all string functions

2019-04-02 Thread Christophe Leroy
Le 02/04/2019 à 14:58, Dmitry Vyukov a écrit : On Tue, Apr 2, 2019 at 11:43 AM Christophe Leroy wrote: Hi Dmitry, Andrey and others, Do you have any comments to this series ? I'd like to know if this approach is ok or if it is better to keep doing as in

Re: [RFC PATCH] powerpc/mm: Reduce memory usage for mm_context_t for radix

2019-04-02 Thread Christophe Leroy
Le 02/04/2019 à 16:34, Aneesh Kumar K.V a écrit : Currently, our mm_context_t on book3s64 include all hash specific context details like slice mask, subpage protection details. We can skip allocating those on radix. This will help us to save 8K per mm_context with radix translation. With the

[PATCH 3/4] powerpc/powernv: Detect the secure boot mode of the system

2019-04-02 Thread Claudio Carvalho
From: Nayna Jain PowerNV secure boot defines different IMA policies based on the secure boot state of the system. This patch defines a function to detect the secure boot state of the system. Signed-off-by: Nayna Jain --- arch/powerpc/include/asm/secboot.h | 21 +

Re: [PATCH] ASoC: fsl_esai: Support synchronous mode

2019-04-02 Thread Nicolin Chen
> > On Mon, Apr 01, 2019 at 11:39:10AM +, S.j. Wang wrote: > > > In ESAI synchronous mode, the clock is generated by Tx, So we should > > > always set registers of Tx which relate with the bit clock and frame > > > clock generation (TCCR, TCR, ECR), even there is only Rx is working. > > > > >

[PATCH 1/4] powerpc/include: Override unneeded early ioremap functions

2019-04-02 Thread Claudio Carvalho
When CONFIG_EFI is enabled, the EFI driver includes the generic early_ioremap header, which assumes that architectures may want to provide their own early ioremap functions. This patch overrides the ioremap functions in powerpc because they are not required for secure boot on powerpc systems.

Re: [RFC PATCH] powerpc/mm: Reduce memory usage for mm_context_t for radix

2019-04-02 Thread Christophe Leroy
Le 02/04/2019 à 20:31, Christophe Leroy a écrit : Le 02/04/2019 à 16:34, Aneesh Kumar K.V a écrit : Currently, our mm_context_t on book3s64 include all hash specific context details like slice mask, subpage protection details. We can skip allocating those on radix. This will help us to

Re: [RFC PATCH v2 3/3] kasan: add interceptors for all string functions

2019-04-02 Thread Andrey Ryabinin
On 4/2/19 12:43 PM, Christophe Leroy wrote: > Hi Dmitry, Andrey and others, > > Do you have any comments to this series ? > I don't see justification for adding all these non-instrumented functions. We need only some subset of these functions and only on powerpc so far. Arches that don't

[PATCH 4/4] powerpc: Add support to initialize ima policy rules

2019-04-02 Thread Claudio Carvalho
From: Nayna Jain PowerNV secure boot relies on the kernel IMA security subsystem to perform the OS kernel image signature verification. Since each secure boot mode has different IMA policy requirements, dynamic definition of the policy rules based on the runtime secure boot mode of the system is

Re: [RFC PATCH] powerpc/mm: Reduce memory usage for mm_context_t for radix

2019-04-02 Thread Christophe Leroy
Le 02/04/2019 à 17:42, Aneesh Kumar K.V a écrit : On 4/2/19 9:06 PM, Christophe Leroy wrote: Le 02/04/2019 à 16:34, Aneesh Kumar K.V a écrit : Currently, our mm_context_t on book3s64 include all hash specific context details like slice mask, subpage protection details. We can skip

Re: [RFC PATCH] powerpc/mm: Reduce memory usage for mm_context_t for radix

2019-04-02 Thread Christophe Leroy
Le 02/04/2019 à 16:34, Aneesh Kumar K.V a écrit : Currently, our mm_context_t on book3s64 include all hash specific context details like slice mask, subpage protection details. We can skip allocating those on radix. This will help us to save 8K per mm_context with radix translation. With the

[PATCH 2/4] powerpc/powernv: Add support for OPAL secure variables

2019-04-02 Thread Claudio Carvalho
The X.509 certificates trusted by the platform and other information required to secure boot the host OS kernel are wrapped in secure variables, which are controlled by OPAL. The OPAL secure variables can be handled through the following OPAL calls. OPAL_SECVAR_GET: Returns the data for a given

[PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-02 Thread Claudio Carvalho
This patch set is part of a series that implements secure boot on PowerNV systems. In order to verify the OS kernel on PowerNV, secure boot requires X.509 certificates trusted by the platform, the secure boot modes, and several other pieces of information. These are stored in secure variables

Re: [PATCH 2/5] powerpc: module_[32|64].c: replace swap function with built-in one

2019-04-02 Thread Andrey Abramov
01.04.2019, 13:11, "Michael Ellerman" : > This looks OK. It's a bit of a pity to replace the 8-byte-at-a-time copy > with a byte-at-a-time copy, but I suspect it's insignificant compared to > the overhead of calling the comparison and swap functions. > > And we could always add a generic

[PATCH v3 2/5] powerpc: module_[32|64].c: replace swap function with built-in one

2019-04-02 Thread Andrey Abramov
Replace relaswap with built-in one, because relaswap does a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized" custom swap function is now a waste of time as well

[PATCH 5/6] powerpc/mmu: drop mmap_sem now that locked_vm is atomic

2019-04-02 Thread Daniel Jordan
With locked_vm now an atomic, there is no need to take mmap_sem as writer. Delete and refactor accordingly. Signed-off-by: Daniel Jordan Cc: Alexey Kardashevskiy Cc: Andrew Morton Cc: Benjamin Herrenschmidt Cc: Christoph Lameter Cc: Davidlohr Bueso Cc: Michael Ellerman Cc: Paul Mackerras

Re: [PATCH v1 2/4] soc/fsl/guts: Add definition for LX2160A

2019-04-02 Thread Li Yang
On Tue, Feb 26, 2019 at 4:12 AM Vabhav Sharma wrote: > > Adding compatible string "lx2160a-dcfg" to > initialize guts driver for lx2160 and SoC die > attribute definition for LX2160A Applied to branch next. Thanks. Regards, Leo > > Signed-off-by: Vabhav Sharma > Signed-off-by: Yinbo Zhu >

Re: [RFC PATCH v2 3/3] kasan: add interceptors for all string functions

2019-04-02 Thread Christophe Leroy
Le 02/04/2019 à 18:14, Andrey Ryabinin a écrit : On 4/2/19 12:43 PM, Christophe Leroy wrote: Hi Dmitry, Andrey and others, Do you have any comments to this series ? I don't see justification for adding all these non-instrumented functions. We need only some subset of these functions

[PATCH 1/6] mm: change locked_vm's type from unsigned long to atomic64_t

2019-04-02 Thread Daniel Jordan
Taking and dropping mmap_sem to modify a single counter, locked_vm, is overkill when the counter could be synchronized separately. Make mmap_sem a little less coarse by changing locked_vm to an atomic, the 64-bit variety to avoid issues with overflow on 32-bit systems. Signed-off-by: Daniel

[PATCH] powerpc: config: skiroot: Add (back) MLX5 ethernet support

2019-04-02 Thread Joel Stanley
It turns out that some defconfig changes and kernel config option changes meant we accidentally dropped Ethernet support for Mellanox CLX5 cards. Reported-by: Carol L Soto Suggested-by: Carol L Soto Signed-off-by: Stewart Smith Signed-off-by: Joel Stanley ---

[PATCH v3 1/5] arch/arc: unwind.c: replace swap function with built-in one

2019-04-02 Thread Andrey Abramov
Replace swap_eh_frame_hdr_table_entries with built-in one, because swap_eh_frame_hdr_table_entries does a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized"

[PATCH v3 5/5] Lib: sort.h: remove the size argument from the swap function

2019-04-02 Thread Andrey Abramov
Removes size argument from the swap function because: 1) It wasn't used. 2) Custom swap function knows what kind of objects it swaps, so it already knows their sizes. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- arch/x86/kernel/unwind_orc.c | 2

[PATCH v3 0/5] simple sort swap function improvements

2019-04-02 Thread Andrey Abramov
This is the logical continuation of the "lib/sort & lib/list_sort: faster and smaller" series by George Spelvin (added to linux-next recently). Since Spectre mitigations have made indirect function calls more expensive, and the previous patch series implements the default simple byte copies

[PATCH v3 4/5] ubifs: find.c: replace swap function with built-in one

2019-04-02 Thread Andrey Abramov
Replace swap_dirty_idx function with built-in one, because swap_dirty_idx does only a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized" custom swap function is

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-02 Thread Claudio Carvalho
On 4/2/19 4:36 PM, Matthew Garrett wrote: > On Tue, Apr 2, 2019 at 11:15 AM Claudio Carvalho > wrote: >> 1. Enable efivarfs by selecting CONFIG_EFI in the CONFIG_OPAL_SECVAR >>introduced in this patch set. With CONFIG_EFIVAR_FS, userspace tools can >>be used to manage the secure

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-02 Thread Matthew Garrett
On Tue, Apr 2, 2019 at 2:11 PM Claudio Carvalho wrote: > We want to use the efivarfs for compatibility with existing userspace > tools. We will track and match any EFI changes that affect us. So you implement the full PK/KEK/db/dbx/dbt infrastructure, and updates are signed in the same way? >

Re: [PATCH] soc/fsl/qe: Fix an error code in qe_pin_request()

2019-04-02 Thread Li Yang
On Thu, Mar 28, 2019 at 9:21 AM Dan Carpenter wrote: > > We forgot to set "err" on this error path. > > Fixes: 1a2d397a6eb5 ("gpio/powerpc: Eliminate duplication of > of_get_named_gpio_flags()") > Signed-off-by: Dan Carpenter Applied to fix branch. Thanks. Regards, Leo > --- >

Re: [PATCH 0/4] Enabling secure boot on PowerNV systems

2019-04-02 Thread Claudio Carvalho
On 4/2/19 6:51 PM, Matthew Garrett wrote: > On Tue, Apr 2, 2019 at 2:11 PM Claudio Carvalho > wrote: >> We want to use the efivarfs for compatibility with existing userspace >> tools. We will track and match any EFI changes that affect us. > So you implement the full PK/KEK/db/dbx/dbt

Re: [PATCH 1/6] mm: change locked_vm's type from unsigned long to atomic64_t

2019-04-02 Thread Davidlohr Bueso
On Tue, 02 Apr 2019, Andrew Morton wrote: Also, we didn't remove any down_write(mmap_sem)s from core code so I'm thinking that the benefit of removing a few mmap_sem-takings from a few obscure drivers (sorry ;)) is pretty small. afaik porting the remaining incorrect users of locked_vm to

[PATCH v3 3/5] ocfs2: dir, refcounttree, xattr: replace swap functions with built-in one

2019-04-02 Thread Andrey Abramov
Replace dx_leaf_sort_swap, swap_refcount_rec and swap_xe functions with built-in one, because they do only a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized"

Re: [PATCH stable v4.14 13/32] powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E

2019-04-02 Thread Michael Ellerman
Joakim Tjernlund writes: > On Tue, 2019-04-02 at 17:19 +1100, Michael Ellerman wrote: >> Joakim Tjernlund writes: ... >> >> > Can I compile it away? >> >> You can't actually, but you can disable it at runtime with >> "nospectre_v1" on the kernel command line. >> >> We could make it a user

[PATCH 6/6] kvm/book3s: drop mmap_sem now that locked_vm is atomic

2019-04-02 Thread Daniel Jordan
With locked_vm now an atomic, there is no need to take mmap_sem as writer. Delete and refactor accordingly. Signed-off-by: Daniel Jordan Cc: Alexey Kardashevskiy Cc: Andrew Morton Cc: Benjamin Herrenschmidt Cc: Christoph Lameter Cc: Davidlohr Bueso Cc: Michael Ellerman Cc: Paul Mackerras

Re: [PATCH 1/6] mm: change locked_vm's type from unsigned long to atomic64_t

2019-04-02 Thread Andrew Morton
On Tue, 2 Apr 2019 16:41:53 -0400 Daniel Jordan wrote: > Taking and dropping mmap_sem to modify a single counter, locked_vm, is > overkill when the counter could be synchronized separately. > > Make mmap_sem a little less coarse by changing locked_vm to an atomic, > the 64-bit variety to

[PATCH 0/6] convert locked_vm from unsigned long to atomic64_t

2019-04-02 Thread Daniel Jordan
Hi, >From patch 1: Taking and dropping mmap_sem to modify a single counter, locked_vm, is overkill when the counter could be synchronized separately. Make mmap_sem a little less coarse by changing locked_vm to an atomic, the 64-bit variety to avoid issues with overflow on 32-bit

Re: [PATCH 2/2] arch: add pidfd and io_uring syscalls everywhere

2019-04-02 Thread Michael Ellerman
Arnd Bergmann writes: > On Sun, Mar 31, 2019 at 5:47 PM Michael Ellerman wrote: >> >> Arnd Bergmann writes: >> > Add the io_uring and pidfd_send_signal system calls to all architectures. >> > >> > These system calls are designed to handle both native and compat tasks, >> > so all entries are

Re: [PATCH 2/2] arch: add pidfd and io_uring syscalls everywhere

2019-04-02 Thread Michael Ellerman
Arnd Bergmann writes: > diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl > b/arch/powerpc/kernel/syscalls/syscall.tbl > index b18abb0c3dae..00f5a63c8d9a 100644 > --- a/arch/powerpc/kernel/syscalls/syscall.tbl > +++ b/arch/powerpc/kernel/syscalls/syscall.tbl > @@ -505,3 +505,7 @@ > 421 32

Re: [PATCH 1/6] mm: change locked_vm's type from unsigned long to atomic64_t

2019-04-02 Thread Christophe Leroy
Le 02/04/2019 à 22:41, Daniel Jordan a écrit : Taking and dropping mmap_sem to modify a single counter, locked_vm, is overkill when the counter could be synchronized separately. Make mmap_sem a little less coarse by changing locked_vm to an atomic, the 64-bit variety to avoid issues with

[PATCH kernel v2 1/2] powerpc/mm_iommu: Fix potential deadlock

2019-04-02 Thread Alexey Kardashevskiy
Currently mm_iommu_do_alloc() is called in 2 cases: - VFIO_IOMMU_SPAPR_REGISTER_MEMORY ioctl() for normal memory: this locks _list_mutex and then locks mm::mmap_sem several times when adjusting locked_vm or pinning pages; - vfio_pci_nvgpu_regops::mmap() for GPU memory: this

Re: [PATCH] powerpc/xmon: add read-only mode

2019-04-02 Thread Christophe Leroy
Le 03/04/2019 à 05:38, Christopher M Riedl a écrit : On March 29, 2019 at 3:41 AM Christophe Leroy wrote: Le 29/03/2019 à 05:21, cmr a écrit : Operations which write to memory should be restricted on secure systems and optionally to avoid self-destructive behaviors. Add a config

Re: [PATCH stable v4.14 13/32] powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E

2019-04-02 Thread Joakim Tjernlund
On Wed, 2019-04-03 at 11:53 +1100, Michael Ellerman wrote: > > Joakim Tjernlund writes: > > On Tue, 2019-04-02 at 17:19 +1100, Michael Ellerman wrote: > > > Joakim Tjernlund writes: > ... > > > > Can I compile it away? > > > > > > You can't actually, but you can disable it at runtime with > >

[PATCH kernel v2 2/2] powerpc/mm_iommu: Allow pinning large regions

2019-04-02 Thread Alexey Kardashevskiy
When called with vmas_arg==NULL, get_user_pages_longterm() allocates an array of nr_pages*8 which can easily get greater that the max order, for example, registering memory for a 256GB guest does this and fails in __alloc_pages_nodemask(). This adds a loop over chunks of entries to fit the max

Re: [PATCH] powerpc/watchdog: Use hrtimers for per-CPU heartbeat

2019-04-02 Thread Ravi Bangoria
On 4/2/19 4:55 PM, Nicholas Piggin wrote: > Using a jiffies timer creates a dependency on the tick_do_timer_cpu > incrementing jiffies. If that CPU has locked up and jiffies is not > incrementing, the watchdog heartbeat timer for all CPUs stops and > creates false positives and confusing

Re: [PATCH] powerpc/xmon: add read-only mode

2019-04-02 Thread Christopher M Riedl
> On March 29, 2019 at 3:41 AM Christophe Leroy wrote: > > > > > Le 29/03/2019 à 05:21, cmr a écrit : > > Operations which write to memory should be restricted on secure systems > > and optionally to avoid self-destructive behaviors. > > > > Add a config option, XMON_RO, to control default

VLC doesn't play videos anymore since the PowerPC fixes 5.1-3

2019-04-02 Thread Christian Zigotzky
Please test VLC with the RC3 of kernel 5.1. The removing of the PowerPC fixes 5.1-3 has solved the VLC issue. Another user has already confirmed that [1]. This isn’t an April Fool‘s. ;-) Thanks [1] http://forum.hyperion-entertainment.com/viewtopic.php?f=58=4256=20#p47561

Re: VLC doesn't play videos anymore since the PowerPC fixes 5.1-3

2019-04-02 Thread Christophe Leroy
Le 03/04/2019 à 05:52, Christian Zigotzky a écrit : Please test VLC with the RC3 of kernel 5.1. The removing of the PowerPC fixes 5.1-3 has solved the VLC issue. Another user has already confirmed that [1]. This isn’t an April Fool‘s. ;-) Could you bisect to identify the guilty commit ?

[PATCH kernel v2 0/2] powerpc/mm_iommu: Fixes

2019-04-02 Thread Alexey Kardashevskiy
The patches do independent things but touch exact same code so the order in which they should apply matters. This supercedes: [PATCH kernel] powerpc/mm_iommu: Allow pinning large regions [PATCH kernel 1/2] powerpc/mm_iommu: Prepare for less locking [PATCH kernel 2/2] powerpc/mm_iommu: Fix

Re: [PATCH 5/6] powerpc/mmu: drop mmap_sem now that locked_vm is atomic

2019-04-02 Thread Christophe Leroy
Le 02/04/2019 à 22:41, Daniel Jordan a écrit : With locked_vm now an atomic, there is no need to take mmap_sem as writer. Delete and refactor accordingly. Could you please detail the change ? It looks like this is not the only change. I'm wondering what the consequences are. Before we