All of lore.kernel.org
 help / color / mirror / Atom feed
* may_use_simd on aarch64, chacha20
@ 2017-05-21 17:02 ` Jason A. Donenfeld
  0 siblings, 0 replies; 10+ messages in thread
From: Jason A. Donenfeld @ 2017-05-21 17:02 UTC (permalink / raw)
  To: Linux Crypto Mailing List, linux-arm-kernel, Ard Biesheuvel,
	Steffen Klassert

Hi folks,

I noticed that the ARM implementation [1] of chacha20 makes a check to
may_use_simd(), but the ARM64 implementation [2] does not. Question 1:
is this a bug, in which case I'll submit a patch shortly, or is this
intentional? In case of the latter, could somebody explain the
reasoning? On a similar note, the only ARM64 glue code that uses
may_use_simd() is sha256; everything else does not. Shall I submit a
substantial patch series to fix this up everywhere?

Secondly, I noticed that may_use_simd() is essentially aliased to
!in_interrupt(), since it uses the asm-generic variety. Question 2:
Isn't this overkill? Couldn't we make an arm/arm64 variant of this
that only checks in_irq()?

Lastly, APIs like pcrypts and padata execute with bottom halves
disabled, even though their actual execution environment is process
context, via a workqueue. Thus, here, in_interrupt() will always be
true, even though this is likely a place where we want to use simd.
Question 3: is there something better that could be done?

Thanks,
Jason

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/crypto/chacha20-neon-glue.c#n67
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/crypto/chacha20-neon-glue.c#n66

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

end of thread, other threads:[~2017-05-26 17:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-21 17:02 may_use_simd on aarch64, chacha20 Jason A. Donenfeld
2017-05-21 17:02 ` Jason A. Donenfeld
2017-05-21 20:55 ` Ard Biesheuvel
2017-05-21 20:55   ` Ard Biesheuvel
2017-05-26 13:28   ` Dave Martin
2017-05-26 13:28     ` Dave Martin
2017-05-26 17:44     ` Ard Biesheuvel
2017-05-26 17:44       ` Ard Biesheuvel
2017-05-26 17:59       ` Dave Martin
2017-05-26 17:59         ` Dave Martin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.