401-crypto-fix-eip97-cache-incoherent.patch 988 B

1234567891011121314151617181920212223242526
  1. --- a/drivers/crypto/inside-secure/safexcel.h
  2. +++ b/drivers/crypto/inside-secure/safexcel.h
  3. @@ -737,6 +737,9 @@ enum safexcel_eip_version {
  4. /* Priority we use for advertising our algorithms */
  5. #define SAFEXCEL_CRA_PRIORITY 300
  6. +/* System cache line size */
  7. +#define SYSTEM_CACHELINE_SIZE 64
  8. +
  9. /* SM3 digest result for zero length message */
  10. #define EIP197_SM3_ZEROM_HASH "\x1A\xB2\x1D\x83\x55\xCF\xA1\x7F" \
  11. "\x8E\x61\x19\x48\x31\xE8\x1A\x8F" \
  12. --- a/drivers/crypto/inside-secure/safexcel_hash.c
  13. +++ b/drivers/crypto/inside-secure/safexcel_hash.c
  14. @@ -55,9 +55,9 @@ struct safexcel_ahash_req {
  15. u8 block_sz; /* block size, only set once */
  16. u8 digest_sz; /* output digest size, only set once */
  17. __le32 state[SHA3_512_BLOCK_SIZE /
  18. - sizeof(__le32)] __aligned(sizeof(__le32));
  19. + sizeof(__le32)] __aligned(SYSTEM_CACHELINE_SIZE);
  20. - u64 len;
  21. + u64 len __aligned(SYSTEM_CACHELINE_SIZE);
  22. u64 processed;
  23. u8 cache[HASH_CACHE_SIZE] __aligned(sizeof(u32));