linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Subject: Re: [PATCH v2 3/6] x86/stacktrace: remove STACKTRACE_DUMP_ONCE from __save_stack_trace_reliable
Date: Mon, 14 May 2018 10:04:58 -0500	[thread overview]
Message-ID: <20180514150458.bf2u6cki4ocheiv2@treble> (raw)
In-Reply-To: <20180514140653.23678-3-jslaby@suse.cz>

On Mon, May 14, 2018 at 04:06:50PM +0200, Jiri Slaby wrote:
> The stack unwinding can sometimes fail yet. Especially with the
> generated debug info. So do not yell at users -- live patching (the only
> user of this interface) will inform the user about the failure
> gracefully.
> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
>  arch/x86/kernel/stacktrace.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c
> index 3a4602c2324f..e0169b128523 100644
> --- a/arch/x86/kernel/stacktrace.c
> +++ b/arch/x86/kernel/stacktrace.c
> @@ -125,20 +125,16 @@ __save_stack_trace_reliable(struct stack_trace *trace,
>  		 * generated code which __kernel_text_address() doesn't know
>  		 * about.
>  		 */
> -		if (!addr) {
> -			STACKTRACE_DUMP_ONCE(task);
> +		if (!addr)
>  			return -EINVAL;
> -		}
>  
>  		if (save_stack_address(trace, addr, false))
>  			return -EINVAL;
>  	}
>  
>  	/* Check for stack corruption */
> -	if (unwind_error(&state)) {
> -		STACKTRACE_DUMP_ONCE(task);
> +	if (unwind_error(&state))
>  		return -EINVAL;
> -	}
>  
>  	/* Success path for non-user tasks, i.e. kthreads and idle tasks */
>  	if (!(task->flags & (PF_KTHREAD | PF_IDLE)))

The STACKTRACE_DUMP_ONCE macro itself can also be removed.

Also the subject is a bit long, how about

  x86/stacktrace: Remove STACKTRACE_DUMP_ONCE

-- 
Josh

  reply	other threads:[~2018-05-14 15:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 14:06 [PATCH v2 1/6] x86/stacktrace: do not unwind after user regs Jiri Slaby
2018-05-14 14:06 ` [PATCH v2 2/6] x86/stacktrace: make clear the success paths Jiri Slaby
2018-05-14 15:03   ` Josh Poimboeuf
2018-05-14 14:06 ` [PATCH v2 3/6] x86/stacktrace: remove STACKTRACE_DUMP_ONCE from __save_stack_trace_reliable Jiri Slaby
2018-05-14 15:04   ` Josh Poimboeuf [this message]
2018-05-14 14:06 ` [PATCH v2 4/6] x86/stacktrace: do not fail for ORC with regs on stack Jiri Slaby
2018-05-14 14:06 ` [PATCH v2 5/6] x86/unwind/orc: Detect the end of the stack Jiri Slaby
2018-05-14 14:06 ` [PATCH v2 6/6] x86/stacktrace: orc, mark it as reliable Jiri Slaby
2018-05-14 15:07   ` Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180514150458.bf2u6cki4ocheiv2@treble \
    --to=jpoimboe@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).