Re: [PATCH] powerpc: Remove inaccessible CMDLINE default

2019-08-01 Thread Christophe Leroy
Le 02/08/2019 à 07:02, Chris Packham a écrit : Since commit cbe46bd4f510 ("powerpc: remove CONFIG_CMDLINE #ifdef mess") CONFIG_CMDLINE has always had a value regardless of CONNIG_CMDLINE_BOOL. s/CONNIG/CONFIG/ For example: $ make ARCH=powerpc defconfig $ cat .config #

[PATCH] powerpc: Remove inaccessible CMDLINE default

2019-08-01 Thread Chris Packham
Since commit cbe46bd4f510 ("powerpc: remove CONFIG_CMDLINE #ifdef mess") CONFIG_CMDLINE has always had a value regardless of CONNIG_CMDLINE_BOOL. For example: $ make ARCH=powerpc defconfig $ cat .config # CONFIG_CMDLINE_BOOL is not set CONFIG_CMDLINE="" When enabling CONNIG_CMDLINE_BOOL

Re: [PATCH] hwrng: Use device-managed registration API

2019-08-01 Thread Herbert Xu
On Thu, Jul 25, 2019 at 04:01:55PM +0800, Chuhong Yuan wrote: > Use devm_hwrng_register to simplify the implementation. > Manual unregistration and some remove functions can be > removed now. > > Signed-off-by: Chuhong Yuan > --- > drivers/char/hw_random/atmel-rng.c | 3 +-- >

Re: [PATCH v2] crypto: nx: nx-842-powernv: Add of_node_put() before return

2019-08-01 Thread Herbert Xu
On Wed, Jul 24, 2019 at 01:24:33PM +0530, Nishka Dasgupta wrote: > Each iteration of for_each_compatible_node puts the previous node, but > in the case of a return from the middle of the loop, there is no put, > thus causing a memory leak. Add an of_node_put before the return. > Issue found with

Re: [PATCH v3] powerpc: Support CMDLINE_EXTEND

2019-08-01 Thread Christophe Leroy
Le 02/08/2019 à 00:50, Chris Packham a écrit : Bring powerpc in line with other architectures that support extending or overriding the bootloader provided command line. The current behaviour is most like CMDLINE_FROM_BOOTLOADER where the bootloader command line is preferred but the kernel

Re: [PATCH v2] powerpc: Support CMDLINE_EXTEND

2019-08-01 Thread Christophe Leroy
Le 02/08/2019 à 00:32, Chris Packham a écrit : On Thu, 2019-08-01 at 08:14 +0200, Christophe Leroy wrote: Le 01/08/2019 à 04:12, Chris Packham a écrit : Bring powerpc in line with other architectures that support extending or overriding the bootloader provided command line. The current

[PATCH v2 3/3] powerpc/spinlocks: Fix oops in shared-processor spinlocks

2019-08-01 Thread Christopher M. Riedl
Booting w/ ppc64le_defconfig + CONFIG_PREEMPT results in the attached kernel trace due to calling shared-processor spinlocks while not running in an SPLPAR. Previously, the out-of-line spinlocks implementations were selected based on CONFIG_PPC_SPLPAR at compile time without a runtime

[PATCH v2 1/3] powerpc/spinlocks: Refactor SHARED_PROCESSOR

2019-08-01 Thread Christopher M. Riedl
Determining if a processor is in shared processor mode is not a constant so don't hide it behind a #define. Signed-off-by: Christopher M. Riedl Reviewed-by: Andrew Donnellan --- arch/powerpc/include/asm/spinlock.h | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-)

[PATCH v2 2/3] powerpc/spinlocks: Rename SPLPAR-only spinlocks

2019-08-01 Thread Christopher M. Riedl
The __rw_yield and __spin_yield locks only pertain to SPLPAR mode. Rename them to make this relationship obvious. Signed-off-by: Christopher M. Riedl Reviewed-by: Andrew Donnellan --- arch/powerpc/include/asm/spinlock.h | 6 -- arch/powerpc/lib/locks.c| 6 +++--- 2 files

[PATCH v2 0/3] Fix oops in shared-processor spinlocks

2019-08-01 Thread Christopher M. Riedl
Fixes an oops when calling the shared-processor spinlock implementation from a non-SP LPAR. Also take this opportunity to refactor SHARED_PROCESSOR a bit. Reference: https://github.com/linuxppc/issues/issues/229 Changes since v1: - Improve comment wording to make it clear why the BOOK3S #ifdef

