Commit ab5718f0 authored by Ard Biesheuvel's avatar Ard Biesheuvel
Browse files

arm64/xorblocks: Switch to 'ksimd' scoped guard API



Switch to the more abstract 'scoped_ksimd()' API, which will be modified
in a future patch to transparently allocate a kernel mode FP/SIMD state
buffer on the stack, so that kernel mode FP/SIMD code remains
preemptible in principe, but without the memory overhead that adds 528
bytes to the size of struct task_struct.

Reviewed-by: default avatarEric Biggers <ebiggers@kernel.org>
Reviewed-by: default avatarJonathan Cameron <jonathan.cameron@huawei.com>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent 03bc4768
Loading
Loading
Loading
Loading
+9 −13
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
#include <linux/hardirq.h>
#include <asm-generic/xor.h>
#include <asm/hwcap.h>
#include <asm/neon.h>
#include <asm/simd.h>

#ifdef CONFIG_KERNEL_MODE_NEON

@@ -19,9 +19,8 @@ static void
xor_neon_2(unsigned long bytes, unsigned long * __restrict p1,
	   const unsigned long * __restrict p2)
{
	kernel_neon_begin();
	scoped_ksimd()
		xor_block_inner_neon.do_2(bytes, p1, p2);
	kernel_neon_end();
}

static void
@@ -29,9 +28,8 @@ xor_neon_3(unsigned long bytes, unsigned long * __restrict p1,
	   const unsigned long * __restrict p2,
	   const unsigned long * __restrict p3)
{
	kernel_neon_begin();
	scoped_ksimd()
		xor_block_inner_neon.do_3(bytes, p1, p2, p3);
	kernel_neon_end();
}

static void
@@ -40,9 +38,8 @@ xor_neon_4(unsigned long bytes, unsigned long * __restrict p1,
	   const unsigned long * __restrict p3,
	   const unsigned long * __restrict p4)
{
	kernel_neon_begin();
	scoped_ksimd()
		xor_block_inner_neon.do_4(bytes, p1, p2, p3, p4);
	kernel_neon_end();
}

static void
@@ -52,9 +49,8 @@ xor_neon_5(unsigned long bytes, unsigned long * __restrict p1,
	   const unsigned long * __restrict p4,
	   const unsigned long * __restrict p5)
{
	kernel_neon_begin();
	scoped_ksimd()
		xor_block_inner_neon.do_5(bytes, p1, p2, p3, p4, p5);
	kernel_neon_end();
}

static struct xor_block_template xor_block_arm64 = {