crypto: aes - Use ___cacheline_aligned for aes data

cacheline_aligned is a special section. It cannot be const at the same
time because it's not read-only. It doesn't give any MMU protection.

Mark it ____cacheline_aligned to not place it in a special section,
but just align it in .rodata

Cc: herbert@gondor.apana.org.au
Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Andi Kleen 2019-03-29 17:46:29 -07:00 committed by Herbert Xu
parent 71052dcf4b
commit 61abc356bf
2 changed files with 8 additions and 8 deletions

View File

@ -64,7 +64,7 @@ static inline u8 byte(const u32 x, const unsigned n)
static const u32 rco_tab[10] = { 1, 2, 4, 8, 16, 32, 64, 128, 27, 54 }; static const u32 rco_tab[10] = { 1, 2, 4, 8, 16, 32, 64, 128, 27, 54 };
/* cacheline-aligned to facilitate prefetching into cache */ /* cacheline-aligned to facilitate prefetching into cache */
__visible const u32 crypto_ft_tab[4][256] __cacheline_aligned = { __visible const u32 crypto_ft_tab[4][256] ____cacheline_aligned = {
{ {
0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6, 0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6,
0x0df2f2ff, 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591, 0x0df2f2ff, 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591,
@ -328,7 +328,7 @@ __visible const u32 crypto_ft_tab[4][256] __cacheline_aligned = {
} }
}; };
__visible const u32 crypto_fl_tab[4][256] __cacheline_aligned = { __visible const u32 crypto_fl_tab[4][256] ____cacheline_aligned = {
{ {
0x00000063, 0x0000007c, 0x00000077, 0x0000007b, 0x00000063, 0x0000007c, 0x00000077, 0x0000007b,
0x000000f2, 0x0000006b, 0x0000006f, 0x000000c5, 0x000000f2, 0x0000006b, 0x0000006f, 0x000000c5,
@ -592,7 +592,7 @@ __visible const u32 crypto_fl_tab[4][256] __cacheline_aligned = {
} }
}; };
__visible const u32 crypto_it_tab[4][256] __cacheline_aligned = { __visible const u32 crypto_it_tab[4][256] ____cacheline_aligned = {
{ {
0x50a7f451, 0x5365417e, 0xc3a4171a, 0x965e273a, 0x50a7f451, 0x5365417e, 0xc3a4171a, 0x965e273a,
0xcb6bab3b, 0xf1459d1f, 0xab58faac, 0x9303e34b, 0xcb6bab3b, 0xf1459d1f, 0xab58faac, 0x9303e34b,
@ -856,7 +856,7 @@ __visible const u32 crypto_it_tab[4][256] __cacheline_aligned = {
} }
}; };
__visible const u32 crypto_il_tab[4][256] __cacheline_aligned = { __visible const u32 crypto_il_tab[4][256] ____cacheline_aligned = {
{ {
0x00000052, 0x00000009, 0x0000006a, 0x000000d5, 0x00000052, 0x00000009, 0x0000006a, 0x000000d5,
0x00000030, 0x00000036, 0x000000a5, 0x00000038, 0x00000030, 0x00000036, 0x000000a5, 0x00000038,

View File

@ -28,10 +28,10 @@ struct crypto_aes_ctx {
u32 key_length; u32 key_length;
}; };
extern const u32 crypto_ft_tab[4][256]; extern const u32 crypto_ft_tab[4][256] ____cacheline_aligned;
extern const u32 crypto_fl_tab[4][256]; extern const u32 crypto_fl_tab[4][256] ____cacheline_aligned;
extern const u32 crypto_it_tab[4][256]; extern const u32 crypto_it_tab[4][256] ____cacheline_aligned;
extern const u32 crypto_il_tab[4][256]; extern const u32 crypto_il_tab[4][256] ____cacheline_aligned;
int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, int crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
unsigned int key_len); unsigned int key_len);