|
@@ -230,9 +230,27 @@ void exit_thread(void)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
+static void tls_thread_flush(void)
|
|
|
+{
|
|
|
+ asm ("msr tpidr_el0, xzr");
|
|
|
+
|
|
|
+ if (is_compat_task()) {
|
|
|
+ current->thread.tp_value = 0;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * We need to ensure ordering between the shadow state and the
|
|
|
+ * hardware state, so that we don't corrupt the hardware state
|
|
|
+ * with a stale shadow state during context switch.
|
|
|
+ */
|
|
|
+ barrier();
|
|
|
+ asm ("msr tpidrro_el0, xzr");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void flush_thread(void)
|
|
|
{
|
|
|
fpsimd_flush_thread();
|
|
|
+ tls_thread_flush();
|
|
|
flush_ptrace_hw_breakpoint(current);
|
|
|
}
|
|
|
|