Re: [PATCH 9/9] sunxi_defconfig: add new crypto options

2019-09-06 Thread Maxime Ripard
On Fri, Sep 06, 2019 at 08:45:51PM +0200, Corentin Labbe wrote: > This patch adds the new allwinner crypto configs to sunxi_defconfig > > Signed-off-by: Corentin Labbe > --- > arch/arm/configs/sunxi_defconfig | 2 ++ > 1 file changed, 2 insertions(+) Can you also enable it in arm64's defconfig a

Re: [PATCH 6/9] ARM64: dts: allwinner: sun50i: Add Crypto Engine node on A64

2019-09-06 Thread Maxime Ripard
On Fri, Sep 06, 2019 at 08:45:48PM +0200, Corentin Labbe wrote: > The Crypto Engine is a hardware cryptographic accelerator that supports > many algorithms. > It could be found on most Allwinner SoCs. > > This patch enables the Crypto Engine on the Allwinner A64 SoC Device-tree. > > Signed-off-by:

Re: [PATCH 4/9] ARM: dts: sun8i: r40: add crypto engine node

2019-09-06 Thread Maxime Ripard
On Fri, Sep 06, 2019 at 08:45:46PM +0200, Corentin Labbe wrote: > The Crypto Engine is a hardware cryptographic offloader that supports > many algorithms. > It could be found on most Allwinner SoCs. > > This patch enables the Crypto Engine on the Allwinner R40 SoC Device-tree. > > Signed-off-by: Co

Re: [PATCH 1/9] crypto: Add allwinner subdirectory

2019-09-06 Thread Maxime Ripard
On Fri, Sep 06, 2019 at 08:45:43PM +0200, Corentin Labbe wrote: > Since a second Allwinner crypto driver will be added, it is better to > create a dedicated subdirectory. > > Signed-off-by: Corentin Labbe > --- > MAINTAINERS | 6 ++ > drivers/crypto/Kconfig | 2

Re: [PATCH 3/9] dt-bindings: crypto: Add DT bindings documentation for sun8i-ce Crypto Engine

2019-09-06 Thread Maxime Ripard
On Fri, Sep 06, 2019 at 08:45:45PM +0200, Corentin Labbe wrote: > This patch adds documentation for Device-Tree bindings for the > Crypto Engine cryptographic accelerator driver. > > Signed-off-by: Corentin Labbe > --- > .../bindings/crypto/allwinner,sun8i-ce.yaml | 84 +++ > 1

Re: [v2 PATCH] crypto: skcipher - Unmap pages after an external error

