Merge tag 'v4.4.37' into android-4.4.y
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 8 Dec 2016 23:08:27 +0000 (15:08 -0800)
committerDmitry Shmidt <dimitrysh@google.com>
Thu, 8 Dec 2016 23:08:27 +0000 (15:08 -0800)
This is the 4.4.37 stable release

Change-Id: Ic6753a5a223abc02c4fe5205642d4f904de2e5b8

1  2 
arch/arm64/include/asm/cpufeature.h
arch/arm64/include/asm/processor.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/suspend.c
arch/arm64/mm/fault.c

Simple merge
index cef1cf398356f1f61ceea854fc564f6df1d316cc,d085595289271bbcc663c70129ab7649de1dd3a8..83d0aa97b577f0f587ba1e83cdc0c20cce181afe
@@@ -190,7 -186,6 +190,7 @@@ static inline void spin_lock_prefetch(c
  
  #endif
  
- void cpu_enable_pan(void *__unused);
+ int cpu_enable_pan(void *__unused);
 +void cpu_enable_uao(void *__unused);
  
  #endif /* __ASM_PROCESSOR_H */
index 40ee3f2933e78dffe011e4d2e5615f0d42222e53,2735bf8145926c5c8c03f2d58a7ec08646bcee2e..ae888588024e8142547c754a471fc040b67129ea
@@@ -811,9 -764,15 +813,15 @@@ enable_cpu_capabilities(const struct ar
  {
        int i;
  
 -      for (i = 0; caps[i].desc; i++)
 +      for (i = 0; caps[i].matches; i++)
                if (caps[i].enable && cpus_have_cap(caps[i].capability))
-                       on_each_cpu(caps[i].enable, NULL, true);
+                       /*
+                        * Use stop_machine() as it schedules the work allowing
+                        * us to modify PSTATE, instead of on_each_cpu() which
+                        * uses an IPI, giving us a PSTATE that disappears when
+                        * we return.
+                        */
+                       stop_machine(caps[i].enable, NULL, cpu_online_mask);
  }
  
  #ifdef CONFIG_HOTPLUG_CPU
Simple merge
index 9cedb10b11078eebc62c5f610423cd8cbabb2fc3,247bae758e1e7ec37b34f26d92e63d5e96745e62..5dcd0f8bbec03e3e19cf514566ba4621bc912007
@@@ -635,21 -608,16 +637,29 @@@ asmlinkage int __exception do_debug_exc
  }
  
  #ifdef CONFIG_ARM64_PAN
void cpu_enable_pan(void *__unused)
int cpu_enable_pan(void *__unused)
  {
+       /*
+        * We modify PSTATE. This won't work from irq context as the PSTATE
+        * is discarded once we return from the exception.
+        */
+       WARN_ON_ONCE(in_interrupt());
        config_sctlr_el1(SCTLR_EL1_SPAN, 0);
+       asm(SET_PSTATE_PAN(1));
+       return 0;
  }
  #endif /* CONFIG_ARM64_PAN */
 +
 +#ifdef CONFIG_ARM64_UAO
 +/*
 + * Kernel threads have fs=KERNEL_DS by default, and don't need to call
 + * set_fs(), devtmpfs in particular relies on this behaviour.
 + * We need to enable the feature at runtime (instead of adding it to
 + * PSR_MODE_EL1h) as the feature may not be implemented by the cpu.
 + */
 +void cpu_enable_uao(void *__unused)
 +{
 +      asm(SET_PSTATE_UAO(1));
 +}
 +#endif /* CONFIG_ARM64_UAO */