[PATCH 1/3] crypto: ghash-generic - move common definitions to a new header file

2016-09-28 Thread Marcelo Cerri
Move common values and types used by ghash-generic to a new header file so drivers can directly use ghash-generic as a fallback implementation. Signed-off-by: Marcelo Cerri --- crypto/ghash-generic.c | 13 + include/crypto/ghash.h | 23

[PATCH 2/3] crypto: vmx - Fix memory corruption caused by p8_ghash

2016-09-28 Thread Marcelo Cerri
This patch changes the p8_ghash driver to use ghash-generic as a fixed fallback implementation. This allows the correct value of descsize to be defined directly in its shash_alg structure and avoids problems with incorrect buffer sizes when its state is exported or imported. Reported-by: Jan

[PATCH 3/3] crypto: vmx - Ensure ghash-generic is enabled

2016-09-28 Thread Marcelo Cerri
Add CRYPTO_GHASH as a dependency for vmx_crypto since p8_ghash uses it as the fallback implementation. Signed-off-by: Marcelo Cerri --- drivers/crypto/vmx/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/vmx/Kconfig

Re: [PATCH v21 06/19] perf, tools: Support alias descriptions

2016-09-28 Thread Sukadev Bhattiprolu
Arnaldo Carvalho de Melo [a...@kernel.org] wrote: > Em Tue, Sep 27, 2016 at 11:11:16AM -0700, Sukadev Bhattiprolu escreveu: > > Arnaldo Carvalho de Melo [a...@kernel.org] wrote: > > > Em Thu, Sep 15, 2016 at 03:24:43PM -0700, Sukadev Bhattiprolu escreveu: > > > > From: Andi Kleen

[PATCH v4 6/7] drivers/pci/hotplug: Use of_property_read_u32() in powernv driver

2016-09-28 Thread Gavin Shan
This replaces of_get_property() with of_property_read_u32() or of_property_read_string() so that we needn't consider the endian issue, the returned value always is in CPU-endian. Signed-off-by: Gavin Shan --- drivers/pci/hotplug/pnv_php.c | 15 --- 1 file

[PATCH v4 1/7] powerpc/eeh: Allow to freeze PE in eeh_pe_set_option()

2016-09-28 Thread Gavin Shan
Function eeh_pe_set_option() is used to apply the requested options (enable, disable, unfreeze) in EEH virtualization path. The semantics of this function isn't complete until freezing is supported. This allows to freeze the indicated PE. The new semantics is going to be used in PCI surprise hot

[PATCH v4 7/7] drivers/pci/hotplug: Support surprise hotplug in powernv driver

2016-09-28 Thread Gavin Shan
This supports PCI surprise hotplug. The design is highlighted as below: * The PCI slot's surprise hotplug capability is exposed through device node property "ibm,slot-surprise-pluggable", meaning PCI surprise hotplug will be disabled if skiboot doesn't support it yet. * The

[PATCH v4 3/7] powerpc/eeh: Export eeh_pe_state_mark()

2016-09-28 Thread Gavin Shan
This exports eeh_pe_state_mark(). It will be used to mark the surprise hot removed PE as isolated to avoid unexpected EEH error reporting in surprise remove path. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/eeh_pe.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH v4 2/7] powerpc/eeh: Export confirm_error_lock

2016-09-28 Thread Gavin Shan
This exports @confirm_error_lock so that eeh_serialize_{lock, unlock}() can be used to freeze the affected PE in PCI surprise hot remove path. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/eeh.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v4 0/7] powerpc/powernv: PCI Surprise Hotplug Support

2016-09-28 Thread Gavin Shan
This series of patches supports PCI surprise hotplug on PowerNV platform. Without the corresponding skiboot patches, this feature won't be enabled and workable. * The skiboot patches can be found in below link (PATCH[01/16):

[PATCH v4 4/7] powerpc/powernv: Unfreeze PE on allocation

2016-09-28 Thread Gavin Shan
This unfreezes PE when it's initialized because the PE might be put into frozen state in the last hot remove path. It's not harmful to do so if the PE is already in unfrozen state. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c | 12

Re: [PATCH v5 3/4] PCI: Add a new option for resource_alignment to reassign alignment

2016-09-28 Thread Bjorn Helgaas
On Tue, Sep 13, 2016 at 05:00:33PM +0800, Yongji Xie wrote: > When using resource_alignment kernel parameter, the current > implement reassigns the alignment by changing resources' size > which can potentially break some drivers. For example, the driver > uses the size to locate some register

Re: [v3,4/5] powerpc/pm: support deep sleep feature on T104x

2016-09-28 Thread Scott Wood
On Tue, 2016-09-27 at 11:05 +, C.H. Zhao wrote: > From: Scott Wood > Sent: Sunday, September 25, 2016 3:24 PM > To: C.H. Zhao > Cc: linuxppc-dev@lists.ozlabs.org; linux-ker...@vger.kernel.org; z.chenhui@g > mail.com; Jason Jin > Subject: Re: [v3,4/5] powerpc/pm: support