2019-09-06 Thread Ard Biesheuvel
On Fri, 6 Sep 2019 at 18:56, Herbert Xu wrote: > > On Fri, Sep 06, 2019 at 06:32:29PM -0700, Ard Biesheuvel wrote: > > > > The point is that doing > > > > skcipher_walk_virt(&walk, ...); > > skcipher_walk_done(&walk, -EFOO); > > > > may clobber your data if you are executing in place (unless I am

Re: [v2 PATCH] crypto: skcipher - Unmap pages after an external error

2019-09-06 Thread Herbert Xu
On Fri, Sep 06, 2019 at 06:32:29PM -0700, Ard Biesheuvel wrote: > > The point is that doing > > skcipher_walk_virt(&walk, ...); > skcipher_walk_done(&walk, -EFOO); > > may clobber your data if you are executing in place (unless I am > missing something) You mean encrypting in place? If you're en

Re: [v2 PATCH] crypto: skcipher - Unmap pages after an external error

2019-09-06 Thread Ard Biesheuvel
On Fri, 6 Sep 2019 at 18:19, Herbert Xu wrote: > > On Fri, Sep 06, 2019 at 05:52:56PM -0700, Ard Biesheuvel wrote: > > > > With this change, we still copy out the output in the > > SKCIPHER_WALK_COPY or SKCIPHER_WALK_SLOW cases. I'd expect the failure > > case to only do the kunmap()s, but otherwi

Re: [v2 PATCH] crypto: skcipher - Unmap pages after an external error

2019-09-06 Thread Herbert Xu
On Fri, Sep 06, 2019 at 05:52:56PM -0700, Ard Biesheuvel wrote: > > With this change, we still copy out the output in the > SKCIPHER_WALK_COPY or SKCIPHER_WALK_SLOW cases. I'd expect the failure > case to only do the kunmap()s, but otherwise not make any changes that > are visible to the caller. I

Re: [v2 PATCH] crypto: skcipher - Unmap pages after an external error

2019-09-06 Thread Ard Biesheuvel
On Thu, 5 Sep 2019 at 20:13, Herbert Xu wrote: > > skcipher_walk_done may be called with an error by internal or > external callers. For those internal callers we shouldn't unmap > pages but for external callers we must unmap any pages that are > in use. > > This patch distinguishes between the t

Re: [PATCH v9 00/11] x86: PIE support to extend KASLR randomization

2019-09-06 Thread Thomas Garnier
On Thu, Aug 29, 2019 at 12:55 PM Thomas Garnier wrote: > > On Tue, Aug 6, 2019 at 8:51 AM Peter Zijlstra wrote: > > > > On Tue, Aug 06, 2019 at 05:43:47PM +0200, Borislav Petkov wrote: > > > On Tue, Jul 30, 2019 at 12:12:44PM -0700, Thomas Garnier wrote: > > > > These patches make some of the cha

RE: [PATCH 1/2] crypto: inside-secure - fix uninitialized-variable warning

2019-09-06 Thread Pascal Van Leeuwen
> -Original Message- > From: Arnd Bergmann > Sent: Friday, September 6, 2019 8:40 PM > To: Pascal Van Leeuwen > Cc: Herbert Xu ; David S. Miller > ; Antoine > Tenart ; Ard Biesheuvel > ; Kees Cook > ; linux-crypto@vger.kernel.org; > linux-ker...@vger.kernel.org > Subject: Re: [PATCH 1/

[PATCH 2/9] crypto: Add Allwinner sun8i-ce Crypto Engine

2019-09-06 Thread Corentin Labbe
The Crypto Engine is an hardware cryptographic offloader present on all recent Allwinner SoCs H2+, H3, R40, A64, H5, H6 This driver supports AES cipher in CBC/ECB mode. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 26 + drivers/crypto/allwinner/Makefile

[PATCH 4/9] ARM: dts: sun8i: r40: add crypto engine node

2019-09-06 Thread Corentin Labbe
The Crypto Engine is a hardware cryptographic offloader that supports many algorithms. It could be found on most Allwinner SoCs. This patch enables the Crypto Engine on the Allwinner R40 SoC Device-tree. Signed-off-by: Corentin Labbe --- arch/arm/boot/dts/sun8i-r40.dtsi | 11 +++ 1 file

[PATCH 8/9] ARM64: dts: allwinner: sun50i: Add Crypto Engine node on H6

2019-09-06 Thread Corentin Labbe
The Crypto Engine is a hardware cryptographic accelerator that supports many algorithms. This patch enables the Crypto Engine on the Allwinner H6 SoC Device-tree. Signed-off-by: Corentin Labbe --- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 10 ++ 1 file changed, 10 insertions(+) di

[PATCH 9/9] sunxi_defconfig: add new crypto options

2019-09-06 Thread Corentin Labbe
This patch adds the new allwinner crypto configs to sunxi_defconfig Signed-off-by: Corentin Labbe --- arch/arm/configs/sunxi_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig index df433abfcb02..d0ab8ba7710a 100644

[PATCH 6/9] ARM64: dts: allwinner: sun50i: Add Crypto Engine node on A64

2019-09-06 Thread Corentin Labbe
The Crypto Engine is a hardware cryptographic accelerator that supports many algorithms. It could be found on most Allwinner SoCs. This patch enables the Crypto Engine on the Allwinner A64 SoC Device-tree. Signed-off-by: Corentin Labbe --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 11

[PATCH 7/9] ARM64: dts: allwinner: sun50i: Add crypto engine node on H5

2019-09-06 Thread Corentin Labbe
The Crypto Engine is a hardware cryptographic accelerator that supports many algorithms. It could be found on most Allwinner SoCs. This patch enables the Crypto Engine on the Allwinner H5 SoC Device-tree. Signed-off-by: Corentin Labbe --- arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi | 11 ++

[PATCH 5/9] ARM: dts: sun8i: h3: Add Crypto Engine node

2019-09-06 Thread Corentin Labbe
The Crypto Engine is a hardware cryptographic accelerator that supports many algorithms. It could be found on most Allwinner SoCs. This patch enables the Crypto Engine on the Allwinner H3 SoC Device-tree. Signed-off-by: Corentin Labbe --- arch/arm/boot/dts/sun8i-h3.dtsi | 11 +++ 1 file

[PATCH 0/9] crypto: add sun8i-ce driver for Allwinner crypto engine

2019-09-06 Thread Corentin Labbe
Hello This patch serie adds support for the Allwinner crypto engine. The Crypto Engine is the third generation of Allwinner cryptogaphic offloader. The first generation is the Security System already handled by the sun4i-ss driver. The second is named also Security System and is present on A80 and

[PATCH 3/9] dt-bindings: crypto: Add DT bindings documentation for sun8i-ce Crypto Engine

2019-09-06 Thread Corentin Labbe
This patch adds documentation for Device-Tree bindings for the Crypto Engine cryptographic accelerator driver. Signed-off-by: Corentin Labbe --- .../bindings/crypto/allwinner,sun8i-ce.yaml | 84 +++ 1 file changed, 84 insertions(+) create mode 100644 Documentation/devicetree/

[PATCH 1/9] crypto: Add allwinner subdirectory

2019-09-06 Thread Corentin Labbe
Since a second Allwinner crypto driver will be added, it is better to create a dedicated subdirectory. Signed-off-by: Corentin Labbe --- MAINTAINERS | 6 ++ drivers/crypto/Kconfig | 2 ++ drivers/crypto/Makefile | 1 + drivers/crypto/allwinner/Kconfig

Re: [PATCH 1/2] crypto: inside-secure - fix uninitialized-variable warning

2019-09-06 Thread Arnd Bergmann
On Fri, Sep 6, 2019 at 6:08 PM Pascal Van Leeuwen wrote: > > > > config CRYPTO_DEV_SAFEXCEL > > tristate "Inside Secure's SafeXcel cryptographic engine driver" > > - depends on OF || PCI || COMPILE_TEST > > + depends on OF || PCI > > > > This seems like it just ignores the problem

[PATCHv3] crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n

2019-09-06 Thread Pascal van Leeuwen
This patch fixes an unused variable warning from the compiler when the driver is being compiled without PCI support in the kernel. changes since v1: - capture the platform_register_driver error code as well - actually return the (last) error code - swapped registration to do PCI first as that's ju

RE: [PATCH 1/2] crypto: inside-secure - fix uninitialized-variable warning

2019-09-06 Thread Pascal Van Leeuwen
> -Original Message- > From: Arnd Bergmann > Sent: Friday, September 6, 2019 5:22 PM > To: Herbert Xu ; David S. Miller > ; > Antoine Tenart > Cc: Arnd Bergmann ; Pascal Van Leeuwen > ; Ard > Biesheuvel ; Kees Cook ; > linux- > cry...@vger.kernel.org; linux-ker...@vger.kernel.org > Sub

[PATCH 5/6] crypto: inside-secure - Base RD fetchcount on actual RD FIFO size

2019-09-06 Thread Pascal van Leeuwen
This patch derives the result descriptor fetch count from the actual FIFO size advertised by the hardware. Fetching result descriptors one at a time is a performance bottleneck for small blocks, especially on hardware with multiple pipes. Even moreso if the HW has few rings. Signed-off-by: Pascal

[PATCH 3/6] crypto: inside-secure - Enable extended algorithms on newer HW

2019-09-06 Thread Pascal van Leeuwen
This patch enables algorithms that did not fit the original 32 bit FUNCTION_EN register anymore via the FUNCTION2_EN extension reg. Signed-off-by: Pascal van Leeuwen --- drivers/crypto/inside-secure/safexcel.c | 2 ++ drivers/crypto/inside-secure/safexcel.h | 1 + 2 files changed, 3 insertions(+

[PATCH 1/6] crypto: inside-secure - Add EIP97/EIP197 and endianness detection

2019-09-06 Thread Pascal van Leeuwen
This patch adds automatic EIP97/EIP197 detection, so it does not need to rely on any static value from the device table anymore. In particular, the static value from the table won't work for PCI devboards that cannot be further identified save from this direct hardware probing. The patch also adds

[PATCH 6/6] crypto: inside-secure - Probe transform record cache RAM sizes

2019-09-06 Thread Pascal van Leeuwen
This patch actually probes the transform record cache data and administration RAM sizes, instead of making assumptions, and then configures the TRC based on the actually probed values. This allows the driver to work with EIP197 HW that has TRC RAM sizes different from those of the Marvell EIP197B/D

[PATCH 4/6] crypto: inside-secure - Base CD fetchcount on actual CD FIFO size

2019-09-06 Thread Pascal van Leeuwen
This patch derives the command descriptor fetch count from the actual FIFO size advertised by the hardware. Fetching command descriptors one at a time is a performance bottleneck for small blocks, especially on hardware with multiple pipes. Even moreso if the HW has few rings. Signed-off-by: Pasca

[PATCH 0/6] crypto: inside-secure - Add supp. for non-Marvell HW

2019-09-06 Thread Pascal van Leeuwen
This patchset adds support for non-Marvell hardware, probing the HW configuration directly from the HW itself instead of making assumptions based on specific Marvell instances and applying appropriate settings. This should get most EIP97/EIP197 instances out there up and running, albeit not always

[PATCH 2/6] crypto: inside-secure: Corrected configuration of EIP96_TOKEN_CTRL

2019-09-06 Thread Pascal van Leeuwen
This patch corrects the configuration of the EIP197_PE_EIP96_TOKEN_CTRL register. Previous value was wrong and potentially dangerous. Signed-off-by: Pascal van Leeuwen --- drivers/crypto/inside-secure/safexcel.c | 4 ++-- drivers/crypto/inside-secure/safexcel.h | 4 ++-- 2 files changed, 4 inser

[PATCH 2/2] crypto: hisilicon - avoid unused function warning

2019-09-06 Thread Arnd Bergmann
The only caller of hisi_zip_vf_q_assign() is hidden in an #ifdef, so the function causes a warning when CONFIG_PCI_IOV is disabled: drivers/crypto/hisilicon/zip/zip_main.c:740:12: error: unused function 'hisi_zip_vf_q_assign' [-Werror,-Wunused-function] Move it into the same #ifdef. Fixes: 79e0

[PATCH 1/2] crypto: inside-secure - fix uninitialized-variable warning

2019-09-06 Thread Arnd Bergmann
The addition of PCI support introduced multiple randconfig issues. - When PCI is disabled, some external functions are undeclared: drivers/crypto/inside-secure/safexcel.c:944:9: error: implicit declaration of function 'pci_irq_vector' [-Werror,-Wimplicit-function-declaration] - Also, in the same

RE: [PATCHv2] crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n

2019-09-06 Thread Pascal Van Leeuwen
> -Original Message- > From: Herbert Xu > Sent: Friday, September 6, 2019 3:05 PM > To: Pascal Van Leeuwen > Cc: Pascal van Leeuwen ; linux-crypto@vger.kernel.org; > antoine.ten...@bootlin.com; da...@davemloft.net; Bjorn Helgaas > > Subject: Re: [PATCHv2] crypto: inside-secure - Fix unu

Re: [PATCHv2] crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n

2019-09-06 Thread Herbert Xu
On Fri, Sep 06, 2019 at 01:01:19PM +, Pascal Van Leeuwen wrote: > > I explicitly DON'T want to abort if the PCI registration fails, > since that may be irrelevant if the OF registration passes AND > the device actually happens to be Device Tree. > So not checking the result value is on purpose

RE: [PATCHv2] crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n

2019-09-06 Thread Pascal Van Leeuwen
> -Original Message- > From: linux-crypto-ow...@vger.kernel.org > On Behalf > Of Herbert Xu > Sent: Friday, September 6, 2019 2:19 PM > To: Pascal van Leeuwen > Cc: linux-crypto@vger.kernel.org; antoine.ten...@bootlin.com; > da...@davemloft.net; > Pascal Van Leeuwen ; Bjorn Helgaas >

Re: [PATCH 03/12] crypto: caam - check irq_of_parse_and_map for errors

2019-09-06 Thread Horia Geanta
On 9/4/2019 5:35 AM, Andrey Smirnov wrote: > Irq_of_parse_and_map will return zero in case of error, so add a error > check for that. > > Signed-off-by: Andrey Smirnov > Cc: Chris Healy > Cc: Lucas Stach > Cc: Horia Geantă > Cc: Herbert Xu > Cc: Iuliana Prodan > Cc: linux-crypto@vger.kernel.

Re: [PATCH 04/12] crypto: caam - dispose of IRQ mapping only after IRQ is freed

2019-09-06 Thread Horia Geanta
On 9/4/2019 5:35 AM, Andrey Smirnov wrote: > With IRQ requesting being managed by devres we need to make sure that > we dispose of IRQ mapping after and not before it is free'd (otherwise > we'll end up with a warning from the kernel). To achieve that simply > convert IRQ mapping to rely on devres

[PATCH -next] crypto: essiv - Remove unnecessary NULL checks

2019-09-06 Thread YueHaibing
NULL check before kfree is not needed. Generated-by: scripts/coccinelle/free/ifnullfree.cocci Signed-off-by: YueHaibing --- crypto/essiv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/essiv.c b/crypto/essiv.c index a8befc8..3d3f9d7 100644 --- a/crypto/essiv.c +++

Re: [PATCHv2] crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n

2019-09-06 Thread Herbert Xu
On Fri, Sep 06, 2019 at 10:07:23AM +0200, Pascal van Leeuwen wrote: > > diff --git a/drivers/crypto/inside-secure/safexcel.c > b/drivers/crypto/inside-secure/safexcel.c > index e12a2a3..2331b31 100644 > --- a/drivers/crypto/inside-secure/safexcel.c > +++ b/drivers/crypto/inside-secure/safexcel.c >

Re: [PATCH 01/12] crypto: caam - make sure clocks are enabled first

2019-09-06 Thread Horia Geanta
On 9/4/2019 5:35 AM, Andrey Smirnov wrote: > In order to access IP block's registers we need to enable appropriate > clocks first, otherwise we are risking hanging the CPU. > > The problem becomes very apparent when trying to use CAAM driver built > as a kernel module. In that case caam_probe() ge

Re: [PATCH] arm64: dts: imx8mq: Add CAAM node

2019-09-06 Thread Horia Geanta
On 8/31/2019 12:01 AM, Andrey Smirnov wrote: > Add node for CAAM - Cryptographic Acceleration and Assurance Module. > > Signed-off-by: Horia Geantă > Signed-off-by: Andrey Smirnov > Cc: Cory Tusar > Cc: Chris Healy > Cc: Lucas Stach > Cc: Herbert Xu > Cc: Shawn Guo > Cc: Iuliana Prodan > C

[PATCHv2] crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n

2019-09-06 Thread Pascal van Leeuwen
This patch fixes an unused variable warning from the compiler when the driver is being compiled without PCI support in the kernel. changes since v1: - capture the platform_register_driver error code as well - actually return the (last) error code - swapped registration to do PCI first as that's ju

Re: [PATCH V2 4/4] crypto: Add Xilinx AES driver

2019-09-06 Thread Corentin Labbe
On Wed, Sep 04, 2019 at 05:40:22PM +, Kalyani Akula wrote: > Hi Corentin, > > Thanks for the review comments. > Please find my response/queries inline. > > > -Original Message- > > From: Corentin Labbe > > Sent: Monday, September 2, 2019 12:29 PM > > To: Kalyani Akula > > Cc: herb..