diff mbox series

[01/26] xor: assert that xor_blocks is not from preemptible user context

Message ID 20260324062211.3216301-2-hch@lst.de (mailing list archive)
State Handled Elsewhere
Headers show
Series [01/26] xor: assert that xor_blocks is not from preemptible user context | expand

Commit Message

Christoph Hellwig March 24, 2026, 6:21 a.m. UTC
Most of the optimized xor_blocks versions require FPU/vector registers,
which generally are not supported in interrupt context.

Both callers already are in user context, so enforce this at the highest
level.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 crypto/xor.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/crypto/xor.c b/crypto/xor.c
index f39621a57bb3..676d7401af43 100644
--- a/crypto/xor.c
+++ b/crypto/xor.c
@@ -28,6 +28,8 @@  xor_blocks(unsigned int src_count, unsigned int bytes, void *dest, void **srcs)
 {
 	unsigned long *p1, *p2, *p3, *p4;
 
+	lockdep_assert_preemption_enabled();
+
 	p1 = (unsigned long *) srcs[0];
 	if (src_count == 1) {
 		active_template->do_2(bytes, dest, p1);