Re: [PATCH] powerpc/kasan: fix early boot failure on PPC32

2019-08-01 Thread Michael Ellerman
On Wed, 2019-07-31 at 06:01:42 UTC, Christophe Leroy wrote: > Due to commit 4a6d8cf90017 ("powerpc/mm: don't use pte_alloc_kernel() > until slab is available on PPC32"), pte_alloc_kernel() cannot be used > during early KASAN init. > > Fix it by using memblock_alloc() instead. > > Reported-by:

Re: [PATCH] powerpc/spe: Mark expected switch fall-throughs

2019-08-01 Thread Michael Ellerman
On Tue, 2019-07-30 at 14:19:17 UTC, Michael Ellerman wrote: > Mark switch cases where we are expecting to fall through. > > Fixes errors such as below, seen with mpc85xx_defconfig: > > arch/powerpc/kernel/align.c: In function 'emulate_spe': > arch/powerpc/kernel/align.c:178:8: error: this

Re: [PATCH] drivers/macintosh/smu.c: Mark expected switch fall-through

2019-08-01 Thread Michael Ellerman
On Tue, 2019-07-30 at 04:37:04 UTC, Stephen Rothwell wrote: > Mark switch cases where we are expecting to fall through. > > This patch fixes the following warning (Building: powerpc): > > drivers/macintosh/smu.c: In function 'smu_queue_i2c': > drivers/macintosh/smu.c:854:21: warning: this

Re: [PATCH v3 00/10] implement KASLR for powerpc/fsl_booke/32

2019-08-01 Thread Jason Yan
On 2019/8/1 22:36, Diana Madalina Craciun wrote: Hi Jason, I have tested these series on a P4080 platform. Regards, Diana Diana, thank you so much. So can you take a look at the code of this version and give a Reviewed-by or Tested-by? Thanks, Jason

Re: [PATCH] powerpc/xive: Update comment referencing magic loads from an ESB

2019-08-01 Thread Stewart Smith
Jordan Niethe writes: > The comment above xive_esb_read() references magic loads from an ESB as > described xive.h. This has been inaccurate since commit 12c1f339cd49 > ("powerpc/xive: Move definition of ESB bits") which moved the > description. Update the comment to reference the new location of

Re: [PATCH v2] PCI: rpaphp: Avoid a sometimes-uninitialized warning

2019-08-01 Thread Bjorn Helgaas
On Mon, Jul 22, 2019 at 02:05:12PM +1000, Michael Ellerman wrote: > Nathan Chancellor writes: > > On Mon, Jun 03, 2019 at 03:11:58PM -0700, Nathan Chancellor wrote: > >> When building with -Wsometimes-uninitialized, clang warns: > >> > >> drivers/pci/hotplug/rpaphp_core.c:243:14: warning:

[PATCH] powerpc/xive: Update comment referencing magic loads from an ESB

2019-08-01 Thread Jordan Niethe
The comment above xive_esb_read() references magic loads from an ESB as described xive.h. This has been inaccurate since commit 12c1f339cd49 ("powerpc/xive: Move definition of ESB bits") which moved the description. Update the comment to reference the new location of the description in xive-regs.h

[PATCH 1/1] pseries/hotplug-memory.c: Change rc variable to bool

2019-08-01 Thread Leonardo Bras
Changes the return variable to bool (as the return value) and avoids doing a ternary operation before returning. Also, since rc will always be true, there is no need to do rc &= bool, as (true && X) will result in X. Signed-off-by: Leonardo Bras ---

[PATCH 1/1] pseries/hotplug-memory.c: Replace nested ifs by switch-case

2019-08-01 Thread Leonardo Bras
I noticed these nested ifs can be easily replaced by switch-cases, which can improve readability. Signed-off-by: Leonardo Bras --- .../platforms/pseries/hotplug-memory.c| 26 +-- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git

[PATCH v3] powerpc: Support CMDLINE_EXTEND

2019-08-01 Thread Chris Packham
Bring powerpc in line with other architectures that support extending or overriding the bootloader provided command line. The current behaviour is most like CMDLINE_FROM_BOOTLOADER where the bootloader command line is preferred but the kernel config can provide a fallback so

Re: [PATCH v2] powerpc: Support CMDLINE_EXTEND

