linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Dave.Martin@arm.com (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] arm64: fpsimd: Consistently use __this_cpu_ ops where appropriate
Date: Thu,  3 Aug 2017 17:23:21 +0100	[thread overview]
Message-ID: <1501777403-9782-4-git-send-email-Dave.Martin@arm.com> (raw)
In-Reply-To: <1501777403-9782-1-git-send-email-Dave.Martin@arm.com>

__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>
---
 arch/arm64/kernel/fpsimd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 06da8ea..d7e5f8a 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -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();
-- 
2.1.4

  parent reply	other threads:[~2017-08-03 16:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 16:23 [PATCH 0/5] Simplify kernel-mode NEON Dave Martin
2017-08-03 16:23 ` [PATCH 1/5] arm64: neon: replace generic definition of may_use_simd() Dave Martin
2017-08-03 16:23 ` [PATCH 2/5] arm64: neon: Add missing header guard in <asm/neon.h> Dave Martin
2017-08-03 16:23 ` Dave Martin [this message]
2017-08-03 16:23 ` [PATCH 4/5] arm64: neon: Allow EFI runtime services to use FPSIMD in irq context Dave Martin
2017-08-03 16:23 ` [PATCH 5/5] arm64: neon: Remove support for nested or hardirq kernel-mode NEON Dave Martin
2017-08-07 11:23   ` Catalin Marinas
2017-08-07 11:31     ` Ard Biesheuvel
2017-08-07 11:35       ` Catalin Marinas
2017-08-04 12:08 ` [PATCH 0/5] Simplify " Catalin Marinas
2017-08-04 12:22   ` Catalin Marinas
2017-08-04 12:25     ` Ard Biesheuvel
2017-08-04 12:41       ` Dave P Martin
2017-08-04 13:12       ` Catalin Marinas
2017-08-04 13:21         ` Ard Biesheuvel
2017-08-04 13:26           ` Dave P Martin
2017-08-04 14:05             ` Catalin Marinas
2017-08-04 14:25               ` Dave Martin
2017-08-04 14:50                 ` Catalin Marinas
2017-08-04 14:00           ` Catalin Marinas
2017-08-04 14:04             ` Ard Biesheuvel
2017-08-04 13:22         ` Dave Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1501777403-9782-4-git-send-email-Dave.Martin@arm.com \
    --to=dave.martin@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).