提交 7cf73995 编写于 作者: H He Chuyue 提交者: guzitao

sw64: fix THREAD_INFO_IN_TASK support

Sunway inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6ILGG

--------------------------------

Since CONFIG_THREAD_INFO_IN_TASK has been activated, init_thread_info
and __current_thread_info are removed, and compile errors occur if
CONFIG_DYNAMIC_FTRACE=y or CONFIG_RELOCATABLE=y.

This patch replaces init_thread_info with task_thread_info(&init_task)
and fixes the method to relocate task pointer and stack pointer to new
kernel image for kaslr.
Signed-off-by: NHe Chuyue <hechuyue@wxiat.com>
Reviewed-by: NHe Sheng <hesheng@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 083122ee
......@@ -100,10 +100,12 @@ void arch_ftrace_update_code(int command)
int __init ftrace_dyn_arch_init(void)
{
init_thread_info.dyn_ftrace_addr = FTRACE_ADDR;
struct thread_info *ti = task_thread_info(&init_task);
ti->dyn_ftrace_addr = FTRACE_ADDR;
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
init_thread_info.dyn_ftrace_regs_addr = FTRACE_REGS_ADDR;
ti->dyn_ftrace_regs_addr = FTRACE_REGS_ADDR;
#endif
return 0;
}
......
......@@ -40,8 +40,10 @@ __start:
call $26, relocate_kernel
ldl $29, 0($30)
addl $29, $0, $29
addl $8, $0, $8
ldi $30, 8($30)
/* Repoint the sp into the new kernel image */
ldi $30, ASM_THREAD_SIZE($8)
addl $30, $0, $30
#endif
/* ... and then we can start the kernel. */
call $26, sw64_start_kernel
......
......@@ -239,9 +239,6 @@ unsigned int __init relocate_kernel(void)
if (plat_post_relocation(offset))
goto out;
/* The current thread is now within the relocated image */
__current_thread_info = RELOCATED(&init_thread_union);
/* Return the new kernel's offset */
return offset;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册