Re: [PATCH 01/14] x86/dumpstack: Add SHOW_REGS_IRET mode

From: Miroslav Benes
Date: Fri Mar 13 2020 - 07:10:09 EST


On Thu, 12 Mar 2020, Josh Poimboeuf wrote:

> Now that __show_regs() has the concept of "modes" to indicate which
> registers should be displayed, replace show_iret_regs() with a new
> SHOW_REGS_IRET mode. This is only a cleanup and doesn't change any
> behavior.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> ---
> arch/x86/include/asm/kdebug.h | 1 +
> arch/x86/kernel/dumpstack.c | 27 ++++++++++-----------------
> arch/x86/kernel/process_64.c | 7 ++++++-
> 3 files changed, 17 insertions(+), 18 deletions(-)
>
> diff --git a/arch/x86/include/asm/kdebug.h b/arch/x86/include/asm/kdebug.h
> index 247ab14c6309..6112227368e7 100644
> --- a/arch/x86/include/asm/kdebug.h
> +++ b/arch/x86/include/asm/kdebug.h
> @@ -23,6 +23,7 @@ enum die_val {
> };
>
> enum show_regs_mode {
> + SHOW_REGS_IRET,
> SHOW_REGS_SHORT,
> /*
> * For when userspace crashed, but we don't think it's our fault, and
> diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
> index ae64ec7f752f..8a9ff25779ec 100644
> --- a/arch/x86/kernel/dumpstack.c
> +++ b/arch/x86/kernel/dumpstack.c
> @@ -126,15 +126,8 @@ void show_ip(struct pt_regs *regs, const char *loglvl)
> show_opcodes(regs, loglvl);
> }
>
> -void show_iret_regs(struct pt_regs *regs)
> -{
> - show_ip(regs, KERN_DEFAULT);
> - printk(KERN_DEFAULT "RSP: %04x:%016lx EFLAGS: %08lx", (int)regs->ss,
> - regs->sp, regs->flags);
> -}
> -

There is also declaration of show_iret_regs() in
arch/x86/include/asm/kdebug.h which can be removed now.

Miroslav