2019-08-01 Thread Chris Packham
On Thu, 2019-08-01 at 08:14 +0200, Christophe Leroy wrote: > > Le 01/08/2019 à 04:12, Chris Packham a écrit : > > > > Bring powerpc in line with other architectures that support > > extending or > > overriding the bootloader provided command line. > > > > The current behaviour is most like

[PATCH v3 7/7] soc/fsl/qbman: Update device tree with reserved memory

2019-08-01 Thread Roy Pledge
When using the reserved memory node in the device tree there are two options - dynamic or static. If a dynamic allocation was selected (where the kernel selects the address for the allocation) convert it to a static allocation by inserting the reg property. This will ensure the same memory is

[PATCH v3 6/7] soc/fsl/qbman: Fixup qman_shutdown_fq()

2019-08-01 Thread Roy Pledge
When shutting down a FQ on a dedicated channel only the SW portal associated with that channel can dequeue from it. Make sure the correct portal is use. Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/qman.c | 53 +++- 1 file changed, 42

[PATCH v3 5/7] soc/fsl/qbman: Disable interrupts during portal recovery

2019-08-01 Thread Roy Pledge
Disable the QBMan interrupts during recovery. Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/qman.c | 22 +++--- drivers/soc/fsl/qbman/qman_ccsr.c | 1 + drivers/soc/fsl/qbman/qman_priv.h | 1 + 3 files changed, 21 insertions(+), 3 deletions(-) diff --git

[PATCH v3 4/7] soc/fsl/qbman: Fix drain_mr_fqni()

2019-08-01 Thread Roy Pledge
The drain_mr_fqni() function may be called fron uninterruptable context so convert the msleep() to an mdelay(). Also ensure that the valid bit is updated while polling. Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/qman.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH v3 3/7] soc/fsl/qbman: Cleanup QMan queues if device was already initialized

2019-08-01 Thread Roy Pledge
If the QMan device was previously initialized make sure all the frame queues are out of service once all the portals are probed. This handles the case where the kernel is restarted without the SoC being reset (kexec for example) Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/qman.c

[PATCH v3 2/7] soc/fsl/qbman: Cleanup buffer pools if BMan was initialized prior to bootup

2019-08-01 Thread Roy Pledge
Clean the BMan buffer pools if the device had been initialized previously. This will ensure a consistent state if the kernel was soft restarted (kexec for example) Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/bman.c| 17 + drivers/soc/fsl/qbman/bman_ccsr.c | 10

[PATCH v3 1/7] soc/fsl/qbman: Rework QBMan private memory setup

2019-08-01 Thread Roy Pledge
Rework QBMan private memory setup so that the areas are not zeroed if the device was previously initialized If the QMan private memory was already initialized skip the PFDR initialization. Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/bman_ccsr.c | 26 +--

[PATCH v3 0/7] soc/fsl/qbman: Enable Kexec for DPAA1 devices

2019-08-01 Thread Roy Pledge
Most DPAA1 devices do not support a soft reset which is an issue if Kexec starts a new kernel. This patch series allows Kexec to function by detecting that the QBMan device was previously initialized. The patches fix some issues with device cleanup as well as ensuring that the location of the

Re: [PATCH] selftests/powerpc: Fix build failures with GCC 9

2019-08-01 Thread Segher Boessenkool
On Thu, Aug 01, 2019 at 10:26:28PM +1000, Michael Ellerman wrote: > GCC 9 fails to build some of the ptrace TM tests, with errors such as: > > ptrace-tm-spd-vsx.c: In function 'tm_spd_vsx': > ptrace-tm-spd-vsx.c:51:2: error: listing the stack pointer register 'r1' in > a clobber list is

Re: [PATCH] dma-mapping: fix page attributes for dma_mmap_*

2019-08-01 Thread Will Deacon
On Thu, Aug 01, 2019 at 06:34:57PM +0200, Christoph Hellwig wrote: > On Thu, Aug 01, 2019 at 05:23:06PM +0100, Will Deacon wrote: > > > - if (!dev_is_dma_coherent(dev) || (attrs & DMA_ATTR_WRITE_COMBINE)) > > > - return pgprot_writecombine(prot); > > > - return prot; > > > + return

Re: [PATCH] dma-mapping: fix page attributes for dma_mmap_*

2019-08-01 Thread Christoph Hellwig
On Thu, Aug 01, 2019 at 05:23:06PM +0100, Will Deacon wrote: > > - if (!dev_is_dma_coherent(dev) || (attrs & DMA_ATTR_WRITE_COMBINE)) > > - return pgprot_writecombine(prot); > > - return prot; > > + return pgprot_writecombine(prot); > > } > > Seems like a sensible cleanup to me:

