[PATCH 3/3] crypto: tcrypt - include 1420 byte blocks in aead and skcipher benchmarks

2020-11-09 Thread Ard Biesheuvel
WireGuard and IPsec both typically operate on input blocks that are ~1420 bytes in size, given the default Ethernet MTU of 1500 bytes and the overhead of the VPN metadata. Many aead and sckipher implementations are optimized for power-of-2 block sizes, and whether they perform well when operating

[PATCH 0/3] crypto: tcrypt enhancements

2020-11-09 Thread Ard Biesheuvel
Some tcrypt enhancements that I have been using locally to test and benchmark crypto algorithms on the command line using KVM: - allow tcrypt.ko to be builtin and defer its initialization to late_initcall - add 1420 byte blocks to the list of benchmarked block sizes for AEADs and skciphers, to ge

[PATCH 1/3] crypto: tcrypt - don't initialize at subsys_initcall time

2020-11-09 Thread Ard Biesheuvel
Commit c4741b2305979 ("crypto: run initcalls for generic implementations earlier") converted tcrypt.ko's module_init() to subsys_initcall(), but this was unintentional: tcrypt.ko currently cannot be built into the core kernel, and so the subsys_initcall() gets converted into module_init() under the

[PATCH 2/3] crypto: tcrypt - permit tcrypt.ko to be builtin

2020-11-09 Thread Ard Biesheuvel
When working on crypto algorithms, being able to run tcrypt quickly without booting an entire Linux installation can be very useful. For instance, QEMU/kvm can be used to boot a kernel from the command line, and having tcrypt.ko builtin would allow tcrypt to be executed to run benchmarks, or to run

[PATCH] crypto:hisilicon/sec2 - Fix aead authentication setting key error.

2020-11-09 Thread Kai Ye
Fix aead auth setting key process error. if use soft shash function, driver need to use digest size replace of the user input key length. Signed-off-by: Kai Ye --- drivers/crypto/hisilicon/sec2/sec_crypto.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/h

Re: [PATCH v7] mm/zswap: move to use crypto_acomp API for hardware acceleration

2020-11-09 Thread Sebastian Andrzej Siewior
I've been looking at the patch and it looks like it should work. Having numbers to backup the performance in the pure-software version and with HW acceleration would _very_ nice to have. On 2020-11-07 19:53:32 [+1300], Barry Song wrote: > index fbb7829..73f04de 100644 > --- a/mm/zswap.c > +++ b/mm

RE: [PATCH v7] mm/zswap: move to use crypto_acomp API for hardware acceleration

2020-11-09 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Sebastian Andrzej Siewior [mailto:bige...@linutronix.de] > Sent: Monday, November 9, 2020 11:29 PM > To: Song Bao Hua (Barry Song) > Cc: linux...@kvack.org; linux-crypto@vger.kernel.org; > a...@linux-foundation.org; Linuxarm ; fanghao (A) > ; linux-ker...@vger

[PATCH v9,net-next,00/12] Add Support for Marvell OcteonTX2 Cryptographic Acceleration Unit

2020-11-09 Thread Srujana Challa
This series introduces crypto(CPT) drivers(PF & VF) for Marvell OcteonTX2 CN96XX Soc. OcteonTX2 SOC's resource virtualization unit (RVU) supports multiple physical and virtual functions. Each of the PF/VF's functionality is determined by what kind of resources are attached to it. When the CPT bloc

[PATCH v9,net-next,02/12] octeontx2-af: add mailbox interface for CPT

2020-11-09 Thread Srujana Challa
On OcteonTX2 SoC, the admin function (AF) is the only one with all priviliges to configure HW and alloc resources, PFs and it's VFs have to request AF via mailbox for all their needs. This patch adds a mailbox interface for CPT PFs and VFs to allocate resources for cryptography. It also adds hardwa

[PATCH v9,net-next,06/12] crypto: octeontx2: enable SR-IOV and mailbox communication with VF

