Skip to content

Commit 07266d0

Browse files
committed
Merge branch 'wireguard-patches-for-5-19-rc6'
Jason A. Donenfeld says: ==================== wireguard patches for 5.19-rc6 1) A few small fixups to the selftests, per usual. Of particular note is a fix for a test flake that occurred on especially fast systems that boot in less than a second. 2) An addition during this cycle of some s390 crypto interacted with the way wireguard selects dependencies, resulting in linker errors reported by the kernel test robot. So Vladis sent in a patch for that, which also required a small preparatory fix moving some Kconfig symbols around. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents faa4e04 + 0d1f700 commit 07266d0

File tree

13 files changed

+157
-134
lines changed

13 files changed

+157
-134
lines changed

crypto/Kconfig

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,18 @@ config CRYPTO_CRC32_MIPS
666666
CRC32c and CRC32 CRC algorithms implemented using mips crypto
667667
instructions, when available.
668668

669+
config CRYPTO_CRC32_S390
670+
tristate "CRC-32 algorithms"
671+
depends on S390
672+
select CRYPTO_HASH
673+
select CRC32
674+
help
675+
Select this option if you want to use hardware accelerated
676+
implementations of CRC algorithms. With this option, you
677+
can optimize the computation of CRC-32 (IEEE 802.3 Ethernet)
678+
and CRC-32C (Castagnoli).
679+
680+
It is available with IBM z13 or later.
669681

670682
config CRYPTO_XXHASH
671683
tristate "xxHash hash algorithm"
@@ -898,6 +910,16 @@ config CRYPTO_SHA512_SSSE3
898910
Extensions version 1 (AVX1), or Advanced Vector Extensions
899911
version 2 (AVX2) instructions, when available.
900912

913+
config CRYPTO_SHA512_S390
914+
tristate "SHA384 and SHA512 digest algorithm"
915+
depends on S390
916+
select CRYPTO_HASH
917+
help
918+
This is the s390 hardware accelerated implementation of the
919+
SHA512 secure hash standard.
920+
921+
It is available as of z10.
922+
901923
config CRYPTO_SHA1_OCTEON
902924
tristate "SHA1 digest algorithm (OCTEON)"
903925
depends on CPU_CAVIUM_OCTEON
@@ -930,6 +952,16 @@ config CRYPTO_SHA1_PPC_SPE
930952
SHA-1 secure hash standard (DFIPS 180-4) implemented
931953
using powerpc SPE SIMD instruction set.
932954

955+
config CRYPTO_SHA1_S390
956+
tristate "SHA1 digest algorithm"
957+
depends on S390
958+
select CRYPTO_HASH
959+
help
960+
This is the s390 hardware accelerated implementation of the
961+
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
962+
963+
It is available as of z990.
964+
933965
config CRYPTO_SHA256
934966
tristate "SHA224 and SHA256 digest algorithm"
935967
select CRYPTO_HASH
@@ -970,6 +1002,16 @@ config CRYPTO_SHA256_SPARC64
9701002
SHA-256 secure hash standard (DFIPS 180-2) implemented
9711003
using sparc64 crypto instructions, when available.
9721004

1005+
config CRYPTO_SHA256_S390
1006+
tristate "SHA256 digest algorithm"
1007+
depends on S390
1008+
select CRYPTO_HASH
1009+
help
1010+
This is the s390 hardware accelerated implementation of the
1011+
SHA256 secure hash standard (DFIPS 180-2).
1012+
1013+
It is available as of z9.
1014+
9731015
config CRYPTO_SHA512
9741016
tristate "SHA384 and SHA512 digest algorithms"
9751017
select CRYPTO_HASH
@@ -1010,6 +1052,26 @@ config CRYPTO_SHA3
10101052
References:
10111053
http://keccak.noekeon.org/
10121054