Re: [PATCH] dma-mapping: fix page attributes for dma_mmap_*

2019-08-01 Thread Will Deacon
On Thu, Aug 01, 2019 at 05:21:18PM +0300, Christoph Hellwig wrote: > All the way back to introducing dma_common_mmap we've defaulyed to mark > the pages as uncached. But this is wrong for DMA coherent devices or > if using DMA_ATTR_NON_CONSISTENT. Later on DMA_ATTR_WRITE_COMBINE > also got

Re: [PATCH 6/8] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-08-01 Thread Nicolas Saenz Julienne
Hi Christoph, thanks for the review. On Thu, 2019-08-01 at 16:04 +0200, Christoph Hellwig wrote: > A few nitpicks, otherwise this looks great: > > > @@ -201,7 +202,7 @@ static int __init mark_nonram_nosave(void) > > * everything else. GFP_DMA32 page allocations automatically fall back to > >

Re: [PATCH v3 00/10] implement KASLR for powerpc/fsl_booke/32

2019-08-01 Thread Diana Madalina Craciun
Hi Jason, I have tested these series on a P4080 platform. Regards, Diana On 7/31/2019 12:26 PM, Jason Yan wrote: > This series implements KASLR for powerpc/fsl_booke/32, as a security > feature that deters exploit attempts relying on knowledge of the location > of kernel internals. > > Since

[PATCH] dma-mapping: fix page attributes for dma_mmap_*

2019-08-01 Thread Christoph Hellwig
All the way back to introducing dma_common_mmap we've defaulyed to mark the pages as uncached. But this is wrong for DMA coherent devices or if using DMA_ATTR_NON_CONSISTENT. Later on DMA_ATTR_WRITE_COMBINE also got incorrect treatment as that flag is only treated special on the alloc side for

fix default dma_mmap_* pgprot

2019-08-01 Thread Christoph Hellwig
Hi all, As Shawn pointed out we've had issues with the dma mmap pgprots ever since the dma_common_mmap helper was added beyong the initial architectures - we default to uncached mappings, but for devices that are DMA coherent, or if the DMA_ATTR_NON_CONSISTENT is set (and supported) this can lead

Re: [PATCH 6/8] dma-direct: turn ARCH_ZONE_DMA_BITS into a variable

2019-08-01 Thread Christoph Hellwig
A few nitpicks, otherwise this looks great: > @@ -201,7 +202,7 @@ static int __init mark_nonram_nosave(void) > * everything else. GFP_DMA32 page allocations automatically fall back to > * ZONE_DMA. > * > - * By using 31-bit unconditionally, we can exploit ARCH_ZONE_DMA_BITS to > + * By

[Bug 204371] BUG kmalloc-4k (Tainted: G W ): Object padding overwritten

2019-08-01 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204371 --- Comment #5 from Erhard F. (erhar...@mailbox.org) --- On Wed, 31 Jul 2019 12:09:54 + bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=204371 > > --- Comment #4 from m...@ellerman.id.au --- > > > I

[PATCH] selftests/powerpc: Fix build failures with GCC 9