Re: [PATCH v21 06/19] perf, tools: Support alias descriptions

2016-09-28 Thread Arnaldo Carvalho de Melo
Em Wed, Sep 28, 2016 at 11:29:16AM -0700, Sukadev Bhattiprolu escreveu: > Arnaldo Carvalho de Melo [a...@kernel.org] wrote: > > Em Tue, Sep 27, 2016 at 11:11:16AM -0700, Sukadev Bhattiprolu escreveu: > > > Arnaldo Carvalho de Melo [a...@kernel.org] wrote: > > > > Em Thu, Sep 15, 2016 at 03:24:43PM

Re: [PATCH 0/3] Fix crypto/vmx/p8_ghash memory corruption

2016-09-28 Thread Anton Blanchard
Hi Marcelo > This series fixes the memory corruption found by Jan Stancek in > 4.8-rc7. The problem however also affects previous versions of the > driver. If it affects previous versions, please add the lines in the sign off to get it into the stable kernels. Anton

[PATCH 0/3] Fix crypto/vmx/p8_ghash memory corruption

2016-09-28 Thread Marcelo Cerri
This series fixes the memory corruption found by Jan Stancek in 4.8-rc7. The problem however also affects previous versions of the driver. Marcelo Cerri (3): crypto: ghash-generic - move common definitions to a new header file crypto: vmx - Fix memory corruption caused by p8_ghash crypto:

Re: [PATCH v5] powerpc: Do not make the entire heap executable

2016-09-28 Thread Kees Cook
On Tue, Sep 27, 2016 at 6:42 PM, Michael Ellerman wrote: > Denys Vlasenko writes: > >> On 32-bit powerpc the ELF PLT sections of binaries (built with --bss-plt, >> or with a toolchain which defaults to it) look like this: > > Or (it seems), for all

Re: [PATCH v5 3/4] PCI: Add a new option for resource_alignment to reassign alignment

2016-09-28 Thread Yongji Xie
On 2016/9/29 6:42, Bjorn Helgaas wrote: On Tue, Sep 13, 2016 at 05:00:33PM +0800, Yongji Xie wrote: When using resource_alignment kernel parameter, the current implement reassigns the alignment by changing resources' size which can potentially break some drivers. For example, the driver uses

Re: [PATCH] usb: Convert pr_warning to pr_warn

2016-09-28 Thread Nicolas Ferre
Le 27/09/2016 à 18:16, Joe Perches a écrit : > Use the more common logging mechanism. > > Miscellanea: > > o Realign multiline statements > o Coalesce format > > Signed-off-by: Joe Perches > --- > drivers/usb/gadget/function/rndis.c | 9 - >

Re: [1/6] powerpc/boot: add sed script

2016-09-28 Thread Michael Ellerman
On Thu, 2016-22-09 at 06:54:29 UTC, Oliver O'Halloran wrote: > The powerpc boot wrapper is compiled with a separate "bootcc" toolchain > rather than the toolchain used for the rest of the kernel. The main > problem with this is that the wrapper does not have access to the kernel > headers (without

Re: [v5, 01/20] selftests/powerpc: Compile selftests against headers without AT_HWCAP2

2016-09-28 Thread Michael Ellerman
On Fri, 2016-23-09 at 06:18:07 UTC, Cyril Bur wrote: > It might be nice to compile selftests against older kernels and > headers but which may not have HWCAP2. > > Signed-off-by: Cyril Bur Applied to powerpc next, thanks.

[PATCH] dma/fsldma : Unmap region obtained by of_iomap

2016-09-28 Thread Arvind Yadav
Free memory mapping, if probe is not successful. Signed-off-by: Arvind Yadav --- drivers/dma/fsldma.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 911b717..7ba8944 100644 ---

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Marcelo Cerri
Hi Herbert, On Wed, Sep 28, 2016 at 10:45:49AM +0800, Herbert Xu wrote: > On Tue, Sep 27, 2016 at 04:46:44PM -0300, Marcelo Cerri wrote: > > > > Can you check if the problem occurs with this patch? > > In light of the fact that padlock-sha is the correct example > to follow, you only need to add

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 03:40:51AM -0400, Jan Stancek wrote: > > Thanks for clearing up how this works in padlock-sha, but > we are not exactly in same situation with p8_ghash. > > p8_ghash_init_tfm() already updates descsize. Problem in original report > is that without custom

[PATCH v2] Fix buglet in tlbiel where we set L=1 for ISA 206/7

2016-09-28 Thread Balbir Singh
This patch fixes a bug where we set bit 10 in tlbie via our custom .long opcode for tlbiel. These bits are reserved for 2.06/2.07. In ISA 3.0 bit 10 is a part of the register field RS and we could end up corrupting the meaning of the register field completely with L=1 Signed-off-by: Balbir Singh

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Jan Stancek
> Jan, > > Can you check if the problem occurs with this patch? No issues in over-night test with this patch. > --- a/drivers/crypto/vmx/vmx.c > +++ b/drivers/crypto/vmx/vmx.c > @@ -28,6 +28,8 @@ > #include > #include > > +int p8_ghash_fallback_descsize(void); > + > extern struct

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Jan Stancek
- Original Message - > From: "Herbert Xu" > To: "Marcelo Cerri" > Cc: "Jan Stancek" , "rui y wang" , > mhce...@linux.vnet.ibm.com, > leosi...@linux.vnet.ibm.com,

