Skip to content

Commit

Permalink
Reflect __{start,end}_init_task kernel symbols rename
Browse files Browse the repository at this point in the history
Kernel commit 8f69cba096b5 ("x86: Rename __{start,end}_init_task to
__{start,end}_init_stack") leads to failure when crash loading:

	crash: invalid count request: 0

Assume both __{start,end}_init_task and __{start,end}_init_stack
symbols could exist for backward compatibility.

Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
  • Loading branch information
Alexander Gordeev authored and lian-bo committed May 20, 2024
1 parent 568c6f0 commit 3879e91
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions task.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,17 @@ task_init(void)
((len = SIZE(thread_union)) != STACKSIZE())) {
machdep->stacksize = len;
} else if (!VALID_SIZE(thread_union) && !VALID_SIZE(task_union)) {
if (kernel_symbol_exists("__start_init_task") &&
kernel_symbol_exists("__end_init_task")) {
len = 0;
if (kernel_symbol_exists("__start_init_stack") &&
kernel_symbol_exists("__end_init_stack")) {
len = symbol_value("__end_init_stack");
len -= symbol_value("__start_init_stack");
} else if (kernel_symbol_exists("__start_init_task") &&
kernel_symbol_exists("__end_init_task")) {
len = symbol_value("__end_init_task");
len -= symbol_value("__start_init_task");
}
if (len) {
ASSIGN_SIZE(thread_union) = len;
machdep->stacksize = len;
}
Expand Down

0 comments on commit 3879e91

Please sign in to comment.