[RFC PATCH v2 16/16] [DO NOT MERGE] x86/kexec: enable DEBUG
Ingo Molnar
mingo at kernel.org
Mon Nov 25 01:21:27 PST 2024
* David Woodhouse <dwmw2 at infradead.org> wrote:
> From: David Woodhouse <dwmw at amazon.co.uk>
>
> Signed-off-by: David Woodhouse <dwmw at amazon.co.uk>
> ---
> arch/x86/kernel/relocate_kernel_64.S | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
> index 67f6853c7abe..ebbd76c9a3e9 100644
> --- a/arch/x86/kernel/relocate_kernel_64.S
> +++ b/arch/x86/kernel/relocate_kernel_64.S
> @@ -14,6 +14,8 @@
> #include <asm/nospec-branch.h>
> #include <asm/unwind_hints.h>
>
> +#define DEBUG
> +
> /*
> * Must be relocatable PIC code callable as a C function, in particular
> * there must be a plain RET and not jump to return thunk.
> @@ -191,6 +193,8 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped)
> pushw $0xff
> lidt (%rsp)
> addq $10, %rsp
> +
> + int3
> #endif /* DEBUG */
That's a really nice piece of debugging code written in assembly,
combined with the exception handling feature that generates debug
output to begin with. Epic effort. :-)
Just curious: did you write this code to debug the series, or was there
some original hair-tearing regression that motivated you? Is there's an
upstream fix to marvel at and be horrified about in equal measure?
I'd argue that this debugging code probably needs a default-off Kconfig
option, even with the obvious hard-coded environmental limitations &
assumptions it has. Could be useful to very early debugging & would
preserve your effort without it bitrotting too obviously.
Thanks,
Ingo
More information about the kexec
mailing list