linux/include/crypto
Peter Collingbourne ca53b8f1b4 BACKPORT: mm: make minimum slab alignment a runtime property
When CONFIG_KASAN_HW_TAGS is enabled we currently increase the minimum
slab alignment to 16.  This happens even if MTE is not supported in
hardware or disabled via kasan=off, which creates an unnecessary memory
overhead in those cases.  Eliminate this overhead by making the minimum
slab alignment a runtime property and only aligning to 16 if KASAN is
enabled at runtime.

On a DragonBoard 845c (non-MTE hardware) with a kernel built with
CONFIG_KASAN_HW_TAGS, waiting for quiescence after a full Android boot I
see the following Slab measurements in /proc/meminfo (median of 3
reboots):

Before: 169020 kB
After:  167304 kB

[akpm@linux-foundation.org: make slab alignment type `unsigned int' to avoid casting]
Link: https://linux-review.googlesource.com/id/I752e725179b43b144153f4b6f584ceb646473ead
Link: https://lkml.kernel.org/r/20220427195820.1716975-2-pcc@google.com
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Bug: 265364138
(cherry picked from commit d949a8155d)
[Zhenhua: fold 587cfd8e66df3515 ("ANDROID: fix alignment of struct shash_desc
member") into this change, to keep ABI compatibility]
Change-Id: I3749f8de65ef3619724e68a9affb4eefd1ebe737
Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
Signed-off-by: Zhenhua Huang <quic_zhenhuah@quicinc.com>
2023-01-20 00:46:19 +00:00
..
internal Merge 5.10.119 into android12-5.10-lts 2022-07-14 14:31:17 +02:00
acompress.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
aead.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
aes.h
akcipher.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
algapi.h UPSTREAM: crypto: remove cipher routines from public crypto API 2021-05-13 07:53:31 +00:00
arc4.h
asym_tpm_subtype.h
authenc.h
b128ops.h
blake2b.h UPSTREAM: crypto: blake2b - sync with blake2s implementation 2021-02-23 08:06:20 +01:00
blake2s.h lib/crypto: blake2s: move hmac construction into wireguard 2022-05-30 09:33:26 +02:00
blowfish.h
cast_common.h
cast5.h
cast6.h
chacha.h random: early initialization of ChaCha constants 2022-05-30 09:33:28 +02:00
chacha20poly1305.h
cryptd.h
ctr.h
curve25519.h
des.h
dh.h
drbg.h crypto: drbg - make reseeding from get_random_bytes() synchronous 2022-06-06 08:42:42 +02:00
ecdh.h
engine.h
gcm.h
gf128mul.h
ghash.h
hash_info.h
hash.h BACKPORT: mm: make minimum slab alignment a runtime property 2023-01-20 00:46:19 +00:00
hmac.h
if_alg.h
kpp.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
md5.h
nhpoly1305.h
null.h
padlock.h
pcrypt.h
pkcs7.h
poly1305.h crypto: poly1305 - fix poly1305_core_setkey() declaration 2021-05-14 09:50:13 +02:00
public_key.h Revert "crypto: public_key: fix overflow during implicit conversion" 2021-09-30 16:01:42 +02:00
rng.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
scatterwalk.h
serpent.h
sha.h
sha1_base.h
sha3.h
sha256_base.h
sha512_base.h
skcipher.h crypto: api - check for ERR pointers in crypto_destroy_tfm() 2021-05-11 14:47:16 +02:00
sm2.h
sm3_base.h
sm3.h
sm4.h
streebog.h
twofish.h
xts.h