Re: [PATCH] powernv/opal: Handle OPAL_WRONG_STATE error from OPAL fails

2017-01-26 Thread Vipin K Parashar
OPAL returns OPAL_WRONG_STATE for XSCOM operations done to read any core FIR which is sleeping, offline. On Friday 27 January 2017 05:47 AM, Michael Ellerman wrote: Vipin K Parashar writes: Added check for OPAL_WRONG_STATE error code returned from OPAL. Currently Linux flashes "unexpected e

Re: [PATCH 3/3] powerpc: enable support for GCC plugins

2017-01-26 Thread Andrew Donnellan
On 27/01/17 16:52, Andrew Donnellan wrote: basic-block.h includes tm.h, and I don't believe we can remove that. I'm not convinced there's a way around this. Includes via function.h, I should say. -- Andrew Donnellan OzLabs, ADL Canberra andrew.donnel...@au1.ibm.com IBM Australia

Re: [PATCH 3/3] powerpc: enable support for GCC plugins

2017-01-26 Thread Andrew Donnellan
On 09/12/16 21:59, PaX Team wrote: the specific problem addressed here can (and IMHO should) be solved in another way: remove the inclusion of the offending headers in gcc-common.h as neither tm.h nor c-common.h are needed by existing plugins. for background, We can't build without tm.h: http:/

[PATCH] powerpc/64: CONFIG_RELOCATABLE support for hmi interrupts

2017-01-26 Thread Nicholas Piggin
The branch from hmi_exception_early to hmi_exception_realmode must use a "relocatable-style" branch, because it is branching from unrelocated exception code to beyond __end_interrupts. Signed-off-by: Nicholas Piggin --- This applies after the KVM RELOCATABLE series, and was split out from patch

Re: [PATCH 3/3] KVM: PPC: Book3S: 64-bit CONFIG_RELOCATABLE support for interrupts

2017-01-26 Thread Nicholas Piggin
On Fri, 27 Jan 2017 13:50:19 +1100 Paul Mackerras wrote: > On Thu, Dec 22, 2016 at 04:29:27AM +1000, Nicholas Piggin wrote: > > 64-bit Book3S exception handlers must find the dynamic kernel base > > to add to the target address when branching beyond __end_interrupts, > > in order to support kerne

Re: [PATCH v5 2/2] KVM: PPC: Exit guest upon MCE when FWNMI capability is enabled