1055+
config CRYPTO_SHA3_256_S390
1056+
tristate "SHA3_224 and SHA3_256 digest algorithm"
1057+
depends on S390
1058+
select CRYPTO_HASH
1059+
help
1060+
This is the s390 hardware accelerated implementation of the
1061+
SHA3_256 secure hash standard.
1062+
1063+
It is available as of z14.
1064+
1065+
config CRYPTO_SHA3_512_S390
1066+
tristate "SHA3_384 and SHA3_512 digest algorithm"
1067+
depends on S390
1068+
select CRYPTO_HASH
1069+
help
1070+
This is the s390 hardware accelerated implementation of the
1071+
SHA3_512 secure hash standard.
1072+
1073+
It is available as of z14.
1074+
10131075
config CRYPTO_SM3
10141076
tristate
10151077

@@ -1070,6 +1132,16 @@ config CRYPTO_GHASH_CLMUL_NI_INTEL
10701132
This is the x86_64 CLMUL-NI accelerated implementation of
10711133
GHASH, the hash function used in GCM (Galois/Counter mode).
10721134

1135+
config CRYPTO_GHASH_S390
1136+
tristate "GHASH hash function"
1137+
depends on S390
1138+
select CRYPTO_HASH
1139+
help
1140+
This is the s390 hardware accelerated implementation of GHASH,
1141+
the hash function used in GCM (Galois/Counter mode).
1142+
1143+
It is available as of z196.
1144+
10731145
comment "Ciphers"
10741146

10751147
config CRYPTO_AES
@@ -1185,6 +1257,23 @@ config CRYPTO_AES_PPC_SPE
11851257
architecture specific assembler implementations that work on 1KB
11861258
tables or 256 bytes S-boxes.
11871259

1260+
config CRYPTO_AES_S390
1261+
tristate "AES cipher algorithms"
1262+
depends on S390
1263+
select CRYPTO_ALGAPI
1264+
select CRYPTO_SKCIPHER
1265+
help
1266+
This is the s390 hardware accelerated implementation of the
1267+
AES cipher algorithms (FIPS-197).
1268+
1269+
As of z9 the ECB and CBC modes are hardware accelerated
1270+
for 128 bit keys.
1271+
As of z10 the ECB and CBC modes are hardware accelerated
1272+
for all AES key sizes.
1273+
As of z196 the CTR mode is hardware accelerated for all AES
1274+
key sizes and XTS mode is hardware accelerated for 256 and
1275+
512 bit keys.
1276+
11881277
config CRYPTO_ANUBIS
11891278
tristate "Anubis cipher algorithm"
11901279
depends on CRYPTO_USER_API_ENABLE_OBSOLETE
@@ -1415,6 +1504,19 @@ config CRYPTO_DES3_EDE_X86_64
14151504
algorithm are provided; regular processing one input block and
14161505
one that processes three blocks parallel.
14171506

1507+
config CRYPTO_DES_S390
1508+
tristate "DES and Triple DES cipher algorithms"
1509+
depends on S390
1510+
select CRYPTO_ALGAPI
1511+
select CRYPTO_SKCIPHER
1512+
select CRYPTO_LIB_DES
1513+
help
1514+
This is the s390 hardware accelerated implementation of the
1515+
DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
1516+
1517+
As of z990 the ECB and CBC mode are hardware accelerated.
1518+
As of z196 the CTR mode is hardware accelerated.
1519+
14181520
config CRYPTO_FCRYPT
14191521
tristate "FCrypt cipher algorithm"
14201522
select CRYPTO_ALGAPI
@@ -1474,6 +1576,18 @@ config CRYPTO_CHACHA_MIPS
14741576
select CRYPTO_SKCIPHER
14751577
select CRYPTO_ARCH_HAVE_LIB_CHACHA
14761578

1579+
config CRYPTO_CHACHA_S390
1580+
tristate "ChaCha20 stream cipher"
1581+
depends on S390
1582+
select CRYPTO_SKCIPHER
1583+
select CRYPTO_LIB_CHACHA_GENERIC
1584+
select CRYPTO_ARCH_HAVE_LIB_CHACHA
1585+
help
1586+
This is the s390 SIMD implementation of the ChaCha20 stream
1587+
cipher (RFC 7539).
1588+
1589+
It is available as of z13.
1590+
14771591
config CRYPTO_SEED
14781592
tristate "SEED cipher algorithm"
14791593
depends on CRYPTO_USER_API_ENABLE_OBSOLETE