Re: [PATCH] crypto: sha1-powerpc: little-endian support

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 10:15:51AM -0300, Marcelo Cerri wrote: > Hi Herbert, > > Any thoughts on this one? Can this patch wait until the next merge window? On the broken platforms it should just fail the self-test, right? Cheers, -- Email: Herbert Xu Home Page:

Re: [PATCH] crypto: sha1-powerpc: little-endian support

2016-09-28 Thread Marcelo Cerri
Hi Herbert, Any thoughts on this one? -- Regards, Marcelo On Fri, Sep 23, 2016 at 04:31:56PM -0300, Marcelo Cerri wrote: > The driver does not handle endianness properly when loading the input > data. > > Signed-off-by: Marcelo Cerri > --- >

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 09:38:41AM -0300, Marcelo Cerri wrote: > > The patch forces ghash-generic as the fallback. And I don't think that > is a big problem if we decide to go by this path. Right it should work but could break for example if we ever decide to change the exported state structure

[RFC/PATCH 43/45] usb: gadget: udc: fsl: remove unnecessary & operation

2016-09-28 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Li Yang Cc: Signed-off-by: Felipe Balbi ---

Re: [PATCH] crypto: sha1-powerpc: little-endian support

2016-09-28 Thread Marcelo Cerri
On Wed, Sep 28, 2016 at 09:20:15PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 10:15:51AM -0300, Marcelo Cerri wrote: > > Hi Herbert, > > > > Any thoughts on this one? > > Can this patch wait until the next merge window? On the broken > platforms it should just fail the self-test, right?

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Marcelo Cerri
On Wed, Sep 28, 2016 at 08:44:52PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 09:38:41AM -0300, Marcelo Cerri wrote: > > > > The patch forces ghash-generic as the fallback. And I don't think that > > is a big problem if we decide to go by this path. > > Right it should work but could

[RFC/PATCH 20/45] usb: gadget: udc: fsl: make use of new usb_endpoint_maxp_mult()

2016-09-28 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Li Yang Cc: Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/fsl_udc_core.c | 2 +- 1 file changed, 1

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 09:55:58AM -0300, Marcelo Cerri wrote: > > Great! If we check the descsize every time a fallback tfm is allocated > that should be enough to prevent bigger problems such as memory > corruptions. Yes a check wouldn't hurt. > Can I move ghash_desc_ctx to a header file

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 09:28:44AM -0300, Marcelo Cerri wrote: > > The big difference between p8_ghash and padlock_sha1 is that > padlock_sha1 defines alg->statesize as sizeof(struct sha1_state), which > is the descsize value used by sha1_generic. This probably works but > it's also wrong because

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Marcelo Cerri
Hi Hebert, On Wed, Sep 28, 2016 at 08:29:35PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 03:40:51AM -0400, Jan Stancek wrote: > > > > Thanks for clearing up how this works in padlock-sha, but > > we are not exactly in same situation with p8_ghash. > > > > p8_ghash_init_tfm() already

Re: [PATCH v5] powerpc: Do not make the entire heap executable

2016-09-28 Thread Florian Weimer
* Jason Gunthorpe: > Eg that 32 bit powerpc currently unconditionally injects writable, > executable pages into a user space process. > > This critically undermines all the W^X security work that has been > done in the tool chain and user space by the PPC community. Exactly, this is how we found

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Paulo Flabiano Smorigo
Wed, Sep 28, 2016 at 08:33:18PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 09:28:44AM -0300, Marcelo Cerri wrote: > > > > The big difference between p8_ghash and padlock_sha1 is that > > padlock_sha1 defines alg->statesize as sizeof(struct sha1_state), which > > is the descsize value used

Re: [PATCH v21 06/19] perf, tools: Support alias descriptions

2016-09-28 Thread Arnaldo Carvalho de Melo
Em Tue, Sep 27, 2016 at 11:11:16AM -0700, Sukadev Bhattiprolu escreveu: > Arnaldo Carvalho de Melo [a...@kernel.org] wrote: > > Em Thu, Sep 15, 2016 at 03:24:43PM -0700, Sukadev Bhattiprolu escreveu: > > > From: Andi Kleen > > > Add support to print alias descriptions in

[PATCH -next] powerpc/4xx: Fix error return code in ppc4xx_msi_probe()

2016-09-28 Thread Wei Yongjun
From: Wei Yongjun Fix to return a negative error code from the ppc4xx_setup_pcieh_hw() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- arch/powerpc/sysdev/ppc4xx_msi.c | 3 ++- 1 file changed,