Re: [PATCH v2 03/12] soc: fsl: dpio: add frame list format support

2018-09-14 Thread Li Yang
On Wed, Sep 12, 2018 at 4:02 AM Horia Geantă wrote: > > Add support for dpaa2_fd_list format, i.e. dpaa2_fl_entry structure > and accessors. > > Frame list entries (FLEs) are similar, but not identical to FDs: > + "F" (final) bit > - FMT[b'01] is reserved > - DD, SC, DROPP bits (covered by "FD com

[PATCH 1/2] Fix static checker warning

2018-09-14 Thread Janakarajan Natarajan
Under certain configuration SEV functions can be defined as no-op. In such a case error can be uninitialized. Initialize the variable to 0. Cc: Dan Carpenter Reported-by: Dan Carpenter Signed-off-by: Janakarajan Natarajan --- drivers/crypto/ccp/psp-dev.c | 2 +- 1 file changed, 1 insertion(+)

[PATCH 2/2] Allow SEV firmware to be chosen based on Family and Model

2018-09-14 Thread Janakarajan Natarajan
During PSP initialization, there is an attempt to update the SEV firmware by looking in /lib/firmware/amd/. Currently, sev.fw is the expected name of the firmware blob. This patch will allow for firmware filenames based on the family and model of the processor. Model specific firmware files are g

[PATCH 0/2] Miscellaneous SEV fixes

2018-09-14 Thread Janakarajan Natarajan
The first patch provides a fix for a static checker warning. The second patch allows for the SEV firmware blob, which will be searched for when updating SEV during PSP initialization, to be named based on the family and model of the processor. Janakarajan Natarajan (2): Fix static checker warni

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

2018-09-14 Thread Al Viro
On Fri, Sep 14, 2018 at 01:35:06PM -0700, Darren Hart wrote: > Acked-by: Darren Hart (VMware) > > As for a longer term solution, would it be possible to init fops in such > a way that the compat_ioctl call defaults to generic_compat_ioctl_ptrarg > so we don't have to duplicate this boilerplate

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

2018-09-14 Thread Darren Hart
On Wed, Sep 12, 2018 at 05:08:52PM +0200, Arnd Bergmann wrote: > The .ioctl and .compat_ioctl file operations have the same prototype so > they can both point to the same function, which works great almost all > the time when all the commands are compatible. > > One exception is the s390 architect

Re: [PATCH net-next v4 18/20] crypto: port ChaCha20 to Zinc

2018-09-14 Thread Jason A. Donenfeld
On Fri, Sep 14, 2018 at 7:38 PM Ard Biesheuvel wrote: > so could we please bring that discussion to a close before we drop the ARM > code? My understanding is that either these will find their way up to AndyP and then back down here, or Eric or you will augment the .S in this patch at a later da

Re: [PATCH net-next v4 00/20] WireGuard: Secure Network Tunnel

2018-09-14 Thread Jason A. Donenfeld
On Fri, Sep 14, 2018 at 7:40 PM Ard Biesheuvel wrote: > > - Move away from makefile ifdef maze and instead prefer kconfig values, > > which also makes the design a bit more modular too, which could help > > in the future. > > Could you elaborate on this? From the patches, it is not clear

Re: [PATCH net-next v4 08/20] zinc: Poly1305 ARM and ARM64 implementations

2018-09-14 Thread Jason A. Donenfeld
Hi Ard, On Fri, Sep 14, 2018 at 7:27 PM Ard Biesheuvel wrote: > As I asked in response to v3, could we please have this as a separate > patch on top? The diff below is corrupted. I had played with that originally, but thought it made things actually harder to review, whereas here you have the ch

Re: [PATCH net-next v4 00/20] WireGuard: Secure Network Tunnel

2018-09-14 Thread Ard Biesheuvel
On 14 September 2018 at 18:19, Jason A. Donenfeld wrote: > Changes v3->v4: > - Remove mistaken double 07/17 patch. > - Fix whitespace issues in blake2s assembly. > - It's not possible to put compound literals into __initconst, so > we now instead just use boring fixed size struct members

Re: [PATCH net-next v4 18/20] crypto: port ChaCha20 to Zinc

2018-09-14 Thread Ard Biesheuvel
On 14 September 2018 at 18:22, Jason A. Donenfeld wrote: > Now that ChaCha20 is in Zinc, we can have the crypto API code simply > call into it. The crypto API expects to have a stored key per instance > and independent nonces, so we follow suite and store the key and > initialize the nonce indepen

Re: [PATCH net-next v4 08/20] zinc: Poly1305 ARM and ARM64 implementations

2018-09-14 Thread Ard Biesheuvel
On 14 September 2018 at 18:22, Jason A. Donenfeld wrote: > These NEON and non-NEON implementations come from Andy Polyakov's > implementation. They are exactly the same as Andy Polyakov's original, > with the following exceptions: > > - Entries and exits use the proper kernel convention macro. > -

[PATCH net-next v4 12/20] zinc: BLAKE2s generic C implementation and selftest

2018-09-14 Thread Jason A. Donenfeld
The C implementation was originally based on Samuel Neves' public domain reference implementation but has since been heavily modified for the kernel. We're able to do compile-time optimizations by moving some scaffolding around the final function into the header file. Information: https://blake2.n

[PATCH net-next v4 15/20] zinc: Curve25519 ARM implementation

2018-09-14 Thread Jason A. Donenfeld
This comes from Dan Bernstein and Peter Schwabe's public domain NEON code, and has been modified to be friendly for kernel space, as well as removing some qhasm strangeness to be more idiomatic. Signed-off-by: Jason A. Donenfeld Cc: Samuel Neves Cc: Andy Lutomirski Cc: Greg KH Cc: Jean-Philipp

[PATCH net-next v4 16/20] zinc: Curve25519 x86_64 implementation

2018-09-14 Thread Jason A. Donenfeld
This implementation is the fastest available x86_64 implementation, and unlike Sandy2x, it doesn't requie use of the floating point registers at all. Instead it makes use of BMI2 and ADX, available on recent microarchitectures. The implementation was written by Armando Faz-Hernández with contributi

[PATCH net-next v4 14/20] zinc: Curve25519 generic C implementations and selftest

2018-09-14 Thread Jason A. Donenfeld
This contains two formally verified C implementations of the Curve25519 scalar multiplication function, one for 32-bit systems, and one for 64-bit systems whose compiler supports efficient 128-bit integer types. Not only are these implementations formally verified, but they are also the fastest ava

Re: [PATCH] crypto: chacha20 - Fix chacha20_block() keystream alignment (again)

2018-09-14 Thread Eric Biggers
Hi Yann, On Wed, Sep 12, 2018 at 11:50:00AM +0200, Yann Droneaud wrote: > Hi, > > Le mardi 11 septembre 2018 à 20:05 -0700, Eric Biggers a écrit : > > From: Eric Biggers > > > > In commit 9f480faec58c ("crypto: chacha20 - Fix keystream alignment for > > chacha20_block()"), I had missed that cha

[PATCH net-next v4 18/20] crypto: port ChaCha20 to Zinc

2018-09-14 Thread Jason A. Donenfeld
Now that ChaCha20 is in Zinc, we can have the crypto API code simply call into it. The crypto API expects to have a stored key per instance and independent nonces, so we follow suite and store the key and initialize the nonce independently. Signed-off-by: Jason A. Donenfeld Cc: Samuel Neves Cc:

[PATCH net-next v4 17/20] crypto: port Poly1305 to Zinc

2018-09-14 Thread Jason A. Donenfeld
Now that Poly1305 is in Zinc, we can have the crypto API code simply call into it. We have to do a little bit of book keeping here, because the crypto API receives the key in the first few calls to update. Signed-off-by: Jason A. Donenfeld Cc: Samuel Neves Cc: Andy Lutomirski Cc: Greg KH Cc: J

[PATCH net-next v4 19/20] security/keys: rewrite big_key crypto to use Zinc

2018-09-14 Thread Jason A. Donenfeld
A while back, I noticed that the crypto and crypto API usage in big_keys were entirely broken in multiple ways, so I rewrote it. Now, I'm rewriting it again, but this time using Zinc's ChaCha20Poly1305 function. This makes the file considerably more simple; the diffstat alone should justify this co

[PATCH net-next v4 09/20] zinc: Poly1305 x86_64 implementation

2018-09-14 Thread Jason A. Donenfeld
This provides AVX, AVX-2, and AVX-512F implementations for Poly1305. The AVX-512F implementation is disabled on Skylake, due to throttling. These come from Andy Polyakov's implementation, with the following modifications from Samuel Neves: - Some cosmetic changes, like renaming labels to .Lname,

[PATCH net-next v4 07/20] zinc: Poly1305 generic C implementations and selftest

2018-09-14 Thread Jason A. Donenfeld
These two C implementations -- a 32x32 one and a 64x64 one, depending on the platform -- come from Andrew Moon's public domain poly1305-donna portable code, modified for usage in the kernel and for usage with accelerated primitives. Information: https://cr.yp.to/mac.html Signed-off-by: Jason A. D

[PATCH net-next v4 13/20] zinc: BLAKE2s x86_64 implementation

2018-09-14 Thread Jason A. Donenfeld
These implementations from Samuel Neves support AVX and AVX-512VL. Originally this used AVX-512F, but Skylake thermal throttling made AVX-512VL more attractive and possible to do with negligable difference. Signed-off-by: Jason A. Donenfeld Signed-off-by: Samuel Neves Cc: Andy Lutomirski Cc: Gr

[PATCH net-next v4 10/20] zinc: Poly1305 MIPS32r2 and MIPS64 implementations

2018-09-14 Thread Jason A. Donenfeld
This MIPS32r2 implementation comes from René van Dorst and me and results in a nice speedup on the usual OpenWRT targets. The MIPS64 implementation comes from Andy Polyakov results in a nice speedup on commodity Octeon hardware, and has been modified slightly from the original: - The function name

[PATCH net-next v4 08/20] zinc: Poly1305 ARM and ARM64 implementations

2018-09-14 Thread Jason A. Donenfeld
These NEON and non-NEON implementations come from Andy Polyakov's implementation. They are exactly the same as Andy Polyakov's original, with the following exceptions: - Entries and exits use the proper kernel convention macro. - CPU feature checking is done in C by the glue code, so that has been

[PATCH net-next v4 05/20] zinc: ChaCha20 x86_64 implementation

2018-09-14 Thread Jason A. Donenfeld
This provides SSSE3, AVX-2, AVX-512F, and AVX-512VL implementations for ChaCha20. The AVX-512F implementation is disabled on Skylake, due to throttling, and the VL ymm implementation is used instead. These come from Andy Polyakov's implementation, with the following modifications from Samuel Neves:

[PATCH net-next v4 06/20] zinc: ChaCha20 MIPS32r2 implementation

2018-09-14 Thread Jason A. Donenfeld
This MIPS32r2 implementation comes from René van Dorst and me and results in a nice speedup on the usual OpenWRT targets. Signed-off-by: Jason A. Donenfeld Signed-off-by: René van Dorst Cc: Samuel Neves Cc: Andy Lutomirski Cc: Greg KH Cc: Jean-Philippe Aumasson Cc: Ralf Baechle Cc: Paul Bur

[PATCH net-next v4 04/20] zinc: ChaCha20 ARM and ARM64 implementations

2018-09-14 Thread Jason A. Donenfeld
These NEON and non-NEON implementations come from Andy Polyakov's implementation. They are exactly the same as Andy Polyakov's original, with the following exceptions: - Entries and exits use the proper kernel convention macro. - CPU feature checking is done in C by the glue code, so that has been

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

2018-09-14 Thread Jason A. Donenfeld
Zinc stands for "Zinc Is Neat Crypto" or "Zinc as IN Crypto" or maybe just "Zx2c4's INsane Cryptolib." It's also short, easy to type, and plays nicely with the recent trend of naming crypto libraries after elements. The guiding principle is "don't overdo it". It's less of a library and more of a di

[PATCH net-next v4 00/20] WireGuard: Secure Network Tunnel

2018-09-14 Thread Jason A. Donenfeld
Changes v3->v4: - Remove mistaken double 07/17 patch. - Fix whitespace issues in blake2s assembly. - It's not possible to put compound literals into __initconst, so we now instead just use boring fixed size struct members. - Move away from makefile ifdef maze and instead prefer kconfig

[PATCH net-next v4 01/20] asm: simd context helper API

2018-09-14 Thread Jason A. Donenfeld
Sometimes it's useful to amortize calls to XSAVE/XRSTOR and the related FPU/SIMD functions over a number of calls, because FPU restoration is quite expensive. This adds a simple header for carrying out this pattern: simd_context_t simd_context = simd_get(); while ((item = get_item_from_que

[PATCH net-next v4 03/20] zinc: ChaCha20 generic C implementation

2018-09-14 Thread Jason A. Donenfeld
This implements the ChaCha20 permutation as a single C statement, by way of the comma operator, which the compiler is able to simplify terrifically. Information: https://cr.yp.to/chacha.html Signed-off-by: Jason A. Donenfeld Cc: Samuel Neves Cc: Andy Lutomirski Cc: Greg KH Cc: Jean-Philippe A

[PATCH net-next v4 00/20] WireGuard: Secure Network Tunnel

2018-09-14 Thread Jason A. Donenfeld
Changes v3->v4: - Remove mistaken double 07/17 patch. - Fix whitespace issues in blake2s assembly. - It's not possible to put compound literals into __initconst, so we now instead just use boring fixed size struct members. - Move away from makefile ifdef maze and instead prefer kconfig

[PATCH] crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic

2018-09-14 Thread Horia Geantă
In some cases the zero-length hw_desc array at the end of ablkcipher_edesc struct requires for 4B of tail padding. Due to tail padding and the way pointers to S/G table and IV are computed: edesc->sec4_sg = (void *)edesc + sizeof(struct ablkcipher_edesc) + desc_byt

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

2018-09-14 Thread David Sterba
On Wed, Sep 12, 2018 at 05:08:52PM +0200, Arnd Bergmann wrote: > The .ioctl and .compat_ioctl file operations have the same prototype so > they can both point to the same function, which works great almost all > the time when all the commands are compatible. > > One exception is the s390 architect

Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-14 Thread Jerome Glisse
On Fri, Sep 14, 2018 at 06:50:55AM +, Tian, Kevin wrote: > > From: Jerome Glisse > > Sent: Thursday, September 13, 2018 10:52 PM > > > [...] > > AFAIK, on x86 and PPC at least, all PCIE devices are in the same group > > by default at boot or at least all devices behind the same bridge. > > th

Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-14 Thread Jerome Glisse
On Fri, Sep 14, 2018 at 11:12:01AM +0800, Kenneth Lee wrote: > On Thu, Sep 13, 2018 at 10:51:50AM -0400, Jerome Glisse wrote: > > On Thu, Sep 13, 2018 at 04:32:32PM +0800, Kenneth Lee wrote: > > > On Tue, Sep 11, 2018 at 09:40:14AM -0400, Jerome Glisse wrote: > > > > On Tue, Sep 11, 2018 at 02:40:4

Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-14 Thread Kenneth Lee
On Fri, Sep 14, 2018 at 06:50:55AM +, Tian, Kevin wrote: > Date: Fri, 14 Sep 2018 06:50:55 + > From: "Tian, Kevin" > To: Jerome Glisse , Kenneth Lee > CC: Kenneth Lee , Alex Williamson > , Herbert Xu , > "k...@vger.kernel.org" , Jonathan Corbet > , Greg Kroah-Hartman , Zaibo > Xu , "l

Re: [PATCH net-next v3 02/17] zinc: introduce minimal cryptography library

2018-09-14 Thread Jason A. Donenfeld
On Fri, Sep 14, 2018 at 8:15 AM Ard Biesheuvel wrote: > OK, so given random.c's future dependency on Zinc (for ChaCha20), and > the fact that Zinc is one monolithic piece of code, all versions of > all algorithms will always be statically linked into the kernel > proper. I'm not sure that is accep