2019-08-01 Thread Michael Ellerman
GCC 9 fails to build some of the ptrace TM tests, with errors such as: ptrace-tm-spd-vsx.c: In function 'tm_spd_vsx': ptrace-tm-spd-vsx.c:51:2: error: listing the stack pointer register 'r1' in a clobber list is deprecated [-Werror=deprecated] 51 | asm __volatile__( | ^~~

[Bug 204375] kernel 5.2.4 w. KASAN enabled fails to boot on a PowerMac G4 3,6 at very early stage

2019-08-01 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=204375 --- Comment #13 from Erhard F. (erhar...@mailbox.org) --- Thanks for the hint! But adding KASAN_SANITIZE := n to lib/mpi/Makefile did not make a change in this case. However I had the idea to disable btrfs (at all) and boot from my other ext4

Re: [PATCH] powerpc/xive: Add some error handling code to 'xive_spapr_init()'

2019-08-01 Thread Cédric Le Goater
On 01/08/2019 13:09, Christophe JAILLET wrote: > 'xive_irq_bitmap_add()' can return -ENOMEM. > In this case, we should free the memory already allocated and return > 'false' to the caller. > > Also add an error path which undoes the 'tima = ioremap(...)' > > Signed-off-by: Christophe JAILLET >

[PATCH] powerpc/mce: Schedule work from irq_work

2019-08-01 Thread Santosh Sivaraj
schedule_work() cannot be called from MCE exception context as MCE can interrupt even in interrupt disabled context. fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/mce.c | 8 +--- 1 file changed, 5 insertions(+), 3

[PATCH] powerpc/xive: Add some error handling code to 'xive_spapr_init()'

2019-08-01 Thread Christophe JAILLET
'xive_irq_bitmap_add()' can return -ENOMEM. In this case, we should free the memory already allocated and return 'false' to the caller. Also add an error path which undoes the 'tima = ioremap(...)' Signed-off-by: Christophe JAILLET --- NOT compile tested (I don't have a cross compiler and won't

Re: [PATCH 2/2] powerpc/xive: Add a check for memory allocation failure

2019-08-01 Thread Greg Kurz
On Thu, 1 Aug 2019 10:32:42 +0200 Christophe JAILLET wrote: > The result of this kzalloc is not checked. Add a check and corresponding > error handling code. > > Signed-off-by: Christophe JAILLET > --- Reviewed-by: Greg Kurz > Note that 'xive_irq_bitmap_add()' failures are not handled in >

Re: [PATCH 1/2] powerpc/xive: Use GFP_KERNEL instead of GFP_ATOMIC in 'xive_irq_bitmap_add()'

2019-08-01 Thread Greg Kurz
On Thu, 1 Aug 2019 10:32:31 +0200 Christophe JAILLET wrote: > There is no need to use GFP_ATOMIC here. GFP_KERNEL should be enough. > GFP_KERNEL is also already used for another allocation just a few lines > below. > > Signed-off-by: Christophe JAILLET > --- Good catch. Reviewed-by: Greg

Re: [PATCH] powerpc/powernv: Print helpful message when cores guarded

2019-08-01 Thread Cédric Le Goater
On 01/08/2019 07:16, Joel Stanley wrote: > Often the firmware will guard out cores after a crash. This often > undesirable, and is not immediately noticeable. > > This adds an informative message when a CPU device tree nodes are marked > bad in the device tree. > > Signed-off-by: Joel Stanley >

Re: [PATCH 1/2] powerpc/xive: Use GFP_KERNEL instead of GFP_ATOMIC in 'xive_irq_bitmap_add()'

2019-08-01 Thread Cédric Le Goater
On 01/08/2019 10:32, Christophe JAILLET wrote: > There is no need to use GFP_ATOMIC here. GFP_KERNEL should be enough. > GFP_KERNEL is also already used for another allocation just a few lines > below. This is correct. > Signed-off-by: Christophe JAILLET Reviewed-by: Cédric Le Goater

[PATCH 2/2] powerpc/xive: Add a check for memory allocation failure

2019-08-01 Thread Christophe JAILLET
The result of this kzalloc is not checked. Add a check and corresponding error handling code. Signed-off-by: Christophe JAILLET --- Note that 'xive_irq_bitmap_add()' failures are not handled in 'xive_spapr_init()' I guess that it is not really an issue. This function is _init, so if a memory

[PATCH 1/2] powerpc/xive: Use GFP_KERNEL instead of GFP_ATOMIC in 'xive_irq_bitmap_add()'

2019-08-01 Thread Christophe JAILLET
There is no need to use GFP_ATOMIC here. GFP_KERNEL should be enough. GFP_KERNEL is also already used for another allocation just a few lines below. Signed-off-by: Christophe JAILLET --- arch/powerpc/sysdev/xive/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 0/2] powerpc/xive: 2 small tweaks in 'xive_irq_bitmap_add()'

2019-08-01 Thread Christophe JAILLET
The first patch uses GFP_KERNEL instead of GFP_ATOMIC. The 2nd adds a check for memory allocation failure. Christophe JAILLET (2): powerpc/xive: Use GFP_KERNEL instead of GFP_ATOMIC in 'xive_irq_bitmap_add()' powerpc/xive: Add a check for memory allocation failure

Re: [PATCH v2] powerpc: Support CMDLINE_EXTEND

2019-08-01 Thread Christophe Leroy
Le 01/08/2019 à 04:12, Chris Packham a écrit : Bring powerpc in line with other architectures that support extending or overriding the bootloader provided command line. The current behaviour is most like CMDLINE_FROM_BOOTLOADER where the bootloader command line is preferred but the kernel