2020-11-09 Thread Srujana Challa
Adds 'sriov_configure' to enable/disable virtual functions (VFs). Also Initializes VF<=>PF mailbox IRQs, register handlers for processing these mailbox messages. Admin function (AF) handles resource allocation and configuration for PFs and their VFs. PFs request the AF directly, via mailboxes. Unl

[PATCH v9,net-next,04/12] drivers: crypto: add Marvell OcteonTX2 CPT PF driver

2020-11-09 Thread Srujana Challa
Adds skeleton for the Marvell OcteonTX2 CPT physical function driver which includes probe, PCI specific initialization and hardware register defines. RVU defines are present in AF driver (drivers/net/ethernet/marvell/octeontx2/af), header files from AF driver are included here to avoid duplication.

[PATCH v9,net-next,05/12] crypto: octeontx2: add mailbox communication with AF

2020-11-09 Thread Srujana Challa
In the resource virtualization unit (RVU) each of the PF and AF (admin function) share a 64KB of reserved memory region for communication. This patch initializes PF <=> AF mailbox IRQs, registers handlers for processing these communication messages. Signed-off-by: Suheil Chandran Signed-off-by: L

[PATCH v9,net-next,01/12] octeontx2-pf: move lmt flush to include/linux/soc

2020-11-09 Thread Srujana Challa
On OcteonTX2 platform CPT instruction enqueue and NIX packet send are only possible via LMTST operations which uses LDEOR instruction. This patch moves lmt flush function from OcteonTX2 nic driver to include/linux/soc since it will be used by OcteonTX2 CPT and NIC driver for LMTST. Signed-off-by:

[PATCH v9,net-next,03/12] octeontx2-af: add debugfs entries for CPT block

2020-11-09 Thread Srujana Challa
Add entries to debugfs at /sys/kernel/debug/octeontx2/cpt. cpt_pc: dump cpt performance HW registers. Usage: cat /sys/kernel/debug/octeontx2/cpt/cpt_pc cpt_ae_sts: show cpt asymmetric engines current state Usage: cat /sys/kernel/debug/octeontx2/cpt/cpt_ae_sts cpt_se_sts: show cpt symmetric engin

[PATCH v9,net-next,10/12] crypto: octeontx2: add virtual function driver support

2020-11-09 Thread Srujana Challa
Add support for the Marvell OcteonTX2 CPT virtual function driver. This patch includes probe, PCI specific initialization and interrupt handling. Signed-off-by: Suheil Chandran Signed-off-by: Lukasz Bartosik Signed-off-by: Srujana Challa --- drivers/crypto/marvell/octeontx2/Makefile | 4

[PATCH v9,net-next,11/12] crypto: octeontx2: add support to process the crypto request

2020-11-09 Thread Srujana Challa
Attach LFs to CPT VF to process the crypto requests and register LF interrupts. Signed-off-by: Suheil Chandran Signed-off-by: Lukasz Bartosik Signed-off-by: Srujana Challa --- drivers/crypto/marvell/octeontx2/Makefile | 2 +- .../marvell/octeontx2/otx2_cpt_common.h | 3 + .../mar

[PATCH v9,net-next,07/12] crypto: octeontx2: load microcode and create engine groups

