Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-20 Thread Arnd Bergmann
On Tue, Apr 20, 2021 at 1:44 AM Dominique MARTINET wrote: > Arnd Bergmann wrote on Mon, Apr 19, 2021 at 02:16:36PM +0200: > > For built-in drivers, load order depends on the initcall level and > > link order (how things are lined listed in the Makefile hierarchy). > > >

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-20 Thread Arnd Bergmann
On Tue, Apr 20, 2021 at 1:44 AM Dominique MARTINET wrote: > Arnd Bergmann wrote on Mon, Apr 19, 2021 at 02:16:36PM +0200: > > For built-in drivers, load order depends on the initcall level and > > link order (how things are lined listed in the Makefile hierarchy). > > >

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-19 Thread Arnd Bergmann
On Mon, Apr 19, 2021 at 11:33 AM Dominique MARTINET wrote: > Geert Uytterhoeven wrote on Mon, Apr 19, 2021 at 11:03:24AM +0200: > > > soc_device_match() should only be used as a last resort, to identify > > systems that cannot be identified otherwise. Typically this is used for > > quirks, which

[PATCH] crypto: poly1305: fix poly1305_core_setkey() declaration

2021-03-22 Thread Arnd Bergmann
From: Arnd Bergmann gcc-11 points out a mismatch between the declaration and the definition of poly1305_core_setkey(): lib/crypto/poly1305-donna32.c:13:67: error: argument 2 of type ‘const u8[16]’ {aka ‘const unsigned char[16]’} with mismatched bound [-Werror=array-parameter=] 13 | void

Re: [PATCH v2] vio: make remove callback return void

2021-02-25 Thread Arnd Bergmann
On Thu, Feb 25, 2021 at 12:52 PM Michael Ellerman wrote: > > Uwe Kleine-König writes: > > The driver core ignores the return value of struct bus_type::remove() > > because there is only little that can be done. To simplify the quest to > > make this function return void, let struct vio_driver::re

[PATCH 2/2] crypto: marvell - fix ethernet driver dependency

