linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Test CRC computation in interrupt contexts
@ 2025-08-11 18:26 Eric Biggers
  2025-08-11 18:26 ` [PATCH 1/3] kunit, lib/crypto: Move run_irq_test() to common header Eric Biggers
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eric Biggers @ 2025-08-11 18:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-crypto, Ard Biesheuvel, linux-kselftest, kunit-dev,
	Eric Biggers

This series updates crc_kunit to use the same interrupt context testing
strategy that I used in the crypto KUnit tests.  I.e., test CRC
computation in hardirq, softirq, and task context concurrently.  This
detect issues related to use of the FPU/SIMD/vector registers.

To allow lib/crc/tests/ and lib/crypto/tests/ to share code, move the
needed helper function to include/kunit/run-in-irq-context.h.
include/kunit/ seems like the most relevant location for this sort of
thing, but let me know if there is any other preference.

The third patch replaces the calls to crypto_simd_usable() in lib/crc/
with calls to the underlying functions, now that we have a better
solution that doesn't rely on the test injecting values.  (Note that
crc_kunit wasn't actually using the injection solution, anyway.)

I'd like to take this series via crc-next.

Eric Biggers (3):
  kunit, lib/crypto: Move run_irq_test() to common header
  lib/crc: crc_kunit: Test CRC computation in interrupt contexts
  lib/crc: Use underlying functions instead of crypto_simd_usable()

 include/kunit/run-in-irq-context.h    | 129 ++++++++++++++++++++++++++
 lib/crc/arm/crc-t10dif.h              |   6 +-
 lib/crc/arm/crc32.h                   |   6 +-
 lib/crc/arm64/crc-t10dif.h            |   6 +-
 lib/crc/arm64/crc32.h                 |  11 ++-
 lib/crc/powerpc/crc-t10dif.h          |   5 +-
 lib/crc/powerpc/crc32.h               |   5 +-
 lib/crc/tests/crc_kunit.c             |  62 +++++++++++--
 lib/crc/x86/crc-pclmul-template.h     |   3 +-
 lib/crc/x86/crc32.h                   |   2 +-
 lib/crypto/tests/hash-test-template.h | 123 +-----------------------
 11 files changed, 206 insertions(+), 152 deletions(-)
 create mode 100644 include/kunit/run-in-irq-context.h


base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
-- 
2.50.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-21  3:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 18:26 [PATCH 0/3] Test CRC computation in interrupt contexts Eric Biggers
2025-08-11 18:26 ` [PATCH 1/3] kunit, lib/crypto: Move run_irq_test() to common header Eric Biggers
2025-08-11 18:26 ` [PATCH 2/3] lib/crc: crc_kunit: Test CRC computation in interrupt contexts Eric Biggers
2025-08-11 18:26 ` [PATCH 3/3] lib/crc: Use underlying functions instead of crypto_simd_usable() Eric Biggers
2025-08-21  3:37 ` [PATCH 0/3] Test CRC computation in interrupt contexts Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).