OSDN Git Service

Revert "arm64: fpsimd: add support to enable/disable fpsimd_settings."
authorSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Mon, 15 Aug 2016 18:01:47 +0000 (11:01 -0700)
committerSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Mon, 15 Aug 2016 22:10:12 +0000 (15:10 -0700)
This reverts commit 1f7d497b0ace ("arm64: fpsimd: add support to
enable/disable fpsimd_settings.").

Feature is not applicable to msmcobalt and only applicable
to MSM8996.

CRs-Fixed: 1054373
Change-Id: I8d11c596d61f0435f4ee2d1007f4903843650aed
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
arch/arm64/include/asm/elf.h
arch/arm64/kernel/fpsimd.c

index 9973366..6c0f356 100644 (file)
@@ -180,6 +180,8 @@ typedef compat_elf_greg_t           compat_elf_gregset_t[COMPAT_ELF_NGREG];
 #define compat_start_thread            compat_start_thread
 #define COMPAT_SET_PERSONALITY(ex)                                     \
 do {                                                                   \
+       if (current->mm)                                                \
+               fpsimd_enable_trap();                                   \
        set_thread_flag(TIF_32BIT);                                     \
 } while (0)
 
index 74bc79e..10133c0 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/cpu.h>
 #include <linux/cpu_pm.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 static DEFINE_PER_CPU(struct fpsimd_state *, fpsimd_last_state);
 static DEFINE_PER_CPU(int, fpsimd_stg_enable);
 
-static int fpsimd_settings = 0x1; /* default = 0x1 */
-module_param(fpsimd_settings, int, 0644);
-
 /*
  * Trapped FP/ASIMD access.
  */
 void do_fpsimd_acc(unsigned int esr, struct pt_regs *regs)
 {
-       if (!fpsimd_settings)
-               return;
-
        fpsimd_disable_trap();
        fpsimd_settings_disable();
        this_cpu_write(fpsimd_stg_enable, 0);
@@ -109,9 +102,6 @@ void do_fpsimd_acc(unsigned int esr, struct pt_regs *regs)
 
 void do_fpsimd_acc_compat(unsigned int esr, struct pt_regs *regs)
 {
-       if (!fpsimd_settings)
-               return;
-
        fpsimd_disable_trap();
        fpsimd_settings_enable();
        this_cpu_write(fpsimd_stg_enable, 1);
@@ -154,7 +144,7 @@ void fpsimd_thread_switch(struct task_struct *next)
        if (current->mm && !test_thread_flag(TIF_FOREIGN_FPSTATE))
                fpsimd_save_state(&current->thread.fpsimd_state);
 
-       if (fpsimd_settings && __this_cpu_read(fpsimd_stg_enable)) {
+       if (__this_cpu_read(fpsimd_stg_enable)) {
                fpsimd_settings_disable();
                this_cpu_write(fpsimd_stg_enable, 0);
        }
@@ -177,9 +167,6 @@ void fpsimd_thread_switch(struct task_struct *next)
                        set_ti_thread_flag(task_thread_info(next),
                                           TIF_FOREIGN_FPSTATE);
 
-               if (!fpsimd_settings)
-                       return;
-
                if (test_ti_thread_flag(task_thread_info(next), TIF_32BIT))
                        fpsimd_enable_trap();
                else