2020-11-09 Thread Srujana Challa
CPT includes microcoded GigaCypher symmetric engines(SEs), IPsec symmetric engines(IEs), and asymmetric engines (AEs). Each engine receives CPT instructions from the engine groups it has subscribed to. This patch loads microcode, configures three engine groups(one for SEs, one for IEs and one for A

[PATCH v9,net-next,08/12] crypto: octeontx2: add LF framework

2020-11-09 Thread Srujana Challa
CPT RVU Local Functions(LFs) needs to be attached to the PF/VF to submit the instructions to CPT. This patch adds the interface to initialize and attach the LFs. It also adds interface to register the LF's interrupts. Signed-off-by: Suheil Chandran Signed-off-by: Lukasz Bartosik Signed-off-by: S

[PATCH v9,net-next,09/12] crypto: octeontx2: add support to get engine capabilities

2020-11-09 Thread Srujana Challa
Adds support to get engine capabilities and adds a new mailbox to share capabilities with VF driver. Signed-off-by: Suheil Chandran Signed-off-by: Srujana Challa --- .../marvell/octeontx2/otx2_cpt_common.h | 36 .../marvell/octeontx2/otx2_cpt_reqmgr.h | 51 ++ drivers/cry

[PATCH v9,net-next,12/12] crypto: octeontx2: register with linux crypto framework

2020-11-09 Thread Srujana Challa
CPT offload module utilises the linux crypto framework to offload crypto processing. This patch registers supported algorithms by calling registration functions provided by the kernel crypto API. The module currently supports: - AES block cipher in CBC,ECB,XTS and CFB mode. - 3DES block cipher in

[PATCH v1] include: crypto - remove the unused include

2020-11-09 Thread Dawning
In the public_key.h file, the #include is not necessary Fixes: 215525639631a("X.509: support OSCCA SM2-with-SM3 certificate verification") Cc: Tianjia Zhang Signed-off-by: Dawning --- include/crypto/public_key.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/crypto/public_key.h b/

Re: [PATCH v2 1/3] dt-bindings: crypto: Add Keem Bay OCS HCU bindings

2020-11-09 Thread Rob Herring
On Tue, Nov 03, 2020 at 06:49:23PM +, Daniele Alessandrelli wrote: > From: Declan Murphy > > Add device-tree bindings for the Intel Keem Bay Offload Crypto Subsystem > (OCS) Hashing Control Unit (HCU) crypto driver. > > Signed-off-by: Declan Murphy > Signed-off-by: Daniele Alessandrelli >

Re: [PATCH 1/3] crypto: tcrypt - don't initialize at subsys_initcall time

2020-11-09 Thread Eric Biggers
On Mon, Nov 09, 2020 at 09:31:41AM +0100, Ard Biesheuvel wrote: > Commit c4741b2305979 ("crypto: run initcalls for generic implementations > earlier") converted tcrypt.ko's module_init() to subsys_initcall(), but > this was unintentional: tcrypt.ko currently cannot be built into the core > kernel,

Re: [PATCH v5 1/9] lib: zstd: Add zstd compatibility wrapper

2020-11-09 Thread Chris Mason
On 6 Nov 2020, at 13:38, Christoph Hellwig wrote: You just keep resedning this crap, don't you? Haven't you been told multiple times to provide a proper kernel API by now? You do consistently ask for a shim layer, but you haven’t explained what we gain by diverging from the documented and

jitterentropy: `jent_mod_init()` takes 17 ms

2020-11-09 Thread Paul Menzel
Dear Linux folks, By mistake I built `XFRM_ESP` into the Linux kernel, resulting in CONFIG_CRYPTO_SEQIV=y CONFIG_CRYPTO_ECHAINIV=y and also the Jitterentropy RNG to be built in. CRYPTO_JITTERENTROPY=y So, on the Asus F2A85-M PRO starting Linux 4.10-rc3 with `initcall_debug`, the

Re: Subject: [RFC] clang tooling cleanups

2020-11-09 Thread Joe Perches
On Tue, 2020-10-27 at 09:42 -0700, t...@redhat.com wrote: > This rfc will describe > An upcoming treewide cleanup. > How clang tooling was used to programatically do the clean up. > Solicit opinions on how to generally use clang tooling. > > The clang warning -Wextra-semi-stmt produces about 10k w

[PATCH] crypto: arm64/gcm - move authentication tag check to SIMD domain

2020-11-09 Thread Ard Biesheuvel
Instead of copying the calculated authentication tag to memory and calling crypto_memneq() to verify it, use vector bytewise compare and min across vector instructions to decide whether the tag is valid. This is more efficient, and given that the tag is only transiently held in a NEON register, it