Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50464185 authored by Dave Martin's avatar Dave Martin Committed by Catalin Marinas
Browse files

arm64: fpsimd: Consistently use __this_cpu_ ops where appropriate



__this_cpu_ ops are not used consistently with regard to this_cpu_
ops in a couple of places in fpsimd.c.

Since preemption is explicitly disabled in
fpsimd_restore_current_state() and fpsimd_update_current_state(),
this patch converts this_cpu_ ops in those functions to __this_cpu_
ops.  This doesn't save cost on arm64, but benefits from additional
assertions in the core code.

Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 0fc9179a
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -194,7 +194,7 @@ void fpsimd_restore_current_state(void)
		struct fpsimd_state *st = &current->thread.fpsimd_state;
		struct fpsimd_state *st = &current->thread.fpsimd_state;


		fpsimd_load_state(st);
		fpsimd_load_state(st);
		this_cpu_write(fpsimd_last_state, st);
		__this_cpu_write(fpsimd_last_state, st);
		st->cpu = smp_processor_id();
		st->cpu = smp_processor_id();
	}
	}
	preempt_enable();
	preempt_enable();
@@ -214,7 +214,7 @@ void fpsimd_update_current_state(struct fpsimd_state *state)
	if (test_and_clear_thread_flag(TIF_FOREIGN_FPSTATE)) {
	if (test_and_clear_thread_flag(TIF_FOREIGN_FPSTATE)) {
		struct fpsimd_state *st = &current->thread.fpsimd_state;
		struct fpsimd_state *st = &current->thread.fpsimd_state;


		this_cpu_write(fpsimd_last_state, st);
		__this_cpu_write(fpsimd_last_state, st);
		st->cpu = smp_processor_id();
		st->cpu = smp_processor_id();
	}
	}
	preempt_enable();
	preempt_enable();