]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
arm64: fpsimd: Consistently use __this_cpu_ ops where appropriate
authorDave Martin <Dave.Martin@arm.com>
Thu, 3 Aug 2017 16:23:21 +0000 (17:23 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 4 Aug 2017 14:00:52 +0000 (15:00 +0100)
__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: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/fpsimd.c

index 06da8ea16bbe5e150bb7330ab0049c7438b25f8d..d7e5f8a2d4f5a9f22d49014fbe29fb8c0a42289b 100644 (file)
@@ -194,7 +194,7 @@ void fpsimd_restore_current_state(void)
                struct fpsimd_state *st = &current->thread.fpsimd_state;
 
                fpsimd_load_state(st);
-               this_cpu_write(fpsimd_last_state, st);
+               __this_cpu_write(fpsimd_last_state, st);
                st->cpu = smp_processor_id();
        }
        preempt_enable();
@@ -214,7 +214,7 @@ void fpsimd_update_current_state(struct fpsimd_state *state)
        if (test_and_clear_thread_flag(TIF_FOREIGN_FPSTATE)) {
                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();
        }
        preempt_enable();