2021-02-04 Thread Arnd Bergmann
From: Arnd Bergmann The OcteonTX2 CPT driver force-enables the OCTEONTX2_MBOX symbol, which fails when network drivers are disabled globally WARNING: unmet direct dependencies detected for OCTEONTX2_MBOX Depends on [n]: NETDEVICES [=n] && ETHERNET [=n] && NET_VENDOR_MARVELL [=

[PATCH 1/2] crypto: octeontx2 - fix -Wpointer-bool-conversion warning

2021-02-04 Thread Arnd Bergmann
From: Arnd Bergmann When CONFIG_CPUMASK_OFFSTACK is disabled, clang reports a warning about a bogus condition: drivers/crypto/marvell/octeontx2/otx2_cptlf.c:334:21: error: address of array 'lfs->lf[slot].affinity_mask' will always evaluate to 'true' [-Werror,-W

Re: [linux-next:master 952/3956] crypto/blake2b_generic.c:73:13: warning: stack frame size of 9776 bytes in function 'blake2b_compress_one_generic'

2021-01-16 Thread Arnd Bergmann
On Sat, Jan 16, 2021 at 2:59 AM Eric Biggers wrote: > On Sat, Jan 16, 2021 at 08:59:50AM +0800, kernel test robot wrote > > Looks like the clang bug that causes large stack usage in this function > (https://bugs.llvm.org/show_bug.cgi?id=45803 which is still unfixed) got > triggered again. Note th

Re: [PATCH] crypto - shash: reduce minimum alignment of shash_desc structure

2021-01-08 Thread Arnd Bergmann
On Fri, Jan 8, 2021 at 11:44 AM Herbert Xu wrote: > > On Fri, Jan 08, 2021 at 11:42:53AM +0100, Arnd Bergmann wrote: > > > > How does this work for kernels with CONFIG_VMAP_STACK? > > I remember some other subsystems (usb, hid) adding workarounds > > for that, bu

Re: [PATCH] crypto - shash: reduce minimum alignment of shash_desc structure

2021-01-08 Thread Arnd Bergmann
On Fri, Jan 8, 2021 at 10:22 AM Herbert Xu wrote: > > On Fri, Jan 08, 2021 at 09:36:23AM +0100, Ard Biesheuvel wrote: > > > > scatterlists, and I don't think we permit pointing the scatterlist > > into request structures) > > Not only do we allow that, we do that in lots of places. How does this

[PATCH] crypto: omap-sham - Fix link error without crypto-engine

2021-01-03 Thread Arnd Bergmann
From: Arnd Bergmann The driver was converted to use the crypto engine helper but is missing the corresponding Kconfig statement to ensure it is available: arm-linux-gnueabi-ld: drivers/crypto/omap-sham.o: in function `omap_sham_probe': omap-sham.c:(.text+0x374): undefined referen

[PATCH] crypto: atmel-i2c - select CONFIG_BITREVERSE

2020-12-03 Thread Arnd Bergmann
From: Arnd Bergmann The bitreverse helper is almost always built into the kernel, but in a rare randconfig build it is possible to hit a case in which it is a loadable module while the atmel-i2c driver is built-in: arm-linux-gnueabi-ld: drivers/crypto/atmel-i2c.o: in function

[PATCH] crypto: aegis128 - fix link error without SIMD

2020-12-03 Thread Arnd Bergmann
From: Arnd Bergmann When the SIMD portion of the driver is disabled, the compiler cannot figure out in advance if it will be called: ERROR: modpost: "crypto_aegis128_update_simd" [crypto/aegis128.ko] undefined! Add a conditional to let the compiler use dead code elimination as befo

Re: [PATCH v3 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-11-16 Thread Arnd Bergmann
On Mon, Nov 16, 2020 at 2:53 PM Corentin Labbe wrote: > > Ciphers produce invalid results on BE. > Key and IV need to be written in LE. > > Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System > crypto accelerator") > Cc: > Signed-off-by: Corentin Labbe > --- > drivers/crypt

Re: [PATCH v2 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-23 Thread Arnd Bergmann
On Wed, Sep 23, 2020 at 8:08 PM LABBE Corentin wrote: > On Wed, Sep 23, 2020 at 04:00:32PM +0200, Arnd Bergmann wrote: > > On Sun, Sep 20, 2020 at 8:37 PM Corentin Labbe wrote: > > > diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c > > > b/drivers/cryp

Re: [PATCH v2 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-23 Thread Arnd Bergmann
On Sun, Sep 20, 2020 at 8:37 PM Corentin Labbe wrote: > > Ciphers produce invalid results on BE. > Key and IV need to be written in LE. > > Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System > crypto accelerator") > Cc: > Signed-off-by: Corentin Labbe > --- > drivers/crypt

Re: lib/crypto/chacha.c:65:1: warning: the frame size of 1604 bytes is larger than 1024 bytes

2020-08-27 Thread Arnd Bergmann
On Thu, Aug 27, 2020 at 7:55 PM Linus Torvalds wrote: > > On Thu, Aug 27, 2020 at 10:34 AM Linus Torvalds > wrote: > > > > How are you guys testing? I have UBSAN and GCOV on, and don't see > > crazy frames on either i386 or x86-64. > > Oh, never mind. I also have COMPILE_TEST on, so it ends up di

Re: lib/crypto/chacha.c:65:1: warning: the frame size of 1604 bytes is larger than 1024 bytes

2020-08-27 Thread Arnd Bergmann
On Thu, Aug 27, 2020 at 1:51 PM Herbert Xu wrote: > > On Thu, Aug 27, 2020 at 12:41:53PM +0200, Ard Biesheuvel wrote: > > > > That does not help, unfortunately. > > > > What does seem to work is > > > > struct chacha_state { u32 x[16]; }; > > > > struct chacha_state chacha_permute(struct chacha_st

Re: lib/crypto/chacha.c:65:1: warning: the frame size of 1604 bytes is larger than 1024 bytes

2020-08-27 Thread Arnd Bergmann
On Thu, Aug 27, 2020 at 10:42 AM Ard Biesheuvel wrote: > > In that case, I suppose we should simply disable instrumentation for > chacha_permute()? It is a straight-forward arithmetic transformation > on a u32[16] array, where ubsan has limited value afaict. I guess that always works as a last re

Re: lib/crypto/chacha.c:65:1: warning: the frame size of 1604 bytes is larger than 1024 bytes

2020-08-27 Thread Arnd Bergmann
On Thu, Aug 27, 2020 at 10:10 AM Ard Biesheuvel wrote: > On Thu, 27 Aug 2020 at 10:06, Herbert Xu wrote: > > > > On Thu, Aug 27, 2020 at 11:52:50AM +0800, kernel test robot wrote: > > > > > > First bad commit (maybe != root cause): > > > > > > tree: > > > https://git.kernel.org/pub/scm/linux/k

Re: [PATCH v3 5/5] hwrng: imx-rngc: enable driver for i.MX6

2020-07-14 Thread Arnd Bergmann
On Tue, Jul 14, 2020 at 2:39 PM Horia Geantă wrote: > diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig > index 8478eb757f3c..98f95a09ce55 100644 > --- a/drivers/char/hw_random/Kconfig > +++ b/drivers/char/hw_random/Kconfig > @@ -255,7 +255,7 @@ config HW_RANDOM_MXC_RNGA

Re: [PATCH 0/5] drivers/char: Constify static variables

2020-07-02 Thread Arnd Bergmann
o - Constify id_table[] > ipmi: watchdog: Constify ident > virtio_console: Constify some static variables I just realized it was a series rather than a single patch I received. They all look correct, so Acked-by: Arnd Bergmann but if you do more of those, I would suggest not including the

Re: [PATCH 2/5] hwrng: nomadik - Constify nmk_rng_ids[]

2020-07-02 Thread Arnd Bergmann
gree this should be .rodata anway. > Signed-off-by: Rikard Falkeborn Acked-by: Arnd Bergmann > --- > drivers/char/hw_random/nomadik-rng.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/hw_random/nomadik-rng.c > b/drivers/char/hw_random/n

Re: [PATCH 0/2] Introduce PCI_FIXUP_IOMMU

2020-06-09 Thread Arnd Bergmann
On Tue, Jun 9, 2020 at 6:02 AM Zhangfei Gao wrote: > On 2020/6/9 上午12:41, Bjorn Helgaas wrote: > > On Mon, Jun 08, 2020 at 10:54:15AM +0800, Zhangfei Gao wrote: > >> On 2020/6/6 上午7:19, Bjorn Helgaas wrote: > +++ b/drivers/iommu/iommu.c > @@ -2418,6 +2418,10 @@ int iommu_fwspec_init(stru

Re: [PATCH] x86: crypto: fix building crc32c with clang ias

2020-05-27 Thread Arnd Bergmann
On Wed, May 27, 2020 at 6:42 PM Nathan Chancellor wrote: > > On Wed, May 27, 2020 at 04:17:40PM +0200, Arnd Bergmann wrote: > > The clang integrated assembler complains about movzxw: > > > > arch/x86/crypto/crc32c-pcl-intel-asm_64.S:173:2: error: invalid instructi

[PATCH] x86: crypto: fix building crc32c with clang ias

2020-05-27 Thread Arnd Bergmann
8ce1ef3940 ("crypto: crc32c - Optimize CRC32C calculation with PCLMULQDQ instruction") Signed-off-by: Arnd Bergmann --- arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S b/arch/x86/cry

Re: [PATCH 0/2] Introduce PCI_FIXUP_IOMMU

2020-05-27 Thread Arnd Bergmann
On Wed, May 27, 2020 at 11:00 AM Greg Kroah-Hartman wrote: > > On Tue, May 26, 2020 at 07:49:07PM +0800, Zhangfei Gao wrote: > > Some platform devices appear as PCI but are actually on the AMBA bus, > > Why would these devices not just show up on the AMBA bus and use all of > that logic instead of

Re: [PATCH 3/3] hwrng: ba431-rng: add support for BA431 hwrng

2020-05-25 Thread Arnd Bergmann
t Viper OEM boards. > > Signed-off-by: Olivier Sobrie > Signed-off-by: Waleed Ziad The driver looks good to me. Acked-by: Arnd Bergmann > drivers/char/hw_random/Kconfig | 10 ++ > drivers/char/hw_random/Makefile| 1 + > drivers/char/hw_random/ba431-rng.c | 240 +

Re: linux-next: manual merge of the sound-asoc tree with the crypto tree

2020-05-12 Thread Arnd Bergmann
On Tue, May 12, 2020 at 10:08 PM Eric Biggers wrote: > On Tue, May 12, 2020 at 06:08:01PM +0100, Mark Brown wrote: > > For later: if SHASH_DESC_ON_STACK is causing problems, we really ought to > find a > better solution, since lots of users are using this macro. A version of > crypto_shash_tfm_d

Re: [PATCH] crypto: blake2b - Fix clang optimization for ARMv7-M

2020-05-08 Thread Arnd Bergmann
On Wed, May 6, 2020 at 7:12 AM Nathan Chancellor wrote: > > - > > +#ifdef CONFIG_CC_IS_CLANG > > Given your comment in the bug: > > "The code is written to assume no loops are unrolled" > > Does it make sense to make this unconditional and take compiler > heuristics out of it? > > > +#pragma nounr

Re: [PATCH] net: wireguard: avoid unused variable warning

2020-05-05 Thread Arnd Bergmann
On Tue, May 5, 2020 at 10:07 PM Jason A. Donenfeld wrote: > On Tue, May 5, 2020 at 8:13 AM Arnd Bergmann wrote: > > > > clang points out a harmless use of uninitialized variables that > > get passed into a local function but are ignored there: > > > > In file in

[PATCH] net: wireguard: avoid unused variable warning

2020-05-05 Thread Arnd Bergmann
g the variables are always initialized, and make up for the loss of readability by changing the "#if IS_ENABLED()" checks to regular "if (IS_ENABLED())". Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Signed-off-by: Arnd Bergmann --- drivers/net/

[PATCH] crypto: curve25519-hacl64 - Disable fortify-source for clang-10

2020-05-05 Thread Arnd Bergmann
Donenfeld Signed-off-by: Arnd Bergmann --- lib/crypto/curve25519-hacl64.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/crypto/curve25519-hacl64.c b/lib/crypto/curve25519-hacl64.c index c7de61829a66..87adeb4f9276 100644 --- a/lib/crypto/curve25519-hacl64.c +++ b/lib/crypto/curve2551

[PATCH] crypto: blake2b - Fix clang optimization for ARMv7-M

2020-05-05 Thread Arnd Bergmann
press' [-Wframe-larger-than=] Forcing it to not unroll the final loop avoids this problem. Fixes: 91d689337fe8 ("crypto: blake2b - add blake2b generic implementation") Signed-off-by: Arnd Bergmann --- crypto/blake2b_generic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

[PATCH 00/15] gcc-10 warning fixes

2020-04-30 Thread Arnd Bergmann
disabled -Wrestrict on gcc in my local test tree, but with the patches from this series and the ones I have already sent, I see no gcc-10 specific warnings in linux-next when doing many randconfig builds for arm/arm64/x86. Arnd Arnd Bergmann (15): crypto - Avoid free() namespace collision

[PATCH 01/15] crypto - Avoid free() namespace collision

2020-04-30 Thread Arnd Bergmann
to skcipher") Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher") Signed-off-by: Arnd Bergmann --- crypto/lrw.c | 6 +++--- crypto/xts.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto/lrw.c b/crypto/lrw.c index 376d7ed3f1f8..5b07a

[PATCH] cxgb4/chcr: avoid -Wreturn-local-addr warning

2020-04-30 Thread Arnd Bergmann
nto a helper to make it easier to understand by both humans and compilers, which avoids the warning. Fixes: 5a4b9fe7fece ("cxgb4/chcr: complete record tx handling") Signed-off-by: Arnd Bergmann --- drivers/crypto/chelsio/chcr_ktls.c | 83 +- 1 file chan

Re: [PATCH] crypto: inside-secure - select CONFIG_CRYPTO_SM3

2019-10-22 Thread Arnd Bergmann
On Tue, Oct 22, 2019 at 5:42 PM Pascal Van Leeuwen wrote: > > diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig > > index 357e230769c8..1ca8d9a15f2a 100644 > > --- a/drivers/crypto/Kconfig > > +++ b/drivers/crypto/Kconfig > > @@ -753,6 +753,7 @@ config CRYPTO_DEV_SAFEXCEL > > sel

[PATCH] [v2] crypto: inside-secure - Reduce stack usage

2019-10-22 Thread Arnd Bergmann
r authenc(hmac(sha*),rfc3686(ctr(aes))) suites") Signed-off-by: Arnd Bergmann --- v2: rebase against crypto/master --- .../crypto/inside-secure/safexcel_cipher.c| 55 --- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/drivers/crypto/inside-secure/safexcel

[PATCH] crypto: inside-secure - select CONFIG_CRYPTO_SM3

2019-10-22 Thread Arnd Bergmann
t for basic SM3 ahash") Signed-off-by: Arnd Bergmann --- drivers/crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 357e230769c8..1ca8d9a15f2a 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -75

[PATCH] hwrng: omap3-rom - Fix unused function warnings

2019-10-22 Thread Arnd Bergmann
_runtime_resume' [-Werror,-Wunused-function] Mark these functions as __maybe_unused so gcc can drop them silently. Fixes: 8d9d4bdc495f ("hwrng: omap3-rom - Use runtime PM instead of custom functions") Signed-off-by: Arnd Bergmann --- drivers/char/hw_random/omap3-rom-rng.c | 4 ++-- 1 fi

Re: [PATCH 3/3] crypto: inside-secure - Remove #ifdef checks

2019-10-17 Thread Arnd Bergmann
On Thu, Oct 17, 2019 at 3:26 PM Pascal Van Leeuwen wrote: > > /* Register PCI driver */ > > - pcireg_rc = pci_register_driver(&safexcel_pci_driver); > > -#endif > > + ret = pci_register_driver(&safexcel_pci_driver); > > > > -#if IS_ENABLED(CONFIG_OF) > > /* Register platform d

Re: [PATCH] hwrng: omap3-rom fix pointer warning for omap3_rom_rng_idle

2019-10-15 Thread Arnd Bergmann
> as NULL pointer > > Signed-off-by: Ben Dooks > --- > Cc: Arnd Bergmann > Cc: Greg Kroah-Hartman > Cc: linux-crypto@vger.kernel.org > Cc: linux-ker...@vger.kernel.org Acked-by: Arnd Bergmann

Re: [PATCH] hwrng: ka-sa - fix __iomem on registers

2019-10-15 Thread Arnd Bergmann
ed void volatile [noderef] > *addr > drivers/char/hw_random/ks-sa-rng.c:104:9:got unsigned int * > > Signed-off-by: Ben Dooks > --- > Cc: Arnd Bergmann Acked-by: Arnd Bergmann

Re: [PATCH v3 19/29] crypto: mips/poly1305 - incorporate OpenSSL/CRYPTOGAMS optimized implementation

2019-10-11 Thread Arnd Bergmann
On Fri, Oct 11, 2019 at 7:21 PM René van Dorst wrote: > Quoting Andy Polyakov : > > On 10/8/19 1:38 PM, Andy Polyakov wrote: > > As an example, MIPS 1004K manual discusses that that there are two > > options for multiplier for this core, proper and poor-man's. Proper > > multiplier unit can issue

Re: [PATCH v2 04/20] crypto: arm/chacha - expose ARM ChaCha routine as library function

2019-10-04 Thread Arnd Bergmann
On Fri, Oct 4, 2019 at 4:23 PM Ard Biesheuvel wrote: > > How is it relevant whether the boot CPU is A5 or A7? These are bL > little cores that only implement NEON for feature parity with their bl > big counterparts, but CPU intensive tasks are scheduled on big cores, > where NEON performance is mu

Re: [PATCH 2/3] crypto: inside-secure - Reduce stack usage

2019-10-01 Thread Arnd Bergmann
On Mon, Sep 30, 2019 at 11:09 PM Pascal Van Leeuwen wrote: > > Subject: Re: [PATCH 2/3] crypto: inside-secure - Reduce stack usage > > > > On Mon, Sep 30, 2019 at 9:04 PM Pascal Van Leeuwen > > wrote: > > > > > > Alternatively, it should be possible to shrink these allocations > > > > as the extr

Re: [PATCH 2/3] crypto: inside-secure - Reduce stack usage

2019-09-30 Thread Arnd Bergmann
On Mon, Sep 30, 2019 at 9:04 PM Pascal Van Leeuwen wrote: > > Alternatively, it should be possible to shrink these allocations > > as the extra buffers appear to be largely unnecessary, but doing > > this would be a much more invasive change. > > > Actually, for HMAC-SHA512 you DO need all that b

[PATCH 3/3] crypto: inside-secure - Remove #ifdef checks

2019-09-30 Thread Arnd Bergmann
best. Fixes: 212ef6f29e5b ("crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n") Signed-off-by: Arnd Bergmann --- drivers/crypto/inside-secure/safexcel.c | 49 ++--- include/linux/pci.h | 1 + 2 files changed, 13 insertions(+),

[PATCH 2/3] crypto: inside-secure - Reduce stack usage

2019-09-30 Thread Arnd Bergmann
r authenc(hmac(sha*),rfc3686(ctr(aes))) suites") Signed-off-by: Arnd Bergmann --- .../crypto/inside-secure/safexcel_cipher.c| 53 --- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/inside-secu

[PATCH 1/3] crypto: inside-secure - Fix a maybe-uninitialized warning

2019-09-30 Thread Arnd Bergmann
is harmless as it is impossible to get into this case, but the compiler has no way of knowing that. Add an explicit error handling case to make it obvious to both compilers and humans reading the source. Fixes: 212ef6f29e5b ("crypto: inside-secure - Fix unused variable warning when CONFIG_PC

Re: [PATCH 2/2] [v2] crypto: hisilicon - allow compile-testing on x86

2019-09-20 Thread Arnd Bergmann
On Fri, Sep 20, 2019 at 3:26 PM Arnd Bergmann wrote: > > On Fri, Sep 20, 2019 at 10:34 AM John Garry wrote: > > > > + if (!IS_ENABLED(CONFIG_ARM64)) { > > > + memcpy_toio(fun_base, src, 16); > > > +

Re: [PATCH 2/2] [v2] crypto: hisilicon - allow compile-testing on x86

2019-09-20 Thread Arnd Bergmann
On Fri, Sep 20, 2019 at 10:34 AM John Garry wrote: > > + if (!IS_ENABLED(CONFIG_ARM64)) { > > + memcpy_toio(fun_base, src, 16); > > + wmb(); > > + return; > > + } > > + > > asm volatile("ldp %0, %1, %3\n" > >"stp %0, %1, %2\n"

[PATCH 2/2] [v2] crypto: hisilicon - allow compile-testing on x86

2019-09-19 Thread Arnd Bergmann
the mmio store (either one) is not endian-safe, this will only work on little- endian configurations, so I also add a Kconfig dependency on that, regardless of the architecture. Finally, a depenndecy on CONFIG_64BIT is needed because of the writeq(). Signed-off-by: Arnd Bergmann --- v2: actually

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

2019-09-19 Thread Arnd Bergmann
On Thu, Sep 19, 2019 at 3:48 PM Herbert Xu wrote: > > On Thu, Sep 19, 2019 at 04:11:13PM +0800, Zhou Wang wrote: > > On 2019/9/13 17:17, Herbert Xu wrote: > > > On Fri, Sep 06, 2019 at 05:22:30PM +0200, Arnd Bergmann wrote: > > >> The only caller of hisi_zip_vf_

[PATCH 2/2] crypto: hisilicon - allow compile-testing on x86

2019-09-19 Thread Arnd Bergmann
the mmio store (either one) is not endian-safe, this will only work on little- endian configurations, so I also add a Kconfig dependency on that, regardless of the architecture. Finally, a depenndecy on CONFIG_64BIT is needed because of the writeq(). Signed-off-by: Arnd Bergmann --- drivers

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

2019-09-19 Thread Arnd Bergmann
IS_ENABLED() check that leads to the function being dropped based on the configuration. Fixes: 79e09f30eeba ("crypto: hisilicon - add SRIOV support for ZIP") Signed-off-by: Arnd Bergmann --- drivers/crypto/hisilicon/zip/zip_main.c | 7 ++- 1 file changed, 2 insertions(+), 5 deleti

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

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

2019-09-06 Thread Arnd Bergmann
ef. Fixes: 79e09f30eeba ("crypto: hisilicon - add SRIOV support for ZIP") Signed-off-by: Arnd Bergmann --- drivers/crypto/hisilicon/zip/zip_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.

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

2019-09-06 Thread Arnd Bergmann
I and OF are disabled. Take care of all of the above by adding more checks for CONFIG_PCI and CONFIG_OF. Fixes: 625f269a5a7a ("crypto: inside-secure - add support for PCI based FPGA development board") Signed-off-by: Arnd Bergmann --- drivers/crypto/Kconfig | 2 +-

Re: [PATCH] asm-generic: Remove redundant arch-specific rules for simd.h

2019-08-01 Thread Arnd Bergmann
ned-off-by: Herbert Xu Acked-by: Arnd Bergmann

Re: [PATCH] asm-generic: make simd.h a mandatory include/asm header

2019-07-29 Thread Arnd Bergmann
On Mon, Jul 29, 2019 at 12:45 PM Ard Biesheuvel wrote: > On Mon, 29 Jul 2019 at 13:32, Arnd Bergmann wrote: > > It looks like there are a number of these that could be handled the > > same way. Should we do that for the asm-generic tree afterwards? > > > > I g

Re: [PATCH] asm-generic: make simd.h a mandatory include/asm header

2019-07-29 Thread Arnd Bergmann
Looks good to me, if you want this to go through the crypto tree, Acked-by: Arnd Bergmann I noticed that this is the first such entry here, and went looking for other candidates: $ git grep -h generic-y arch/*/include/asm/Kbuild | sort | uniq -c | sort -nr | head -n 30 24 generic-y +=

Re: [RFC PATCH] rxrpc: Fix -Wframe-larger-than= warnings from on-stack crypto

2019-07-25 Thread Arnd Bergmann
er buffers from the slab instead, caching the allocated > packet crypto request memory used for DATA packet crypto in the rxrpc_call > struct. > > Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by > userspace and kernel both") > Reported-by: Arnd Bergmann > Signed-off-by: David Howells > cc: Herbert Xu Acked-by: Arnd Bergmann

[PATCH] crypto: jitterentropy: build without sanitizer

2019-07-24 Thread Arnd Bergmann
-O0 anyway. Turning off just KASAN avoids the warning already, but I suspect both of these have undesired side-effects for jitterentropy. Link: https://godbolt.org/z/fDcwZ5 Signed-off-by: Arnd Bergmann --- crypto/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/Makefile b/c

Re: [PATCH] crypto: aegis: fix badly optimized clang output

2019-07-18 Thread Arnd Bergmann
On Thu, Jul 18, 2019 at 11:17 PM 'Nick Desaulniers' via Clang Built Linux wrote: > On Thu, Jul 18, 2019 at 6:50 AM Arnd Bergmann wrote: > > diff --git a/crypto/aegis.h b/crypto/aegis.h > > index 41a3090cda8e..efed7251c49d 100644 > > --- a/crypto/aegis.h > &g

[PATCH] crypto: aegis: fix badly optimized clang output

2019-07-18 Thread Arnd Bergmann
to_aegis128_crypt' [-Wframe-larger-than=] crypto/aegis128.c:177:13: warning: stack frame size of 592 bytes in function 'crypto_aegis128_decrypt_chunk' [-Wframe-larger-than=] Forcing the primitives to all get inlined avoids the issue and the resulting code is similar to what gcc

Re: [PATCH 1/2] char: hw_random: imx-rngc: use devm_platform_ioremap_resource() to simplify code

2019-07-17 Thread Arnd Bergmann
On Wed, Jul 17, 2019 at 11:14 AM wrote: > > From: Anson Huang > > Use the new helper devm_platform_ioremap_resource() which wraps the > platform_get_resource() and devm_ioremap_resource() together, to > simplify the code. > > Signed-off-by: Anson Huang Both patches Acked-by: Arnd Bergmann

[PATCH] crypto: ccp - Reduce maximum stack usage

2019-07-12 Thread Arnd Bergmann
at most 524 bytes for each of the other cases. Fixes: 63b945091a07 ("crypto: ccp - CCP device driver and interface support") Signed-off-by: Arnd Bergmann --- drivers/crypto/ccp/ccp-ops.c | 52 +--- 1 file changed, 31 insertions(+), 21 deletions(-) diff --

[PATCH] crypto: asymmetric_keys - select CRYPTO_HASH where needed

2019-06-18 Thread Arnd Bergmann
7; pkcs7_verify.c:(.text+0x3c1): undefined reference to `crypto_shash_update' pkcs7_verify.c:(.text+0x411): undefined reference to `crypto_shash_finup' This normally doesn't show up in randconfig tests because there is a large number of other options that select CRYPTO_HASH. Signed-off-b

[PATCH] [v2] crypto: serpent - mark __serpent_setkey_sbox noinline

2019-06-18 Thread Arnd Bergmann
ne' reduces the stack usage from 2112 bytes to 192 and 96 bytes, respectively, and seems to generate more useful object code. Fixes: c871c10e4ea7 ("crypto: serpent - improve __serpent_setkey with UBSAN") Signed-off-by: Arnd Bergmann --- v2: style improvements suggested by Eric Biggers

[PATCH v2 2/2] crypto: testmgr - dynamically allocate crypto_shash

2019-06-18 Thread Arnd Bergmann
ers Fixes: 9a8a6b3f0950 ("crypto: testmgr - fuzz hashes against their generic implementation") Signed-off-by: Arnd Bergmann --- crypto/testmgr.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 0e07f61f1a31..0ce28

[PATCH v2 1/2] crypto: testmgr - dynamically allocate testvec_config

2019-06-18 Thread Arnd Bergmann
o dynamic allocation. Fixes: 40153b10d91c ("crypto: testmgr - fuzz AEADs against their generic implementation") Fixes: d435e10e67be ("crypto: testmgr - fuzz skciphers against their generic implementation") Fixes: 9a8a6b3f0950 ("crypto: testmgr - fuzz hashes against their

Re: [PATCH] crypto: testmgr - reduce stack usage in fuzzers

2019-06-17 Thread Arnd Bergmann
On Mon, Jun 17, 2019 at 7:20 PM Eric Biggers wrote: > On Mon, Jun 17, 2019 at 03:23:02PM +0200, Arnd Bergmann wrote: > > On arm32, we get warnings about high stack usage in some of the functions: > > > > @@ -1541,6 +1543,10 @@ static void generate_random_hash_testvec(str

Re: [PATCH] crypto: testmgr - reduce stack usage in fuzzers

2019-06-17 Thread Arnd Bergmann
On Mon, Jun 17, 2019 at 4:56 PM Herbert Xu wrote: > > On Mon, Jun 17, 2019 at 04:54:16PM +0200, Arnd Bergmann wrote: > > > > Just converting the three testvec_config variables is what I originally > > had in my patch. It got some configurations below the warning level, &

Re: [PATCH] crypto: testmgr - reduce stack usage in fuzzers

2019-06-17 Thread Arnd Bergmann
On Mon, Jun 17, 2019 at 4:24 PM Herbert Xu wrote: > > On Mon, Jun 17, 2019 at 04:10:44PM +0200, Arnd Bergmann wrote: > > > > In most cases, this ends up in favor of clang (concerning the stack > > warning size limit) because most variables are small, but here we have >

Re: [PATCH] crypto: testmgr - reduce stack usage in fuzzers

2019-06-17 Thread Arnd Bergmann
On Mon, Jun 17, 2019 at 4:04 PM Herbert Xu wrote: > > On Mon, Jun 17, 2019 at 03:23:02PM +0200, Arnd Bergmann wrote: > > On arm32, we get warnings about high stack usage in some of the functions: > > > > crypto/testmgr.c:2269:12: error: stack frame size o

[PATCH] crypto: sun4i-ss - reduce stack usage

2019-06-17 Thread Arnd Bergmann
cksize") Signed-off-by: Arnd Bergmann --- drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 47 +++ 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c index 7b0c42882830..4ab14

[PATCH] crypto: testmgr - reduce stack usage in fuzzers

2019-06-17 Thread Arnd Bergmann
o dynamic allocation. Fixes: 40153b10d91c ("crypto: testmgr - fuzz AEADs against their generic implementation") Fixes: d435e10e67be ("crypto: testmgr - fuzz skciphers against their generic implementation") Fixes: 9a8a6b3f0950 ("crypto: testmgr - fuzz hashes against their

[PATCH] crypto: serpent - mark __serpent_setkey_sbox noinline

2019-06-17 Thread Arnd Bergmann
ne' reduces the stack usage from 2112 bytes to 192 and 96 bytes, respectively, and seems to generate more useful object code. Fixes: c871c10e4ea7 ("crypto: serpent - improve __serpent_setkey with UBSAN") Signed-off-by: Arnd Bergmann --- crypto/serpent_generic.c | 2 +- 1 file chang

Re: [PATCH -next] hwrng: make symbol 'optee_rng_id_table' static

2019-02-20 Thread Arnd Bergmann
On Wed, Feb 20, 2019 at 5:26 PM Sumit Garg wrote: > On Wed, 20 Feb 2019 at 21:04, Arnd Bergmann wrote: > Reviewed-by: Sumit Garg > > There are already fixes sent in upstream for these. Maybe you could > pick those too. > > https://www.mail-archive.com/linux-kernel@vger.

Re: [PATCH -next] hwrng: make symbol 'optee_rng_id_table' static

2019-02-20 Thread Arnd Bergmann
On Wed, Feb 20, 2019 at 12:17 PM Sumit Garg wrote: > > On Wed, 20 Feb 2019 at 16:19, Colin Ian King wrote: > > > > On 20/02/2019 10:37, Ard Biesheuvel wrote: > > > On Wed, 20 Feb 2019 at 11:34, Sumit Garg wrote: > > >> > > >> On Wed, 20 Feb 2019 at 14:51, Wei Yongjun wrote: > > >>> > > >>> Fixe

Re: [PATCH] hwrng: optee: Initialize some structs using memset instead of braces

2019-02-20 Thread Arnd Bergmann
On Tue, Feb 19, 2019 at 6:11 AM Sumit Garg wrote: > On Tue, 19 Feb 2019 at 08:52, Nathan Chancellor > wrote: > > > > Fixes: 5fe8b1cc6a03 ("hwrng: add OP-TEE based rng driver") > > Link: https://github.com/ClangBuiltLinux/linux/issues/369 > > Signed-off-by: Nathan Chancellor > > Reviewed-by: Sum

[PATCH] crypto: caam/qi2 - add a CRYPTO_DEV_FSL_CAAM dependency

2018-12-20 Thread Arnd Bergmann
tions. Overall, I'm still not happy with that dependency, but for now it documents what the code requires. Fixes: 52813ab24959 ("crypto: caam/qi2 - avoid double export") Signed-off-by: Arnd Bergmann --- drivers/crypto/caam/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH] crypto: cavium/nitrox - Fix format strings

2018-10-02 Thread Arnd Bergmann
~~~^ %ld drivers/crypto/cavium/nitrox/nitrox_debugfs.c:65:31: error: format '%lld' expects argument of type 'long long int', but argument 3 has type 'long int' [-Werror=format=] Add an explicit cast to 's64'

[PATCH] crypto: caam/qi2 - avoid double export

2018-10-02 Thread Arnd Bergmann
the two drivers in a cleaner way. Fixes: 8d818c105501 ("crypto: caam/qi2 - add DPAA2-CAAM driver") Signed-off-by: Arnd Bergmann --- drivers/crypto/caam/caamalg_qi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/ca

Re: [PATCH] crypto: qat - move temp buffers off the stack

2018-09-26 Thread Arnd Bergmann
On Wed, Sep 26, 2018 at 5:43 PM Kees Cook wrote: > On Wed, Sep 26, 2018 at 2:51 AM, Ard Biesheuvel > wrote: > > I think the depth warning is minor (90 bytes over), so I don't think > it's high priority to backport the fix. I'm fine either way, of > course. The way I see these warnings, anything

[PATCH] crypto: caam/qi2 - add CONFIG_NETDEVICES dependency

2018-09-26 Thread Arnd Bergmann
; >From what I can tell, CONFIG_NETDEVICES is the correct dependency here, and adding it fixes the randconfig failures. Fixes: 8d818c105501 ("crypto: caam/qi2 - add DPAA2-CAAM driver") Signed-off-by: Arnd Bergmann --- drivers/crypto/caam/Kconfig | 1 + 1 file changed, 1 insertion(+)

Re: [PATCH v8 7/9] crypto: qat: Remove VLA usage

2018-09-26 Thread Arnd Bergmann
On Wed, Sep 26, 2018 at 10:44 AM Ard Biesheuvel wrote: > > On Tue, 25 Sep 2018 at 18:12, Arnd Bergmann wrote: > > > > On Tue, Aug 7, 2018 at 11:18 PM Kees Cook wrote: > > > > > > In the quest to remove all stack VLA usage from the kernel[1], this uses >

Re: [PATCH v8 7/9] crypto: qat: Remove VLA usage

2018-09-25 Thread Arnd Bergmann
On Tue, Aug 7, 2018 at 11:18 PM Kees Cook wrote: > > In the quest to remove all stack VLA usage from the kernel[1], this uses > the new upper bound for the stack buffer. Also adds a sanity check. > > [1] > https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.co

Re: [PATCH net-next v5 02/20] zinc: introduce minimal cryptography library

2018-09-25 Thread Arnd Bergmann
On Sat, Sep 22, 2018 at 6:11 PM Arnd Bergmann wrote: > > On Thu, Sep 20, 2018 at 5:12 PM Jason A. Donenfeld wrote: > > > > Hey Arnd, > > > > On Thu, Sep 20, 2018 at 6:02 PM Arnd Bergmann wrote: > > > Right, if you hit a stack requirement like this

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-24 Thread Arnd Bergmann
On Mon, Sep 24, 2018 at 10:35 PM Jason Gunthorpe wrote: > On Mon, Sep 24, 2018 at 10:18:52PM +0200, Arnd Bergmann wrote: > > On Tue, Sep 18, 2018 at 7:59 PM Jason Gunthorpe wrote: > > > On Tue, Sep 18, 2018 at 10:51:08AM -0700, Darren Hart wrote: > > > > On Fri, Se

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-24 Thread Arnd Bergmann
On Tue, Sep 18, 2018 at 7:59 PM Jason Gunthorpe wrote: > > On Tue, Sep 18, 2018 at 10:51:08AM -0700, Darren Hart wrote: > > On Fri, Sep 14, 2018 at 09:57:48PM +0100, Al Viro wrote: > > > On Fri, Sep 14, 2018 at 01:35:06PM -0700, Darren Hart wrote: > > > > > > > Acked-by: Darren Hart (VMware) > >

Re: [PATCH net-next v5 02/20] zinc: introduce minimal cryptography library

2018-09-22 Thread Arnd Bergmann
On Thu, Sep 20, 2018 at 5:12 PM Jason A. Donenfeld wrote: > > Hey Arnd, > > On Thu, Sep 20, 2018 at 6:02 PM Arnd Bergmann wrote: > > Right, if you hit a stack requirement like this, it's usually the compiler > > doing something bad, not just using too much stack b

Re: [PATCH net-next v5 02/20] zinc: introduce minimal cryptography library

2018-09-20 Thread Arnd Bergmann
On Thu, Sep 20, 2018 at 8:41 AM Ard Biesheuvel wrote: > > (+ Arnd, Eric) > > On 18 September 2018 at 09:16, Jason A. Donenfeld wrote: > ... > > > diff --git a/lib/zinc/Makefile b/lib/zinc/Makefile > > new file mode 100644 > > index ..83dfd63988c0 > > --- /dev/null > > +++ b/lib/zinc/M

[PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-12 Thread Arnd Bergmann
e not interpreted as integer values. Signed-off-by: Arnd Bergmann --- drivers/android/binder.c| 2 +- drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 +- drivers/dma-buf/dma-buf.c | 4 +--- drivers/dma-buf/sw_sync.c | 2 +- drivers/dm

Re: [PATCH 1/4] treewide: convert ISO_8859-1 text comments to utf-8

2018-07-25 Thread Arnd Bergmann
24 Jul 2018 13:13:25 +0200 Arnd Bergmann wrote: >> > > Almost all files in the kernel are either plain text or UTF-8 >> > > encoded. A couple however are ISO_8859-1, usually just a few >> > > characters in a C comments, for historic reasons. >> > > T

[PATCH 1/4] treewide: convert ISO_8859-1 text comments to utf-8

2018-07-24 Thread Arnd Bergmann
Almost all files in the kernel are either plain text or UTF-8 encoded. A couple however are ISO_8859-1, usually just a few characters in a C comments, for historic reasons. This converts them all to UTF-8 for consistency. Signed-off-by: Arnd Bergmann --- .../devicetree/bindings/net/nfc/pn544

Re: [PATCH v4 11/14] treewide: Prepare to remove VLA usage for AHASH_REQUEST_ON_STACK

2018-07-18 Thread Arnd Bergmann
On Wed, Jul 18, 2018 at 5:19 PM, Ard Biesheuvel wrote: > On 18 July 2018 at 23:50, Ard Biesheuvel wrote: >> On 18 July 2018 at 05:59, Arnd Bergmann wrote: >>> On Sun, Jul 15, 2018 at 6:28 AM, Kees Cook wrote: >>>> >>>> After my ahash to shash conversio

Re: [PATCH v4 11/14] treewide: Prepare to remove VLA usage for AHASH_REQUEST_ON_STACK

2018-07-17 Thread Arnd Bergmann
On Sun, Jul 15, 2018 at 6:28 AM, Kees Cook wrote: > > After my ahash to shash conversions, only ccm is left as an ahash > user, since it actually uses sg. But with the hard-coded value reduced > to 376, this doesn't trip the frame warnings any more. :) > > I'll send an updated series soon. Maybe

  1   2   3   4   >