drivers/crypto/Kconfig

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -133,98 +133,6 @@ config CRYPTO_PAES_S390
133133
Select this option if you want to use the paes cipher
134134
for example to use protected key encrypted devices.
135135

136-
config CRYPTO_SHA1_S390
137-
tristate "SHA1 digest algorithm"
138-
depends on S390
139-
select CRYPTO_HASH
140-
help
141-
This is the s390 hardware accelerated implementation of the
142-
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
143-
144-
It is available as of z990.
145-
146-
config CRYPTO_SHA256_S390
147-
tristate "SHA256 digest algorithm"
148-
depends on S390
149-
select CRYPTO_HASH
150-
help
151-
This is the s390 hardware accelerated implementation of the
152-
SHA256 secure hash standard (DFIPS 180-2).
153-
154-
It is available as of z9.
155-
156-
config CRYPTO_SHA512_S390
157-
tristate "SHA384 and SHA512 digest algorithm"
158-
depends on S390
159-
select CRYPTO_HASH
160-
help
161-
This is the s390 hardware accelerated implementation of the
162-
SHA512 secure hash standard.
163-
164-
It is available as of z10.
165-
166-
config CRYPTO_SHA3_256_S390
167-
tristate "SHA3_224 and SHA3_256 digest algorithm"
168-
depends on S390
169-
select CRYPTO_HASH
170-
help
171-
This is the s390 hardware accelerated implementation of the
172-
SHA3_256 secure hash standard.
173-
174-
It is available as of z14.
175-
176-
config CRYPTO_SHA3_512_S390
177-
tristate "SHA3_384 and SHA3_512 digest algorithm"
178-
depends on S390
179-
select CRYPTO_HASH
180-
help
181-
This is the s390 hardware accelerated implementation of the
182-
SHA3_512 secure hash standard.
183-
184-
It is available as of z14.
185-
186-
config CRYPTO_DES_S390
187-
tristate "DES and Triple DES cipher algorithms"
188-
depends on S390
189-
select CRYPTO_ALGAPI
190-
select CRYPTO_SKCIPHER
191-
select CRYPTO_LIB_DES
192-
help
193-
This is the s390 hardware accelerated implementation of the
194-
DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
195-
196-
As of z990 the ECB and CBC mode are hardware accelerated.
197-
As of z196 the CTR mode is hardware accelerated.
198-
199-
config CRYPTO_AES_S390
200-
tristate "AES cipher algorithms"
201-
depends on S390
202-
select CRYPTO_ALGAPI
203-
select CRYPTO_SKCIPHER
204-
help
205-
This is the s390 hardware accelerated implementation of the
206-
AES cipher algorithms (FIPS-197).
207-
208-
As of z9 the ECB and CBC modes are hardware accelerated
209-
for 128 bit keys.
210-
As of z10 the ECB and CBC modes are hardware accelerated
211-
for all AES key sizes.
212-
As of z196 the CTR mode is hardware accelerated for all AES
213-
key sizes and XTS mode is hardware accelerated for 256 and
214-
512 bit keys.
215-
216-
config CRYPTO_CHACHA_S390
217-
tristate "ChaCha20 stream cipher"
218-
depends on S390
219-
select CRYPTO_SKCIPHER
220-
select CRYPTO_LIB_CHACHA_GENERIC
221-
select CRYPTO_ARCH_HAVE_LIB_CHACHA
222-
help
223-
This is the s390 SIMD implementation of the ChaCha20 stream
224-
cipher (RFC 7539).
225-
226-
It is available as of z13.
227-
228136
config S390_PRNG
229137
tristate "Pseudo random number generator device driver"
230138
depends on S390
@@ -238,29 +146,6 @@ config S390_PRNG
238146

239147
It is available as of z9.
240148