2017-01-26 Thread Paul Mackerras
On Wed, Jan 18, 2017 at 11:19:26AM +0530, Mahesh Jagannath Salgaonkar wrote: > On 01/16/2017 10:05 AM, Paul Mackerras wrote: > > On Fri, Jan 13, 2017 at 04:51:45PM +0530, Aravinda Prasad wrote: [snip] > >>case BOOK3S_INTERRUPT_MACHINE_CHECK: > >> + /* Exit to guest with KVM_EXIT_NMI

Re: [PATCH 3/3] KVM: PPC: Book3S: 64-bit CONFIG_RELOCATABLE support for interrupts

2017-01-26 Thread Paul Mackerras
On Thu, Dec 22, 2016 at 04:29:27AM +1000, Nicholas Piggin wrote: > 64-bit Book3S exception handlers must find the dynamic kernel base > to add to the target address when branching beyond __end_interrupts, > in order to support kernel running at non-0 physical address. > > Support this in KVM by br

Re: [PATCH 2/3] KVM: PPC: Book3S: Move 64-bit KVM interrupt handler out from alt section

2017-01-26 Thread Paul Mackerras
On Thu, Dec 22, 2016 at 04:29:26AM +1000, Nicholas Piggin wrote: > A subsequent patch to make KVM handlers relocation-safe makes them > unusable from within alt section "else" cases (due to the way fixed > addresses are taken from within fixed section head code). > > Stop open-coding the KVM handl

Re: [PATCH 1/3] KVM: PPC: Book3S: Change interrupt call to reduce scratch space use on HV

2017-01-26 Thread Paul Mackerras
On Thu, Dec 22, 2016 at 04:29:25AM +1000, Nicholas Piggin wrote: > Change the calling convention to put the trap number together with > CR in two halves of r12, which frees up HSTATE_SCRATCH2 in the HV > handler. > > The 64-bit PR handler entry translates the calling convention back > to match the

Re: ibmvtpm byteswapping inconsistency

2017-01-26 Thread Benjamin Herrenschmidt
On Thu, 2017-01-26 at 17:42 -0800, Tyrel Datwyler wrote: > On 01/26/2017 12:22 PM, Michal Suchánek wrote: > > Hello, > > > > building ibmvtpm I noticed gcc warning complaining that second word > > of > > struct ibmvtpm_crq in tpm_ibmvtpm_suspend is uninitialized. > > > > The structure is defined

Re: ibmvtpm byteswapping inconsistency

2017-01-26 Thread Tyrel Datwyler
On 01/26/2017 12:22 PM, Michal Suchánek wrote: > Hello, > > building ibmvtpm I noticed gcc warning complaining that second word of > struct ibmvtpm_crq in tpm_ibmvtpm_suspend is uninitialized. > > The structure is defined as > > struct ibmvtpm_crq { > u8 valid; > u8 msg; >

Re: [v2] cxl: prevent read/write to AFU config space while AFU not configured

2017-01-26 Thread Andrew Donnellan
On 27/01/17 11:40, Michael Ellerman wrote: Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/14a3ae34bfd0bcb1cc12d55b06a858 Will fix the remaining locking issue in a follow up patch... -- Andrew Donnellan OzLabs, ADL Canberra andrew.donnel...@au1.ibm.com IBM Aust

Re: ibmvtpm byteswapping inconsistency

2017-01-26 Thread Ashley Lai
Adding Vicky from IBM. On 01/26/2017 04:05 PM, Jason Gunthorpe wrote: On Thu, Jan 26, 2017 at 09:22:48PM +0100, Michal Such??nek wrote: This is repeated a few times in the driver so I added memset to quiet gcc and make behavior deterministic in case the unused fields get some meaning in the f

Re: gcc trunk fails to build kernel on PowerPC64 due to oprofile warnings

2017-01-26 Thread William Cohen
On 01/25/2017 06:00 PM, Anton Blanchard wrote: > Hi, > > gcc trunk has failed to build PowerPC64 kernels for a month or so. The issue > is in oprofile, which is common code but ends up being sucked into > arch/powerpc and therefore subject to the -Werror applied to arch/powerpc: > > linux/arch/p

Re: powerpc/powernv/pci: Use kmalloc_array() in two functions

2017-01-26 Thread Michael Ellerman
On Wed, 2016-08-24 at 20:36:54 UTC, SF Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 24 Aug 2016 22:26:37 +0200 > > A multiplication for the size determination of a memory allocation > indicated that an array data structure should be processed. > Thus reuse the corresponding function

Re: powerpc/sstep: Return directly after a failed address_ok() in emulate_step()

2017-01-26 Thread Michael Ellerman
On Sat, 2017-01-21 at 14:45:19 UTC, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sat, 21 Jan 2017 15:30:15 +0100 > > * Return directly after a call of the function "address_ok" failed > in a case block. > > This issue was detected by using the Coccinelle software. > > * Delete tw

Re: powerpc/mm: Remove the debug hugepd_ok check

2017-01-26 Thread Michael Ellerman
On Wed, 2016-12-14 at 04:39:45 UTC, "Aneesh Kumar K.V" wrote: > We don't do this for other page table entries. So lets keep this simple > and always return false for hugepd check on a 64K page size config. > > Signed-off-by: Aneesh Kumar K.V Applied to powerpc next, thanks. https://git.kernel.o

Re: powerpc/mm: Return directly after a failed __copy_from_user() in sys_subpage_prot()

2017-01-26 Thread Michael Ellerman
On Sat, 2017-01-21 at 15:24:58 UTC, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sat, 21 Jan 2017 16:10:50 +0100 > > * Return directly after a call of the function "__copy_from_user" > failed here. > > This issue was detected by using the Coccinelle software. > > * Delete the jum

Re: powerpc: opal-msglog: Report size of memcons log

2017-01-26 Thread Michael Ellerman
On Fri, 2017-01-13 at 03:53:49 UTC, Joel Stanley wrote: > The OPAL memory console is reported to be size zero, as we do not > initialise the struct attr with any size information due to the size > being variable. This leads users to think that the console is empty. > > Instead report the maximum s

Re: powerpc/mm: Fixup wrong LPCR_VRMASD value

2017-01-26 Thread Michael Ellerman
On Thu, 2016-12-08 at 03:42:13 UTC, "Aneesh Kumar K.V" wrote: > In commit a4b349540a26af ("powerpc/mm: Cleanup LPCR defines") we updated > LPCR_VRMASD wrongly as below. > > -#define LPCR_VRMASD (0x1ful << (63-16)) > +#define LPCR_VRMASD_SH 47 > +#define LPCR_VRMASD (ASM_CONST

Re: powerpc/mm/4k: don't allocate larger pmd page table for 4k

2017-01-26 Thread Michael Ellerman
On Wed, 2017-01-04 at 02:49:12 UTC, "Aneesh Kumar K.V" wrote: > We now support THP with both 64k and 4K page size configuration > for radix. (hash only support THP with 64K page size). Hence we > will have CONFIG_TRANSPARENT_HUGEPAGE enabled for both PPC_64K > and PPC_4K config. Since we only need

Re: [v2] cxl: prevent read/write to AFU config space while AFU not configured

2017-01-26 Thread Michael Ellerman
On Fri, 2016-12-09 at 06:18:50 UTC, Andrew Donnellan wrote: > During EEH recovery, we deconfigure all AFUs whilst leaving the > corresponding vPHB and virtual PCI device in place. > > If something attempts to interact with the AFU's PCI config space (e.g. > running lspci) after the AFU has been de

Re: [RESEND] cxl: Force psl data-cache flush during device shutdown

2017-01-26 Thread Michael Ellerman
On Wed, 2017-01-04 at 06:18:52 UTC, Vaibhav Jain wrote: > This change adds a force psl data cache flush during device shutdown > callback. This should reduce a possibility of psl holding a dirty > cache line while the CAPP is being reinitialized, which may result in > a UE [load/store] machine chec

Re: cxl: drop unused header asm/pnv-pci.h

2017-01-26 Thread Michael Ellerman
On Thu, 2017-01-19 at 10:50:10 UTC, Greg Kurz wrote: > The kernel API does not use anything from this header file. > > Signed-off-by: Greg Kurz > Reviewed-by: Andrew Donnellan > Acked-by: Frederic Barrat Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/0e17166d377e74164e4067a

Re: [2/3] powerpc: bpf: flush the entire JIT buffer

2017-01-26 Thread Michael Ellerman
On Fri, 2017-01-13 at 17:10:01 UTC, "Naveen N. Rao" wrote: > With bpf_jit_binary_alloc(), we allocate at a page granularity and fill > the rest of the space with illegal instructions to mitigate BPF spraying > attacks, while having the actual JIT'ed BPF program at a random location > within the all

Re: [2/2] powerpc/64: Use optimized checksum routines on little-endian

2017-01-26 Thread Michael Ellerman
On Thu, 2016-11-03 at 05:15:42 UTC, Paul Mackerras wrote: > Currently we have optimized hand-coded assembly checksum routines > for big-endian 64-bit systems, but for little-endian we use the > generic C routines. This modifies the optimized routines to work > for little-endian. With this, we no

Re: [v2, 1/3] powerpc/kernel: Remove nested if statements in rtas_initialize()

2017-01-26 Thread Michael Ellerman
On Mon, 2017-01-23 at 22:49:52 UTC, Gavin Shan wrote: > This removes the unnecessary nested if statements in function > rtas_initialize(), to simplify the code. No functional changes > introduced. > > Signed-off-by: Gavin Shan Series applied to powerpc next, thanks. https://git.kernel.org/power

Re: [1/3] powerpc: bpf: remove redundant check for non-null image

2017-01-26 Thread Michael Ellerman
On Fri, 2017-01-13 at 17:10:00 UTC, "Naveen N. Rao" wrote: > From: Daniel Borkmann > > We have a check earlier to ensure we don't proceed if image is NULL. As > such, the redundant check can be removed. > > Signed-off-by: Daniel Borkmann > [Added similar changes for classic BPF JIT] > Signed-of

Re: [1/2] powerpc/64: Fix checksum folding in csum_tcpudp_nofold and ip_fast_csum_nofold

2017-01-26 Thread Michael Ellerman
On Thu, 2016-11-03 at 05:10:55 UTC, Paul Mackerras wrote: > These functions compute an IP checksum by computing a 64-bit sum and > folding it to 32 bits (the "nofold" in their names refers to folding > down to 16 bits). However, doing (u32) (s + (s >> 32)) is not > sufficient to fold a 64-bit sum

Re: powerpc: Ignore reserved field in DCSR and PVR reads and writes

2017-01-26 Thread Michael Ellerman
On Thu, 2017-01-19 at 03:19:10 UTC, Anton Blanchard wrote: > From: Anton Blanchard > > IBM bit 31 (for the rest of us - bit 0) is a reserved field in the > instruction definition of mtspr and mfspr. Hardware is encouraged to > (and does) ignore it. > > As a result, if userspace executes an mtspr

Re: powerpc: Add missing error check to prom_find_boot_cpu()

2017-01-26 Thread Michael Ellerman
On Mon, 2017-01-23 at 19:42:54 UTC, Darren Stevens wrote: > prom_init.c calls 'instance-to-package' twice, but the return > is not checked during prom_find_boot_cpu(). The result is then > passed to prom_getprop, which could be PROM_ERROR. > Add a return check to prevent this. > > This was found o

Re: [v2] powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe()

2017-01-26 Thread Michael Ellerman
On Wed, 2017-01-18 at 23:10:16 UTC, Gavin Shan wrote: > In __eeh_clear_pe_frozen_state(), we should pass the flag's value > instead of its address to eeh_unfreeze_pe(). The isolated flag is > cleared if no error returned from __eeh_clear_pe_frozen_state(). > We never observed the error from the fun

Re: [PATCH] powernv/opal: Handle OPAL_WRONG_STATE error from OPAL fails

2017-01-26 Thread Michael Ellerman
Vipin K Parashar writes: > Added check for OPAL_WRONG_STATE error code returned from OPAL. > Currently Linux flashes "unexpected error" over console for this > error. This will avoid throwing such message and return I/O error > for such OPAL failures. Why do we expect to get OPAL_WRONG_STATE ?

Re: ibmvtpm byteswapping inconsistency

2017-01-26 Thread Michal Suchanek
On 26 January 2017 at 23:05, Jason Gunthorpe wrote: > On Thu, Jan 26, 2017 at 09:22:48PM +0100, Michal Such??nek wrote: > >> This is repeated a few times in the driver so I added memset to quiet >> gcc and make behavior deterministic in case the unused fields get some >> meaning in the future. > >

Re: ibmvtpm byteswapping inconsistency

2017-01-26 Thread Jason Gunthorpe
On Thu, Jan 26, 2017 at 09:22:48PM +0100, Michal Such??nek wrote: > This is repeated a few times in the driver so I added memset to quiet > gcc and make behavior deterministic in case the unused fields get some > meaning in the future. Yep, reserved certainly needs to be zeroed.. Can you send a p

ibmvtpm byteswapping inconsistency

2017-01-26 Thread Michal Suchánek
Hello, building ibmvtpm I noticed gcc warning complaining that second word of struct ibmvtpm_crq in tpm_ibmvtpm_suspend is uninitialized. The structure is defined as struct ibmvtpm_crq { u8 valid; u8 msg; __be16 len; __be32 data; __be64 reserved; } __attr

Re: [PATCH net 1/5] ibmvnic: harden interrupt handler

2017-01-26 Thread Thomas Falcon
On 01/26/2017 12:28 PM, Stephen Hemminger wrote: > On Wed, 25 Jan 2017 15:02:19 -0600 > Thomas Falcon wrote: > >> static irqreturn_t ibmvnic_interrupt(int irq, void *instance) >> { >> struct ibmvnic_adapter *adapter = instance; >> +unsigned long flags; >> + >> +spin_lock_irqsave(&ad

Re: [PATCH net 1/5] ibmvnic: harden interrupt handler

2017-01-26 Thread Thomas Falcon
On 01/26/2017 11:56 AM, David Miller wrote: > From: Thomas Falcon > Date: Thu, 26 Jan 2017 10:44:22 -0600 > >> On 01/25/2017 10:04 PM, David Miller wrote: >>> From: Thomas Falcon >>> Date: Wed, 25 Jan 2017 15:02:19 -0600 >>> Move most interrupt handler processing into a tasklet, and int

Re: [PATCH net 1/5] ibmvnic: harden interrupt handler

2017-01-26 Thread Stephen Hemminger
On Wed, 25 Jan 2017 15:02:19 -0600 Thomas Falcon wrote: > static irqreturn_t ibmvnic_interrupt(int irq, void *instance) > { > struct ibmvnic_adapter *adapter = instance; > + unsigned long flags; > + > + spin_lock_irqsave(&adapter->crq.lock, flags); > + vio_disable_interrupts(a

Re: [PATCH v4 01/15] stacktrace/x86: add function for detecting reliable stack traces

2017-01-26 Thread Josh Poimboeuf
On Thu, Jan 26, 2017 at 02:56:03PM +0100, Petr Mladek wrote: > On Thu 2017-01-19 09:46:09, Josh Poimboeuf wrote: > > For live patching and possibly other use cases, a stack trace is only > > useful if it can be assured that it's completely reliable. Add a new > > save_stack_trace_tsk_reliable() fu

Re: [PATCH net 2/5] ibmvnic: Fix MTU settings

2017-01-26 Thread David Miller
From: Thomas Falcon Date: Thu, 26 Jan 2017 10:44:31 -0600 > On 01/25/2017 10:05 PM, David Miller wrote: >> From: Thomas Falcon >> Date: Wed, 25 Jan 2017 15:02:20 -0600 >> >>> In the current driver, the MTU is set to the maximum value >>> capable for the backing device. This patch sets the MTU to

Re: [PATCH net 1/5] ibmvnic: harden interrupt handler

2017-01-26 Thread David Miller
From: Thomas Falcon Date: Thu, 26 Jan 2017 10:44:22 -0600 > On 01/25/2017 10:04 PM, David Miller wrote: >> From: Thomas Falcon >> Date: Wed, 25 Jan 2017 15:02:19 -0600 >> >>> Move most interrupt handler processing into a tasklet, and >>> introduce a delay after re-enabling interrupts to fix timi

Re: [PATCH v2 02/10] Move GET_FIELD/SET_FIELD to vas.h

2017-01-26 Thread Dan Streetman
On Wed, Jan 25, 2017 at 8:38 PM, Sukadev Bhattiprolu wrote: > > Move the GET_FIELD and SET_FIELD macros to vas.h as VAS and other > users of VAS, including NX-842 can use those macros. > > Signed-off-by: Sukadev Bhattiprolu Reviewed-by: Dan Streetman > --- > arch/powerpc/include/asm/vas.h

Re: [PATCH net 2/5] ibmvnic: Fix MTU settings

2017-01-26 Thread Thomas Falcon
On 01/25/2017 10:05 PM, David Miller wrote: > From: Thomas Falcon > Date: Wed, 25 Jan 2017 15:02:20 -0600 > >> In the current driver, the MTU is set to the maximum value >> capable for the backing device. This patch sets the MTU to the >> default value for a Linux net device. > Why are you doing t

Re: [PATCH net 1/5] ibmvnic: harden interrupt handler

2017-01-26 Thread Thomas Falcon
On 01/25/2017 10:04 PM, David Miller wrote: > From: Thomas Falcon > Date: Wed, 25 Jan 2017 15:02:19 -0600 > >> Move most interrupt handler processing into a tasklet, and >> introduce a delay after re-enabling interrupts to fix timing >> issues encountered in hardware testing. >> >> Signed-off-by:

Re: gcc trunk fails to build kernel on PowerPC64 due to oprofile warnings

2017-01-26 Thread Robert Richter
On 26.01.17 10:46:43, William Cohen wrote: > From 7e46dbd7dc5bc941926a4a63c28ccebf46493e8d Mon Sep 17 00:00:00 2001 > From: William Cohen > Date: Thu, 26 Jan 2017 10:33:59 -0500 > Subject: [PATCH] Avoid hypthetical string truncation in oprofile stats buffer > MIME-Version: 1.0 > Content-Type: text

[PATCH V2] mtd/ifc: Fix location of eccstat registers for IFC V1.0

2017-01-26 Thread mark.marshall
From: Mark Marshall The commit 7a654172161c ("mtd/ifc: Add support for IFC controller version 2.0") added support for version 2.0 of the IFC controller. The version 2.0 controller has the ECC status registers at a different location to the previous versions. Correct the fsl_ifc_nand structure so

Re: [PATCH v4 01/15] stacktrace/x86: add function for detecting reliable stack traces

2017-01-26 Thread Petr Mladek
On Thu 2017-01-19 09:46:09, Josh Poimboeuf wrote: > For live patching and possibly other use cases, a stack trace is only > useful if it can be assured that it's completely reliable. Add a new > save_stack_trace_tsk_reliable() function to achieve that. > diff --git a/arch/x86/kernel/stacktrace.c

Re: gcc trunk fails to build kernel on PowerPC64 due to oprofile warnings

2017-01-26 Thread Arnd Bergmann
On Thu, Jan 26, 2017 at 12:00 PM, David Laight wrote: > From: Anton Blanchard >> Sent: 25 January 2017 23:01 >> gcc trunk has failed to build PowerPC64 kernels for a month or so. The issue >> is in oprofile, which is common code but ends up being sucked into >> arch/powerpc and therefore subject t

RE: gcc trunk fails to build kernel on PowerPC64 due to oprofile warnings

2017-01-26 Thread David Laight
From: Anton Blanchard > Sent: 25 January 2017 23:01 > gcc trunk has failed to build PowerPC64 kernels for a month or so. The issue > is in oprofile, which is common code but ends up being sucked into > arch/powerpc and therefore subject to the -Werror applied to arch/powerpc: ... > linux/arch/power

Re: [PATCH] usb: gadget: udc: constify usb_ep_ops structures

2017-01-26 Thread Robert Jarzmik
Bhumika Goyal writes: > Declare usb_ep_ops structures as const as they are only stored in the > ops field of an usb_ep structure. This field is of type const, so > usb_ep_ops structures having this property can be made const too. > Done using Coccinelle( A smaller version of the script) For pxa2

Re: [PATCH v2 03/10] VAS: Define vas_init() and vas_exit()

2017-01-26 Thread kbuild test robot
-VAS/20170126-095706 config: powerpc-allmodconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross