Sean Fu
2018-09-29 09:09:57 UTC
Implemented support for 16k stack size that was introduced by commit
6538b8ea886e472f4431db8ca1d60478f838d14b titled "x86_64: expand kernel
stack to 16K".
Without the patch, kernels has 16k stack, leading to errors in commands
such as "bt" and any command regarding 8K stack.
Add a new "--machdep stacksize=<value>" option that can be used to
override the default machdep->stacksize value which is 8k.
Signed-off-by: Sean Fu <***@gmail.com>
---
x86_64.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/x86_64.c b/x86_64.c
index 7d01140..1798f05 100644
--- a/x86_64.c
+++ b/x86_64.c
@@ -5716,6 +5716,15 @@ parse_cmdline_args(void)
continue;
}
}
+ } else if (STRNEQ(arglist[i], "stacksize=")) {
+ p = arglist[i] + strlen("stacksize=");
+ if (strlen(p)) {
+ value = stol(p, RETURN_ON_ERROR|QUIET, &errflag);
+ if (!errflag) {
+ machdep->stacksize = value;
+ continue;
+ }
+ }
}
error(WARNING, "ignoring --machdep option: %s\n", arglist[i]);
6538b8ea886e472f4431db8ca1d60478f838d14b titled "x86_64: expand kernel
stack to 16K".
Without the patch, kernels has 16k stack, leading to errors in commands
such as "bt" and any command regarding 8K stack.
Add a new "--machdep stacksize=<value>" option that can be used to
override the default machdep->stacksize value which is 8k.
Signed-off-by: Sean Fu <***@gmail.com>
---
x86_64.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/x86_64.c b/x86_64.c
index 7d01140..1798f05 100644
--- a/x86_64.c
+++ b/x86_64.c
@@ -5716,6 +5716,15 @@ parse_cmdline_args(void)
continue;
}
}
+ } else if (STRNEQ(arglist[i], "stacksize=")) {
+ p = arglist[i] + strlen("stacksize=");
+ if (strlen(p)) {
+ value = stol(p, RETURN_ON_ERROR|QUIET, &errflag);
+ if (!errflag) {
+ machdep->stacksize = value;
+ continue;
+ }
+ }
}
error(WARNING, "ignoring --machdep option: %s\n", arglist[i]);
--
2.6.2
2.6.2