241-
config CRYPTO_GHASH_S390
242-
tristate "GHASH hash function"
243-
depends on S390
244-
select CRYPTO_HASH
245-
help
246-
This is the s390 hardware accelerated implementation of GHASH,
247-
the hash function used in GCM (Galois/Counter mode).
248-
249-
It is available as of z196.
250-
251-
config CRYPTO_CRC32_S390
252-
tristate "CRC-32 algorithms"
253-
depends on S390
254-
select CRYPTO_HASH
255-
select CRC32
256-
help
257-
Select this option if you want to use hardware accelerated
258-
implementations of CRC algorithms. With this option, you
259-
can optimize the computation of CRC-32 (IEEE 802.3 Ethernet)
260-
and CRC-32C (Castagnoli).
261-
262-
It is available with IBM z13 or later.
263-
264149
config CRYPTO_DEV_NIAGARA2
265150
tristate "Niagara2 Stream Processing Unit driver"
266151
select CRYPTO_LIB_DES

drivers/net/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ config WIREGUARD
9494
select CRYPTO_CURVE25519_NEON if ARM && KERNEL_MODE_NEON
9595
select CRYPTO_CHACHA_MIPS if CPU_MIPS32_R2
9696
select CRYPTO_POLY1305_MIPS if MIPS
97+
select CRYPTO_CHACHA_S390 if S390
9798
help
9899
WireGuard is a secure, fast, and easy to use replacement for IPSec
99100
that uses modern cryptography and clever networking tricks. It's

tools/testing/selftests/wireguard/qemu/Makefile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ endif
1919
MIRROR := https://download.wireguard.com/qemu-test/distfiles/
2020

2121
KERNEL_BUILD_PATH := $(BUILD_PATH)/kernel$(if $(findstring yes,$(DEBUG_KERNEL)),-debug)
22-
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
23-
WIREGUARD_SOURCES := $(call rwildcard,$(KERNEL_PATH)/drivers/net/wireguard/,*)
2422

2523
default: qemu
2624

