aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2020-09-01 09:09:13 +0200
committerJohn Crispin <john@phrozen.org>2020-09-01 09:09:13 +0200
commit4841ac042e00df7e29d305eb92f68994ebc739fd (patch)
treef0e4a290859b2b68958ee64a61263f1a04ab4c1d /target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch
parent2ddd8387a7031c1ed62cfdf027b6cab25bc03b08 (diff)
downloadupstream-4841ac042e00df7e29d305eb92f68994ebc739fd.tar.gz
upstream-4841ac042e00df7e29d305eb92f68994ebc739fd.tar.bz2
upstream-4841ac042e00df7e29d305eb92f68994ebc739fd.zip
mediatek: pull in some fixes fromt he latest SDK
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch')
-rw-r--r--target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch b/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch
new file mode 100644
index 0000000000..bb2bcebbfd
--- /dev/null
+++ b/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch
@@ -0,0 +1,26 @@
+--- a/drivers/crypto/inside-secure/safexcel.h
++++ b/drivers/crypto/inside-secure/safexcel.h
+@@ -722,6 +722,9 @@
+ /* Priority we use for advertising our algorithms */
+ #define SAFEXCEL_CRA_PRIORITY 300
+
++/* System cache line size */
++#define SYSTEM_CACHELINE_SIZE 64
++
+ /* SM3 digest result for zero length message */
+ #define EIP197_SM3_ZEROM_HASH "\x1A\xB2\x1D\x83\x55\xCF\xA1\x7F" \
+ "\x8E\x61\x19\x48\x31\xE8\x1A\x8F" \
+--- a/drivers/crypto/inside-secure/safexcel_hash.c
++++ b/drivers/crypto/inside-secure/safexcel_hash.c
+@@ -57,9 +57,9 @@
+ u8 block_sz; /* block size, only set once */
+ u8 digest_sz; /* output digest size, only set once */
+ __le32 state[SHA3_512_BLOCK_SIZE /
+- sizeof(__le32)] __aligned(sizeof(__le32));
++ sizeof(__le32)] __aligned(SYSTEM_CACHELINE_SIZE);
+
+- u64 len;
++ u64 len __aligned(SYSTEM_CACHELINE_SIZE);
+ u64 processed;
+
+ u8 cache[HASH_CACHE_SIZE] __aligned(sizeof(u32));