HACK
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 88e4f79..4df1fb1 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -250,9 +250,9 @@ void show_regs(struct pt_regs *regs)
static void tls_thread_flush(void)
{
- if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
- task_pt_regs(current)->tpidr_el0 = 0;
- else
+ //if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
+ //current_pt_regs()->tpidr_el0 = 0;
+ //else
write_sysreg(0, tpidr_el0);
if (system_supports_tpidr2())
write_sysreg_s(0, SYS_TPIDR2_EL0);
@@ -266,9 +266,9 @@ static void tls_thread_flush(void)
* with a stale shadow state during context switch.
*/
barrier();
- if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
- task_pt_regs(current)->tpidrro_el0 = 0;
- else
+ // if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
+ current_pt_regs()->tpidrro_el0 = 0;
+ // else
write_sysreg(0, tpidrro_el0);
}
}
@@ -442,6 +442,7 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
* out-of-sync with the saved value.
*/
*task_user_tls(p) = read_sysreg(tpidr_el0);
+ // *task_user_tls(p) = current_pt_regs()->tpidr_el0;
if (system_supports_poe())
p->thread.por_el0 = read_sysreg_s(SYS_POR_EL0);
@@ -524,9 +525,9 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
void tls_preserve_current_state(void)
{
- if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
- *task_user_tls(current) = task_pt_regs(current)->tpidr_el0;
- else
+ // if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
+ // *task_user_tls(current) = current_pt_regs()->tpidr_el0;
+ // else
*task_user_tls(current) = read_sysreg(tpidr_el0);
if (system_supports_tpidr2() && !is_compat_task())
current->thread.tpidr2_el0 = read_sysreg_s(SYS_TPIDR2_EL0);
@@ -537,20 +538,20 @@ static void tls_thread_switch(struct task_struct *next)
tls_preserve_current_state();
if (is_compat_thread(task_thread_info(next))) {
- if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
- task_pt_regs(current)->tpidrro_el0 = next->thread.uw.tp_value;
- else
+ // if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
+ current_pt_regs()->tpidrro_el0 = next->thread.uw.tp_value;
+ // else
write_sysreg(next->thread.uw.tp_value, tpidrro_el0);
} else {
- if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
- task_pt_regs(current)->tpidrro_el0 = 0;
- else
+ // if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
+ current_pt_regs()->tpidrro_el0 = 0;
+ // else
write_sysreg(0, tpidrro_el0);
}
- if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
- task_pt_regs(current)->tpidr_el0 = *task_user_tls(next);
- else
+ // if (IS_ENABLED(CONFIG_DYNAMIC_STACK))
+ current_pt_regs()->tpidr_el0 = *task_user_tls(next);
+ // else
write_sysreg(*task_user_tls(next), tpidr_el0);
if (system_supports_tpidr2())
write_sysreg_s(next->thread.tpidr2_el0, SYS_TPIDR2_EL0);