@@ -109,20 +107,22 @@ CHOST := x86_64-linux-musl
109107
QEMU_ARCH := x86_64
110108
KERNEL_ARCH := x86_64
111109
KERNEL_BZIMAGE := $(KERNEL_BUILD_PATH)/arch/x86/boot/bzImage
110+
QEMU_VPORT_RESULT := virtio-serial-device
112111
ifeq ($(HOST_ARCH),$(ARCH))
113-
QEMU_MACHINE := -cpu host -machine q35,accel=kvm
112+
QEMU_MACHINE := -cpu host -machine microvm,accel=kvm,pit=off,pic=off,rtc=off -no-acpi
114113
else
115-
QEMU_MACHINE := -cpu max -machine q35
114+
QEMU_MACHINE := -cpu max -machine microvm -no-acpi
116115
endif
117116
else ifeq ($(ARCH),i686)
118117
CHOST := i686-linux-musl
119118
QEMU_ARCH := i386
120119
KERNEL_ARCH := x86
121120
KERNEL_BZIMAGE := $(KERNEL_BUILD_PATH)/arch/x86/boot/bzImage
121+
QEMU_VPORT_RESULT := virtio-serial-device
122122
ifeq ($(subst x86_64,i686,$(HOST_ARCH)),$(ARCH))
123-
QEMU_MACHINE := -cpu host -machine q35,accel=kvm
123+
QEMU_MACHINE := -cpu host -machine microvm,accel=kvm,pit=off,pic=off,rtc=off -no-acpi
124124
else
125-
QEMU_MACHINE := -cpu max -machine q35
125+
QEMU_MACHINE := -cpu coreduo -machine microvm -no-acpi
126126
endif
127127
else ifeq ($(ARCH),mips64)
128128
CHOST := mips64-linux-musl
@@ -208,10 +208,11 @@ QEMU_ARCH := m68k
208208
KERNEL_ARCH := m68k
209209
KERNEL_BZIMAGE := $(KERNEL_BUILD_PATH)/vmlinux
210210
KERNEL_CMDLINE := $(shell sed -n 's/CONFIG_CMDLINE=\(.*\)/\1/p' arch/m68k.config)
211+
QEMU_VPORT_RESULT := virtio-serial-device
211212
ifeq ($(HOST_ARCH),$(ARCH))
212-
QEMU_MACHINE := -cpu host,accel=kvm -machine q800 -append $(KERNEL_CMDLINE)
213+
QEMU_MACHINE := -cpu host,accel=kvm -machine virt -append $(KERNEL_CMDLINE)
213214
else
214-
QEMU_MACHINE := -machine q800 -smp 1 -append $(KERNEL_CMDLINE)
215+
QEMU_MACHINE := -machine virt -smp 1 -append $(KERNEL_CMDLINE)
215216
endif
216217
else ifeq ($(ARCH),riscv64)
217218
CHOST := riscv64-linux-musl
@@ -322,8 +323,9 @@ $(KERNEL_BUILD_PATH)/.config: $(TOOLCHAIN_PATH)/.installed kernel.config arch/$(
322323
cd $(KERNEL_BUILD_PATH) && ARCH=$(KERNEL_ARCH) $(KERNEL_PATH)/scripts/kconfig/merge_config.sh -n $(KERNEL_BUILD_PATH)/.config $(KERNEL_BUILD_PATH)/minimal.config
323324
$(if $(findstring yes,$(DEBUG_KERNEL)),cp debug.config $(KERNEL_BUILD_PATH) && cd $(KERNEL_BUILD_PATH) && ARCH=$(KERNEL_ARCH) $(KERNEL_PATH)/scripts/kconfig/merge_config.sh -n $(KERNEL_BUILD_PATH)/.config debug.config,)
324325

325-
$(KERNEL_BZIMAGE): $(TOOLCHAIN_PATH)/.installed $(KERNEL_BUILD_PATH)/.config $(BUILD_PATH)/init-cpio-spec.txt $(IPERF_PATH)/src/iperf3 $(IPUTILS_PATH)/ping $(BASH_PATH)/bash $(IPROUTE2_PATH)/misc/ss $(IPROUTE2_PATH)/ip/ip $(IPTABLES_PATH)/iptables/xtables-legacy-multi $(NMAP_PATH)/ncat/ncat $(WIREGUARD_TOOLS_PATH)/src/wg $(BUILD_PATH)/init ../netns.sh $(WIREGUARD_SOURCES)
326+
$(KERNEL_BZIMAGE): $(TOOLCHAIN_PATH)/.installed $(KERNEL_BUILD_PATH)/.config $(BUILD_PATH)/init-cpio-spec.txt $(IPERF_PATH)/src/iperf3 $(IPUTILS_PATH)/ping $(BASH_PATH)/bash $(IPROUTE2_PATH)/misc/ss $(IPROUTE2_PATH)/ip/ip $(IPTABLES_PATH)/iptables/xtables-legacy-multi $(NMAP_PATH)/ncat/ncat $(WIREGUARD_TOOLS_PATH)/src/wg $(BUILD_PATH)/init
326327
$(MAKE) -C $(KERNEL_PATH) O=$(KERNEL_BUILD_PATH) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(CROSS_COMPILE)
328+
.PHONY: $(KERNEL_BZIMAGE)
327329

328330
$(TOOLCHAIN_PATH)/$(CHOST)/include/linux/.installed: | $(KERNEL_BUILD_PATH)/.config $(TOOLCHAIN_PATH)/.installed
329331
rm -rf $(TOOLCHAIN_PATH)/$(CHOST)/include/linux

tools/testing/selftests/wireguard/qemu/arch/arm.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
77
CONFIG_VIRTIO_MENU=y
88
CONFIG_VIRTIO_MMIO=y
99
CONFIG_VIRTIO_CONSOLE=y
10+
CONFIG_COMPAT_32BIT_TIME=y
1011
CONFIG_CMDLINE_BOOL=y
1112
CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1 panic_on_warn=1"
1213
CONFIG_FRAME_WARN=1024

tools/testing/selftests/wireguard/qemu/arch/armeb.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
77
CONFIG_VIRTIO_MENU=y
88
CONFIG_VIRTIO_MMIO=y
99
CONFIG_VIRTIO_CONSOLE=y
10+
CONFIG_COMPAT_32BIT_TIME=y
1011
CONFIG_CMDLINE_BOOL=y
1112
CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1 panic_on_warn=1"
1213
CONFIG_CPU_BIG_ENDIAN=y

0 commit comments

Comments
 (0)